react-native-reanimated 2.9.1 → 3.0.0-rc.2
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/AnimatedSensor/AnimatedSensorModule.cpp +4 -4
- package/Common/cpp/Fabric/FabricUtils.cpp +133 -0
- package/Common/cpp/Fabric/ReanimatedUIManagerBinding.cpp +220 -0
- package/Common/cpp/Fabric/ShadowTreeCloner.cpp +92 -0
- package/Common/cpp/NativeModules/NativeReanimatedModule.cpp +336 -6
- package/Common/cpp/NativeModules/NativeReanimatedModuleSpec.cpp +23 -0
- package/Common/cpp/Registries/EventHandlerRegistry.cpp +14 -1
- package/Common/cpp/Registries/NewestShadowNodesRegistry.cpp +68 -0
- package/Common/cpp/SharedItems/ShareableValue.cpp +18 -0
- package/Common/cpp/Tools/Mapper.cpp +23 -4
- package/Common/cpp/Tools/RuntimeDecorator.cpp +92 -32
- package/Common/cpp/Tools/Scheduler.cpp +4 -0
- package/Common/cpp/headers/Fabric/FabricUtils.h +79 -0
- package/Common/cpp/headers/Fabric/ReanimatedUIManagerBinding.h +47 -0
- package/Common/cpp/headers/Fabric/ShadowTreeCloner.h +41 -0
- package/Common/cpp/headers/NativeModules/NativeReanimatedModule.h +81 -2
- package/Common/cpp/headers/NativeModules/NativeReanimatedModuleSpec.h +8 -0
- package/Common/cpp/headers/Registries/EventHandlerRegistry.h +8 -0
- package/Common/cpp/headers/Registries/NewestShadowNodesRegistry.h +41 -0
- package/Common/cpp/headers/SharedItems/SharedParent.h +3 -0
- package/Common/cpp/headers/SharedItems/ValueWrapper.h +25 -0
- package/Common/cpp/headers/SpecTools/ErrorHandler.h +5 -0
- package/Common/cpp/headers/Tools/Mapper.h +1 -1
- package/Common/cpp/headers/Tools/PlatformDepMethodsHolder.h +48 -8
- package/Common/cpp/headers/Tools/RuntimeDecorator.h +8 -3
- package/README.md +4 -0
- package/RNReanimated.podspec +48 -15
- package/android/CMakeLists.txt +205 -86
- package/android/build.gradle +242 -236
- package/android/src/fabric/java/com/swmansion/reanimated/NativeProxy.java +335 -0
- package/android/src/fabric/java/com/swmansion/reanimated/ReaCompatibility.java +25 -0
- package/android/src/main/cpp/NativeProxy.cpp +220 -51
- package/android/src/main/cpp/OnLoad.cpp +1 -0
- package/android/src/main/cpp/headers/NativeProxy.h +72 -7
- package/android/src/main/java/com/swmansion/reanimated/NodesManager.java +16 -246
- package/android/src/main/java/com/swmansion/reanimated/ReanimatedModule.java +0 -125
- package/android/src/main/java/com/swmansion/reanimated/keyboardObserver/ReanimatedKeyboardEventListener.java +165 -0
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/AnimationsManager.java +19 -16
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/LayoutAnimations.java +2 -1
- package/android/src/main/java/com/swmansion/reanimated/sensor/ReanimatedSensor.java +5 -1
- package/android/src/main/java/com/swmansion/reanimated/sensor/ReanimatedSensorType.java +1 -1
- package/android/src/paper/java/com/swmansion/reanimated/NativeProxy.java +326 -0
- package/android/src/paper/java/com/swmansion/reanimated/ReaCompatibility.java +17 -0
- package/ios/Fabric/REAInitializerRCTFabricSurface.h +12 -0
- package/ios/Fabric/REAInitializerRCTFabricSurface.mm +73 -0
- package/ios/REAEventDispatcher.m +0 -1
- package/ios/REAModule.h +10 -1
- package/ios/REAModule.mm +284 -0
- package/ios/REANodesManager.h +27 -51
- package/ios/REANodesManager.mm +517 -0
- package/ios/keyboardObserver/REAKeyboardEventObserver.h +17 -0
- package/ios/keyboardObserver/REAKeyboardEventObserver.m +198 -0
- package/ios/native/NativeProxy.mm +95 -17
- package/ios/native/REAInitializer.mm +10 -12
- package/ios/native/REAJSIUtils.h +66 -0
- package/ios/native/UIResponder+Reanimated.h +3 -1
- package/ios/native/UIResponder+Reanimated.mm +3 -1
- package/ios/sensor/ReanimatedSensor.m +26 -17
- package/lib/commonjs/Animated.js +70 -0
- package/lib/commonjs/Animated.js.map +1 -0
- package/lib/commonjs/ConfigHelper.js +173 -0
- package/lib/commonjs/ConfigHelper.js.map +1 -0
- package/lib/commonjs/createAnimatedComponent.js +474 -0
- package/lib/commonjs/createAnimatedComponent.js.map +1 -0
- package/lib/commonjs/index.js +44 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/index.web.js +32 -0
- package/lib/commonjs/index.web.js.map +1 -0
- package/lib/commonjs/reanimated2/Bezier.js +166 -0
- package/lib/commonjs/reanimated2/Bezier.js.map +1 -0
- package/lib/commonjs/reanimated2/Colors.js +673 -0
- package/lib/commonjs/reanimated2/Colors.js.map +1 -0
- package/lib/commonjs/reanimated2/Easing.js +274 -0
- package/lib/commonjs/reanimated2/Easing.js.map +1 -0
- package/lib/commonjs/reanimated2/NativeMethods.js +100 -0
- package/lib/commonjs/reanimated2/NativeMethods.js.map +1 -0
- package/lib/commonjs/reanimated2/NativeReanimated/NativeReanimated.js +99 -0
- package/lib/commonjs/reanimated2/NativeReanimated/NativeReanimated.js.map +1 -0
- package/lib/commonjs/reanimated2/NativeReanimated/index.js +26 -0
- package/lib/commonjs/reanimated2/NativeReanimated/index.js.map +1 -0
- package/lib/commonjs/reanimated2/PlatformChecker.js +33 -0
- package/lib/commonjs/reanimated2/PlatformChecker.js.map +1 -0
- package/lib/commonjs/reanimated2/PropAdapters.js +68 -0
- package/lib/commonjs/reanimated2/PropAdapters.js.map +1 -0
- package/lib/commonjs/reanimated2/UpdateProps.js +82 -0
- package/lib/commonjs/reanimated2/UpdateProps.js.map +1 -0
- package/lib/commonjs/reanimated2/ViewDescriptorsSet.js +96 -0
- package/lib/commonjs/reanimated2/ViewDescriptorsSet.js.map +1 -0
- package/lib/commonjs/reanimated2/WorkletEventHandler.js +75 -0
- package/lib/commonjs/reanimated2/WorkletEventHandler.js.map +1 -0
- package/lib/commonjs/reanimated2/animation/commonTypes.js +6 -0
- package/lib/commonjs/reanimated2/animation/commonTypes.js.map +1 -0
- package/lib/commonjs/reanimated2/animation/decay.js +132 -0
- package/lib/commonjs/reanimated2/animation/decay.js.map +1 -0
- package/lib/commonjs/reanimated2/animation/delay.js +89 -0
- package/lib/commonjs/reanimated2/animation/delay.js.map +1 -0
- package/lib/commonjs/reanimated2/animation/index.js +82 -0
- package/lib/commonjs/reanimated2/animation/index.js.map +1 -0
- package/lib/commonjs/reanimated2/animation/repeat.js +107 -0
- package/lib/commonjs/reanimated2/animation/repeat.js.map +1 -0
- package/lib/commonjs/reanimated2/animation/sequence.js +103 -0
- package/lib/commonjs/reanimated2/animation/sequence.js.map +1 -0
- package/lib/commonjs/reanimated2/animation/spring.js +121 -0
- package/lib/commonjs/reanimated2/animation/spring.js.map +1 -0
- package/lib/commonjs/reanimated2/animation/styleAnimation.js +206 -0
- package/lib/commonjs/reanimated2/animation/styleAnimation.js.map +1 -0
- package/lib/commonjs/reanimated2/animation/timing.js +82 -0
- package/lib/commonjs/reanimated2/animation/timing.js.map +1 -0
- package/lib/commonjs/reanimated2/animation/util.js +233 -0
- package/lib/commonjs/reanimated2/animation/util.js.map +1 -0
- package/lib/commonjs/reanimated2/commonTypes.js +17 -0
- package/lib/commonjs/reanimated2/commonTypes.js.map +1 -0
- package/lib/commonjs/reanimated2/component/FlatList.js +53 -0
- package/lib/commonjs/reanimated2/component/FlatList.js.map +1 -0
- package/lib/commonjs/reanimated2/component/Image.js +17 -0
- package/lib/commonjs/reanimated2/component/Image.js.map +1 -0
- package/lib/commonjs/reanimated2/component/ScrollView.js +17 -0
- package/lib/commonjs/reanimated2/component/ScrollView.js.map +1 -0
- package/lib/commonjs/reanimated2/component/Text.js +17 -0
- package/lib/commonjs/reanimated2/component/Text.js.map +1 -0
- package/lib/commonjs/reanimated2/component/View.js +17 -0
- package/lib/commonjs/reanimated2/component/View.js.map +1 -0
- package/lib/commonjs/reanimated2/core.js +360 -0
- package/lib/commonjs/reanimated2/core.js.map +1 -0
- package/lib/commonjs/reanimated2/fabricUtils.js +27 -0
- package/lib/commonjs/reanimated2/fabricUtils.js.map +1 -0
- package/lib/commonjs/reanimated2/fabricUtils.web.js +21 -0
- package/lib/commonjs/reanimated2/fabricUtils.web.js.map +1 -0
- package/lib/commonjs/reanimated2/frameCallback/FrameCallbackRegistryJS.js +55 -0
- package/lib/commonjs/reanimated2/frameCallback/FrameCallbackRegistryJS.js.map +1 -0
- package/lib/commonjs/reanimated2/frameCallback/FrameCallbackRegistryUI.js +64 -0
- package/lib/commonjs/reanimated2/frameCallback/FrameCallbackRegistryUI.js.map +1 -0
- package/lib/commonjs/reanimated2/globals.d.js +6 -0
- package/lib/commonjs/reanimated2/globals.d.js.map +1 -0
- package/lib/commonjs/reanimated2/hook/Hooks.js +35 -0
- package/lib/commonjs/reanimated2/hook/Hooks.js.map +1 -0
- package/lib/commonjs/reanimated2/hook/commonTypes.js +6 -0
- package/lib/commonjs/reanimated2/hook/commonTypes.js.map +1 -0
- package/lib/commonjs/reanimated2/hook/index.js +118 -0
- package/lib/commonjs/reanimated2/hook/index.js.map +1 -0
- package/lib/commonjs/reanimated2/hook/useAnimatedGestureHandler.js +66 -0
- package/lib/commonjs/reanimated2/hook/useAnimatedGestureHandler.js.map +1 -0
- package/lib/commonjs/reanimated2/hook/useAnimatedKeyboard.js +48 -0
- package/lib/commonjs/reanimated2/hook/useAnimatedKeyboard.js.map +1 -0
- package/lib/commonjs/reanimated2/hook/useAnimatedReaction.js +44 -0
- package/lib/commonjs/reanimated2/hook/useAnimatedReaction.js.map +1 -0
- package/lib/commonjs/reanimated2/hook/useAnimatedRef.js +43 -0
- package/lib/commonjs/reanimated2/hook/useAnimatedRef.js.map +1 -0
- package/lib/commonjs/reanimated2/hook/useAnimatedScrollHandler.js +62 -0
- package/lib/commonjs/reanimated2/hook/useAnimatedScrollHandler.js.map +1 -0
- package/lib/commonjs/reanimated2/hook/useAnimatedSensor.js +94 -0
- package/lib/commonjs/reanimated2/hook/useAnimatedSensor.js.map +1 -0
- package/lib/commonjs/reanimated2/hook/useAnimatedStyle.js +471 -0
- package/lib/commonjs/reanimated2/hook/useAnimatedStyle.js.map +1 -0
- package/lib/commonjs/reanimated2/hook/useDerivedValue.js +49 -0
- package/lib/commonjs/reanimated2/hook/useDerivedValue.js.map +1 -0
- package/lib/commonjs/reanimated2/hook/useFrameCallback.js +36 -0
- package/lib/commonjs/reanimated2/hook/useFrameCallback.js.map +1 -0
- package/lib/commonjs/reanimated2/hook/useSharedValue.js +30 -0
- package/lib/commonjs/reanimated2/hook/useSharedValue.js.map +1 -0
- package/lib/commonjs/reanimated2/hook/utils.js +247 -0
- package/lib/commonjs/reanimated2/hook/utils.js.map +1 -0
- package/lib/commonjs/reanimated2/index.js +162 -0
- package/lib/commonjs/reanimated2/index.js.map +1 -0
- package/lib/commonjs/reanimated2/interpolateColor.js +154 -0
- package/lib/commonjs/reanimated2/interpolateColor.js.map +1 -0
- package/lib/commonjs/reanimated2/interpolation.js +143 -0
- package/lib/commonjs/reanimated2/interpolation.js.map +1 -0
- package/lib/commonjs/reanimated2/jestUtils.js +239 -0
- package/lib/commonjs/reanimated2/jestUtils.js.map +1 -0
- package/lib/commonjs/reanimated2/js-reanimated/JSReanimated.js +160 -0
- package/lib/commonjs/reanimated2/js-reanimated/JSReanimated.js.map +1 -0
- package/lib/commonjs/reanimated2/js-reanimated/Mapper.js +74 -0
- package/lib/commonjs/reanimated2/js-reanimated/Mapper.js.map +1 -0
- package/lib/commonjs/reanimated2/js-reanimated/MapperRegistry.js +146 -0
- package/lib/commonjs/reanimated2/js-reanimated/MapperRegistry.js.map +1 -0
- package/lib/commonjs/reanimated2/js-reanimated/MutableValue.js +57 -0
- package/lib/commonjs/reanimated2/js-reanimated/MutableValue.js.map +1 -0
- package/lib/commonjs/reanimated2/js-reanimated/commonTypes.js +6 -0
- package/lib/commonjs/reanimated2/js-reanimated/commonTypes.js.map +1 -0
- package/lib/commonjs/reanimated2/js-reanimated/global.js +57 -0
- package/lib/commonjs/reanimated2/js-reanimated/global.js.map +1 -0
- package/lib/commonjs/reanimated2/js-reanimated/index.js +57 -0
- package/lib/commonjs/reanimated2/js-reanimated/index.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/LayoutAnimationRepository.js +97 -0
- package/lib/commonjs/reanimated2/layoutReanimation/LayoutAnimationRepository.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js +100 -0
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js +203 -0
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/Keyframe.js +244 -0
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/Keyframe.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/commonTypes.js +6 -0
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/commonTypes.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/index.js +30 -0
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/index.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Bounce.js +570 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Bounce.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Default.js +55 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Default.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Fade.js +409 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Fade.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Flip.js +559 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Flip.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js +221 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js +101 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Roll.js +189 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Roll.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Rotate.js +403 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Rotate.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Slide.js +298 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Slide.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Stretch.js +167 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Stretch.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Zoom.js +700 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Zoom.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/index.js +136 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/index.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js +120 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js +180 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js +66 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js +64 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js +52 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js +68 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/index.js +84 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/index.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/index.js +47 -0
- package/lib/commonjs/reanimated2/layoutReanimation/index.js.map +1 -0
- package/lib/commonjs/reanimated2/mock.js +88 -0
- package/lib/commonjs/reanimated2/mock.js.map +1 -0
- package/lib/commonjs/reanimated2/platform-specific/RNRenderer.js +16 -0
- package/lib/commonjs/reanimated2/platform-specific/RNRenderer.js.map +1 -0
- package/lib/commonjs/reanimated2/platform-specific/RNRenderer.web.js +5 -0
- package/lib/commonjs/reanimated2/platform-specific/RNRenderer.web.js.map +1 -0
- package/lib/commonjs/reanimated2/utils.js +19 -0
- package/lib/commonjs/reanimated2/utils.js.map +1 -0
- package/lib/commonjs/setAndForwardRef.js +63 -0
- package/lib/commonjs/setAndForwardRef.js.map +1 -0
- package/lib/module/Animated.js +8 -0
- package/lib/module/Animated.js.map +1 -0
- package/lib/module/ConfigHelper.js +161 -0
- package/lib/module/ConfigHelper.js.map +1 -0
- package/lib/module/createAnimatedComponent.js +452 -0
- package/lib/module/createAnimatedComponent.js.map +1 -0
- package/lib/module/index.js +15 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/index.web.js +6 -0
- package/lib/module/index.web.js.map +1 -0
- package/lib/module/reanimated2/Bezier.js +159 -0
- package/lib/module/reanimated2/Bezier.js.map +1 -0
- package/lib/module/reanimated2/Colors.js +632 -0
- package/lib/module/reanimated2/Colors.js.map +1 -0
- package/lib/module/reanimated2/Easing.js +311 -0
- package/lib/module/reanimated2/Easing.js.map +1 -0
- package/lib/module/reanimated2/NativeMethods.js +82 -0
- package/lib/module/reanimated2/NativeMethods.js.map +1 -0
- package/lib/module/reanimated2/NativeReanimated/NativeReanimated.js +89 -0
- package/lib/module/reanimated2/NativeReanimated/NativeReanimated.js.map +1 -0
- package/lib/module/reanimated2/NativeReanimated/index.js +13 -0
- package/lib/module/reanimated2/NativeReanimated/index.js.map +1 -0
- package/lib/module/reanimated2/PlatformChecker.js +17 -0
- package/lib/module/reanimated2/PlatformChecker.js.map +1 -0
- package/lib/module/reanimated2/PropAdapters.js +56 -0
- package/lib/module/reanimated2/PropAdapters.js.map +1 -0
- package/lib/module/reanimated2/UpdateProps.js +64 -0
- package/lib/module/reanimated2/UpdateProps.js.map +1 -0
- package/lib/module/reanimated2/ViewDescriptorsSet.js +83 -0
- package/lib/module/reanimated2/ViewDescriptorsSet.js.map +1 -0
- package/lib/module/reanimated2/WorkletEventHandler.js +64 -0
- package/lib/module/reanimated2/WorkletEventHandler.js.map +1 -0
- package/lib/module/reanimated2/animation/commonTypes.js +2 -0
- package/lib/module/reanimated2/animation/commonTypes.js.map +1 -0
- package/lib/module/reanimated2/animation/decay.js +123 -0
- package/lib/module/reanimated2/animation/decay.js.map +1 -0
- package/lib/module/reanimated2/animation/delay.js +79 -0
- package/lib/module/reanimated2/animation/delay.js.map +1 -0
- package/lib/module/reanimated2/animation/index.js +9 -0
- package/lib/module/reanimated2/animation/index.js.map +1 -0
- package/lib/module/reanimated2/animation/repeat.js +95 -0
- package/lib/module/reanimated2/animation/repeat.js.map +1 -0
- package/lib/module/reanimated2/animation/sequence.js +93 -0
- package/lib/module/reanimated2/animation/sequence.js.map +1 -0
- package/lib/module/reanimated2/animation/spring.js +113 -0
- package/lib/module/reanimated2/animation/spring.js.map +1 -0
- package/lib/module/reanimated2/animation/styleAnimation.js +191 -0
- package/lib/module/reanimated2/animation/styleAnimation.js.map +1 -0
- package/lib/module/reanimated2/animation/timing.js +73 -0
- package/lib/module/reanimated2/animation/timing.js.map +1 -0
- package/lib/module/reanimated2/animation/util.js +216 -0
- package/lib/module/reanimated2/animation/util.js.map +1 -0
- package/lib/module/reanimated2/commonTypes.js +10 -0
- package/lib/module/reanimated2/commonTypes.js.map +1 -0
- package/lib/module/reanimated2/component/FlatList.js +33 -0
- package/lib/module/reanimated2/component/FlatList.js.map +1 -0
- package/lib/module/reanimated2/component/Image.js +5 -0
- package/lib/module/reanimated2/component/Image.js.map +1 -0
- package/lib/module/reanimated2/component/ScrollView.js +5 -0
- package/lib/module/reanimated2/component/ScrollView.js.map +1 -0
- package/lib/module/reanimated2/component/Text.js +5 -0
- package/lib/module/reanimated2/component/Text.js.map +1 -0
- package/lib/module/reanimated2/component/View.js +5 -0
- package/lib/module/reanimated2/component/View.js.map +1 -0
- package/lib/module/reanimated2/core.js +314 -0
- package/lib/module/reanimated2/core.js.map +1 -0
- package/lib/module/reanimated2/fabricUtils.js +18 -0
- package/lib/module/reanimated2/fabricUtils.js.map +1 -0
- package/lib/module/reanimated2/fabricUtils.web.js +12 -0
- package/lib/module/reanimated2/fabricUtils.web.js.map +1 -0
- package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryJS.js +44 -0
- package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryJS.js.map +1 -0
- package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryUI.js +55 -0
- package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryUI.js.map +1 -0
- package/lib/module/reanimated2/globals.d.js +2 -0
- package/lib/module/reanimated2/globals.d.js.map +1 -0
- package/lib/module/reanimated2/hook/Hooks.js +10 -0
- package/lib/module/reanimated2/hook/Hooks.js.map +1 -0
- package/lib/module/reanimated2/hook/commonTypes.js +2 -0
- package/lib/module/reanimated2/hook/commonTypes.js.map +1 -0
- package/lib/module/reanimated2/hook/index.js +12 -0
- package/lib/module/reanimated2/hook/index.js.map +1 -0
- package/lib/module/reanimated2/hook/useAnimatedGestureHandler.js +56 -0
- package/lib/module/reanimated2/hook/useAnimatedGestureHandler.js.map +1 -0
- package/lib/module/reanimated2/hook/useAnimatedKeyboard.js +34 -0
- package/lib/module/reanimated2/hook/useAnimatedKeyboard.js.map +1 -0
- package/lib/module/reanimated2/hook/useAnimatedReaction.js +35 -0
- package/lib/module/reanimated2/hook/useAnimatedReaction.js.map +1 -0
- package/lib/module/reanimated2/hook/useAnimatedRef.js +32 -0
- package/lib/module/reanimated2/hook/useAnimatedRef.js.map +1 -0
- package/lib/module/reanimated2/hook/useAnimatedScrollHandler.js +54 -0
- package/lib/module/reanimated2/hook/useAnimatedScrollHandler.js.map +1 -0
- package/lib/module/reanimated2/hook/useAnimatedSensor.js +79 -0
- package/lib/module/reanimated2/hook/useAnimatedSensor.js.map +1 -0
- package/lib/module/reanimated2/hook/useAnimatedStyle.js +450 -0
- package/lib/module/reanimated2/hook/useAnimatedStyle.js.map +1 -0
- package/lib/module/reanimated2/hook/useDerivedValue.js +39 -0
- package/lib/module/reanimated2/hook/useDerivedValue.js.map +1 -0
- package/lib/module/reanimated2/hook/useFrameCallback.js +24 -0
- package/lib/module/reanimated2/hook/useFrameCallback.js.map +1 -0
- package/lib/module/reanimated2/hook/useSharedValue.js +20 -0
- package/lib/module/reanimated2/hook/useSharedValue.js.map +1 -0
- package/lib/module/reanimated2/hook/utils.js +208 -0
- package/lib/module/reanimated2/hook/utils.js.map +1 -0
- package/lib/module/reanimated2/index.js +13 -0
- package/lib/module/reanimated2/index.js.map +1 -0
- package/lib/module/reanimated2/interpolateColor.js +135 -0
- package/lib/module/reanimated2/interpolateColor.js.map +1 -0
- package/lib/module/reanimated2/interpolation.js +135 -0
- package/lib/module/reanimated2/interpolation.js.map +1 -0
- package/lib/module/reanimated2/jestUtils.js +217 -0
- package/lib/module/reanimated2/jestUtils.js.map +1 -0
- package/lib/module/reanimated2/js-reanimated/JSReanimated.js +144 -0
- package/lib/module/reanimated2/js-reanimated/JSReanimated.js.map +1 -0
- package/lib/module/reanimated2/js-reanimated/Mapper.js +62 -0
- package/lib/module/reanimated2/js-reanimated/Mapper.js.map +1 -0
- package/lib/module/reanimated2/js-reanimated/MapperRegistry.js +137 -0
- package/lib/module/reanimated2/js-reanimated/MapperRegistry.js.map +1 -0
- package/lib/module/reanimated2/js-reanimated/MutableValue.js +48 -0
- package/lib/module/reanimated2/js-reanimated/MutableValue.js.map +1 -0
- package/lib/module/reanimated2/js-reanimated/commonTypes.js +2 -0
- package/lib/module/reanimated2/js-reanimated/commonTypes.js.map +1 -0
- package/lib/module/reanimated2/js-reanimated/global.js +48 -0
- package/lib/module/reanimated2/js-reanimated/global.js.map +1 -0
- package/lib/module/reanimated2/js-reanimated/index.js +43 -0
- package/lib/module/reanimated2/js-reanimated/index.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/LayoutAnimationRepository.js +91 -0
- package/lib/module/reanimated2/layoutReanimation/LayoutAnimationRepository.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js +90 -0
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js +192 -0
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/Keyframe.js +233 -0
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/Keyframe.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/commonTypes.js +2 -0
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/commonTypes.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/index.js +4 -0
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/index.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Bounce.js +530 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Bounce.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Default.js +40 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Default.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Fade.js +372 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Fade.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Flip.js +516 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Flip.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js +199 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js +88 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Roll.js +168 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Roll.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Rotate.js +372 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Rotate.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Slide.js +265 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Slide.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Stretch.js +148 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Stretch.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Zoom.js +643 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Zoom.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/index.js +11 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/index.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js +108 -0
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js +166 -0
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js +55 -0
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js +52 -0
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js +41 -0
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js +57 -0
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/index.js +7 -0
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/index.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/index.js +5 -0
- package/lib/module/reanimated2/layoutReanimation/index.js.map +1 -0
- package/lib/module/reanimated2/mock.js +86 -0
- package/lib/module/reanimated2/mock.js.map +1 -0
- package/lib/module/reanimated2/platform-specific/RNRenderer.js +4 -0
- package/lib/module/reanimated2/platform-specific/RNRenderer.js.map +1 -0
- package/lib/module/reanimated2/platform-specific/RNRenderer.web.js +3 -0
- package/lib/module/reanimated2/platform-specific/RNRenderer.web.js.map +1 -0
- package/lib/module/reanimated2/utils.js +11 -0
- package/lib/module/reanimated2/utils.js.map +1 -0
- package/lib/module/setAndForwardRef.js +55 -0
- package/lib/module/setAndForwardRef.js.map +1 -0
- package/mock.js +1 -0
- package/package.json +29 -25
- package/plugin.js +11 -17
- package/react-native-reanimated.d.ts +57 -4
- package/src/Animated.ts +0 -2
- package/src/createAnimatedComponent.tsx +37 -197
- package/src/index.ts +11 -5
- package/src/index.web.ts +5 -0
- package/src/reanimated2/Colors.ts +1 -1
- package/src/reanimated2/Easing.ts +0 -53
- package/src/reanimated2/NativeMethods.ts +44 -7
- package/src/reanimated2/NativeReanimated/NativeReanimated.ts +9 -0
- package/src/reanimated2/UpdateProps.ts +38 -19
- package/src/reanimated2/animation/decay.ts +79 -30
- package/src/reanimated2/animation/index.ts +7 -4
- package/src/reanimated2/animation/util.ts +8 -1
- package/src/reanimated2/commonTypes.ts +17 -1
- package/src/reanimated2/component/FlatList.tsx +29 -19
- package/src/reanimated2/core.ts +15 -9
- package/src/reanimated2/fabricUtils.ts +27 -0
- package/src/reanimated2/fabricUtils.web.ts +19 -0
- package/src/reanimated2/frameCallback/FrameCallbackRegistryJS.ts +43 -0
- package/src/reanimated2/frameCallback/FrameCallbackRegistryUI.ts +64 -0
- package/src/reanimated2/globals.d.ts +20 -1
- package/src/reanimated2/hook/commonTypes.ts +4 -2
- package/src/reanimated2/hook/index.ts +14 -14
- package/src/reanimated2/hook/useAnimatedGestureHandler.ts +2 -2
- package/src/reanimated2/hook/useAnimatedKeyboard.ts +35 -0
- package/src/reanimated2/hook/useAnimatedRef.ts +8 -3
- package/src/reanimated2/hook/useAnimatedScrollHandler.ts +2 -2
- package/src/reanimated2/hook/useAnimatedSensor.ts +5 -5
- package/src/reanimated2/hook/useFrameCallback.ts +39 -0
- package/src/reanimated2/hook/utils.ts +2 -5
- package/src/reanimated2/interpolateColor.ts +6 -2
- package/src/reanimated2/interpolation.ts +1 -26
- package/src/reanimated2/jestUtils.ts +11 -3
- package/src/reanimated2/js-reanimated/JSReanimated.ts +16 -1
- package/src/reanimated2/js-reanimated/global.ts +46 -29
- package/src/reanimated2/layoutReanimation/LayoutAnimationRepository.ts +1 -1
- package/src/reanimated2/layoutReanimation/animationBuilder/index.ts +1 -1
- package/android/.gradle/7.2/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/7.2/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/7.2/executionHistory/executionHistory.bin +0 -0
- package/android/.gradle/7.2/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/7.2/fileChanges/last-build.bin +0 -0
- package/android/.gradle/7.2/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/7.2/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/7.2/fileHashes/resourceHashesCache.bin +0 -0
- package/android/.gradle/7.2/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
- package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- package/android/.gradle/checksums/checksums.lock +0 -0
- package/android/.gradle/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/react-native-reanimated-65-hermes.aar +0 -0
- package/android/react-native-reanimated-65-jsc.aar +0 -0
- package/android/react-native-reanimated-66-hermes.aar +0 -0
- package/android/react-native-reanimated-66-jsc.aar +0 -0
- package/android/react-native-reanimated-67-hermes.aar +0 -0
- package/android/react-native-reanimated-67-jsc.aar +0 -0
- package/android/react-native-reanimated-68-hermes.aar +0 -0
- package/android/react-native-reanimated-68-jsc.aar +0 -0
- package/android/react-native-reanimated-69-hermes.aar +0 -0
- package/android/react-native-reanimated-69-jsc.aar +0 -0
- package/android/rnVersionPatch/69/.gitkeep +0 -0
- package/android/src/main/java/com/swmansion/reanimated/NativeProxy.java +0 -288
- package/android/src/main/java/com/swmansion/reanimated/UpdateContext.java +0 -11
- package/android/src/main/java/com/swmansion/reanimated/nodes/AlwaysNode.java +0 -29
- package/android/src/main/java/com/swmansion/reanimated/nodes/BezierNode.java +0 -87
- package/android/src/main/java/com/swmansion/reanimated/nodes/BlockNode.java +0 -24
- package/android/src/main/java/com/swmansion/reanimated/nodes/CallFuncNode.java +0 -49
- package/android/src/main/java/com/swmansion/reanimated/nodes/ClockNode.java +0 -38
- package/android/src/main/java/com/swmansion/reanimated/nodes/ClockOpNode.java +0 -73
- package/android/src/main/java/com/swmansion/reanimated/nodes/ConcatNode.java +0 -36
- package/android/src/main/java/com/swmansion/reanimated/nodes/CondNode.java +0 -41
- package/android/src/main/java/com/swmansion/reanimated/nodes/DebugNode.java +0 -33
- package/android/src/main/java/com/swmansion/reanimated/nodes/EventNode.java +0 -83
- package/android/src/main/java/com/swmansion/reanimated/nodes/FinalNode.java +0 -5
- package/android/src/main/java/com/swmansion/reanimated/nodes/FunctionNode.java +0 -20
- package/android/src/main/java/com/swmansion/reanimated/nodes/JSCallNode.java +0 -41
- package/android/src/main/java/com/swmansion/reanimated/nodes/Node.java +0 -139
- package/android/src/main/java/com/swmansion/reanimated/nodes/NoopNode.java +0 -37
- package/android/src/main/java/com/swmansion/reanimated/nodes/OperatorNode.java +0 -377
- package/android/src/main/java/com/swmansion/reanimated/nodes/ParamNode.java +0 -71
- package/android/src/main/java/com/swmansion/reanimated/nodes/PropsNode.java +0 -153
- package/android/src/main/java/com/swmansion/reanimated/nodes/SetNode.java +0 -32
- package/android/src/main/java/com/swmansion/reanimated/nodes/StyleNode.java +0 -40
- package/android/src/main/java/com/swmansion/reanimated/nodes/TransformNode.java +0 -84
- package/android/src/main/java/com/swmansion/reanimated/nodes/ValueNode.java +0 -40
- package/android/src/main/java/com/swmansion/reanimated/transitions/ChangeTransition.java +0 -84
- package/android/src/main/java/com/swmansion/reanimated/transitions/SaneSidePropagation.java +0 -25
- package/android/src/main/java/com/swmansion/reanimated/transitions/Scale.java +0 -86
- package/android/src/main/java/com/swmansion/reanimated/transitions/TransitionModule.java +0 -41
- package/android/src/main/java/com/swmansion/reanimated/transitions/TransitionUtils.java +0 -161
- package/ios/Nodes/REAAlwaysNode.h +0 -4
- package/ios/Nodes/REAAlwaysNode.m +0 -35
- package/ios/Nodes/REABezierNode.h +0 -5
- package/ios/Nodes/REABezierNode.m +0 -103
- package/ios/Nodes/REABlockNode.h +0 -5
- package/ios/Nodes/REABlockNode.m +0 -25
- package/ios/Nodes/REACallFuncNode.h +0 -6
- package/ios/Nodes/REACallFuncNode.m +0 -69
- package/ios/Nodes/REAClockNodes.h +0 -19
- package/ios/Nodes/REAClockNodes.m +0 -118
- package/ios/Nodes/REAConcatNode.h +0 -5
- package/ios/Nodes/REAConcatNode.m +0 -32
- package/ios/Nodes/REACondNode.h +0 -5
- package/ios/Nodes/REACondNode.m +0 -36
- package/ios/Nodes/READebugNode.h +0 -5
- package/ios/Nodes/READebugNode.m +0 -30
- package/ios/Nodes/REAEventNode.h +0 -8
- package/ios/Nodes/REAEventNode.m +0 -35
- package/ios/Nodes/REAFunctionNode.h +0 -6
- package/ios/Nodes/REAFunctionNode.m +0 -24
- package/ios/Nodes/REAJSCallNode.h +0 -5
- package/ios/Nodes/REAJSCallNode.m +0 -30
- package/ios/Nodes/REANode.h +0 -40
- package/ios/Nodes/REANode.m +0 -155
- package/ios/Nodes/REAOperatorNode.h +0 -5
- package/ios/Nodes/REAOperatorNode.m +0 -114
- package/ios/Nodes/REAParamNode.h +0 -10
- package/ios/Nodes/REAParamNode.m +0 -79
- package/ios/Nodes/REAPropsNode.h +0 -9
- package/ios/Nodes/REAPropsNode.m +0 -96
- package/ios/Nodes/REASetNode.h +0 -5
- package/ios/Nodes/REASetNode.m +0 -34
- package/ios/Nodes/REAStyleNode.h +0 -5
- package/ios/Nodes/REAStyleNode.m +0 -27
- package/ios/Nodes/REATransformNode.h +0 -5
- package/ios/Nodes/REATransformNode.m +0 -36
- package/ios/Nodes/REAValueNode.h +0 -9
- package/ios/Nodes/REAValueNode.m +0 -26
- package/ios/REAModule.m +0 -184
- package/ios/REANodesManager.m +0 -626
- package/ios/Transitioning/RCTConvert+REATransition.h +0 -11
- package/ios/Transitioning/RCTConvert+REATransition.m +0 -53
- package/ios/Transitioning/REAAllTransitions.h +0 -26
- package/ios/Transitioning/REAAllTransitions.m +0 -296
- package/ios/Transitioning/REATransition.h +0 -64
- package/ios/Transitioning/REATransition.m +0 -210
- package/ios/Transitioning/REATransitionAnimation.h +0 -17
- package/ios/Transitioning/REATransitionAnimation.m +0 -79
- package/ios/Transitioning/REATransitionManager.h +0 -9
- package/ios/Transitioning/REATransitionManager.m +0 -60
- package/ios/Transitioning/REATransitionValues.h +0 -15
- package/ios/Transitioning/REATransitionValues.m +0 -25
- package/lib/Animated.js +0 -9
- package/lib/ConfigHelper.js +0 -145
- package/lib/ReanimatedEventEmitter.js +0 -3
- package/lib/ReanimatedModule.js +0 -2
- package/lib/ReanimatedModule.macos.js +0 -2
- package/lib/ReanimatedModule.native.js +0 -12
- package/lib/ReanimatedModule.windows.js +0 -2
- package/lib/ReanimatedModuleCompat.js +0 -66
- package/lib/__mocks__/ReanimatedEventEmitter.js +0 -8
- package/lib/__mocks__/ReanimatedModule.native.js +0 -11
- package/lib/createAnimatedComponent.js +0 -514
- package/lib/index.js +0 -6
- package/lib/reanimated1/Easing.js +0 -231
- package/lib/reanimated1/SpringConfig.js +0 -79
- package/lib/reanimated1/Transitioning.js +0 -158
- package/lib/reanimated1/animations/Animation.js +0 -32
- package/lib/reanimated1/animations/SpringUtils.js +0 -199
- package/lib/reanimated1/animations/backwardCompatibleAnimWrapper.js +0 -117
- package/lib/reanimated1/animations/decay.js +0 -54
- package/lib/reanimated1/animations/spring.js +0 -198
- package/lib/reanimated1/animations/timing.js +0 -74
- package/lib/reanimated1/base.js +0 -13
- package/lib/reanimated1/core/AnimatedAlways.js +0 -33
- package/lib/reanimated1/core/AnimatedBezier.js +0 -150
- package/lib/reanimated1/core/AnimatedBlock.js +0 -52
- package/lib/reanimated1/core/AnimatedCall.js +0 -55
- package/lib/reanimated1/core/AnimatedCallFunc.js +0 -72
- package/lib/reanimated1/core/AnimatedClock.js +0 -90
- package/lib/reanimated1/core/AnimatedClockTest.js +0 -22
- package/lib/reanimated1/core/AnimatedCode.js +0 -32
- package/lib/reanimated1/core/AnimatedConcat.js +0 -32
- package/lib/reanimated1/core/AnimatedCond.js +0 -57
- package/lib/reanimated1/core/AnimatedDebug.js +0 -62
- package/lib/reanimated1/core/AnimatedEvent.js +0 -126
- package/lib/reanimated1/core/AnimatedFunction.js +0 -55
- package/lib/reanimated1/core/AnimatedNode.js +0 -223
- package/lib/reanimated1/core/AnimatedOperator.js +0 -103
- package/lib/reanimated1/core/AnimatedParam.js +0 -88
- package/lib/reanimated1/core/AnimatedProps.js +0 -108
- package/lib/reanimated1/core/AnimatedSet.js +0 -38
- package/lib/reanimated1/core/AnimatedStartClock.js +0 -30
- package/lib/reanimated1/core/AnimatedStopClock.js +0 -30
- package/lib/reanimated1/core/AnimatedStyle.js +0 -78
- package/lib/reanimated1/core/AnimatedTransform.js +0 -78
- package/lib/reanimated1/core/AnimatedValue.js +0 -38
- package/lib/reanimated1/core/Core.test.js +0 -30
- package/lib/reanimated1/core/InternalAnimatedValue.js +0 -87
- package/lib/reanimated1/core/__mocks__/AnimatedProps.js +0 -86
- package/lib/reanimated1/core/createEventObjectProxyPolyfill.js +0 -44
- package/lib/reanimated1/derived/__mocks__/evaluateOnce.js +0 -14
- package/lib/reanimated1/derived/acc.js +0 -11
- package/lib/reanimated1/derived/color.js +0 -47
- package/lib/reanimated1/derived/diff.js +0 -16
- package/lib/reanimated1/derived/diffClamp.js +0 -11
- package/lib/reanimated1/derived/evaluateOnce.js +0 -35
- package/lib/reanimated1/derived/index.js +0 -8
- package/lib/reanimated1/derived/interpolate.js +0 -152
- package/lib/reanimated1/derived/interpolateColors.js +0 -62
- package/lib/reanimated1/derived/onChange.js +0 -14
- package/lib/reanimated1/derived/useCode.js +0 -41
- package/lib/reanimated1/index.js +0 -53
- package/lib/reanimated1/operators.js +0 -35
- package/lib/reanimated1/useValue.js +0 -10
- package/lib/reanimated1/val.js +0 -3
- package/lib/reanimated2/Bezier.js +0 -126
- package/lib/reanimated2/Colors.js +0 -522
- package/lib/reanimated2/Easing.js +0 -248
- package/lib/reanimated2/NativeMethods.js +0 -42
- package/lib/reanimated2/NativeReanimated/NativeReanimated.js +0 -50
- package/lib/reanimated2/NativeReanimated/index.js +0 -11
- package/lib/reanimated2/PlatformChecker.js +0 -16
- package/lib/reanimated2/PropAdapters.js +0 -55
- package/lib/reanimated2/UpdateProps.js +0 -55
- package/lib/reanimated2/ViewDescriptorsSet.js +0 -75
- package/lib/reanimated2/WorkletEventHandler.js +0 -37
- package/lib/reanimated2/__mocks__/MutableValue.js +0 -13
- package/lib/reanimated2/__mocks__/NativeReanimated.js +0 -20
- package/lib/reanimated2/__mocks__/NativeReanimated.native.js +0 -20
- package/lib/reanimated2/animation/commonTypes.js +0 -1
- package/lib/reanimated2/animation/decay.js +0 -71
- package/lib/reanimated2/animation/delay.js +0 -64
- package/lib/reanimated2/animation/index.js +0 -8
- package/lib/reanimated2/animation/repeat.js +0 -69
- package/lib/reanimated2/animation/sequence.js +0 -69
- package/lib/reanimated2/animation/spring.js +0 -103
- package/lib/reanimated2/animation/styleAnimation.js +0 -171
- package/lib/reanimated2/animation/timing.js +0 -64
- package/lib/reanimated2/animation/util.js +0 -180
- package/lib/reanimated2/commonTypes.js +0 -1
- package/lib/reanimated2/component/FlatList.js +0 -30
- package/lib/reanimated2/component/Image.js +0 -4
- package/lib/reanimated2/component/ScrollView.js +0 -4
- package/lib/reanimated2/component/Text.js +0 -4
- package/lib/reanimated2/component/View.js +0 -4
- package/lib/reanimated2/core.js +0 -268
- package/lib/reanimated2/globals.d.ts +0 -60
- package/lib/reanimated2/hook/Hooks.js +0 -9
- package/lib/reanimated2/hook/commonTypes.js +0 -1
- package/lib/reanimated2/hook/index.js +0 -9
- package/lib/reanimated2/hook/useAnimatedGestureHandler.js +0 -49
- package/lib/reanimated2/hook/useAnimatedReaction.js +0 -37
- package/lib/reanimated2/hook/useAnimatedRef.js +0 -25
- package/lib/reanimated2/hook/useAnimatedScrollHandler.js +0 -41
- package/lib/reanimated2/hook/useAnimatedSensor.js +0 -66
- package/lib/reanimated2/hook/useAnimatedStyle.js +0 -393
- package/lib/reanimated2/hook/useDerivedValue.js +0 -36
- package/lib/reanimated2/hook/useSharedValue.js +0 -17
- package/lib/reanimated2/hook/utils.js +0 -173
- package/lib/reanimated2/index.js +0 -12
- package/lib/reanimated2/interpolateColor.js +0 -98
- package/lib/reanimated2/interpolation.js +0 -127
- package/lib/reanimated2/jestUtils.js +0 -160
- package/lib/reanimated2/js-reanimated/JSReanimated.js +0 -99
- package/lib/reanimated2/js-reanimated/Mapper.js +0 -43
- package/lib/reanimated2/js-reanimated/MapperRegistry.js +0 -101
- package/lib/reanimated2/js-reanimated/MutableValue.js +0 -29
- package/lib/reanimated2/js-reanimated/commonTypes.js +0 -1
- package/lib/reanimated2/js-reanimated/global.js +0 -25
- package/lib/reanimated2/js-reanimated/index.js +0 -35
- package/lib/reanimated2/layoutReanimation/LayoutAnimationRepository.js +0 -67
- package/lib/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js +0 -69
- package/lib/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js +0 -133
- package/lib/reanimated2/layoutReanimation/animationBuilder/Keyframe.js +0 -194
- package/lib/reanimated2/layoutReanimation/animationBuilder/commonTypes.js +0 -1
- package/lib/reanimated2/layoutReanimation/animationBuilder/index.js +0 -3
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Bounce.js +0 -376
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Default.js +0 -36
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Fade.js +0 -275
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Flip.js +0 -385
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js +0 -138
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js +0 -81
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Roll.js +0 -115
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Rotate.js +0 -273
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Slide.js +0 -203
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Stretch.js +0 -101
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Zoom.js +0 -451
- package/lib/reanimated2/layoutReanimation/defaultAnimations/index.js +0 -10
- package/lib/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js +0 -90
- package/lib/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js +0 -132
- package/lib/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js +0 -37
- package/lib/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js +0 -41
- package/lib/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js +0 -34
- package/lib/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js +0 -46
- package/lib/reanimated2/layoutReanimation/defaultTransitions/index.js +0 -6
- package/lib/reanimated2/layoutReanimation/index.js +0 -4
- package/lib/reanimated2/mock.js +0 -75
- package/lib/reanimated2/platform-specific/RNRenderer.js +0 -3
- package/lib/reanimated2/platform-specific/RNRenderer.web.js +0 -3
- package/lib/reanimated2/utils.js +0 -9
- package/lib/setAndForwardRef.js +0 -19
- package/lib/types/lib/Animated.d.ts +0 -8
- package/lib/types/lib/ConfigHelper.d.ts +0 -12
- package/lib/types/lib/ReanimatedEventEmitter.d.ts +0 -3
- package/lib/types/lib/ReanimatedModule.d.ts +0 -2
- package/lib/types/lib/ReanimatedModule.macos.d.ts +0 -2
- package/lib/types/lib/ReanimatedModule.native.d.ts +0 -2
- package/lib/types/lib/ReanimatedModule.windows.d.ts +0 -2
- package/lib/types/lib/ReanimatedModuleCompat.d.ts +0 -14
- package/lib/types/lib/createAnimatedComponent.d.ts +0 -33
- package/lib/types/lib/index.d.ts +0 -4
- package/lib/types/lib/reanimated2/Bezier.d.ts +0 -6
- package/lib/types/lib/reanimated2/Colors.d.ts +0 -31
- package/lib/types/lib/reanimated2/Easing.d.ts +0 -172
- package/lib/types/lib/reanimated2/NativeMethods.d.ts +0 -14
- package/lib/types/lib/reanimated2/NativeReanimated/NativeReanimated.d.ts +0 -20
- package/lib/types/lib/reanimated2/NativeReanimated/index.d.ts +0 -3
- package/lib/types/lib/reanimated2/PlatformChecker.d.ts +0 -5
- package/lib/types/lib/reanimated2/PropAdapters.d.ts +0 -4
- package/lib/types/lib/reanimated2/UpdateProps.d.ts +0 -9
- package/lib/types/lib/reanimated2/ViewDescriptorsSet.d.ts +0 -20
- package/lib/types/lib/reanimated2/WorkletEventHandler.d.ts +0 -13
- package/lib/types/lib/reanimated2/__mocks__/MutableValue.d.ts +0 -5
- package/lib/types/lib/reanimated2/__mocks__/NativeReanimated.d.ts +0 -13
- package/lib/types/lib/reanimated2/__mocks__/NativeReanimated.native.d.ts +0 -13
- package/lib/types/lib/reanimated2/animation/commonTypes.d.ts +0 -27
- package/lib/types/lib/reanimated2/animation/decay.d.ts +0 -19
- package/lib/types/lib/reanimated2/animation/delay.d.ts +0 -7
- package/lib/types/lib/reanimated2/animation/index.d.ts +0 -9
- package/lib/types/lib/reanimated2/animation/repeat.d.ts +0 -12
- package/lib/types/lib/reanimated2/animation/sequence.d.ts +0 -7
- package/lib/types/lib/reanimated2/animation/spring.d.ts +0 -22
- package/lib/types/lib/reanimated2/animation/styleAnimation.d.ts +0 -7
- package/lib/types/lib/reanimated2/animation/timing.d.ts +0 -21
- package/lib/types/lib/reanimated2/animation/util.d.ts +0 -9
- package/lib/types/lib/reanimated2/commonTypes.d.ts +0 -79
- package/lib/types/lib/reanimated2/component/FlatList.d.ts +0 -9
- package/lib/types/lib/reanimated2/component/Image.d.ts +0 -3
- package/lib/types/lib/reanimated2/component/ScrollView.d.ts +0 -3
- package/lib/types/lib/reanimated2/component/Text.d.ts +0 -3
- package/lib/types/lib/reanimated2/component/View.d.ts +0 -3
- package/lib/types/lib/reanimated2/core.d.ts +0 -24
- package/lib/types/lib/reanimated2/hook/Hooks.d.ts +0 -5
- package/lib/types/lib/reanimated2/hook/commonTypes.d.ts +0 -14
- package/lib/types/lib/reanimated2/hook/index.d.ts +0 -10
- package/lib/types/lib/reanimated2/hook/useAnimatedGestureHandler.d.ts +0 -35
- package/lib/types/lib/reanimated2/hook/useAnimatedReaction.d.ts +0 -12
- package/lib/types/lib/reanimated2/hook/useAnimatedRef.d.ts +0 -3
- package/lib/types/lib/reanimated2/hook/useAnimatedScrollHandler.d.ts +0 -21
- package/lib/types/lib/reanimated2/hook/useAnimatedSensor.d.ts +0 -18
- package/lib/types/lib/reanimated2/hook/useAnimatedStyle.d.ts +0 -11
- package/lib/types/lib/reanimated2/hook/useDerivedValue.d.ts +0 -4
- package/lib/types/lib/reanimated2/hook/useSharedValue.d.ts +0 -2
- package/lib/types/lib/reanimated2/hook/utils.d.ts +0 -28
- package/lib/types/lib/reanimated2/index.d.ts +0 -12
- package/lib/types/lib/reanimated2/interpolateColor.d.ts +0 -26
- package/lib/types/lib/reanimated2/interpolation.d.ts +0 -14
- package/lib/types/lib/reanimated2/jestUtils.d.ts +0 -12
- package/lib/types/lib/reanimated2/js-reanimated/JSReanimated.d.ts +0 -30
- package/lib/types/lib/reanimated2/js-reanimated/Mapper.d.ts +0 -14
- package/lib/types/lib/reanimated2/js-reanimated/MapperRegistry.d.ts +0 -14
- package/lib/types/lib/reanimated2/js-reanimated/MutableValue.d.ts +0 -14
- package/lib/types/lib/reanimated2/js-reanimated/commonTypes.d.ts +0 -44
- package/lib/types/lib/reanimated2/js-reanimated/global.d.ts +0 -1
- package/lib/types/lib/reanimated2/js-reanimated/index.d.ts +0 -15
- package/lib/types/lib/reanimated2/layoutReanimation/LayoutAnimationRepository.d.ts +0 -1
- package/lib/types/lib/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.d.ts +0 -22
- package/lib/types/lib/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.d.ts +0 -38
- package/lib/types/lib/reanimated2/layoutReanimation/animationBuilder/Keyframe.d.ts +0 -25
- package/lib/types/lib/reanimated2/layoutReanimation/animationBuilder/commonTypes.d.ts +0 -77
- package/lib/types/lib/reanimated2/layoutReanimation/animationBuilder/index.d.ts +0 -4
- package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Bounce.d.ts +0 -62
- package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Default.d.ts +0 -4
- package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Fade.d.ts +0 -42
- package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Flip.d.ts +0 -50
- package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.d.ts +0 -18
- package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.d.ts +0 -10
- package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Roll.d.ts +0 -18
- package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Rotate.d.ts +0 -34
- package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Slide.d.ts +0 -34
- package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Stretch.d.ts +0 -18
- package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Zoom.d.ts +0 -66
- package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/index.d.ts +0 -10
- package/lib/types/lib/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.d.ts +0 -19
- package/lib/types/lib/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.d.ts +0 -13
- package/lib/types/lib/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.d.ts +0 -6
- package/lib/types/lib/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.d.ts +0 -6
- package/lib/types/lib/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.d.ts +0 -7
- package/lib/types/lib/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.d.ts +0 -9
- package/lib/types/lib/reanimated2/layoutReanimation/defaultTransitions/index.d.ts +0 -6
- package/lib/types/lib/reanimated2/layoutReanimation/index.d.ts +0 -4
- package/lib/types/lib/reanimated2/mock.d.ts +0 -61
- package/lib/types/lib/reanimated2/platform-specific/RNRenderer.d.ts +0 -1
- package/lib/types/lib/reanimated2/platform-specific/RNRenderer.web.d.ts +0 -0
- package/lib/types/lib/reanimated2/utils.d.ts +0 -7
- package/lib/types/lib/setAndForwardRef.d.ts +0 -40
- package/lib/types/react-native-reanimated-tests.d.ts +0 -1
- package/src/ReanimatedEventEmitter.ts +0 -4
- package/src/ReanimatedModule.macos.ts +0 -3
- package/src/ReanimatedModule.native.ts +0 -13
- package/src/ReanimatedModule.ts +0 -3
- package/src/ReanimatedModule.windows.ts +0 -3
- package/src/ReanimatedModuleCompat.ts +0 -51
- package/src/__mocks__/ReanimatedEventEmitter.js +0 -8
- package/src/__mocks__/ReanimatedModule.native.js +0 -11
- package/src/reanimated1/Easing.js +0 -231
- package/src/reanimated1/SpringConfig.js +0 -79
- package/src/reanimated1/Transitioning.js +0 -158
- package/src/reanimated1/animations/Animation.js +0 -32
- package/src/reanimated1/animations/SpringUtils.js +0 -199
- package/src/reanimated1/animations/backwardCompatibleAnimWrapper.js +0 -117
- package/src/reanimated1/animations/decay.js +0 -54
- package/src/reanimated1/animations/spring.js +0 -198
- package/src/reanimated1/animations/timing.js +0 -74
- package/src/reanimated1/base.js +0 -13
- package/src/reanimated1/core/AnimatedAlways.js +0 -33
- package/src/reanimated1/core/AnimatedBezier.js +0 -150
- package/src/reanimated1/core/AnimatedBlock.js +0 -52
- package/src/reanimated1/core/AnimatedCall.js +0 -55
- package/src/reanimated1/core/AnimatedCallFunc.js +0 -72
- package/src/reanimated1/core/AnimatedClock.js +0 -90
- package/src/reanimated1/core/AnimatedClockTest.js +0 -22
- package/src/reanimated1/core/AnimatedCode.js +0 -32
- package/src/reanimated1/core/AnimatedConcat.js +0 -32
- package/src/reanimated1/core/AnimatedCond.js +0 -57
- package/src/reanimated1/core/AnimatedDebug.js +0 -62
- package/src/reanimated1/core/AnimatedEvent.js +0 -126
- package/src/reanimated1/core/AnimatedFunction.js +0 -55
- package/src/reanimated1/core/AnimatedNode.js +0 -223
- package/src/reanimated1/core/AnimatedOperator.js +0 -103
- package/src/reanimated1/core/AnimatedParam.js +0 -88
- package/src/reanimated1/core/AnimatedProps.js +0 -108
- package/src/reanimated1/core/AnimatedSet.js +0 -38
- package/src/reanimated1/core/AnimatedStartClock.js +0 -30
- package/src/reanimated1/core/AnimatedStopClock.js +0 -30
- package/src/reanimated1/core/AnimatedStyle.js +0 -78
- package/src/reanimated1/core/AnimatedTransform.js +0 -78
- package/src/reanimated1/core/AnimatedValue.js +0 -38
- package/src/reanimated1/core/Core.test.js +0 -30
- package/src/reanimated1/core/InternalAnimatedValue.js +0 -87
- package/src/reanimated1/core/__mocks__/AnimatedProps.js +0 -86
- package/src/reanimated1/core/createEventObjectProxyPolyfill.js +0 -44
- package/src/reanimated1/derived/__mocks__/evaluateOnce.js +0 -14
- package/src/reanimated1/derived/acc.js +0 -11
- package/src/reanimated1/derived/color.js +0 -47
- package/src/reanimated1/derived/diff.js +0 -16
- package/src/reanimated1/derived/diffClamp.js +0 -11
- package/src/reanimated1/derived/evaluateOnce.js +0 -35
- package/src/reanimated1/derived/index.js +0 -8
- package/src/reanimated1/derived/interpolate.js +0 -152
- package/src/reanimated1/derived/interpolateColors.js +0 -62
- package/src/reanimated1/derived/onChange.js +0 -14
- package/src/reanimated1/derived/useCode.js +0 -41
- package/src/reanimated1/index.js +0 -53
- package/src/reanimated1/operators.js +0 -35
- package/src/reanimated1/useValue.js +0 -10
- package/src/reanimated1/val.js +0 -3
- package/src/reanimated2/__mocks__/MutableValue.ts +0 -15
- package/src/reanimated2/__mocks__/NativeReanimated.ts +0 -23
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { addWhitelistedNativeProps } from '../ConfigHelper';
|
|
2
|
+
export function createAnimatedPropAdapter(adapter, nativeProps) {
|
|
3
|
+
const nativePropsToAdd = {}; // eslint-disable-next-line no-unused-expressions
|
|
4
|
+
|
|
5
|
+
nativeProps === null || nativeProps === void 0 ? void 0 : nativeProps.forEach(prop => {
|
|
6
|
+
nativePropsToAdd[prop] = true;
|
|
7
|
+
});
|
|
8
|
+
addWhitelistedNativeProps(nativePropsToAdd);
|
|
9
|
+
return adapter;
|
|
10
|
+
} // ADAPTERS
|
|
11
|
+
|
|
12
|
+
export const SVGAdapter = createAnimatedPropAdapter(props => {
|
|
13
|
+
'worklet';
|
|
14
|
+
|
|
15
|
+
const keys = Object.keys(props); // transform
|
|
16
|
+
|
|
17
|
+
if (keys.includes('transform')) {
|
|
18
|
+
if (Array.isArray(props.transform)) {
|
|
19
|
+
// case of array with 6 values => https://github.com/react-native-svg/react-native-svg/blob/b2e2c355204ff4b10973d3afce1495f7e4167ff7/src/elements/Shape.tsx#L200
|
|
20
|
+
if (props.transform.length !== 6) {
|
|
21
|
+
throw new Error(`invalid transform length of ${props.transform.length}, should be 6`);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const transform = props.transform;
|
|
25
|
+
const x = props.x ?? 0;
|
|
26
|
+
const y = props.y ?? 0;
|
|
27
|
+
props.transform = [{
|
|
28
|
+
translateX: transform[0] * x + transform[2] * y + transform[4]
|
|
29
|
+
}, {
|
|
30
|
+
translateY: transform[1] * x + transform[3] * y + transform[5]
|
|
31
|
+
}];
|
|
32
|
+
} else if (typeof props.transform === 'string') {
|
|
33
|
+
// case of string 'translate(translateX translateY)'
|
|
34
|
+
// todo: handle other cases of transform string like here https://github.com/react-native-svg/react-native-svg/blob/b2e2c355204ff4b10973d3afce1495f7e4167ff7/src/lib/extract/extractTransform.ts#L184
|
|
35
|
+
const transform = props.transform;
|
|
36
|
+
const arr = transform.replace('translate(', '').replace(')', '').split(' ');
|
|
37
|
+
props.transform = [{
|
|
38
|
+
translateX: parseFloat(arr[0])
|
|
39
|
+
}, {
|
|
40
|
+
translateY: parseFloat(arr[1])
|
|
41
|
+
}];
|
|
42
|
+
}
|
|
43
|
+
} // todo: other props
|
|
44
|
+
|
|
45
|
+
});
|
|
46
|
+
export const TextInputAdapter = createAnimatedPropAdapter(props => {
|
|
47
|
+
'worklet';
|
|
48
|
+
|
|
49
|
+
const keys = Object.keys(props); // convert text to value like RN does here: https://github.com/facebook/react-native/blob/f2c6279ca497b34d5a2bfbb6f2d33dc7a7bea02a/Libraries/Components/TextInput/TextInput.js#L878
|
|
50
|
+
|
|
51
|
+
if (keys.includes('value')) {
|
|
52
|
+
props.text = props.value;
|
|
53
|
+
delete props.value;
|
|
54
|
+
}
|
|
55
|
+
}, ['text']);
|
|
56
|
+
//# sourceMappingURL=PropAdapters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["addWhitelistedNativeProps","createAnimatedPropAdapter","adapter","nativeProps","nativePropsToAdd","forEach","prop","SVGAdapter","props","keys","Object","includes","Array","isArray","transform","length","Error","x","y","translateX","translateY","arr","replace","split","parseFloat","TextInputAdapter","text","value"],"sources":["PropAdapters.ts"],"sourcesContent":["import { addWhitelistedNativeProps } from '../ConfigHelper';\nimport { AdapterWorkletFunction } from './commonTypes';\n\nexport function createAnimatedPropAdapter(\n adapter: AdapterWorkletFunction,\n nativeProps?: string[]\n): AdapterWorkletFunction {\n const nativePropsToAdd: { [key: string]: boolean } = {};\n // eslint-disable-next-line no-unused-expressions\n nativeProps?.forEach((prop) => {\n nativePropsToAdd[prop] = true;\n });\n addWhitelistedNativeProps(nativePropsToAdd);\n return adapter;\n}\n\n// ADAPTERS\n\nexport const SVGAdapter: AdapterWorkletFunction = createAnimatedPropAdapter(\n (props) => {\n 'worklet';\n const keys = Object.keys(props);\n // transform\n if (keys.includes('transform')) {\n if (Array.isArray(props.transform)) {\n // case of array with 6 values => https://github.com/react-native-svg/react-native-svg/blob/b2e2c355204ff4b10973d3afce1495f7e4167ff7/src/elements/Shape.tsx#L200\n if (props.transform.length !== 6) {\n throw new Error(\n `invalid transform length of ${props.transform.length}, should be 6`\n );\n }\n const transform: number[] = props.transform as number[];\n const x: number = (props.x as number) ?? 0;\n const y: number = (props.y as number) ?? 0;\n props.transform = [\n { translateX: transform[0] * x + transform[2] * y + transform[4] },\n { translateY: transform[1] * x + transform[3] * y + transform[5] },\n ];\n } else if (typeof props.transform === 'string') {\n // case of string 'translate(translateX translateY)'\n // todo: handle other cases of transform string like here https://github.com/react-native-svg/react-native-svg/blob/b2e2c355204ff4b10973d3afce1495f7e4167ff7/src/lib/extract/extractTransform.ts#L184\n const transform: string = props.transform as string;\n const arr = transform\n .replace('translate(', '')\n .replace(')', '')\n .split(' ');\n props.transform = [\n { translateX: parseFloat(arr[0]) },\n { translateY: parseFloat(arr[1]) },\n ];\n }\n }\n // todo: other props\n }\n);\n\nexport const TextInputAdapter = createAnimatedPropAdapter(\n (props) => {\n 'worklet';\n const keys = Object.keys(props);\n // convert text to value like RN does here: https://github.com/facebook/react-native/blob/f2c6279ca497b34d5a2bfbb6f2d33dc7a7bea02a/Libraries/Components/TextInput/TextInput.js#L878\n if (keys.includes('value')) {\n props.text = props.value;\n delete props.value;\n }\n },\n ['text']\n);\n"],"mappings":"AAAA,SAASA,yBAAT,QAA0C,iBAA1C;AAGA,OAAO,SAASC,yBAAT,CACLC,OADK,EAELC,WAFK,EAGmB;EACxB,MAAMC,gBAA4C,GAAG,EAArD,CADwB,CAExB;;EACAD,WAAW,SAAX,IAAAA,WAAW,WAAX,YAAAA,WAAW,CAAEE,OAAb,CAAsBC,IAAD,IAAU;IAC7BF,gBAAgB,CAACE,IAAD,CAAhB,GAAyB,IAAzB;EACD,CAFD;EAGAN,yBAAyB,CAACI,gBAAD,CAAzB;EACA,OAAOF,OAAP;AACD,C,CAED;;AAEA,OAAO,MAAMK,UAAkC,GAAGN,yBAAyB,CACxEO,KAAD,IAAW;EACT;;EACA,MAAMC,IAAI,GAAGC,MAAM,CAACD,IAAP,CAAYD,KAAZ,CAAb,CAFS,CAGT;;EACA,IAAIC,IAAI,CAACE,QAAL,CAAc,WAAd,CAAJ,EAAgC;IAC9B,IAAIC,KAAK,CAACC,OAAN,CAAcL,KAAK,CAACM,SAApB,CAAJ,EAAoC;MAClC;MACA,IAAIN,KAAK,CAACM,SAAN,CAAgBC,MAAhB,KAA2B,C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KAAZ,CAAb,CAFS,CAGT;;EACA,IAAIC,IAAI,CAACE,QAAL,CAAc,OAAd,CAAJ,EAA4B;IAC1BH,KAAK,CAACkB,IAAN,GAAalB,KAAK,CAACmB,KAAnB;IACA,OAAOnB,KAAK,CAACmB,KAAb;EACD;AACF,CATsD,EAUvD,CAAC,MAAD,CAVuD,CAAlD"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/* global _updatePropsPaper _updatePropsFabric */
|
|
2
|
+
import { processColor } from './Colors';
|
|
3
|
+
import { makeShareable, isConfigured } from './core';
|
|
4
|
+
import { _updatePropsJS } from './js-reanimated';
|
|
5
|
+
import { shouldBeUseWeb } from './PlatformChecker';
|
|
6
|
+
// copied from react-native/Libraries/Components/View/ReactNativeStyleAttributes
|
|
7
|
+
export const colorProps = ['backgroundColor', 'borderBottomColor', 'borderColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor', 'borderStartColor', 'borderEndColor', 'color', 'shadowColor', 'textDecorationColor', 'tintColor', 'textShadowColor', 'overlayColor'];
|
|
8
|
+
export const ColorProperties = !isConfigured() ? [] : makeShareable(colorProps);
|
|
9
|
+
let updatePropsByPlatform;
|
|
10
|
+
|
|
11
|
+
if (shouldBeUseWeb()) {
|
|
12
|
+
updatePropsByPlatform = (_, updates, maybeViewRef) => {
|
|
13
|
+
'worklet';
|
|
14
|
+
|
|
15
|
+
if (maybeViewRef) {
|
|
16
|
+
maybeViewRef.items.forEach((item, _) => {
|
|
17
|
+
_updatePropsJS(updates, item);
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
} else {
|
|
22
|
+
if (global._IS_FABRIC) {
|
|
23
|
+
updatePropsByPlatform = (viewDescriptors, updates, _) => {
|
|
24
|
+
'worklet';
|
|
25
|
+
|
|
26
|
+
for (const key in updates) {
|
|
27
|
+
if (ColorProperties.indexOf(key) !== -1) {
|
|
28
|
+
updates[key] = processColor(updates[key]);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
viewDescriptors.value.forEach(viewDescriptor => {
|
|
33
|
+
_updatePropsFabric(viewDescriptor.shadowNodeWrapper, updates);
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
} else {
|
|
37
|
+
updatePropsByPlatform = (viewDescriptors, updates, _) => {
|
|
38
|
+
'worklet';
|
|
39
|
+
|
|
40
|
+
for (const key in updates) {
|
|
41
|
+
if (ColorProperties.indexOf(key) !== -1) {
|
|
42
|
+
updates[key] = processColor(updates[key]);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
viewDescriptors.value.forEach(viewDescriptor => {
|
|
47
|
+
_updatePropsPaper(viewDescriptor.tag, viewDescriptor.name || 'RCTView', updates);
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export const updateProps = updatePropsByPlatform;
|
|
54
|
+
export const updatePropsJestWrapper = (viewDescriptors, updates, maybeViewRef, animatedStyle, adapters) => {
|
|
55
|
+
adapters.forEach(adapter => {
|
|
56
|
+
adapter(updates);
|
|
57
|
+
});
|
|
58
|
+
animatedStyle.current.value = { ...animatedStyle.current.value,
|
|
59
|
+
...updates
|
|
60
|
+
};
|
|
61
|
+
updateProps(viewDescriptors, updates, maybeViewRef);
|
|
62
|
+
};
|
|
63
|
+
export default updateProps;
|
|
64
|
+
//# sourceMappingURL=UpdateProps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["processColor","makeShareable","isConfigured","_updatePropsJS","shouldBeUseWeb","colorProps","ColorProperties","updatePropsByPlatform","_","updates","maybeViewRef","items","forEach","item","global","_IS_FABRIC","viewDescriptors","key","indexOf","value","viewDescriptor","_updatePropsFabric","shadowNodeWrapper","_updatePropsPaper","tag","name","updateProps","updatePropsJestWrapper","animatedStyle","adapters","adapter","current"],"sources":["UpdateProps.ts"],"sourcesContent":["/* global _updatePropsPaper _updatePropsFabric */\nimport { MutableRefObject } from 'react';\nimport { processColor } from './Colors';\nimport { AnimatedStyle, SharedValue, StyleProps } from './commonTypes';\nimport { makeShareable, isConfigured } from './core';\nimport { Descriptor } from './hook/commonTypes';\nimport { _updatePropsJS } from './js-reanimated';\nimport { shouldBeUseWeb } from './PlatformChecker';\nimport { ViewRefSet } from './ViewDescriptorsSet';\n\n// copied from react-native/Libraries/Components/View/ReactNativeStyleAttributes\nexport const colorProps = [\n 'backgroundColor',\n 'borderBottomColor',\n 'borderColor',\n 'borderLeftColor',\n 'borderRightColor',\n 'borderTopColor',\n 'borderStartColor',\n 'borderEndColor',\n 'color',\n 'shadowColor',\n 'textDecorationColor',\n 'tintColor',\n 'textShadowColor',\n 'overlayColor',\n];\n\nexport const ColorProperties = !isConfigured() ? [] : makeShareable(colorProps);\n\nlet updatePropsByPlatform;\nif (shouldBeUseWeb()) {\n updatePropsByPlatform = (\n _: SharedValue<Descriptor[]>,\n updates: StyleProps | AnimatedStyle,\n maybeViewRef: ViewRefSet<any> | undefined\n ): void => {\n 'worklet';\n if (maybeViewRef) {\n maybeViewRef.items.forEach((item, _) => {\n _updatePropsJS(updates, item);\n });\n }\n };\n} else {\n if (global._IS_FABRIC) {\n updatePropsByPlatform = (\n viewDescriptors: SharedValue<Descriptor[]>,\n updates: StyleProps | AnimatedStyle,\n _: ViewRefSet<any> | undefined\n ): void => {\n 'worklet';\n\n for (const key in updates) {\n if (ColorProperties.indexOf(key) !== -1) {\n updates[key] = processColor(updates[key]);\n }\n }\n\n viewDescriptors.value.forEach((viewDescriptor) => {\n _updatePropsFabric(viewDescriptor.shadowNodeWrapper, updates);\n });\n };\n } else {\n updatePropsByPlatform = (\n viewDescriptors: SharedValue<Descriptor[]>,\n updates: StyleProps | AnimatedStyle,\n _: ViewRefSet<any> | undefined\n ): void => {\n 'worklet';\n\n for (const key in updates) {\n if (ColorProperties.indexOf(key) !== -1) {\n updates[key] = processColor(updates[key]);\n }\n }\n viewDescriptors.value.forEach((viewDescriptor) => {\n _updatePropsPaper(\n viewDescriptor.tag,\n viewDescriptor.name || 'RCTView',\n updates\n );\n });\n };\n }\n}\n\nexport const updateProps: (\n viewDescriptor: SharedValue<Descriptor[]>,\n updates: StyleProps | AnimatedStyle,\n maybeViewRef: ViewRefSet<any> | undefined\n) => void = updatePropsByPlatform;\n\nexport const updatePropsJestWrapper = (\n viewDescriptors: SharedValue<Descriptor[]>,\n updates: AnimatedStyle,\n maybeViewRef: ViewRefSet<any> | undefined,\n animatedStyle: MutableRefObject<AnimatedStyle>,\n adapters: ((updates: AnimatedStyle) => void)[]\n): void => {\n adapters.forEach((adapter) => {\n adapter(updates);\n });\n animatedStyle.current.value = {\n ...animatedStyle.current.value,\n ...updates,\n };\n\n updateProps(viewDescriptors, updates, maybeViewRef);\n};\n\nexport default updateProps;\n"],"mappings":"AAAA;AAEA,SAASA,YAAT,QAA6B,UAA7B;AAEA,SAASC,aAAT,EAAwBC,YAAxB,QAA4C,QAA5C;AAEA,SAASC,cAAT,QAA+B,iBAA/B;AACA,SAASC,cAAT,QAA+B,mBAA/B;AAGA;AACA,OAAO,MAAMC,UAAU,GAAG,CACxB,iBADwB,EAExB,mBAFwB,EAGxB,aAHwB,EAIxB,iBAJwB,EAKxB,kBALwB,EAMxB,gBANwB,EAOxB,kBAPwB,EAQxB,gBARwB,EASxB,OATwB,EAUxB,aAVwB,EAWxB,qBAXwB,EAYxB,WAZwB,EAaxB,iBAbwB,EAcxB,cAdwB,CAAnB;AAiBP,OAAO,MAAMC,eAAe,GAAG,CAACJ,YAAY,EAAb,GAAkB,EAAlB,GAAuBD,aAAa,CAACI,UAAD,CAA5D;AAEP,IAAIE,qBAAJ;;AACA,IAAIH,cAAc,EAAlB,EAAsB;EACpBG,qBAAqB,GAAG,CACtBC,CADsB,EAEtBC,OAFsB,EAGtBC,YAHsB,KAIb;IACT;;IACA,IAAIA,YAAJ,EAAkB;MAChBA,YAAY,CAACC,KAAb,CAAmBC,OAAnB,CAA2B,CAACC,IAAD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YAHoC,EAIpCkB,aAJoC,EAKpCC,QALoC,KAM3B;EACTA,QAAQ,CAACjB,OAAT,CAAkBkB,OAAD,IAAa;IAC5BA,OAAO,CAACrB,OAAD,CAAP;EACD,CAFD;EAGAmB,aAAa,CAACG,OAAd,CAAsBZ,KAAtB,GAA8B,EAC5B,GAAGS,aAAa,CAACG,OAAd,CAAsBZ,KADG;IAE5B,GAAGV;EAFyB,CAA9B;EAKAiB,WAAW,CAACV,eAAD,EAAkBP,OAAlB,EAA2BC,YAA3B,CAAX;AACD,CAhBM;AAkBP,eAAegB,WAAf"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { useRef } from 'react';
|
|
2
|
+
import { makeMutable } from './core';
|
|
3
|
+
import { shouldBeUseWeb } from './PlatformChecker';
|
|
4
|
+
const scheduleUpdates = shouldBeUseWeb() ? requestAnimationFrame : setImmediate;
|
|
5
|
+
export function makeViewDescriptorsSet() {
|
|
6
|
+
const ref = useRef(null);
|
|
7
|
+
|
|
8
|
+
if (ref.current === null) {
|
|
9
|
+
const data = {
|
|
10
|
+
batchToRemove: new Set(),
|
|
11
|
+
tags: new Set(),
|
|
12
|
+
waitForInsertSync: false,
|
|
13
|
+
waitForRemoveSync: false,
|
|
14
|
+
sharableViewDescriptors: makeMutable([]),
|
|
15
|
+
items: [],
|
|
16
|
+
add: item => {
|
|
17
|
+
if (data.tags.has(item.tag)) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
data.tags.add(item.tag);
|
|
22
|
+
data.items.push(item);
|
|
23
|
+
|
|
24
|
+
if (!data.waitForInsertSync) {
|
|
25
|
+
data.waitForInsertSync = true;
|
|
26
|
+
scheduleUpdates(() => {
|
|
27
|
+
data.sharableViewDescriptors.value = data.items;
|
|
28
|
+
data.waitForInsertSync = false;
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
remove: viewTag => {
|
|
33
|
+
data.batchToRemove.add(viewTag);
|
|
34
|
+
|
|
35
|
+
if (!data.waitForRemoveSync) {
|
|
36
|
+
data.waitForRemoveSync = true;
|
|
37
|
+
scheduleUpdates(() => {
|
|
38
|
+
const items = [];
|
|
39
|
+
|
|
40
|
+
for (const item of data.items) {
|
|
41
|
+
if (data.batchToRemove.has(item.tag)) {
|
|
42
|
+
data.tags.delete(item.tag);
|
|
43
|
+
} else {
|
|
44
|
+
items.push(item);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
data.items = items;
|
|
49
|
+
data.sharableViewDescriptors.value = items;
|
|
50
|
+
data.batchToRemove = new Set();
|
|
51
|
+
data.waitForRemoveSync = false;
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
rebuildsharableViewDescriptors: sharableViewDescriptors => {
|
|
56
|
+
data.sharableViewDescriptors = sharableViewDescriptors;
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
ref.current = data;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return ref.current;
|
|
63
|
+
}
|
|
64
|
+
export function makeViewsRefSet() {
|
|
65
|
+
const ref = useRef(null);
|
|
66
|
+
|
|
67
|
+
if (ref.current === null) {
|
|
68
|
+
const data = {
|
|
69
|
+
items: new Set(),
|
|
70
|
+
add: item => {
|
|
71
|
+
if (data.items.has(item)) return;
|
|
72
|
+
data.items.add(item);
|
|
73
|
+
},
|
|
74
|
+
remove: item => {
|
|
75
|
+
data.items.delete(item);
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
ref.current = data;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return ref.current;
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=ViewDescriptorsSet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useRef","makeMutable","shouldBeUseWeb","scheduleUpdates","requestAnimationFrame","setImmediate","makeViewDescriptorsSet","ref","current","data","batchToRemove","Set","tags","waitForInsertSync","waitForRemoveSync","sharableViewDescriptors","items","add","item","has","tag","push","value","remove","viewTag","delete","rebuildsharableViewDescriptors","makeViewsRefSet"],"sources":["ViewDescriptorsSet.ts"],"sourcesContent":["import { useRef } from 'react';\nimport { makeMutable } from './core';\nimport { SharedValue } from './commonTypes';\nimport { Descriptor } from './hook/commonTypes';\nimport { shouldBeUseWeb } from './PlatformChecker';\n\nexport interface ViewRefSet<T> {\n items: Set<T>;\n add: (item: T) => void;\n remove: (item: T) => void;\n}\n\nexport interface ViewDescriptorsSet {\n batchToRemove: Set<number>;\n tags: Set<number>;\n waitForInsertSync: boolean;\n waitForRemoveSync: boolean;\n sharableViewDescriptors: SharedValue<Descriptor[]>;\n items: Descriptor[];\n add: (item: Descriptor) => void;\n remove: (viewTag: number) => void;\n rebuildsharableViewDescriptors: (\n sharableViewDescriptor: SharedValue<Descriptor[]>\n ) => void;\n}\n\nconst scheduleUpdates = shouldBeUseWeb() ? requestAnimationFrame : setImmediate;\n\nexport function makeViewDescriptorsSet(): ViewDescriptorsSet {\n const ref = useRef<ViewDescriptorsSet | null>(null);\n if (ref.current === null) {\n const data: ViewDescriptorsSet = {\n batchToRemove: new Set(),\n tags: new Set(),\n waitForInsertSync: false,\n waitForRemoveSync: false,\n sharableViewDescriptors: makeMutable([]),\n items: [],\n\n add: (item: Descriptor) => {\n if (data.tags.has(item.tag)) {\n return;\n }\n data.tags.add(item.tag);\n data.items.push(item);\n\n if (!data.waitForInsertSync) {\n data.waitForInsertSync = true;\n\n scheduleUpdates(() => {\n data.sharableViewDescriptors.value = data.items;\n data.waitForInsertSync = false;\n });\n }\n },\n\n remove: (viewTag: number) => {\n data.batchToRemove.add(viewTag);\n\n if (!data.waitForRemoveSync) {\n data.waitForRemoveSync = true;\n\n scheduleUpdates(() => {\n const items = [];\n for (const item of data.items) {\n if (data.batchToRemove.has(item.tag)) {\n data.tags.delete(item.tag);\n } else {\n items.push(item);\n }\n }\n data.items = items;\n data.sharableViewDescriptors.value = items;\n data.batchToRemove = new Set();\n data.waitForRemoveSync = false;\n });\n }\n },\n\n rebuildsharableViewDescriptors: (\n sharableViewDescriptors: SharedValue<Descriptor[]>\n ) => {\n data.sharableViewDescriptors = sharableViewDescriptors;\n },\n };\n ref.current = data;\n }\n\n return ref.current;\n}\n\nexport function makeViewsRefSet<T>(): ViewRefSet<T> {\n const ref = useRef<ViewRefSet<T> | null>(null);\n if (ref.current === null) {\n const data: ViewRefSet<T> = {\n items: new Set(),\n\n add: (item: T) => {\n if (data.items.has(item)) return;\n data.items.add(item);\n },\n\n remove: (item: T) => {\n data.items.delete(item);\n },\n };\n ref.current = data;\n }\n\n return ref.current;\n}\n"],"mappings":"AAAA,SAASA,MAAT,QAAuB,OAAvB;AACA,SAASC,WAAT,QAA4B,QAA5B;AAGA,SAASC,cAAT,QAA+B,mBAA/B;AAsBA,MAAMC,eAAe,GAAGD,cAAc,KAAKE,qBAAL,GAA6BC,YAAnE;AAEA,OAAO,SAASC,sBAAT,GAAsD;EAC3D,MAAMC,GAAG,GAAGP,MAAM,CAA4B,IAA5B,CAAlB;;EACA,IAAIO,GAAG,CAACC,OAAJ,KAAgB,IAApB,EAA0B;IACxB,MAAMC,IAAwB,GAAG;MAC/BC,aAAa,EAAE,IAAIC,GAAJ,EADgB;MAE/BC,IAAI,EAAE,IAAID,GAAJ,EAFyB;MAG/BE,iBAAiB,EAAE,KAHY;MAI/BC,iBAAiB,EAAE,KAJY;MAK/BC,uBAAuB,EAAEd,WAAW,CAAC,EAAD,CALL;MAM/Be,KAAK,EAAE,EANwB;MAQ/BC,GAAG,EAAGC,IAAD,IAAsB;QACzB,IAAIT,IAAI,CAACG,IAAL,CAAUO,GAAV,CAAcD,IAAI,CAACE,GAAnB,CAAJ,EAA6B;UAC3B;QACD;;QACDX,IAAI,CAACG,IAAL,CAAUK,GAAV,CAAcC,IAAI,CAACE,GAAnB;QACAX,IAAI,CAACO,KAAL,CAAWK,IAAX,CAAgBH,IAAhB;;QAEA,IAAI,CAACT,IAAI,CAAC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AAvB,CAAlB;;EACA,IAAIO,GAAG,CAACC,OAAJ,KAAgB,IAApB,EAA0B;IACxB,MAAMC,IAAmB,GAAG;MAC1BO,KAAK,EAAE,IAAIL,GAAJ,EADmB;MAG1BM,GAAG,EAAGC,IAAD,IAAa;QAChB,IAAIT,IAAI,CAACO,KAAL,CAAWG,GAAX,CAAeD,IAAf,CAAJ,EAA0B;QAC1BT,IAAI,CAACO,KAAL,CAAWC,GAAX,CAAeC,IAAf;MACD,CANyB;MAQ1BK,MAAM,EAAGL,IAAD,IAAa;QACnBT,IAAI,CAACO,KAAL,CAAWS,MAAX,CAAkBP,IAAlB;MACD;IAVyB,CAA5B;IAYAX,GAAG,CAACC,OAAJ,GAAcC,IAAd;EACD;;EAED,OAAOF,GAAG,CAACC,OAAX;AACD"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
|
|
3
|
+
import NativeReanimatedModule from './NativeReanimated';
|
|
4
|
+
|
|
5
|
+
function jsListener(eventName, handler) {
|
|
6
|
+
return evt => {
|
|
7
|
+
handler({ ...evt.nativeEvent,
|
|
8
|
+
eventName
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default class WorkletEventHandler {
|
|
14
|
+
constructor(worklet) {
|
|
15
|
+
let eventNames = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
16
|
+
|
|
17
|
+
_defineProperty(this, "worklet", void 0);
|
|
18
|
+
|
|
19
|
+
_defineProperty(this, "eventNames", void 0);
|
|
20
|
+
|
|
21
|
+
_defineProperty(this, "reattachNeeded", void 0);
|
|
22
|
+
|
|
23
|
+
_defineProperty(this, "listeners", void 0);
|
|
24
|
+
|
|
25
|
+
_defineProperty(this, "viewTag", void 0);
|
|
26
|
+
|
|
27
|
+
_defineProperty(this, "registrations", void 0);
|
|
28
|
+
|
|
29
|
+
this.worklet = worklet;
|
|
30
|
+
this.eventNames = eventNames;
|
|
31
|
+
this.reattachNeeded = false;
|
|
32
|
+
this.listeners = {};
|
|
33
|
+
this.viewTag = undefined;
|
|
34
|
+
this.registrations = [];
|
|
35
|
+
|
|
36
|
+
if (!NativeReanimatedModule.native) {
|
|
37
|
+
this.listeners = eventNames.reduce((acc, eventName) => {
|
|
38
|
+
acc[eventName] = jsListener(eventName, worklet);
|
|
39
|
+
return acc;
|
|
40
|
+
}, {});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
updateWorklet(newWorklet) {
|
|
45
|
+
this.worklet = newWorklet;
|
|
46
|
+
this.reattachNeeded = true;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
registerForEvents(viewTag, fallbackEventName) {
|
|
50
|
+
this.viewTag = viewTag;
|
|
51
|
+
this.registrations = this.eventNames.map(eventName => NativeReanimatedModule.registerEventHandler(viewTag + eventName, this.worklet));
|
|
52
|
+
|
|
53
|
+
if (this.registrations.length === 0 && fallbackEventName) {
|
|
54
|
+
this.registrations.push(NativeReanimatedModule.registerEventHandler(viewTag + fallbackEventName, this.worklet));
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
unregisterFromEvents() {
|
|
59
|
+
this.registrations.forEach(id => NativeReanimatedModule.unregisterEventHandler(id));
|
|
60
|
+
this.registrations = [];
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=WorkletEventHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["NativeReanimatedModule","jsListener","eventName","handler","evt","nativeEvent","WorkletEventHandler","constructor","worklet","eventNames","reattachNeeded","listeners","viewTag","undefined","registrations","native","reduce","acc","updateWorklet","newWorklet","registerForEvents","fallbackEventName","map","registerEventHandler","length","push","unregisterFromEvents","forEach","id","unregisterEventHandler"],"sources":["WorkletEventHandler.ts"],"sourcesContent":["import { NativeEvent } from './commonTypes';\nimport NativeReanimatedModule from './NativeReanimated';\n\nfunction jsListener<T extends NativeEvent<T>>(\n eventName: string,\n handler: (event: T) => void\n) {\n return (evt: T) => {\n handler({ ...evt.nativeEvent, eventName });\n };\n}\n\nexport default class WorkletEventHandler<T extends NativeEvent<T>> {\n worklet: (event: T) => void;\n eventNames: string[];\n reattachNeeded: boolean;\n listeners: Record<string, (event: T) => void>;\n viewTag: number | undefined;\n registrations: string[];\n constructor(worklet: (event: T) => void, eventNames: string[] = []) {\n this.worklet = worklet;\n this.eventNames = eventNames;\n this.reattachNeeded = false;\n this.listeners = {};\n this.viewTag = undefined;\n this.registrations = [];\n\n if (!NativeReanimatedModule.native) {\n this.listeners = eventNames.reduce(\n (acc: Record<string, (event: T) => void>, eventName: string) => {\n acc[eventName] = jsListener(eventName, worklet);\n return acc;\n },\n {}\n );\n }\n }\n\n updateWorklet(newWorklet: (event: T) => void): void {\n this.worklet = newWorklet;\n this.reattachNeeded = true;\n }\n\n registerForEvents(viewTag: number, fallbackEventName?: string): void {\n this.viewTag = viewTag;\n this.registrations = this.eventNames.map((eventName) =>\n NativeReanimatedModule.registerEventHandler(\n viewTag + eventName,\n this.worklet\n )\n );\n if (this.registrations.length === 0 && fallbackEventName) {\n this.registrations.push(\n NativeReanimatedModule.registerEventHandler(\n viewTag + fallbackEventName,\n this.worklet\n )\n );\n }\n }\n\n unregisterFromEvents(): void {\n this.registrations.forEach((id) =>\n NativeReanimatedModule.unregisterEventHandler(id)\n );\n this.registrations = [];\n }\n}\n"],"mappings":";;AACA,OAAOA,sBAAP,MAAmC,oBAAnC;;AAEA,SAASC,UAAT,CACEC,SADF,EAEEC,OAFF,EAGE;EACA,OAAQC,GAAD,IAAY;IACjBD,OAAO,CAAC,EAAE,GAAGC,GAAG,CAACC,WAAT;MAAsBH;IAAtB,CAAD,CAAP;EACD,CAFD;AAGD;;AAED,eAAe,MAAMI,mBAAN,CAAo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AAC6B,sBAAvB,CAA8CD,EAA9C,CADF;IAGA,KAAKd,aAAL,GAAqB,EAArB;EACD;;AAtDgE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["commonTypes.ts"],"sourcesContent":["import {\n AnimatedStyle,\n StyleProps,\n AnimatableValue,\n AnimationObject,\n Animation,\n Timestamp,\n AnimationCallback,\n} from '../commonTypes';\n\nexport interface HigherOrderAnimation {\n isHigherOrder?: boolean;\n}\n\nexport type NextAnimation<T extends AnimationObject> = T | (() => T);\n\nexport interface DelayAnimation\n extends Animation<DelayAnimation>,\n HigherOrderAnimation {\n startTime: Timestamp;\n started: boolean;\n previousAnimation: DelayAnimation | null;\n current: AnimatableValue;\n}\n\nexport interface RepeatAnimation\n extends Animation<RepeatAnimation>,\n HigherOrderAnimation {\n reps: number;\n startValue: AnimatableValue;\n toValue?: AnimatableValue;\n previousAnimation?: RepeatAnimation;\n}\n\nexport interface SequenceAnimation\n extends Animation<SequenceAnimation>,\n HigherOrderAnimation {\n animationIndex: number;\n}\n\nexport interface StyleLayoutAnimation extends HigherOrderAnimation {\n current: StyleProps;\n styleAnimations: AnimatedStyle;\n onFrame: (animation: StyleLayoutAnimation, timestamp: Timestamp) => boolean;\n onStart: (\n nextAnimation: StyleLayoutAnimation,\n current: AnimatedStyle,\n timestamp: Timestamp,\n previousAnimation: StyleLayoutAnimation\n ) => void;\n callback?: AnimationCallback;\n}\n"],"mappings":""}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { defineAnimation } from './util';
|
|
2
|
+
import { Platform } from 'react-native';
|
|
3
|
+
export function withDecay(userConfig, callback) {
|
|
4
|
+
'worklet';
|
|
5
|
+
|
|
6
|
+
return defineAnimation(0, () => {
|
|
7
|
+
'worklet';
|
|
8
|
+
|
|
9
|
+
const config = {
|
|
10
|
+
deceleration: 0.998,
|
|
11
|
+
velocityFactor: Platform.OS !== 'web' ? 1 : 1000,
|
|
12
|
+
velocity: 0,
|
|
13
|
+
rubberBandFactor: 0.6
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
if (userConfig) {
|
|
17
|
+
Object.keys(userConfig).forEach(key => config[key] = userConfig[key]);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const VELOCITY_EPS = Platform.OS !== 'web' ? 1 : 1 / 20;
|
|
21
|
+
const SLOPE_FACTOR = 0.1;
|
|
22
|
+
let decay;
|
|
23
|
+
|
|
24
|
+
if (config.rubberBandEffect) {
|
|
25
|
+
decay = (animation, now) => {
|
|
26
|
+
const {
|
|
27
|
+
lastTimestamp,
|
|
28
|
+
startTimestamp,
|
|
29
|
+
current,
|
|
30
|
+
initialVelocity,
|
|
31
|
+
velocity
|
|
32
|
+
} = animation;
|
|
33
|
+
const deltaTime = Math.min(now - lastTimestamp, 64);
|
|
34
|
+
const clampIndex = initialVelocity > 0 ? 1 : 0;
|
|
35
|
+
let derivative = 0;
|
|
36
|
+
|
|
37
|
+
if (current < config.clamp[0] || current > config.clamp[1]) {
|
|
38
|
+
derivative = current - config.clamp[clampIndex];
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (derivative !== 0) {
|
|
42
|
+
animation.springActive = true;
|
|
43
|
+
} else if (derivative === 0 && animation.springActive) {
|
|
44
|
+
animation.current = config.clamp[clampIndex];
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const v = velocity * Math.exp(-(1 - config.deceleration) * (now - startTimestamp) * SLOPE_FACTOR) - derivative * config.rubberBandFactor;
|
|
49
|
+
animation.current = current + v * config.velocityFactor * deltaTime / 1000;
|
|
50
|
+
animation.velocity = v;
|
|
51
|
+
animation.lastTimestamp = now;
|
|
52
|
+
return false;
|
|
53
|
+
};
|
|
54
|
+
} else {
|
|
55
|
+
decay = (animation, now) => {
|
|
56
|
+
const {
|
|
57
|
+
lastTimestamp,
|
|
58
|
+
startTimestamp,
|
|
59
|
+
initialVelocity,
|
|
60
|
+
current,
|
|
61
|
+
velocity
|
|
62
|
+
} = animation;
|
|
63
|
+
const deltaTime = Math.min(now - lastTimestamp, 64);
|
|
64
|
+
const v = velocity * Math.exp(-(1 - config.deceleration) * (now - startTimestamp) * SLOPE_FACTOR);
|
|
65
|
+
animation.current = current + v * config.velocityFactor * deltaTime / 1000;
|
|
66
|
+
animation.velocity = v;
|
|
67
|
+
animation.lastTimestamp = now;
|
|
68
|
+
|
|
69
|
+
if (config.clamp) {
|
|
70
|
+
if (initialVelocity < 0 && animation.current <= config.clamp[0]) {
|
|
71
|
+
animation.current = config.clamp[0];
|
|
72
|
+
return true;
|
|
73
|
+
} else if (initialVelocity > 0 && animation.current >= config.clamp[1]) {
|
|
74
|
+
animation.current = config.clamp[1];
|
|
75
|
+
return true;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return Math.abs(v) < VELOCITY_EPS;
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function validateConfig() {
|
|
84
|
+
if (config.clamp) {
|
|
85
|
+
if (!Array.isArray(config.clamp)) {
|
|
86
|
+
throw Error(`config.clamp must be an array but is ${typeof config.clamp}`);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (config.clamp.length !== 2) {
|
|
90
|
+
throw Error(`clamp array must contain 2 items but is given ${config.clamp.length}`);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if (config.velocityFactor <= 0) {
|
|
95
|
+
throw Error(`config.velocityFactor must be greather then 0 but is ${config.velocityFactor}`);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
if (config.rubberBandEffect && !config.clamp) {
|
|
99
|
+
throw Error('You need to set `clamp` property when using `rubberBandEffect`.');
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function onStart(animation, value, now) {
|
|
104
|
+
animation.current = value;
|
|
105
|
+
animation.lastTimestamp = now;
|
|
106
|
+
animation.startTimestamp = now;
|
|
107
|
+
animation.initialVelocity = config.velocity;
|
|
108
|
+
validateConfig();
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return {
|
|
112
|
+
onFrame: decay,
|
|
113
|
+
onStart,
|
|
114
|
+
callback,
|
|
115
|
+
velocity: config.velocity ?? 0,
|
|
116
|
+
initialVelocity: 0,
|
|
117
|
+
current: 0,
|
|
118
|
+
lastTimestamp: 0,
|
|
119
|
+
startTimestamp: 0
|
|
120
|
+
};
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=decay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["defineAnimation","Platform","withDecay","userConfig","callback","config","deceleration","velocityFactor","OS","velocity","rubberBandFactor","Object","keys","forEach","key","VELOCITY_EPS","SLOPE_FACTOR","decay","rubberBandEffect","animation","now","lastTimestamp","startTimestamp","current","initialVelocity","deltaTime","Math","min","clampIndex","derivative","clamp","springActive","v","exp","abs","validateConfig","Array","isArray","Error","length","onStart","value","onFrame"],"sources":["decay.ts"],"sourcesContent":["import { defineAnimation } from './util';\nimport {\n Animation,\n AnimationCallback,\n AnimationObject,\n AnimatableValue,\n Timestamp,\n} from '../commonTypes';\nimport { Platform } from 'react-native';\n\ninterface DecayConfig {\n deceleration?: number;\n velocityFactor?: number;\n clamp?: number[];\n velocity?: number;\n}\n\ninterface DefaultDecayConfig {\n deceleration: number;\n velocityFactor: number;\n clamp?: number[];\n velocity: number;\n rubberBandEffect?: boolean;\n rubberBandFactor: number;\n}\n\nexport interface DecayAnimation extends Animation<DecayAnimation> {\n lastTimestamp: Timestamp;\n startTimestamp: Timestamp;\n initialVelocity: number;\n velocity: number;\n current: AnimatableValue;\n}\n\nexport interface InnerDecayAnimation\n extends Omit<DecayAnimation, 'current'>,\n AnimationObject {\n current: number;\n}\n\nexport function withDecay(\n userConfig: DecayConfig,\n callback?: AnimationCallback\n): Animation<DecayAnimation> {\n 'worklet';\n\n return defineAnimation<DecayAnimation>(0, () => {\n 'worklet';\n const config: DefaultDecayConfig = {\n deceleration: 0.998,\n velocityFactor: Platform.OS !== 'web' ? 1 : 1000,\n velocity: 0,\n rubberBandFactor: 0.6,\n };\n if (userConfig) {\n Object.keys(userConfig).forEach(\n (key) =>\n ((config as any)[key] = userConfig[key as keyof typeof userConfig])\n );\n }\n\n const VELOCITY_EPS = Platform.OS !== 'web' ? 1 : 1 / 20;\n const SLOPE_FACTOR = 0.1;\n\n let decay: (animation: InnerDecayAnimation, now: number) => boolean;\n\n if (config.rubberBandEffect) {\n decay = (animation: InnerDecayAnimation, now: number): boolean => {\n const {\n lastTimestamp,\n startTimestamp,\n current,\n initialVelocity,\n velocity,\n } = animation;\n\n const deltaTime = Math.min(now - lastTimestamp, 64);\n const clampIndex = initialVelocity > 0 ? 1 : 0;\n let derivative = 0;\n if (current < config.clamp![0] || current > config.clamp![1]) {\n derivative = current - config.clamp![clampIndex];\n }\n\n if (derivative !== 0) {\n animation.springActive = true;\n } else if (derivative === 0 && animation.springActive) {\n animation.current = config.clamp![clampIndex];\n return true;\n }\n\n const v =\n velocity *\n Math.exp(\n -(1 - config.deceleration) * (now - startTimestamp) * SLOPE_FACTOR\n ) -\n derivative * config.rubberBandFactor;\n\n animation.current =\n current + (v * config.velocityFactor * deltaTime) / 1000;\n animation.velocity = v;\n animation.lastTimestamp = now;\n return false;\n };\n } else {\n decay = (animation: InnerDecayAnimation, now: number): boolean => {\n const {\n lastTimestamp,\n startTimestamp,\n initialVelocity,\n current,\n velocity,\n } = animation;\n\n const deltaTime = Math.min(now - lastTimestamp, 64);\n const v =\n velocity *\n Math.exp(\n -(1 - config.deceleration) * (now - startTimestamp) * SLOPE_FACTOR\n );\n animation.current =\n current + (v * config.velocityFactor * deltaTime) / 1000;\n animation.velocity = v;\n animation.lastTimestamp = now;\n\n if (config.clamp) {\n if (initialVelocity < 0 && animation.current <= config.clamp[0]) {\n animation.current = config.clamp[0];\n return true;\n } else if (\n initialVelocity > 0 &&\n animation.current >= config.clamp[1]\n ) {\n animation.current = config.clamp[1];\n return true;\n }\n }\n\n return Math.abs(v) < VELOCITY_EPS;\n };\n }\n\n function validateConfig(): void {\n if (config.clamp) {\n if (!Array.isArray(config.clamp)) {\n throw Error(\n `config.clamp must be an array but is ${typeof config.clamp}`\n );\n }\n if (config.clamp.length !== 2) {\n throw Error(\n `clamp array must contain 2 items but is given ${config.clamp.length}`\n );\n }\n }\n if (config.velocityFactor <= 0) {\n throw Error(\n `config.velocityFactor must be greather then 0 but is ${config.velocityFactor}`\n );\n }\n if (config.rubberBandEffect && !config.clamp) {\n throw Error(\n 'You need to set `clamp` property when using `rubberBandEffect`.'\n );\n }\n }\n\n function onStart(\n animation: DecayAnimation,\n value: number,\n now: Timestamp\n ): void {\n animation.current = value;\n animation.lastTimestamp = now;\n animation.startTimestamp = now;\n animation.initialVelocity = config.velocity;\n validateConfig();\n }\n\n return {\n onFrame: decay,\n onStart,\n callback,\n velocity: config.velocity ?? 0,\n initialVelocity: 0,\n current: 0,\n lastTimestamp: 0,\n startTimestamp: 0,\n } as DecayAnimation;\n });\n}\n"],"mappings":"AAAA,SAASA,eAAT,QAAgC,QAAhC;AAQA,SAASC,QAAT,QAAyB,cAAzB;AAgCA,OAAO,SAASC,SAAT,CACLC,UADK,EAELC,QAFK,EAGsB;EAC3B;;EAEA,OAAOJ,eAAe,CAAiB,CAAjB,EAAoB,MAAM;IAC9C;;IACA,MAAMK,MAA0B,GAAG;MACjCC,YAAY,EAAE,KADmB;MAEjCC,cAAc,EAAEN,QAAQ,CAACO,EAAT,KAAgB,KAAhB,GAAwB,CAAxB,GAA4B,IAFX;MAGjCC,QAAQ,EAAE,CAHuB;MAIjCC,gBAAgB,EAAE;IAJe,CAAnC;;IAMA,IAAIP,UAAJ,EAAgB;MACdQ,MAAM,CAACC,IAAP,CAAYT,UAAZ,EAAwBU,OAAxB,CACGC,GAAD,IACIT,MAAD,CAAgBS,GAAhB,IAAuBX,UAAU,CAACW,GAAD,CAFtC;IAID;;IAED,MA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|
+
import { defineAnimation } from './util';
|
|
2
|
+
export function withDelay(delayMs, _nextAnimation) {
|
|
3
|
+
'worklet';
|
|
4
|
+
|
|
5
|
+
return defineAnimation(_nextAnimation, () => {
|
|
6
|
+
'worklet';
|
|
7
|
+
|
|
8
|
+
const nextAnimation = typeof _nextAnimation === 'function' ? _nextAnimation() : _nextAnimation;
|
|
9
|
+
|
|
10
|
+
function delay(animation, now) {
|
|
11
|
+
const {
|
|
12
|
+
startTime,
|
|
13
|
+
started,
|
|
14
|
+
previousAnimation
|
|
15
|
+
} = animation;
|
|
16
|
+
|
|
17
|
+
if (now - startTime > delayMs) {
|
|
18
|
+
if (!started) {
|
|
19
|
+
nextAnimation.onStart(nextAnimation, animation.current, now, previousAnimation);
|
|
20
|
+
animation.previousAnimation = null;
|
|
21
|
+
animation.started = true;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const finished = nextAnimation.onFrame(nextAnimation, now);
|
|
25
|
+
animation.current = nextAnimation.current;
|
|
26
|
+
return finished;
|
|
27
|
+
} else if (previousAnimation) {
|
|
28
|
+
const finished = previousAnimation.finished || previousAnimation.onFrame(previousAnimation, now);
|
|
29
|
+
animation.current = previousAnimation.current;
|
|
30
|
+
|
|
31
|
+
if (finished) {
|
|
32
|
+
animation.previousAnimation = null;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function onStart(animation, value, now, previousAnimation) {
|
|
40
|
+
animation.startTime = now;
|
|
41
|
+
animation.started = false;
|
|
42
|
+
animation.current = value;
|
|
43
|
+
|
|
44
|
+
if (previousAnimation === animation) {
|
|
45
|
+
animation.previousAnimation = previousAnimation.previousAnimation;
|
|
46
|
+
} else {
|
|
47
|
+
animation.previousAnimation = previousAnimation;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const callback = finished => {
|
|
52
|
+
if (nextAnimation.callback) {
|
|
53
|
+
nextAnimation.callback(finished);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
return {
|
|
58
|
+
isHigherOrder: true,
|
|
59
|
+
onFrame: delay,
|
|
60
|
+
onStart,
|
|
61
|
+
current: nextAnimation.current,
|
|
62
|
+
callback,
|
|
63
|
+
previousAnimation: null,
|
|
64
|
+
startTime: 0,
|
|
65
|
+
started: false
|
|
66
|
+
};
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* @deprecated Kept for backward compatibility. Will be removed soon.
|
|
71
|
+
*/
|
|
72
|
+
|
|
73
|
+
export function delay(delayMs, _nextAnimation) {
|
|
74
|
+
'worklet';
|
|
75
|
+
|
|
76
|
+
console.warn('Method `delay` is deprecated. Please use `withDelay` instead');
|
|
77
|
+
return withDelay(delayMs, _nextAnimation);
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=delay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["defineAnimation","withDelay","delayMs","_nextAnimation","nextAnimation","delay","animation","now","startTime","started","previousAnimation","onStart","current","finished","onFrame","value","callback","isHigherOrder","console","warn"],"sources":["delay.ts"],"sourcesContent":["import { defineAnimation } from './util';\nimport { Animation, Timestamp, AnimatableValue } from '../commonTypes';\nimport { NextAnimation, DelayAnimation } from './commonTypes';\n\nexport function withDelay(\n delayMs: number,\n _nextAnimation: NextAnimation<DelayAnimation>\n): Animation<DelayAnimation> {\n 'worklet';\n return defineAnimation<DelayAnimation>(_nextAnimation, () => {\n 'worklet';\n const nextAnimation =\n typeof _nextAnimation === 'function' ? _nextAnimation() : _nextAnimation;\n\n function delay(animation: DelayAnimation, now: Timestamp): boolean {\n const { startTime, started, previousAnimation } = animation;\n\n if (now - startTime > delayMs) {\n if (!started) {\n nextAnimation.onStart(\n nextAnimation,\n animation.current,\n now,\n previousAnimation as DelayAnimation\n );\n animation.previousAnimation = null;\n animation.started = true;\n }\n const finished = nextAnimation.onFrame(nextAnimation, now);\n animation.current = nextAnimation.current;\n return finished;\n } else if (previousAnimation) {\n const finished =\n previousAnimation.finished ||\n previousAnimation.onFrame(previousAnimation, now);\n animation.current = previousAnimation.current;\n if (finished) {\n animation.previousAnimation = null;\n }\n }\n return false;\n }\n\n function onStart(\n animation: DelayAnimation,\n value: AnimatableValue,\n now: Timestamp,\n previousAnimation: DelayAnimation\n ): void {\n animation.startTime = now;\n animation.started = false;\n animation.current = value;\n if (previousAnimation === animation) {\n animation.previousAnimation = previousAnimation.previousAnimation;\n } else {\n animation.previousAnimation = previousAnimation;\n }\n }\n\n const callback = (finished?: boolean): void => {\n if (nextAnimation.callback) {\n nextAnimation.callback(finished);\n }\n };\n\n return {\n isHigherOrder: true,\n onFrame: delay,\n onStart,\n current: nextAnimation.current,\n callback,\n previousAnimation: null,\n startTime: 0,\n started: false,\n };\n });\n}\n\n/**\n * @deprecated Kept for backward compatibility. Will be removed soon.\n */\nexport function delay(\n delayMs: number,\n _nextAnimation: NextAnimation<DelayAnimation>\n): Animation<DelayAnimation> {\n 'worklet';\n console.warn('Method `delay` is deprecated. Please use `withDelay` instead');\n return withDelay(delayMs, _nextAnimation);\n}\n"],"mappings":"AAAA,SAASA,eAAT,QAAgC,QAAhC;AAIA,OAAO,SAASC,SAAT,CACLC,OADK,EAELC,cAFK,EAGsB;EAC3B;;EACA,OAAOH,eAAe,CAAiBG,cAAjB,EAAiC,MAAM;IAC3D;;IACA,MAAMC,aAAa,GACjB,OAAOD,cAAP,KAA0B,UAA1B,GAAuCA,cAAc,EAArD,GAA0DA,cAD5D;;IAGA,SAASE,KAAT,CAAeC,SAAf,EAA0CC,GAA1C,EAAmE;MACjE,MAAM;QAAEC,SAAF;QAAaC,OAAb;QAAsBC;MAAtB,IAA4CJ,SAAlD;;MAEA,IAAIC,GAAG,GAAGC,SAAN,GAAkBN,OAAtB,EAA+B;QAC7B,IAAI,CAACO,OAAL,EAAc;UACZL,aAAa,CAACO,OAAd,CACEP,aADF,EAE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MLN,iBAAiB,EAAE,IANd;MAOLF,SAAS,EAAE,CAPN;MAQLC,OAAO,EAAE;IARJ,CAAP;EAUD,CAlEqB,CAAtB;AAmED;AAED;AACA;AACA;;AACA,OAAO,SAASJ,KAAT,CACLH,OADK,EAELC,cAFK,EAGsB;EAC3B;;EACAe,OAAO,CAACC,IAAR,CAAa,8DAAb;EACA,OAAOlB,SAAS,CAACC,OAAD,EAAUC,cAAV,CAAhB;AACD"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { cancelAnimation, defineAnimation, initialUpdaterRun } from './util';
|
|
2
|
+
export { withTiming } from './timing';
|
|
3
|
+
export { withSpring } from './spring';
|
|
4
|
+
export { withDecay } from './decay';
|
|
5
|
+
export { withDelay } from './delay';
|
|
6
|
+
export { withRepeat } from './repeat';
|
|
7
|
+
export { withSequence } from './sequence';
|
|
8
|
+
export { withStyleAnimation } from './styleAnimation';
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["cancelAnimation","defineAnimation","initialUpdaterRun","withTiming","withSpring","withDecay","withDelay","withRepeat","withSequence","withStyleAnimation"],"sources":["index.ts"],"sourcesContent":["export type {\n HigherOrderAnimation,\n NextAnimation,\n DelayAnimation,\n RepeatAnimation,\n SequenceAnimation,\n StyleLayoutAnimation,\n} from './commonTypes';\nexport { cancelAnimation, defineAnimation, initialUpdaterRun } from './util';\nexport { withTiming } from './timing';\nexport type { TimingAnimation } from './timing';\nexport { withSpring } from './spring';\nexport type { SpringAnimation } from './spring';\nexport { withDecay } from './decay';\nexport type { DecayAnimation } from './decay';\nexport { withDelay } from './delay';\nexport { withRepeat } from './repeat';\nexport { withSequence } from './sequence';\nexport { withStyleAnimation } from './styleAnimation';\n"],"mappings":"AAQA,SAASA,eAAT,EAA0BC,eAA1B,EAA2CC,iBAA3C,QAAoE,QAApE;AACA,SAASC,UAAT,QAA2B,UAA3B;AAEA,SAASC,UAAT,QAA2B,UAA3B;AAEA,SAASC,SAAT,QAA0B,SAA1B;AAEA,SAASC,SAAT,QAA0B,SAA1B;AACA,SAASC,UAAT,QAA2B,UAA3B;AACA,SAASC,YAAT,QAA6B,YAA7B;AACA,SAASC,kBAAT,QAAmC,kBAAnC"}
|