react-native-reanimated 3.0.2 → 3.1.0
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/Fabric/FabricUtils.h +1 -1
- package/Common/cpp/NativeModules/NativeReanimatedModule.cpp +38 -27
- package/Common/cpp/SharedItems/Shareables.h +22 -0
- package/Common/cpp/Tools/PlatformDepMethodsHolder.h +2 -0
- package/Common/cpp/Tools/RuntimeDecorator.cpp +4 -1
- package/Common/cpp/Tools/RuntimeDecorator.h +2 -1
- package/Common/cpp/Tools/SingleInstanceChecker.h +14 -2
- package/RNReanimated.podspec +5 -2
- package/android/CMakeLists.txt +4 -0
- package/android/build.gradle +18 -10
- package/android/src/main/cpp/NativeProxy.cpp +316 -337
- package/android/src/main/cpp/NativeProxy.h +53 -11
- package/android/src/main/java/com/swmansion/reanimated/NativeMethodsHelper.java +7 -12
- package/android/src/main/java/com/swmansion/reanimated/NodesManager.java +11 -8
- package/android/src/main/java/com/swmansion/reanimated/nativeProxy/NativeProxyCommon.java +21 -14
- package/android/src/paper/java/com/swmansion/reanimated/NativeProxy.java +0 -3
- package/ios/Fabric/REAInitializerRCTFabricSurface.mm +1 -0
- package/ios/REANodesManager.h +1 -0
- package/ios/REANodesManager.mm +30 -4
- package/ios/keyboardObserver/REAKeyboardEventObserver.m +51 -130
- package/ios/native/NativeMethods.mm +1 -1
- package/ios/native/NativeProxy.mm +4 -1
- package/ios/native/REAIOSErrorHandler.mm +1 -1
- package/ios/native/REAIOSLogger.mm +1 -1
- package/ios/native/REAIOSScheduler.mm +1 -1
- package/ios/native/REAInitializer.mm +1 -1
- package/ios/native/REAMessageThread.mm +2 -2
- package/lib/commonjs/Animated.js +0 -8
- package/lib/commonjs/Animated.js.map +1 -1
- package/lib/commonjs/ConfigHelper.js +8 -19
- package/lib/commonjs/ConfigHelper.js.map +1 -1
- package/lib/commonjs/createAnimatedComponent.js +20 -158
- package/lib/commonjs/createAnimatedComponent.js.map +1 -1
- package/lib/commonjs/index.js +0 -9
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/index.web.js +0 -7
- package/lib/commonjs/index.web.js.map +1 -1
- package/lib/commonjs/reanimated2/Bezier.js +14 -34
- package/lib/commonjs/reanimated2/Bezier.js.map +1 -1
- package/lib/commonjs/reanimated2/Colors.js +60 -132
- package/lib/commonjs/reanimated2/Colors.js.map +1 -1
- package/lib/commonjs/reanimated2/Easing.js +81 -34
- package/lib/commonjs/reanimated2/Easing.js.map +1 -1
- package/lib/commonjs/reanimated2/NativeMethods.js +8 -20
- package/lib/commonjs/reanimated2/NativeMethods.js.map +1 -1
- package/lib/commonjs/reanimated2/NativeReanimated/NativeReanimated.js +5 -31
- package/lib/commonjs/reanimated2/NativeReanimated/NativeReanimated.js.map +1 -1
- package/lib/commonjs/reanimated2/NativeReanimated/index.js +0 -7
- package/lib/commonjs/reanimated2/NativeReanimated/index.js.map +1 -1
- package/lib/commonjs/reanimated2/PlatformChecker.js +0 -6
- package/lib/commonjs/reanimated2/PlatformChecker.js.map +1 -1
- package/lib/commonjs/reanimated2/PropAdapters.js +10 -12
- package/lib/commonjs/reanimated2/PropAdapters.js.map +1 -1
- package/lib/commonjs/reanimated2/UpdateProps.js +3 -12
- package/lib/commonjs/reanimated2/UpdateProps.js.map +1 -1
- package/lib/commonjs/reanimated2/ViewDescriptorsSet.js +0 -10
- package/lib/commonjs/reanimated2/ViewDescriptorsSet.js.map +1 -1
- package/lib/commonjs/reanimated2/WorkletEventHandler.js +5 -22
- package/lib/commonjs/reanimated2/WorkletEventHandler.js.map +1 -1
- package/lib/commonjs/reanimated2/animation/decay.js +7 -18
- package/lib/commonjs/reanimated2/animation/decay.js.map +1 -1
- package/lib/commonjs/reanimated2/animation/delay.js +0 -11
- package/lib/commonjs/reanimated2/animation/delay.js.map +1 -1
- package/lib/commonjs/reanimated2/animation/index.js +0 -8
- package/lib/commonjs/reanimated2/animation/index.js.map +1 -1
- package/lib/commonjs/reanimated2/animation/repeat.js +6 -22
- package/lib/commonjs/reanimated2/animation/repeat.js.map +1 -1
- package/lib/commonjs/reanimated2/animation/sequence.js +3 -20
- package/lib/commonjs/reanimated2/animation/sequence.js.map +1 -1
- package/lib/commonjs/reanimated2/animation/spring.js +11 -23
- package/lib/commonjs/reanimated2/animation/spring.js.map +1 -1
- package/lib/commonjs/reanimated2/animation/styleAnimation.js +3 -35
- package/lib/commonjs/reanimated2/animation/styleAnimation.js.map +1 -1
- package/lib/commonjs/reanimated2/animation/timing.js +0 -11
- package/lib/commonjs/reanimated2/animation/timing.js.map +1 -1
- package/lib/commonjs/reanimated2/animation/util.js +11 -41
- package/lib/commonjs/reanimated2/animation/util.js.map +1 -1
- package/lib/commonjs/reanimated2/commonTypes.js +16 -23
- package/lib/commonjs/reanimated2/commonTypes.js.map +1 -1
- package/lib/commonjs/reanimated2/component/FlatList.js +0 -16
- package/lib/commonjs/reanimated2/component/FlatList.js.map +1 -1
- package/lib/commonjs/reanimated2/component/Image.js +0 -4
- package/lib/commonjs/reanimated2/component/Image.js.map +1 -1
- package/lib/commonjs/reanimated2/component/ScrollView.js +0 -4
- package/lib/commonjs/reanimated2/component/ScrollView.js.map +1 -1
- package/lib/commonjs/reanimated2/component/Text.js +0 -4
- package/lib/commonjs/reanimated2/component/Text.js.map +1 -1
- package/lib/commonjs/reanimated2/component/View.js +0 -4
- package/lib/commonjs/reanimated2/component/View.js.map +1 -1
- package/lib/commonjs/reanimated2/core.js +6 -48
- package/lib/commonjs/reanimated2/core.js.map +1 -1
- package/lib/commonjs/reanimated2/errors.js +3 -14
- package/lib/commonjs/reanimated2/errors.js.map +1 -1
- package/lib/commonjs/reanimated2/fabricUtils.js +3 -5
- package/lib/commonjs/reanimated2/fabricUtils.js.map +1 -1
- package/lib/commonjs/reanimated2/fabricUtils.web.js +1 -3
- package/lib/commonjs/reanimated2/fabricUtils.web.js.map +1 -1
- package/lib/commonjs/reanimated2/frameCallback/FrameCallbackRegistryJS.js +3 -12
- package/lib/commonjs/reanimated2/frameCallback/FrameCallbackRegistryJS.js.map +1 -1
- package/lib/commonjs/reanimated2/frameCallback/FrameCallbackRegistryUI.js +13 -17
- package/lib/commonjs/reanimated2/frameCallback/FrameCallbackRegistryUI.js.map +1 -1
- package/lib/commonjs/reanimated2/globals.d.js.map +1 -1
- package/lib/commonjs/reanimated2/hook/Hooks.js +0 -5
- package/lib/commonjs/reanimated2/hook/Hooks.js.map +1 -1
- package/lib/commonjs/reanimated2/hook/commonTypes.js.map +1 -1
- package/lib/commonjs/reanimated2/hook/index.js +0 -12
- package/lib/commonjs/reanimated2/hook/index.js.map +1 -1
- package/lib/commonjs/reanimated2/hook/useAnimatedGestureHandler.js +4 -17
- package/lib/commonjs/reanimated2/hook/useAnimatedGestureHandler.js.map +1 -1
- package/lib/commonjs/reanimated2/hook/useAnimatedKeyboard.js +2 -9
- package/lib/commonjs/reanimated2/hook/useAnimatedKeyboard.js.map +1 -1
- package/lib/commonjs/reanimated2/hook/useAnimatedReaction.js +1 -11
- package/lib/commonjs/reanimated2/hook/useAnimatedReaction.js.map +1 -1
- package/lib/commonjs/reanimated2/hook/useAnimatedRef.js +0 -12
- package/lib/commonjs/reanimated2/hook/useAnimatedRef.js.map +1 -1
- package/lib/commonjs/reanimated2/hook/useAnimatedScrollHandler.js +2 -9
- package/lib/commonjs/reanimated2/hook/useAnimatedScrollHandler.js.map +1 -1
- package/lib/commonjs/reanimated2/hook/useAnimatedSensor.js +8 -23
- package/lib/commonjs/reanimated2/hook/useAnimatedSensor.js.map +1 -1
- package/lib/commonjs/reanimated2/hook/useAnimatedStyle.js +13 -71
- package/lib/commonjs/reanimated2/hook/useAnimatedStyle.js.map +1 -1
- package/lib/commonjs/reanimated2/hook/useDerivedValue.js +4 -13
- package/lib/commonjs/reanimated2/hook/useDerivedValue.js.map +1 -1
- package/lib/commonjs/reanimated2/hook/useFrameCallback.js +0 -5
- package/lib/commonjs/reanimated2/hook/useFrameCallback.js.map +1 -1
- package/lib/commonjs/reanimated2/hook/useScrollViewOffset.js +0 -7
- package/lib/commonjs/reanimated2/hook/useScrollViewOffset.js.map +1 -1
- package/lib/commonjs/reanimated2/hook/useSharedValue.js +2 -7
- package/lib/commonjs/reanimated2/hook/useSharedValue.js.map +1 -1
- package/lib/commonjs/reanimated2/hook/utils.js +8 -39
- package/lib/commonjs/reanimated2/hook/utils.js.map +1 -1
- package/lib/commonjs/reanimated2/index.js +0 -26
- package/lib/commonjs/reanimated2/index.js.map +1 -1
- package/lib/commonjs/reanimated2/initializers.js +21 -43
- package/lib/commonjs/reanimated2/initializers.js.map +1 -1
- package/lib/commonjs/reanimated2/interpolateColor.js +6 -43
- package/lib/commonjs/reanimated2/interpolateColor.js.map +1 -1
- package/lib/commonjs/reanimated2/interpolation.js +14 -29
- package/lib/commonjs/reanimated2/interpolation.js.map +1 -1
- package/lib/commonjs/reanimated2/jestUtils.js +11 -44
- package/lib/commonjs/reanimated2/jestUtils.js.map +1 -1
- package/lib/commonjs/reanimated2/js-reanimated/JSReanimated.js +15 -39
- package/lib/commonjs/reanimated2/js-reanimated/JSReanimated.js.map +1 -1
- package/lib/commonjs/reanimated2/js-reanimated/Mapper.js +9 -28
- package/lib/commonjs/reanimated2/js-reanimated/Mapper.js.map +1 -1
- package/lib/commonjs/reanimated2/js-reanimated/MapperRegistry.js +7 -37
- package/lib/commonjs/reanimated2/js-reanimated/MapperRegistry.js.map +1 -1
- package/lib/commonjs/reanimated2/js-reanimated/MutableValue.js +5 -18
- package/lib/commonjs/reanimated2/js-reanimated/MutableValue.js.map +1 -1
- package/lib/commonjs/reanimated2/js-reanimated/global.js +2 -9
- package/lib/commonjs/reanimated2/js-reanimated/global.js.map +1 -1
- package/lib/commonjs/reanimated2/js-reanimated/index.js +3 -14
- package/lib/commonjs/reanimated2/js-reanimated/index.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js +7 -26
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js +3 -49
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/Keyframe.js +7 -43
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/Keyframe.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/commonTypes.js +4 -5
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/commonTypes.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/index.js +0 -4
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/index.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/animationsManager.js +4 -23
- package/lib/commonjs/reanimated2/layoutReanimation/animationsManager.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Bounce.js +3 -74
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Bounce.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Fade.js +3 -53
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Fade.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Flip.js +3 -63
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Flip.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js +7 -26
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js +3 -13
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Roll.js +3 -23
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Roll.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Rotate.js +3 -43
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Rotate.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Slide.js +3 -43
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Slide.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Stretch.js +3 -23
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Stretch.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Zoom.js +3 -83
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Zoom.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/index.js +0 -20
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/index.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js +3 -22
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js +5 -29
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js +3 -9
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js +5 -11
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js +3 -8
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js +3 -12
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/index.js +0 -12
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/index.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/index.js +0 -9
- package/lib/commonjs/reanimated2/layoutReanimation/index.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/sharedTransitions/index.js +3 -17
- package/lib/commonjs/reanimated2/layoutReanimation/sharedTransitions/index.js.map +1 -1
- package/lib/commonjs/reanimated2/mappers.js +26 -32
- package/lib/commonjs/reanimated2/mappers.js.map +1 -1
- package/lib/commonjs/reanimated2/mock.js +5 -15
- package/lib/commonjs/reanimated2/mock.js.map +1 -1
- package/lib/commonjs/reanimated2/mutables.js +2 -28
- package/lib/commonjs/reanimated2/mutables.js.map +1 -1
- package/lib/commonjs/reanimated2/platform-specific/RNRenderer.js +0 -2
- package/lib/commonjs/reanimated2/platform-specific/RNRenderer.js.map +1 -1
- package/lib/commonjs/reanimated2/platform-specific/RNRenderer.web.js.map +1 -1
- package/lib/commonjs/reanimated2/platform-specific/checkCppVersion.js +31 -0
- package/lib/commonjs/reanimated2/platform-specific/checkCppVersion.js.map +1 -0
- package/lib/commonjs/reanimated2/platform-specific/checkVersion.web.js +0 -2
- package/lib/commonjs/reanimated2/platform-specific/checkVersion.web.js.map +1 -1
- package/lib/commonjs/reanimated2/platform-specific/jsVersion.js +14 -0
- package/lib/commonjs/reanimated2/platform-specific/jsVersion.js.map +1 -0
- package/lib/commonjs/reanimated2/pluginUtils.js +0 -1
- package/lib/commonjs/reanimated2/pluginUtils.js.map +1 -1
- package/lib/commonjs/reanimated2/shareables.js +92 -49
- package/lib/commonjs/reanimated2/shareables.js.map +1 -1
- package/lib/commonjs/reanimated2/threads.js +42 -46
- package/lib/commonjs/reanimated2/threads.js.map +1 -1
- package/lib/commonjs/reanimated2/utils.js +0 -5
- package/lib/commonjs/reanimated2/utils.js.map +1 -1
- package/lib/commonjs/reanimated2/valueSetter.js +6 -21
- package/lib/commonjs/reanimated2/valueSetter.js.map +1 -1
- package/lib/commonjs/setAndForwardRef.js +3 -3
- package/lib/commonjs/setAndForwardRef.js.map +1 -1
- package/lib/module/Animated.js.map +1 -1
- package/lib/module/ConfigHelper.js +9 -15
- package/lib/module/ConfigHelper.js.map +1 -1
- package/lib/module/createAnimatedComponent.js +20 -139
- package/lib/module/createAnimatedComponent.js.map +1 -1
- package/lib/module/index.js +0 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.web.js.map +1 -1
- package/lib/module/reanimated2/Bezier.js +14 -33
- package/lib/module/reanimated2/Bezier.js.map +1 -1
- package/lib/module/reanimated2/Colors.js +59 -109
- package/lib/module/reanimated2/Colors.js.map +1 -1
- package/lib/module/reanimated2/Easing.js +37 -33
- package/lib/module/reanimated2/Easing.js.map +1 -1
- package/lib/module/reanimated2/NativeMethods.js +8 -15
- package/lib/module/reanimated2/NativeMethods.js.map +1 -1
- package/lib/module/reanimated2/NativeReanimated/NativeReanimated.js +5 -27
- package/lib/module/reanimated2/NativeReanimated/NativeReanimated.js.map +1 -1
- package/lib/module/reanimated2/NativeReanimated/index.js +0 -2
- package/lib/module/reanimated2/NativeReanimated/index.js.map +1 -1
- package/lib/module/reanimated2/PlatformChecker.js.map +1 -1
- package/lib/module/reanimated2/PropAdapters.js +12 -10
- package/lib/module/reanimated2/PropAdapters.js.map +1 -1
- package/lib/module/reanimated2/UpdateProps.js +3 -5
- package/lib/module/reanimated2/UpdateProps.js.map +1 -1
- package/lib/module/reanimated2/ViewDescriptorsSet.js +0 -6
- package/lib/module/reanimated2/ViewDescriptorsSet.js.map +1 -1
- package/lib/module/reanimated2/WorkletEventHandler.js +5 -18
- package/lib/module/reanimated2/WorkletEventHandler.js.map +1 -1
- package/lib/module/reanimated2/animation/decay.js +7 -15
- package/lib/module/reanimated2/animation/decay.js.map +1 -1
- package/lib/module/reanimated2/animation/delay.js +0 -9
- package/lib/module/reanimated2/animation/delay.js.map +1 -1
- package/lib/module/reanimated2/animation/index.js.map +1 -1
- package/lib/module/reanimated2/animation/repeat.js +6 -20
- package/lib/module/reanimated2/animation/repeat.js.map +1 -1
- package/lib/module/reanimated2/animation/sequence.js +3 -18
- package/lib/module/reanimated2/animation/sequence.js.map +1 -1
- package/lib/module/reanimated2/animation/spring.js +11 -21
- package/lib/module/reanimated2/animation/spring.js.map +1 -1
- package/lib/module/reanimated2/animation/styleAnimation.js +7 -31
- package/lib/module/reanimated2/animation/styleAnimation.js.map +1 -1
- package/lib/module/reanimated2/animation/timing.js +0 -8
- package/lib/module/reanimated2/animation/timing.js.map +1 -1
- package/lib/module/reanimated2/animation/util.js +10 -33
- package/lib/module/reanimated2/animation/util.js.map +1 -1
- package/lib/module/reanimated2/commonTypes.js +12 -19
- package/lib/module/reanimated2/commonTypes.js.map +1 -1
- package/lib/module/reanimated2/component/FlatList.js +0 -4
- package/lib/module/reanimated2/component/FlatList.js.map +1 -1
- package/lib/module/reanimated2/component/Image.js.map +1 -1
- package/lib/module/reanimated2/component/ScrollView.js.map +1 -1
- package/lib/module/reanimated2/component/Text.js.map +1 -1
- package/lib/module/reanimated2/component/View.js.map +1 -1
- package/lib/module/reanimated2/core.js +6 -22
- package/lib/module/reanimated2/core.js.map +1 -1
- package/lib/module/reanimated2/errors.js +3 -13
- package/lib/module/reanimated2/errors.js.map +1 -1
- package/lib/module/reanimated2/fabricUtils.js +3 -3
- package/lib/module/reanimated2/fabricUtils.js.map +1 -1
- package/lib/module/reanimated2/fabricUtils.web.js +1 -1
- package/lib/module/reanimated2/fabricUtils.web.js.map +1 -1
- package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryJS.js +3 -8
- package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryJS.js.map +1 -1
- package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryUI.js +13 -15
- package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryUI.js.map +1 -1
- package/lib/module/reanimated2/globals.d.js.map +1 -1
- package/lib/module/reanimated2/hook/Hooks.js +3 -2
- package/lib/module/reanimated2/hook/Hooks.js.map +1 -1
- package/lib/module/reanimated2/hook/commonTypes.js.map +1 -1
- package/lib/module/reanimated2/hook/index.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedGestureHandler.js +3 -14
- package/lib/module/reanimated2/hook/useAnimatedGestureHandler.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedKeyboard.js +2 -5
- package/lib/module/reanimated2/hook/useAnimatedKeyboard.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedReaction.js +1 -7
- package/lib/module/reanimated2/hook/useAnimatedReaction.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedRef.js +0 -6
- package/lib/module/reanimated2/hook/useAnimatedRef.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedScrollHandler.js +2 -7
- package/lib/module/reanimated2/hook/useAnimatedScrollHandler.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedSensor.js +9 -20
- package/lib/module/reanimated2/hook/useAnimatedSensor.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedStyle.js +13 -59
- package/lib/module/reanimated2/hook/useAnimatedStyle.js.map +1 -1
- package/lib/module/reanimated2/hook/useDerivedValue.js +4 -8
- package/lib/module/reanimated2/hook/useDerivedValue.js.map +1 -1
- package/lib/module/reanimated2/hook/useFrameCallback.js.map +1 -1
- package/lib/module/reanimated2/hook/useScrollViewOffset.js +0 -1
- package/lib/module/reanimated2/hook/useScrollViewOffset.js.map +1 -1
- package/lib/module/reanimated2/hook/useSharedValue.js +2 -3
- package/lib/module/reanimated2/hook/useSharedValue.js.map +1 -1
- package/lib/module/reanimated2/hook/utils.js +8 -21
- package/lib/module/reanimated2/hook/utils.js.map +1 -1
- package/lib/module/reanimated2/index.js.map +1 -1
- package/lib/module/reanimated2/initializers.js +23 -37
- package/lib/module/reanimated2/initializers.js.map +1 -1
- package/lib/module/reanimated2/interpolateColor.js +5 -34
- package/lib/module/reanimated2/interpolateColor.js.map +1 -1
- package/lib/module/reanimated2/interpolation.js +13 -28
- package/lib/module/reanimated2/interpolation.js.map +1 -1
- package/lib/module/reanimated2/jestUtils.js +11 -35
- package/lib/module/reanimated2/jestUtils.js.map +1 -1
- package/lib/module/reanimated2/js-reanimated/JSReanimated.js +15 -35
- package/lib/module/reanimated2/js-reanimated/JSReanimated.js.map +1 -1
- package/lib/module/reanimated2/js-reanimated/Mapper.js +9 -23
- package/lib/module/reanimated2/js-reanimated/Mapper.js.map +1 -1
- package/lib/module/reanimated2/js-reanimated/MapperRegistry.js +7 -35
- package/lib/module/reanimated2/js-reanimated/MapperRegistry.js.map +1 -1
- package/lib/module/reanimated2/js-reanimated/MutableValue.js +5 -16
- package/lib/module/reanimated2/js-reanimated/MutableValue.js.map +1 -1
- package/lib/module/reanimated2/js-reanimated/global.js +2 -6
- package/lib/module/reanimated2/js-reanimated/global.js.map +1 -1
- package/lib/module/reanimated2/js-reanimated/index.js +3 -9
- package/lib/module/reanimated2/js-reanimated/index.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js +7 -23
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js +3 -45
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/Keyframe.js +7 -39
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/Keyframe.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/commonTypes.js +3 -3
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/commonTypes.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/index.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/animationsManager.js +4 -19
- package/lib/module/reanimated2/layoutReanimation/animationsManager.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Bounce.js +3 -52
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Bounce.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Fade.js +3 -32
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Fade.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Flip.js +3 -38
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Flip.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js +7 -16
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js +3 -8
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Roll.js +3 -14
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Roll.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Rotate.js +3 -26
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Rotate.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Slide.js +3 -26
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Slide.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Stretch.js +3 -14
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Stretch.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Zoom.js +3 -50
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Zoom.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/index.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js +3 -17
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js +5 -23
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js +3 -5
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js +5 -6
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js +3 -5
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js +3 -8
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/index.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/index.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/sharedTransitions/index.js +3 -13
- package/lib/module/reanimated2/layoutReanimation/sharedTransitions/index.js.map +1 -1
- package/lib/module/reanimated2/mappers.js +26 -25
- package/lib/module/reanimated2/mappers.js.map +1 -1
- package/lib/module/reanimated2/mock.js +5 -15
- package/lib/module/reanimated2/mock.js.map +1 -1
- package/lib/module/reanimated2/mutables.js +2 -19
- package/lib/module/reanimated2/mutables.js.map +1 -1
- package/lib/module/reanimated2/platform-specific/RNRenderer.js.map +1 -1
- package/lib/module/reanimated2/platform-specific/RNRenderer.web.js.map +1 -1
- package/lib/module/reanimated2/platform-specific/checkCppVersion.js +24 -0
- package/lib/module/reanimated2/platform-specific/checkCppVersion.js.map +1 -0
- package/lib/module/reanimated2/platform-specific/checkVersion.web.js +0 -1
- package/lib/module/reanimated2/platform-specific/checkVersion.web.js.map +1 -1
- package/lib/module/reanimated2/platform-specific/jsVersion.js +7 -0
- package/lib/module/reanimated2/platform-specific/jsVersion.js.map +1 -0
- package/lib/module/reanimated2/pluginUtils.js.map +1 -1
- package/lib/module/reanimated2/shareables.js +96 -44
- package/lib/module/reanimated2/shareables.js.map +1 -1
- package/lib/module/reanimated2/threads.js +39 -33
- package/lib/module/reanimated2/threads.js.map +1 -1
- package/lib/module/reanimated2/utils.js +0 -3
- package/lib/module/reanimated2/utils.js.map +1 -1
- package/lib/module/reanimated2/valueSetter.js +6 -19
- package/lib/module/reanimated2/valueSetter.js.map +1 -1
- package/lib/module/setAndForwardRef.js +3 -2
- package/lib/module/setAndForwardRef.js.map +1 -1
- package/package.json +46 -40
- package/plugin/.eslintrc.js +7 -0
- package/plugin/README.md +241 -0
- package/plugin/build/plugin.js +714 -0
- package/plugin/build/plugin.js.map +7 -0
- package/plugin/index.js +1 -807
- package/plugin/package.json +23 -0
- package/plugin/src/buildWorkletString.ts +213 -0
- package/plugin/src/commonObjects.ts +60 -0
- package/plugin/src/injectVersion.ts +37 -0
- package/plugin/src/makeWorklet.ts +375 -0
- package/plugin/src/plugin.ts +49 -0
- package/plugin/src/processForCalleesWorklets.ts +106 -0
- package/plugin/src/processIfGestureHandlerEventCallbackFunctionNode.ts +156 -0
- package/plugin/src/processIfWorkletFunction.ts +55 -0
- package/plugin/src/processIfWorkletNode.ts +44 -0
- package/plugin/src/processInlineStylesWarning.ts +129 -0
- package/plugin/src/processWorkletObjectMethod.ts +31 -0
- package/plugin/src/types.ts +15 -0
- package/plugin/src/utils.ts +6 -0
- package/plugin/tsconfig.json +15 -0
- package/plugin/yarn.lock +2193 -0
- package/react-native-reanimated.d.ts +1 -0
- package/scripts/reanimated_utils.rb +2 -2
- package/src/createAnimatedComponent.tsx +2 -3
- package/src/reanimated2/Easing.ts +19 -0
- package/src/reanimated2/NativeMethods.ts +9 -4
- package/src/reanimated2/NativeReanimated/NativeReanimated.ts +2 -2
- package/src/reanimated2/UpdateProps.ts +2 -2
- package/src/reanimated2/animation/decay.ts +7 -1
- package/src/reanimated2/animation/styleAnimation.ts +5 -1
- package/src/reanimated2/core.ts +4 -4
- package/src/reanimated2/errors.ts +1 -0
- package/src/reanimated2/frameCallback/FrameCallbackRegistryUI.ts +12 -4
- package/src/reanimated2/globals.d.ts +71 -112
- package/src/reanimated2/hook/commonTypes.ts +1 -1
- package/src/reanimated2/hook/useAnimatedReaction.ts +2 -2
- package/src/reanimated2/hook/useAnimatedSensor.ts +2 -2
- package/src/reanimated2/initializers.ts +11 -8
- package/src/reanimated2/jestUtils.ts +0 -1
- package/src/reanimated2/js-reanimated/JSReanimated.ts +5 -1
- package/src/reanimated2/js-reanimated/index.ts +1 -1
- package/src/reanimated2/mappers.ts +26 -4
- package/src/reanimated2/mock.ts +1 -0
- package/src/reanimated2/platform-specific/checkCppVersion.ts +29 -0
- package/src/reanimated2/platform-specific/jsVersion.ts +6 -0
- package/src/reanimated2/shareables.ts +107 -8
- package/src/reanimated2/threads.ts +36 -17
- package/lib/commonjs/reanimated2/platform-specific/checkVersion.js +0 -42
- package/lib/commonjs/reanimated2/platform-specific/checkVersion.js.map +0 -1
- package/lib/module/reanimated2/platform-specific/checkVersion.js +0 -35
- package/lib/module/reanimated2/platform-specific/checkVersion.js.map +0 -1
- package/src/reanimated2/platform-specific/checkVersion.ts +0 -39
|
@@ -7,36 +7,29 @@ exports.cancelAnimation = cancelAnimation;
|
|
|
7
7
|
exports.defineAnimation = defineAnimation;
|
|
8
8
|
exports.initialUpdaterRun = initialUpdaterRun;
|
|
9
9
|
exports.withStartValue = withStartValue;
|
|
10
|
-
|
|
11
10
|
var _Colors = require("../Colors");
|
|
12
|
-
|
|
13
11
|
var _NativeReanimated = _interopRequireDefault(require("../NativeReanimated"));
|
|
14
|
-
|
|
15
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
-
|
|
17
13
|
/* global _WORKLET */
|
|
18
|
-
let IN_STYLE_UPDATER = false;
|
|
19
14
|
|
|
15
|
+
let IN_STYLE_UPDATER = false;
|
|
20
16
|
function initialUpdaterRun(updater) {
|
|
21
17
|
IN_STYLE_UPDATER = true;
|
|
22
18
|
const result = updater();
|
|
23
19
|
IN_STYLE_UPDATER = false;
|
|
24
20
|
return result;
|
|
25
21
|
}
|
|
26
|
-
|
|
27
22
|
function recognizePrefixSuffix(value) {
|
|
28
23
|
'worklet';
|
|
29
24
|
|
|
30
25
|
if (typeof value === 'string') {
|
|
31
26
|
const match = value.match(/([A-Za-z]*)(-?\d*\.?\d*)([eE][-+]?[0-9]+)?([A-Za-z%]*)/);
|
|
32
|
-
|
|
33
27
|
if (!match) {
|
|
34
28
|
throw Error("Couldn't parse animation value. Check if there isn't any typo.");
|
|
35
29
|
}
|
|
36
|
-
|
|
37
30
|
const prefix = match[1];
|
|
38
|
-
const suffix = match[4];
|
|
39
|
-
|
|
31
|
+
const suffix = match[4];
|
|
32
|
+
// number with scientific notation
|
|
40
33
|
const number = match[2] + (match[3] ?? '');
|
|
41
34
|
return {
|
|
42
35
|
prefix,
|
|
@@ -49,19 +42,16 @@ function recognizePrefixSuffix(value) {
|
|
|
49
42
|
};
|
|
50
43
|
}
|
|
51
44
|
}
|
|
52
|
-
|
|
53
45
|
function decorateAnimation(animation) {
|
|
54
46
|
'worklet';
|
|
55
47
|
|
|
56
48
|
if (animation.isHigherOrder) {
|
|
57
49
|
return;
|
|
58
50
|
}
|
|
59
|
-
|
|
60
51
|
const baseOnStart = animation.onStart;
|
|
61
52
|
const baseOnFrame = animation.onFrame;
|
|
62
53
|
const animationCopy = Object.assign({}, animation);
|
|
63
54
|
delete animationCopy.callback;
|
|
64
|
-
|
|
65
55
|
const prefNumberSuffOnStart = (animation, value, timestamp, previousAnimation) => {
|
|
66
56
|
// recognize prefix, suffix, and updates stripped value on animation start
|
|
67
57
|
const {
|
|
@@ -78,7 +68,6 @@ function decorateAnimation(animation) {
|
|
|
78
68
|
animation.current = strippedValue;
|
|
79
69
|
animation.startValue = strippedValue;
|
|
80
70
|
animation.toValue = strippedToValue;
|
|
81
|
-
|
|
82
71
|
if (previousAnimation && previousAnimation !== animation) {
|
|
83
72
|
const {
|
|
84
73
|
prefix: paPrefix,
|
|
@@ -89,15 +78,12 @@ function decorateAnimation(animation) {
|
|
|
89
78
|
previousAnimation.__prefix = paPrefix;
|
|
90
79
|
previousAnimation.__suffix = paSuffix;
|
|
91
80
|
}
|
|
92
|
-
|
|
93
81
|
baseOnStart(animation, strippedValue, timestamp, previousAnimation);
|
|
94
82
|
animation.current = (animation.__prefix ?? '') + animation.current + (animation.__suffix ?? '');
|
|
95
|
-
|
|
96
83
|
if (previousAnimation && previousAnimation !== animation) {
|
|
97
84
|
previousAnimation.current = (previousAnimation.__prefix ?? '') + previousAnimation.current + (previousAnimation.__suffix ?? '');
|
|
98
85
|
}
|
|
99
86
|
};
|
|
100
|
-
|
|
101
87
|
const prefNumberSuffOnFrame = (animation, timestamp) => {
|
|
102
88
|
animation.current = animation.strippedCurrent;
|
|
103
89
|
const res = baseOnFrame(animation, timestamp);
|
|
@@ -105,24 +91,19 @@ function decorateAnimation(animation) {
|
|
|
105
91
|
animation.current = (animation.__prefix ?? '') + animation.current + (animation.__suffix ?? '');
|
|
106
92
|
return res;
|
|
107
93
|
};
|
|
108
|
-
|
|
109
94
|
const tab = ['R', 'G', 'B', 'A'];
|
|
110
|
-
|
|
111
95
|
const colorOnStart = (animation, value, timestamp, previousAnimation) => {
|
|
112
96
|
let RGBAValue;
|
|
113
97
|
let RGBACurrent;
|
|
114
98
|
let RGBAToValue;
|
|
115
99
|
const res = [];
|
|
116
|
-
|
|
117
100
|
if ((0, _Colors.isColor)(value)) {
|
|
118
101
|
RGBACurrent = (0, _Colors.toLinearSpace)((0, _Colors.convertToRGBA)(animation.current));
|
|
119
102
|
RGBAValue = (0, _Colors.toLinearSpace)((0, _Colors.convertToRGBA)(value));
|
|
120
|
-
|
|
121
103
|
if (animation.toValue) {
|
|
122
104
|
RGBAToValue = (0, _Colors.toLinearSpace)((0, _Colors.convertToRGBA)(animation.toValue));
|
|
123
105
|
}
|
|
124
106
|
}
|
|
125
|
-
|
|
126
107
|
tab.forEach((i, index) => {
|
|
127
108
|
animation[i] = Object.assign({}, animationCopy);
|
|
128
109
|
animation[i].current = RGBACurrent[index];
|
|
@@ -132,21 +113,19 @@ function decorateAnimation(animation) {
|
|
|
132
113
|
});
|
|
133
114
|
animation.current = (0, _Colors.rgbaArrayToRGBAColor)((0, _Colors.toGammaSpace)(res));
|
|
134
115
|
};
|
|
135
|
-
|
|
136
116
|
const colorOnFrame = (animation, timestamp) => {
|
|
137
117
|
const RGBACurrent = (0, _Colors.toLinearSpace)((0, _Colors.convertToRGBA)(animation.current));
|
|
138
118
|
const res = [];
|
|
139
119
|
let finished = true;
|
|
140
120
|
tab.forEach((i, index) => {
|
|
141
|
-
animation[i].current = RGBACurrent[index];
|
|
142
|
-
|
|
121
|
+
animation[i].current = RGBACurrent[index];
|
|
122
|
+
// @ts-ignore: disable-next-line
|
|
143
123
|
finished &= animation[i].onFrame(animation[i], timestamp);
|
|
144
124
|
res.push(animation[i].current);
|
|
145
125
|
});
|
|
146
126
|
animation.current = (0, _Colors.rgbaArrayToRGBAColor)((0, _Colors.toGammaSpace)(res));
|
|
147
127
|
return finished;
|
|
148
128
|
};
|
|
149
|
-
|
|
150
129
|
const arrayOnStart = (animation, value, timestamp, previousAnimation) => {
|
|
151
130
|
value.forEach((v, i) => {
|
|
152
131
|
animation[i] = Object.assign({}, animationCopy);
|
|
@@ -156,7 +135,6 @@ function decorateAnimation(animation) {
|
|
|
156
135
|
});
|
|
157
136
|
animation.current = value;
|
|
158
137
|
};
|
|
159
|
-
|
|
160
138
|
const arrayOnFrame = (animation, timestamp) => {
|
|
161
139
|
let finished = true;
|
|
162
140
|
animation.current.forEach((v, i) => {
|
|
@@ -166,7 +144,6 @@ function decorateAnimation(animation) {
|
|
|
166
144
|
});
|
|
167
145
|
return finished;
|
|
168
146
|
};
|
|
169
|
-
|
|
170
147
|
animation.onStart = (animation, value, timestamp, previousAnimation) => {
|
|
171
148
|
if ((0, _Colors.isColor)(value)) {
|
|
172
149
|
colorOnStart(animation, value, timestamp, previousAnimation);
|
|
@@ -181,20 +158,16 @@ function decorateAnimation(animation) {
|
|
|
181
158
|
animation.onFrame = prefNumberSuffOnFrame;
|
|
182
159
|
return;
|
|
183
160
|
}
|
|
184
|
-
|
|
185
161
|
baseOnStart(animation, value, timestamp, previousAnimation);
|
|
186
162
|
};
|
|
187
163
|
}
|
|
188
|
-
|
|
189
164
|
const IS_NATIVE = _NativeReanimated.default.native;
|
|
190
|
-
|
|
191
165
|
function defineAnimation(starting, factory) {
|
|
192
166
|
'worklet';
|
|
193
167
|
|
|
194
168
|
if (IN_STYLE_UPDATER) {
|
|
195
169
|
return starting;
|
|
196
170
|
}
|
|
197
|
-
|
|
198
171
|
const create = () => {
|
|
199
172
|
'worklet';
|
|
200
173
|
|
|
@@ -202,22 +175,20 @@ function defineAnimation(starting, factory) {
|
|
|
202
175
|
decorateAnimation(animation);
|
|
203
176
|
return animation;
|
|
204
177
|
};
|
|
205
|
-
|
|
206
178
|
if (_WORKLET || !IS_NATIVE) {
|
|
207
179
|
return create();
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
|
|
180
|
+
}
|
|
181
|
+
// @ts-ignore: eslint-disable-line
|
|
211
182
|
return create;
|
|
212
183
|
}
|
|
213
|
-
|
|
214
184
|
function cancelAnimation(sharedValue) {
|
|
215
|
-
'worklet';
|
|
185
|
+
'worklet';
|
|
216
186
|
|
|
187
|
+
// setting the current value cancels the animation if one is currently running
|
|
217
188
|
sharedValue.value = sharedValue.value; // eslint-disable-line no-self-assign
|
|
218
|
-
}
|
|
219
|
-
|
|
189
|
+
}
|
|
220
190
|
|
|
191
|
+
// TODO it should work only if there was no animation before.
|
|
221
192
|
function withStartValue(startValue, animation) {
|
|
222
193
|
'worklet';
|
|
223
194
|
|
|
@@ -227,7 +198,6 @@ function withStartValue(startValue, animation) {
|
|
|
227
198
|
if (!_WORKLET && typeof animation === 'function') {
|
|
228
199
|
animation = animation();
|
|
229
200
|
}
|
|
230
|
-
|
|
231
201
|
animation.current = startValue;
|
|
232
202
|
return animation;
|
|
233
203
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["IN_STYLE_UPDATER","initialUpdaterRun","updater","result","recognizePrefixSuffix","value","match","Error","prefix","suffix","number","strippedValue","parseFloat","decorateAnimation","animation","isHigherOrder","baseOnStart","onStart","baseOnFrame","onFrame","animationCopy","Object","assign","callback","prefNumberSuffOnStart","timestamp","previousAnimation","__prefix","__suffix","strippedCurrent","strippedToValue","toValue","current","startValue","paPrefix","paSuffix","paStrippedValue","prefNumberSuffOnFrame","res","tab","colorOnStart","RGBAValue","RGBACurrent","RGBAToValue","isColor","toLinearSpace","convertToRGBA","forEach","i","index","undefined","push","rgbaArrayToRGBAColor","toGammaSpace","colorOnFrame","finished","arrayOnStart","v","arrayOnFrame","Array","isArray","IS_NATIVE","NativeReanimatedModule","native","defineAnimation","starting","factory","create","_WORKLET","cancelAnimation","sharedValue","withStartValue"],"sources":["util.ts"],"sourcesContent":["import {\n HigherOrderAnimation,\n NextAnimation,\n DelayAnimation,\n RepeatAnimation,\n SequenceAnimation,\n StyleLayoutAnimation,\n} from './commonTypes';\n/* global _WORKLET */\nimport {\n ParsedColorArray,\n isColor,\n convertToRGBA,\n rgbaArrayToRGBAColor,\n toGammaSpace,\n toLinearSpace,\n} from '../Colors';\n\nimport {\n AnimatedStyle,\n SharedValue,\n AnimatableValue,\n Animation,\n AnimationObject,\n Timestamp,\n} from '../commonTypes';\nimport NativeReanimatedModule from '../NativeReanimated';\n\nlet IN_STYLE_UPDATER = false;\n\nexport type UserUpdater = () => AnimatedStyle;\n\nexport function initialUpdaterRun<T>(updater: () => T): T {\n IN_STYLE_UPDATER = true;\n const result = updater();\n IN_STYLE_UPDATER = false;\n return result;\n}\n\ninterface RecognizedPrefixSuffix {\n prefix?: string;\n suffix?: string;\n strippedValue: number;\n}\n\nfunction recognizePrefixSuffix(value: string | number): RecognizedPrefixSuffix {\n 'worklet';\n if (typeof value === 'string') {\n const match = value.match(\n /([A-Za-z]*)(-?\\d*\\.?\\d*)([eE][-+]?[0-9]+)?([A-Za-z%]*)/\n );\n if (!match) {\n throw Error(\n \"Couldn't parse animation value. Check if there isn't any typo.\"\n );\n }\n const prefix = match[1];\n const suffix = match[4];\n // number with scientific notation\n const number = match[2] + (match[3] ?? '');\n return { prefix, suffix, strippedValue: parseFloat(number) };\n } else {\n return { strippedValue: value };\n }\n}\n\nfunction decorateAnimation<T extends AnimationObject | StyleLayoutAnimation>(\n animation: T\n): void {\n 'worklet';\n if ((animation as HigherOrderAnimation).isHigherOrder) {\n return;\n }\n\n const baseOnStart = (animation as Animation<AnimationObject>).onStart;\n const baseOnFrame = (animation as Animation<AnimationObject>).onFrame;\n const animationCopy = Object.assign({}, animation);\n delete animationCopy.callback;\n\n const prefNumberSuffOnStart = (\n animation: Animation<AnimationObject>,\n value: string | number,\n timestamp: number,\n previousAnimation: Animation<AnimationObject>\n ) => {\n // recognize prefix, suffix, and updates stripped value on animation start\n const { prefix, suffix, strippedValue } = recognizePrefixSuffix(value);\n animation.__prefix = prefix;\n animation.__suffix = suffix;\n animation.strippedCurrent = strippedValue;\n const { strippedValue: strippedToValue } = recognizePrefixSuffix(\n animation.toValue as string | number\n );\n animation.current = strippedValue;\n animation.startValue = strippedValue;\n animation.toValue = strippedToValue;\n if (previousAnimation && previousAnimation !== animation) {\n const {\n prefix: paPrefix,\n suffix: paSuffix,\n strippedValue: paStrippedValue,\n } = recognizePrefixSuffix(previousAnimation.current as string | number);\n previousAnimation.current = paStrippedValue;\n previousAnimation.__prefix = paPrefix;\n previousAnimation.__suffix = paSuffix;\n }\n\n baseOnStart(animation, strippedValue, timestamp, previousAnimation);\n\n animation.current =\n (animation.__prefix ?? '') +\n animation.current +\n (animation.__suffix ?? '');\n\n if (previousAnimation && previousAnimation !== animation) {\n previousAnimation.current =\n (previousAnimation.__prefix ?? '') +\n previousAnimation.current +\n (previousAnimation.__suffix ?? '');\n }\n };\n const prefNumberSuffOnFrame = (\n animation: Animation<AnimationObject>,\n timestamp: number\n ) => {\n animation.current = animation.strippedCurrent;\n const res = baseOnFrame(animation, timestamp);\n animation.strippedCurrent = animation.current;\n animation.current =\n (animation.__prefix ?? '') +\n animation.current +\n (animation.__suffix ?? '');\n return res;\n };\n\n const tab = ['R', 'G', 'B', 'A'];\n const colorOnStart = (\n animation: Animation<AnimationObject>,\n value: string | number,\n timestamp: Timestamp,\n previousAnimation: Animation<AnimationObject>\n ): void => {\n let RGBAValue: ParsedColorArray;\n let RGBACurrent: ParsedColorArray;\n let RGBAToValue: ParsedColorArray;\n const res: Array<number> = [];\n if (isColor(value)) {\n RGBACurrent = toLinearSpace(convertToRGBA(animation.current));\n RGBAValue = toLinearSpace(convertToRGBA(value));\n if (animation.toValue) {\n RGBAToValue = toLinearSpace(convertToRGBA(animation.toValue));\n }\n }\n tab.forEach((i, index) => {\n animation[i] = Object.assign({}, animationCopy);\n animation[i].current = RGBACurrent[index];\n animation[i].toValue = RGBAToValue ? RGBAToValue[index] : undefined;\n animation[i].onStart(\n animation[i],\n RGBAValue[index],\n timestamp,\n previousAnimation ? previousAnimation[i] : undefined\n );\n res.push(animation[i].current);\n });\n\n animation.current = rgbaArrayToRGBAColor(\n toGammaSpace(res as ParsedColorArray)\n );\n };\n\n const colorOnFrame = (\n animation: Animation<AnimationObject>,\n timestamp: Timestamp\n ): boolean => {\n const RGBACurrent = toLinearSpace(convertToRGBA(animation.current));\n const res: Array<number> = [];\n let finished = true;\n tab.forEach((i, index) => {\n animation[i].current = RGBACurrent[index];\n // @ts-ignore: disable-next-line\n finished &= animation[i].onFrame(animation[i], timestamp);\n res.push(animation[i].current);\n });\n\n animation.current = rgbaArrayToRGBAColor(\n toGammaSpace(res as ParsedColorArray)\n );\n return finished;\n };\n\n const arrayOnStart = (\n animation: Animation<AnimationObject>,\n value: Array<number>,\n timestamp: Timestamp,\n previousAnimation: Animation<AnimationObject>\n ): void => {\n value.forEach((v, i) => {\n animation[i] = Object.assign({}, animationCopy);\n animation[i].current = v;\n animation[i].toValue = (animation.toValue as Array<number>)[i];\n animation[i].onStart(\n animation[i],\n v,\n timestamp,\n previousAnimation ? previousAnimation[i] : undefined\n );\n });\n\n animation.current = value;\n };\n\n const arrayOnFrame = (\n animation: Animation<AnimationObject>,\n timestamp: Timestamp\n ): boolean => {\n let finished = true;\n (animation.current as Array<number>).forEach((v, i) => {\n // @ts-ignore: disable-next-line\n finished &= animation[i].onFrame(animation[i], timestamp);\n (animation.current as Array<number>)[i] = animation[i].current;\n });\n\n return finished;\n };\n\n animation.onStart = (\n animation: Animation<AnimationObject>,\n value: number,\n timestamp: Timestamp,\n previousAnimation: Animation<AnimationObject>\n ) => {\n if (isColor(value)) {\n colorOnStart(animation, value, timestamp, previousAnimation);\n animation.onFrame = colorOnFrame;\n return;\n } else if (Array.isArray(value)) {\n arrayOnStart(animation, value, timestamp, previousAnimation);\n animation.onFrame = arrayOnFrame;\n return;\n } else if (typeof value === 'string') {\n prefNumberSuffOnStart(animation, value, timestamp, previousAnimation);\n animation.onFrame = prefNumberSuffOnFrame;\n return;\n }\n baseOnStart(animation, value, timestamp, previousAnimation);\n };\n}\n\ntype AnimationToDecoration<T extends AnimationObject | StyleLayoutAnimation> =\n T extends StyleLayoutAnimation\n ? Record<string, unknown>\n : T extends DelayAnimation\n ? NextAnimation<DelayAnimation>\n : T extends RepeatAnimation\n ? NextAnimation<RepeatAnimation>\n : T extends SequenceAnimation\n ? NextAnimation<SequenceAnimation>\n : AnimatableValue | T;\n\nconst IS_NATIVE = NativeReanimatedModule.native;\n\nexport function defineAnimation<\n T extends AnimationObject | StyleLayoutAnimation\n>(starting: AnimationToDecoration<T>, factory: () => T): T {\n 'worklet';\n if (IN_STYLE_UPDATER) {\n return starting as T;\n }\n const create = () => {\n 'worklet';\n const animation = factory();\n decorateAnimation<T>(animation);\n return animation;\n };\n\n if (_WORKLET || !IS_NATIVE) {\n return create();\n }\n // @ts-ignore: eslint-disable-line\n return create;\n}\n\nexport function cancelAnimation<T>(sharedValue: SharedValue<T>): void {\n 'worklet';\n // setting the current value cancels the animation if one is currently running\n sharedValue.value = sharedValue.value; // eslint-disable-line no-self-assign\n}\n\n// TODO it should work only if there was no animation before.\nexport function withStartValue(\n startValue: AnimatableValue,\n animation: NextAnimation<AnimationObject>\n): Animation<AnimationObject> {\n 'worklet';\n return defineAnimation(startValue, () => {\n 'worklet';\n if (!_WORKLET && typeof animation === 'function') {\n animation = animation();\n }\n (animation as Animation<AnimationObject>).current = startValue;\n return animation as Animation<AnimationObject>;\n });\n}\n"],"mappings":";;;;;;;;;;AASA;;AAiBA;;;;AAlBA;AAoBA,IAAIA,gBAAgB,GAAG,KAAvB;;AAIO,SAASC,iBAAT,CAA8BC,OAA9B,EAAmD;EACxDF,gBAAgB,GAAG,IAAnB;EACA,MAAMG,MAAM,GAAGD,OAAO,EAAtB;EACAF,gBAAgB,GAAG,KAAnB;EACA,OAAOG,MAAP;AACD;;AAQD,SAASC,qBAAT,CAA+BC,KAA/B,EAA+E;EAC7E;;EACA,IAAI,OAAOA,KAAP,KAAiB,QAArB,EAA+B;IAC7B,MAAMC,KAAK,GAAGD,KAAK,CAACC,KAAN,CACZ,wDADY,CAAd;;IAGA,IAAI,CAACA,KAAL,EAAY;MACV,MAAMC,KAAK,CACT,gEADS,CAAX;IAGD;;IACD,MAAMC,MAAM,GAAGF,KAAK,CAAC,CAAD,CAApB;IACA,MAAMG,MAAM,GAAGH,KAAK,CAAC,CAAD,CAApB,CAV6B,CAW7B;;IACA,MAAMI,MAAM,GAAGJ,KAAK,CAAC,CAAD,CAAL,IAAYA,KAAK,CAAC,CAAD,CAAL,IAAY,EAAxB,CAAf;IACA,OAAO;MAAEE,MAAF;MAAUC,MAAV;MAAkBE,aAAa,EAAEC,UAAU,CAACF,MAAD;IAA3C,CAAP;EACD,CAdD,MAcO;IACL,OAAO;MAAEC,aAAa,EAAEN;IAAjB,CAAP;EACD;AAC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AOiE,QAAP;EACD;;EACD,MAAME,MAAM,GAAG,MAAM;IACnB;;IACA,MAAMrD,SAAS,GAAGoD,OAAO,EAAzB;IACArD,iBAAiB,CAAIC,SAAJ,CAAjB;IACA,OAAOA,SAAP;EACD,CALD;;EAOA,IAAIsD,QAAQ,IAAI,CAACP,SAAjB,EAA4B;IAC1B,OAAOM,MAAM,EAAb;EACD,CAdwD,CAezD;;;EACA,OAAOA,MAAP;AACD;;AAEM,SAASE,eAAT,CAA4BC,WAA5B,EAA+D;EACpE,UADoE,CAEpE;;EACAA,WAAW,CAACjE,KAAZ,GAAoBiE,WAAW,CAACjE,KAAhC,CAHoE,CAG7B;AACxC,C,CAED;;;AACO,SAASkE,cAAT,CACLtC,UADK,EAELnB,SAFK,EAGuB;EAC5B;;EACA,OAAOkD,eAAe,CAAC/B,UAAD,EAAa,MAAM;IACvC;;IACA,IAAI,CAACmC,QAAD,IAAa,OAAOtD,SAAP,KAAqB,UAAtC,EAAkD;MAChDA,SAAS,GAAGA,SAAS,EAArB;IACD;;IACAA,SAAD,CAA0CkB,OAA1C,GAAoDC,UAApD;IACA,OAAOnB,SAAP;EACD,CAPqB,CAAtB;AAQD"}
|
|
1
|
+
{"version":3,"names":["_Colors","require","_NativeReanimated","_interopRequireDefault","obj","__esModule","default","IN_STYLE_UPDATER","initialUpdaterRun","updater","result","recognizePrefixSuffix","value","match","Error","prefix","suffix","number","strippedValue","parseFloat","decorateAnimation","animation","isHigherOrder","baseOnStart","onStart","baseOnFrame","onFrame","animationCopy","Object","assign","callback","prefNumberSuffOnStart","timestamp","previousAnimation","__prefix","__suffix","strippedCurrent","strippedToValue","toValue","current","startValue","paPrefix","paSuffix","paStrippedValue","prefNumberSuffOnFrame","res","tab","colorOnStart","RGBAValue","RGBACurrent","RGBAToValue","isColor","toLinearSpace","convertToRGBA","forEach","i","index","undefined","push","rgbaArrayToRGBAColor","toGammaSpace","colorOnFrame","finished","arrayOnStart","v","arrayOnFrame","Array","isArray","IS_NATIVE","NativeReanimatedModule","native","defineAnimation","starting","factory","create","_WORKLET","cancelAnimation","sharedValue","withStartValue"],"sources":["util.ts"],"sourcesContent":["import {\n HigherOrderAnimation,\n NextAnimation,\n DelayAnimation,\n RepeatAnimation,\n SequenceAnimation,\n StyleLayoutAnimation,\n} from './commonTypes';\n/* global _WORKLET */\nimport {\n ParsedColorArray,\n isColor,\n convertToRGBA,\n rgbaArrayToRGBAColor,\n toGammaSpace,\n toLinearSpace,\n} from '../Colors';\n\nimport {\n AnimatedStyle,\n SharedValue,\n AnimatableValue,\n Animation,\n AnimationObject,\n Timestamp,\n} from '../commonTypes';\nimport NativeReanimatedModule from '../NativeReanimated';\n\nlet IN_STYLE_UPDATER = false;\n\nexport type UserUpdater = () => AnimatedStyle;\n\nexport function initialUpdaterRun<T>(updater: () => T): T {\n IN_STYLE_UPDATER = true;\n const result = updater();\n IN_STYLE_UPDATER = false;\n return result;\n}\n\ninterface RecognizedPrefixSuffix {\n prefix?: string;\n suffix?: string;\n strippedValue: number;\n}\n\nfunction recognizePrefixSuffix(value: string | number): RecognizedPrefixSuffix {\n 'worklet';\n if (typeof value === 'string') {\n const match = value.match(\n /([A-Za-z]*)(-?\\d*\\.?\\d*)([eE][-+]?[0-9]+)?([A-Za-z%]*)/\n );\n if (!match) {\n throw Error(\n \"Couldn't parse animation value. Check if there isn't any typo.\"\n );\n }\n const prefix = match[1];\n const suffix = match[4];\n // number with scientific notation\n const number = match[2] + (match[3] ?? '');\n return { prefix, suffix, strippedValue: parseFloat(number) };\n } else {\n return { strippedValue: value };\n }\n}\n\nfunction decorateAnimation<T extends AnimationObject | StyleLayoutAnimation>(\n animation: T\n): void {\n 'worklet';\n if ((animation as HigherOrderAnimation).isHigherOrder) {\n return;\n }\n\n const baseOnStart = (animation as Animation<AnimationObject>).onStart;\n const baseOnFrame = (animation as Animation<AnimationObject>).onFrame;\n const animationCopy = Object.assign({}, animation);\n delete animationCopy.callback;\n\n const prefNumberSuffOnStart = (\n animation: Animation<AnimationObject>,\n value: string | number,\n timestamp: number,\n previousAnimation: Animation<AnimationObject>\n ) => {\n // recognize prefix, suffix, and updates stripped value on animation start\n const { prefix, suffix, strippedValue } = recognizePrefixSuffix(value);\n animation.__prefix = prefix;\n animation.__suffix = suffix;\n animation.strippedCurrent = strippedValue;\n const { strippedValue: strippedToValue } = recognizePrefixSuffix(\n animation.toValue as string | number\n );\n animation.current = strippedValue;\n animation.startValue = strippedValue;\n animation.toValue = strippedToValue;\n if (previousAnimation && previousAnimation !== animation) {\n const {\n prefix: paPrefix,\n suffix: paSuffix,\n strippedValue: paStrippedValue,\n } = recognizePrefixSuffix(previousAnimation.current as string | number);\n previousAnimation.current = paStrippedValue;\n previousAnimation.__prefix = paPrefix;\n previousAnimation.__suffix = paSuffix;\n }\n\n baseOnStart(animation, strippedValue, timestamp, previousAnimation);\n\n animation.current =\n (animation.__prefix ?? '') +\n animation.current +\n (animation.__suffix ?? '');\n\n if (previousAnimation && previousAnimation !== animation) {\n previousAnimation.current =\n (previousAnimation.__prefix ?? '') +\n previousAnimation.current +\n (previousAnimation.__suffix ?? '');\n }\n };\n const prefNumberSuffOnFrame = (\n animation: Animation<AnimationObject>,\n timestamp: number\n ) => {\n animation.current = animation.strippedCurrent;\n const res = baseOnFrame(animation, timestamp);\n animation.strippedCurrent = animation.current;\n animation.current =\n (animation.__prefix ?? '') +\n animation.current +\n (animation.__suffix ?? '');\n return res;\n };\n\n const tab = ['R', 'G', 'B', 'A'];\n const colorOnStart = (\n animation: Animation<AnimationObject>,\n value: string | number,\n timestamp: Timestamp,\n previousAnimation: Animation<AnimationObject>\n ): void => {\n let RGBAValue: ParsedColorArray;\n let RGBACurrent: ParsedColorArray;\n let RGBAToValue: ParsedColorArray;\n const res: Array<number> = [];\n if (isColor(value)) {\n RGBACurrent = toLinearSpace(convertToRGBA(animation.current));\n RGBAValue = toLinearSpace(convertToRGBA(value));\n if (animation.toValue) {\n RGBAToValue = toLinearSpace(convertToRGBA(animation.toValue));\n }\n }\n tab.forEach((i, index) => {\n animation[i] = Object.assign({}, animationCopy);\n animation[i].current = RGBACurrent[index];\n animation[i].toValue = RGBAToValue ? RGBAToValue[index] : undefined;\n animation[i].onStart(\n animation[i],\n RGBAValue[index],\n timestamp,\n previousAnimation ? previousAnimation[i] : undefined\n );\n res.push(animation[i].current);\n });\n\n animation.current = rgbaArrayToRGBAColor(\n toGammaSpace(res as ParsedColorArray)\n );\n };\n\n const colorOnFrame = (\n animation: Animation<AnimationObject>,\n timestamp: Timestamp\n ): boolean => {\n const RGBACurrent = toLinearSpace(convertToRGBA(animation.current));\n const res: Array<number> = [];\n let finished = true;\n tab.forEach((i, index) => {\n animation[i].current = RGBACurrent[index];\n // @ts-ignore: disable-next-line\n finished &= animation[i].onFrame(animation[i], timestamp);\n res.push(animation[i].current);\n });\n\n animation.current = rgbaArrayToRGBAColor(\n toGammaSpace(res as ParsedColorArray)\n );\n return finished;\n };\n\n const arrayOnStart = (\n animation: Animation<AnimationObject>,\n value: Array<number>,\n timestamp: Timestamp,\n previousAnimation: Animation<AnimationObject>\n ): void => {\n value.forEach((v, i) => {\n animation[i] = Object.assign({}, animationCopy);\n animation[i].current = v;\n animation[i].toValue = (animation.toValue as Array<number>)[i];\n animation[i].onStart(\n animation[i],\n v,\n timestamp,\n previousAnimation ? previousAnimation[i] : undefined\n );\n });\n\n animation.current = value;\n };\n\n const arrayOnFrame = (\n animation: Animation<AnimationObject>,\n timestamp: Timestamp\n ): boolean => {\n let finished = true;\n (animation.current as Array<number>).forEach((v, i) => {\n // @ts-ignore: disable-next-line\n finished &= animation[i].onFrame(animation[i], timestamp);\n (animation.current as Array<number>)[i] = animation[i].current;\n });\n\n return finished;\n };\n\n animation.onStart = (\n animation: Animation<AnimationObject>,\n value: number,\n timestamp: Timestamp,\n previousAnimation: Animation<AnimationObject>\n ) => {\n if (isColor(value)) {\n colorOnStart(animation, value, timestamp, previousAnimation);\n animation.onFrame = colorOnFrame;\n return;\n } else if (Array.isArray(value)) {\n arrayOnStart(animation, value, timestamp, previousAnimation);\n animation.onFrame = arrayOnFrame;\n return;\n } else if (typeof value === 'string') {\n prefNumberSuffOnStart(animation, value, timestamp, previousAnimation);\n animation.onFrame = prefNumberSuffOnFrame;\n return;\n }\n baseOnStart(animation, value, timestamp, previousAnimation);\n };\n}\n\ntype AnimationToDecoration<T extends AnimationObject | StyleLayoutAnimation> =\n T extends StyleLayoutAnimation\n ? Record<string, unknown>\n : T extends DelayAnimation\n ? NextAnimation<DelayAnimation>\n : T extends RepeatAnimation\n ? NextAnimation<RepeatAnimation>\n : T extends SequenceAnimation\n ? NextAnimation<SequenceAnimation>\n : AnimatableValue | T;\n\nconst IS_NATIVE = NativeReanimatedModule.native;\n\nexport function defineAnimation<\n T extends AnimationObject | StyleLayoutAnimation\n>(starting: AnimationToDecoration<T>, factory: () => T): T {\n 'worklet';\n if (IN_STYLE_UPDATER) {\n return starting as T;\n }\n const create = () => {\n 'worklet';\n const animation = factory();\n decorateAnimation<T>(animation);\n return animation;\n };\n\n if (_WORKLET || !IS_NATIVE) {\n return create();\n }\n // @ts-ignore: eslint-disable-line\n return create;\n}\n\nexport function cancelAnimation<T>(sharedValue: SharedValue<T>): void {\n 'worklet';\n // setting the current value cancels the animation if one is currently running\n sharedValue.value = sharedValue.value; // eslint-disable-line no-self-assign\n}\n\n// TODO it should work only if there was no animation before.\nexport function withStartValue(\n startValue: AnimatableValue,\n animation: NextAnimation<AnimationObject>\n): Animation<AnimationObject> {\n 'worklet';\n return defineAnimation(startValue, () => {\n 'worklet';\n if (!_WORKLET && typeof animation === 'function') {\n animation = animation();\n }\n (animation as Animation<AnimationObject>).current = startValue;\n return animation as Animation<AnimationObject>;\n });\n}\n"],"mappings":";;;;;;;;;AASA,IAAAA,OAAA,GAAAC,OAAA;AAiBA,IAAAC,iBAAA,GAAAC,sBAAA,CAAAF,OAAA;AAAyD,SAAAE,uBAAAC,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,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C;;AAEA;AACO,SAASkE,cAAcA,CAC5BtC,UAA2B,EAC3BnB,SAAyC,EACb;EAC5B,SAAS;;EACT,OAAOkD,eAAe,CAAC/B,UAAU,EAAE,MAAM;IACvC,SAAS;;IACT,IAAI,CAACmC,QAAQ,IAAI,OAAOtD,SAAS,KAAK,UAAU,EAAE;MAChDA,SAAS,GAAGA,SAAS,EAAE;IACzB;IACCA,SAAS,CAAgCkB,OAAO,GAAGC,UAAU;IAC9D,OAAOnB,SAAS;EAClB,CAAC,CAAC;AACJ"}
|
|
@@ -11,46 +11,39 @@ exports.SensorType = exports.KeyboardState = exports.InterfaceOrientation = expo
|
|
|
11
11
|
// check other methods that may use them. However, this field is not actually defined
|
|
12
12
|
// nor should be used for anything else as assigning any data to those objects will
|
|
13
13
|
// throw an error.
|
|
14
|
-
let SensorType
|
|
15
|
-
exports.SensorType = SensorType;
|
|
16
|
-
|
|
17
|
-
(function (SensorType) {
|
|
14
|
+
let SensorType = /*#__PURE__*/function (SensorType) {
|
|
18
15
|
SensorType[SensorType["ACCELEROMETER"] = 1] = "ACCELEROMETER";
|
|
19
16
|
SensorType[SensorType["GYROSCOPE"] = 2] = "GYROSCOPE";
|
|
20
17
|
SensorType[SensorType["GRAVITY"] = 3] = "GRAVITY";
|
|
21
18
|
SensorType[SensorType["MAGNETIC_FIELD"] = 4] = "MAGNETIC_FIELD";
|
|
22
19
|
SensorType[SensorType["ROTATION"] = 5] = "ROTATION";
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
(function (IOSReferenceFrame) {
|
|
20
|
+
return SensorType;
|
|
21
|
+
}({});
|
|
22
|
+
exports.SensorType = SensorType;
|
|
23
|
+
let IOSReferenceFrame = /*#__PURE__*/function (IOSReferenceFrame) {
|
|
29
24
|
IOSReferenceFrame[IOSReferenceFrame["XArbitraryZVertical"] = 0] = "XArbitraryZVertical";
|
|
30
25
|
IOSReferenceFrame[IOSReferenceFrame["XArbitraryCorrectedZVertical"] = 1] = "XArbitraryCorrectedZVertical";
|
|
31
26
|
IOSReferenceFrame[IOSReferenceFrame["XMagneticNorthZVertical"] = 2] = "XMagneticNorthZVertical";
|
|
32
27
|
IOSReferenceFrame[IOSReferenceFrame["XTrueNorthZVertical"] = 3] = "XTrueNorthZVertical";
|
|
33
28
|
IOSReferenceFrame[IOSReferenceFrame["Auto"] = 4] = "Auto";
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
(function (InterfaceOrientation) {
|
|
29
|
+
return IOSReferenceFrame;
|
|
30
|
+
}({});
|
|
31
|
+
exports.IOSReferenceFrame = IOSReferenceFrame;
|
|
32
|
+
let InterfaceOrientation = /*#__PURE__*/function (InterfaceOrientation) {
|
|
40
33
|
InterfaceOrientation[InterfaceOrientation["ROTATION_0"] = 0] = "ROTATION_0";
|
|
41
34
|
InterfaceOrientation[InterfaceOrientation["ROTATION_90"] = 90] = "ROTATION_90";
|
|
42
35
|
InterfaceOrientation[InterfaceOrientation["ROTATION_180"] = 180] = "ROTATION_180";
|
|
43
36
|
InterfaceOrientation[InterfaceOrientation["ROTATION_270"] = 270] = "ROTATION_270";
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
(function (KeyboardState) {
|
|
37
|
+
return InterfaceOrientation;
|
|
38
|
+
}({});
|
|
39
|
+
exports.InterfaceOrientation = InterfaceOrientation;
|
|
40
|
+
let KeyboardState = /*#__PURE__*/function (KeyboardState) {
|
|
50
41
|
KeyboardState[KeyboardState["UNKNOWN"] = 0] = "UNKNOWN";
|
|
51
42
|
KeyboardState[KeyboardState["OPENING"] = 1] = "OPENING";
|
|
52
43
|
KeyboardState[KeyboardState["OPEN"] = 2] = "OPEN";
|
|
53
44
|
KeyboardState[KeyboardState["CLOSING"] = 3] = "CLOSING";
|
|
54
45
|
KeyboardState[KeyboardState["CLOSED"] = 4] = "CLOSED";
|
|
55
|
-
|
|
46
|
+
return KeyboardState;
|
|
47
|
+
}({});
|
|
48
|
+
exports.KeyboardState = KeyboardState;
|
|
56
49
|
//# sourceMappingURL=commonTypes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SensorType","IOSReferenceFrame","InterfaceOrientation","KeyboardState"],"sources":["commonTypes.ts"],"sourcesContent":["import {\n PerpectiveTransform,\n RotateTransform,\n RotateXTransform,\n RotateYTransform,\n RotateZTransform,\n ScaleTransform,\n ScaleXTransform,\n ScaleYTransform,\n TranslateXTransform,\n TranslateYTransform,\n SkewXTransform,\n SkewYTransform,\n MatrixTransform,\n ViewStyle,\n TextStyle,\n} from 'react-native';\n\nexport type TransformProperty =\n | PerpectiveTransform\n | RotateTransform\n | RotateXTransform\n | RotateYTransform\n | RotateZTransform\n | ScaleTransform\n | ScaleXTransform\n | ScaleYTransform\n | TranslateXTransform\n | TranslateYTransform\n | SkewXTransform\n | SkewYTransform\n | MatrixTransform;\n\nexport interface StyleProps extends ViewStyle, TextStyle {\n originX?: number;\n originY?: number;\n [key: string]: any;\n}\n\nexport interface AnimatedStyle\n extends Record<string, Animation<AnimationObject>> {\n [key: string]: any;\n transform?: Array<Record<string, Animation<AnimationObject>>>;\n}\nexport interface SharedValue<T> {\n value: T;\n addListener: (listenerID: number, listener: (value: T) => void) => void;\n removeListener: (listenerID: number) => void;\n modify: (modifier: (value: T) => T) => void;\n}\n\n// The below type is used for HostObjects retured by the JSI API that don't have\n// any accessable fields or methods but can carry data that is accessed from the\n// c++ side. We add a field to the type to make it possible for typescript to recognize\n// which JSI methods accept those types as arguments and to be able to correctly type\n// check other methods that may use them. However, this field is not actually defined\n// nor should be used for anything else as assigning any data to those objects will\n// throw an error.\nexport type ShareableRef<T> = {\n __hostObjectShareableJSRef: T;\n};\n\nexport type ShareableSyncDataHolderRef<T> = {\n __hostObjectShareableJSRefSyncDataHolder: T;\n};\n\nexport type MapperRegistry = {\n start: (\n mapperID: number,\n worklet: () => void,\n inputs: SharedValue<any>[],\n outputs?: SharedValue<any>[]\n ) => void;\n stop: (mapperID: number) => void;\n};\n\nexport type Context = Record<string, unknown>;\n\nexport interface WorkletFunction {\n _closure?: Context;\n __workletHash?: number;\n}\n\nexport interface BasicWorkletFunction<T> extends WorkletFunction {\n (): T;\n}\n\nexport interface BasicWorkletFunctionOptional<T> extends WorkletFunction {\n (): Partial<T>;\n}\n\nexport interface NativeEvent<T> {\n nativeEvent: T;\n}\nexport interface ComplexWorkletFunction<A extends any[], R>\n extends WorkletFunction {\n (...args: A): R;\n __remoteFunction?: (...args: A) => R;\n}\n\nexport interface NestedObject<T> {\n [key: string]: NestedObjectValues<T>;\n}\n\nexport type NestedObjectValues<T> =\n | T\n | Array<NestedObjectValues<T>>\n | NestedObject<T>;\n\nexport interface AdapterWorkletFunction extends WorkletFunction {\n (value: NestedObject<string | number | AnimationObject>): void;\n}\n\nexport type AnimatableValue = number | string | Array<number>;\n\nexport interface AnimationObject {\n [key: string]: any;\n callback: AnimationCallback;\n current?: AnimatableValue;\n toValue?: AnimationObject['current'];\n startValue?: AnimationObject['current'];\n finished?: boolean;\n strippedCurrent?: number;\n cancelled?: boolean;\n\n __prefix?: string;\n __suffix?: string;\n onFrame: (animation: any, timestamp: Timestamp) => boolean;\n onStart: (\n nextAnimation: any,\n current: any,\n timestamp: Timestamp,\n previousAnimation: any\n ) => void;\n}\n\nexport interface Animation<T extends AnimationObject> extends AnimationObject {\n onFrame: (animation: T, timestamp: Timestamp) => boolean;\n onStart: (\n nextAnimation: T,\n current: T extends NumericAnimation ? number : AnimatableValue,\n timestamp: Timestamp,\n previousAnimation: T\n ) => void;\n}\n\nexport enum SensorType {\n ACCELEROMETER = 1,\n GYROSCOPE = 2,\n GRAVITY = 3,\n MAGNETIC_FIELD = 4,\n ROTATION = 5,\n}\nexport enum IOSReferenceFrame {\n XArbitraryZVertical,\n XArbitraryCorrectedZVertical,\n XMagneticNorthZVertical,\n XTrueNorthZVertical,\n Auto,\n}\n\nexport interface NumericAnimation {\n current?: number;\n}\n\nexport type AnimationCallback = (\n finished?: boolean,\n current?: AnimatableValue\n) => void;\n\nexport type Timestamp = number;\n\nexport type Value3D = {\n x: number;\n y: number;\n z: number;\n interfaceOrientation: InterfaceOrientation;\n};\n\nexport type ValueRotation = {\n qw: number;\n qx: number;\n qy: number;\n qz: number;\n yaw: number;\n pitch: number;\n roll: number;\n interfaceOrientation: InterfaceOrientation;\n};\n\nexport enum InterfaceOrientation {\n ROTATION_0 = 0,\n ROTATION_90 = 90,\n ROTATION_180 = 180,\n ROTATION_270 = 270,\n}\n\nexport type ShadowNodeWrapper = object;\n\nexport enum KeyboardState {\n UNKNOWN = 0,\n OPENING = 1,\n OPEN = 2,\n CLOSING = 3,\n CLOSED = 4,\n}\n\nexport type AnimatedKeyboardInfo = {\n height: SharedValue<number>;\n state: SharedValue<KeyboardState>;\n};\n\nexport interface MeasuredDimensions {\n x: number;\n y: number;\n width: number;\n height: number;\n pageX: number;\n pageY: number;\n}\n\nexport interface AnimatedKeyboardOptions {\n isStatusBarTranslucentAndroid?: boolean;\n}\n"],"mappings":";;;;;;AAmDA;AACA;AACA;AACA;AACA;AACA;AACA;IAyFYA,
|
|
1
|
+
{"version":3,"names":["SensorType","exports","IOSReferenceFrame","InterfaceOrientation","KeyboardState"],"sources":["commonTypes.ts"],"sourcesContent":["import {\n PerpectiveTransform,\n RotateTransform,\n RotateXTransform,\n RotateYTransform,\n RotateZTransform,\n ScaleTransform,\n ScaleXTransform,\n ScaleYTransform,\n TranslateXTransform,\n TranslateYTransform,\n SkewXTransform,\n SkewYTransform,\n MatrixTransform,\n ViewStyle,\n TextStyle,\n} from 'react-native';\n\nexport type TransformProperty =\n | PerpectiveTransform\n | RotateTransform\n | RotateXTransform\n | RotateYTransform\n | RotateZTransform\n | ScaleTransform\n | ScaleXTransform\n | ScaleYTransform\n | TranslateXTransform\n | TranslateYTransform\n | SkewXTransform\n | SkewYTransform\n | MatrixTransform;\n\nexport interface StyleProps extends ViewStyle, TextStyle {\n originX?: number;\n originY?: number;\n [key: string]: any;\n}\n\nexport interface AnimatedStyle\n extends Record<string, Animation<AnimationObject>> {\n [key: string]: any;\n transform?: Array<Record<string, Animation<AnimationObject>>>;\n}\nexport interface SharedValue<T> {\n value: T;\n addListener: (listenerID: number, listener: (value: T) => void) => void;\n removeListener: (listenerID: number) => void;\n modify: (modifier: (value: T) => T) => void;\n}\n\n// The below type is used for HostObjects retured by the JSI API that don't have\n// any accessable fields or methods but can carry data that is accessed from the\n// c++ side. We add a field to the type to make it possible for typescript to recognize\n// which JSI methods accept those types as arguments and to be able to correctly type\n// check other methods that may use them. However, this field is not actually defined\n// nor should be used for anything else as assigning any data to those objects will\n// throw an error.\nexport type ShareableRef<T> = {\n __hostObjectShareableJSRef: T;\n};\n\nexport type ShareableSyncDataHolderRef<T> = {\n __hostObjectShareableJSRefSyncDataHolder: T;\n};\n\nexport type MapperRegistry = {\n start: (\n mapperID: number,\n worklet: () => void,\n inputs: SharedValue<any>[],\n outputs?: SharedValue<any>[]\n ) => void;\n stop: (mapperID: number) => void;\n};\n\nexport type Context = Record<string, unknown>;\n\nexport interface WorkletFunction {\n _closure?: Context;\n __workletHash?: number;\n}\n\nexport interface BasicWorkletFunction<T> extends WorkletFunction {\n (): T;\n}\n\nexport interface BasicWorkletFunctionOptional<T> extends WorkletFunction {\n (): Partial<T>;\n}\n\nexport interface NativeEvent<T> {\n nativeEvent: T;\n}\nexport interface ComplexWorkletFunction<A extends any[], R>\n extends WorkletFunction {\n (...args: A): R;\n __remoteFunction?: (...args: A) => R;\n}\n\nexport interface NestedObject<T> {\n [key: string]: NestedObjectValues<T>;\n}\n\nexport type NestedObjectValues<T> =\n | T\n | Array<NestedObjectValues<T>>\n | NestedObject<T>;\n\nexport interface AdapterWorkletFunction extends WorkletFunction {\n (value: NestedObject<string | number | AnimationObject>): void;\n}\n\nexport type AnimatableValue = number | string | Array<number>;\n\nexport interface AnimationObject {\n [key: string]: any;\n callback: AnimationCallback;\n current?: AnimatableValue;\n toValue?: AnimationObject['current'];\n startValue?: AnimationObject['current'];\n finished?: boolean;\n strippedCurrent?: number;\n cancelled?: boolean;\n\n __prefix?: string;\n __suffix?: string;\n onFrame: (animation: any, timestamp: Timestamp) => boolean;\n onStart: (\n nextAnimation: any,\n current: any,\n timestamp: Timestamp,\n previousAnimation: any\n ) => void;\n}\n\nexport interface Animation<T extends AnimationObject> extends AnimationObject {\n onFrame: (animation: T, timestamp: Timestamp) => boolean;\n onStart: (\n nextAnimation: T,\n current: T extends NumericAnimation ? number : AnimatableValue,\n timestamp: Timestamp,\n previousAnimation: T\n ) => void;\n}\n\nexport enum SensorType {\n ACCELEROMETER = 1,\n GYROSCOPE = 2,\n GRAVITY = 3,\n MAGNETIC_FIELD = 4,\n ROTATION = 5,\n}\nexport enum IOSReferenceFrame {\n XArbitraryZVertical,\n XArbitraryCorrectedZVertical,\n XMagneticNorthZVertical,\n XTrueNorthZVertical,\n Auto,\n}\n\nexport interface NumericAnimation {\n current?: number;\n}\n\nexport type AnimationCallback = (\n finished?: boolean,\n current?: AnimatableValue\n) => void;\n\nexport type Timestamp = number;\n\nexport type Value3D = {\n x: number;\n y: number;\n z: number;\n interfaceOrientation: InterfaceOrientation;\n};\n\nexport type ValueRotation = {\n qw: number;\n qx: number;\n qy: number;\n qz: number;\n yaw: number;\n pitch: number;\n roll: number;\n interfaceOrientation: InterfaceOrientation;\n};\n\nexport enum InterfaceOrientation {\n ROTATION_0 = 0,\n ROTATION_90 = 90,\n ROTATION_180 = 180,\n ROTATION_270 = 270,\n}\n\nexport type ShadowNodeWrapper = object;\n\nexport enum KeyboardState {\n UNKNOWN = 0,\n OPENING = 1,\n OPEN = 2,\n CLOSING = 3,\n CLOSED = 4,\n}\n\nexport type AnimatedKeyboardInfo = {\n height: SharedValue<number>;\n state: SharedValue<KeyboardState>;\n};\n\nexport interface MeasuredDimensions {\n x: number;\n y: number;\n width: number;\n height: number;\n pageX: number;\n pageY: number;\n}\n\nexport interface AnimatedKeyboardOptions {\n isStatusBarTranslucentAndroid?: boolean;\n}\n"],"mappings":";;;;;;AAmDA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA,IAyFYA,UAAU,0BAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAA,OAAVA,UAAU;AAAA;AAAAC,OAAA,CAAAD,UAAA,GAAAA,UAAA;AAAA,IAOVE,iBAAiB,0BAAjBA,iBAAiB;EAAjBA,iBAAiB,CAAjBA,iBAAiB;EAAjBA,iBAAiB,CAAjBA,iBAAiB;EAAjBA,iBAAiB,CAAjBA,iBAAiB;EAAjBA,iBAAiB,CAAjBA,iBAAiB;EAAjBA,iBAAiB,CAAjBA,iBAAiB;EAAA,OAAjBA,iBAAiB;AAAA;AAAAD,OAAA,CAAAC,iBAAA,GAAAA,iBAAA;AAAA,IAqCjBC,oBAAoB,0BAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAAA,OAApBA,oBAAoB;AAAA;AAAAF,OAAA,CAAAE,oBAAA,GAAAA,oBAAA;AAAA,IASpBC,aAAa,0BAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAA,OAAbA,aAAa;AAAA;AAAAH,OAAA,CAAAG,aAAA,GAAAA,aAAA"}
|
|
@@ -4,25 +4,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
8
|
var _reactNative = require("react-native");
|
|
11
|
-
|
|
12
9
|
var _View = _interopRequireDefault(require("./View"));
|
|
13
|
-
|
|
14
10
|
var _createAnimatedComponent = _interopRequireDefault(require("../../createAnimatedComponent"));
|
|
15
|
-
|
|
16
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
-
|
|
18
12
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
|
-
|
|
20
13
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
|
-
|
|
22
14
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
23
|
-
|
|
24
15
|
const AnimatedFlatList = (0, _createAnimatedComponent.default)(_reactNative.FlatList);
|
|
25
|
-
|
|
26
16
|
const createCellRenderer = (itemLayoutAnimation, cellStyle) => {
|
|
27
17
|
const cellRenderer = props => {
|
|
28
18
|
return /*#__PURE__*/_react.default.createElement(_View.default, {
|
|
@@ -31,26 +21,21 @@ const createCellRenderer = (itemLayoutAnimation, cellStyle) => {
|
|
|
31
21
|
style: cellStyle
|
|
32
22
|
}, props.children);
|
|
33
23
|
};
|
|
34
|
-
|
|
35
24
|
return cellRenderer;
|
|
36
25
|
};
|
|
37
|
-
|
|
38
26
|
const ReanimatedFlatlist = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
39
27
|
const {
|
|
40
28
|
itemLayoutAnimation,
|
|
41
29
|
...restProps
|
|
42
30
|
} = props;
|
|
43
31
|
const cellStyle = restProps !== null && restProps !== void 0 && restProps.inverted ? restProps !== null && restProps !== void 0 && restProps.horizontal ? styles.horizontallyInverted : styles.verticallyInverted : undefined;
|
|
44
|
-
|
|
45
32
|
const cellRenderer = _react.default.useMemo(() => createCellRenderer(itemLayoutAnimation, cellStyle), [cellStyle]);
|
|
46
|
-
|
|
47
33
|
return /*#__PURE__*/_react.default.createElement(AnimatedFlatList, _extends({
|
|
48
34
|
ref: ref
|
|
49
35
|
}, restProps, {
|
|
50
36
|
CellRendererComponent: cellRenderer
|
|
51
37
|
}));
|
|
52
38
|
});
|
|
53
|
-
|
|
54
39
|
const styles = _reactNative.StyleSheet.create({
|
|
55
40
|
verticallyInverted: {
|
|
56
41
|
transform: [{
|
|
@@ -63,7 +48,6 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
63
48
|
}]
|
|
64
49
|
}
|
|
65
50
|
});
|
|
66
|
-
|
|
67
51
|
var _default = ReanimatedFlatlist;
|
|
68
52
|
exports.default = _default;
|
|
69
53
|
//# sourceMappingURL=FlatList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["AnimatedFlatList","createAnimatedComponent","FlatList","createCellRenderer","itemLayoutAnimation","cellStyle","cellRenderer","props","onLayout","children","ReanimatedFlatlist","forwardRef","ref","restProps","inverted","horizontal","styles","horizontallyInverted","verticallyInverted","undefined","React","useMemo","StyleSheet","create","transform","scaleY","scaleX"],"sources":["FlatList.tsx"],"sourcesContent":["import React, { ForwardedRef, forwardRef } from 'react';\nimport {\n FlatList,\n FlatListProps,\n LayoutChangeEvent,\n StyleSheet,\n} from 'react-native';\nimport ReanimatedView from './View';\nimport createAnimatedComponent from '../../createAnimatedComponent';\nimport { ILayoutAnimationBuilder } from '../layoutReanimation/animationBuilder/commonTypes';\nimport { StyleProps } from '../commonTypes';\n\nconst AnimatedFlatList = createAnimatedComponent(FlatList as any) as any;\n\ninterface AnimatedFlatListProps {\n onLayout: (event: LayoutChangeEvent) => void;\n // implicit `children` prop has been removed in @types/react^18.0.0\n children: React.ReactNode;\n inverted?: boolean;\n horizontal?: boolean;\n}\n\nconst createCellRenderer = (\n itemLayoutAnimation?: ILayoutAnimationBuilder,\n cellStyle?: StyleProps\n) => {\n const cellRenderer = (props: AnimatedFlatListProps) => {\n return (\n <ReanimatedView\n layout={itemLayoutAnimation}\n onLayout={props.onLayout}\n style={cellStyle}>\n {props.children}\n </ReanimatedView>\n );\n };\n\n return cellRenderer;\n};\n\nexport interface ReanimatedFlatListProps<ItemT> extends FlatListProps<ItemT> {\n itemLayoutAnimation?: ILayoutAnimationBuilder;\n}\n\ntype ReanimatedFlatListFC<T = any> = React.FC<ReanimatedFlatListProps<T>>;\n\nconst ReanimatedFlatlist: ReanimatedFlatListFC = forwardRef(\n (props: ReanimatedFlatListProps<any>, ref: ForwardedRef<FlatList>) => {\n const { itemLayoutAnimation, ...restProps } = props;\n\n const cellStyle = restProps?.inverted\n ? restProps?.horizontal\n ? styles.horizontallyInverted\n : styles.verticallyInverted\n : undefined;\n\n const cellRenderer = React.useMemo(\n () => createCellRenderer(itemLayoutAnimation, cellStyle),\n [cellStyle]\n );\n\n return (\n <AnimatedFlatList\n ref={ref}\n {...restProps}\n CellRendererComponent={cellRenderer}\n />\n );\n }\n);\n\nconst styles = StyleSheet.create({\n verticallyInverted: { transform: [{ scaleY: -1 }] },\n horizontallyInverted: { transform: [{ scaleX: -1 }] },\n});\n\nexport default ReanimatedFlatlist;\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_View","_interopRequireDefault","_createAnimatedComponent","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_extends","assign","bind","target","i","arguments","length","source","apply","AnimatedFlatList","createAnimatedComponent","FlatList","createCellRenderer","itemLayoutAnimation","cellStyle","cellRenderer","props","createElement","layout","onLayout","style","children","ReanimatedFlatlist","forwardRef","ref","restProps","inverted","horizontal","styles","horizontallyInverted","verticallyInverted","undefined","React","useMemo","CellRendererComponent","StyleSheet","create","transform","scaleY","scaleX","_default","exports"],"sources":["FlatList.tsx"],"sourcesContent":["import React, { ForwardedRef, forwardRef } from 'react';\nimport {\n FlatList,\n FlatListProps,\n LayoutChangeEvent,\n StyleSheet,\n} from 'react-native';\nimport ReanimatedView from './View';\nimport createAnimatedComponent from '../../createAnimatedComponent';\nimport { ILayoutAnimationBuilder } from '../layoutReanimation/animationBuilder/commonTypes';\nimport { StyleProps } from '../commonTypes';\n\nconst AnimatedFlatList = createAnimatedComponent(FlatList as any) as any;\n\ninterface AnimatedFlatListProps {\n onLayout: (event: LayoutChangeEvent) => void;\n // implicit `children` prop has been removed in @types/react^18.0.0\n children: React.ReactNode;\n inverted?: boolean;\n horizontal?: boolean;\n}\n\nconst createCellRenderer = (\n itemLayoutAnimation?: ILayoutAnimationBuilder,\n cellStyle?: StyleProps\n) => {\n const cellRenderer = (props: AnimatedFlatListProps) => {\n return (\n <ReanimatedView\n layout={itemLayoutAnimation}\n onLayout={props.onLayout}\n style={cellStyle}>\n {props.children}\n </ReanimatedView>\n );\n };\n\n return cellRenderer;\n};\n\nexport interface ReanimatedFlatListProps<ItemT> extends FlatListProps<ItemT> {\n itemLayoutAnimation?: ILayoutAnimationBuilder;\n}\n\ntype ReanimatedFlatListFC<T = any> = React.FC<ReanimatedFlatListProps<T>>;\n\nconst ReanimatedFlatlist: ReanimatedFlatListFC = forwardRef(\n (props: ReanimatedFlatListProps<any>, ref: ForwardedRef<FlatList>) => {\n const { itemLayoutAnimation, ...restProps } = props;\n\n const cellStyle = restProps?.inverted\n ? restProps?.horizontal\n ? styles.horizontallyInverted\n : styles.verticallyInverted\n : undefined;\n\n const cellRenderer = React.useMemo(\n () => createCellRenderer(itemLayoutAnimation, cellStyle),\n [cellStyle]\n );\n\n return (\n <AnimatedFlatList\n ref={ref}\n {...restProps}\n CellRendererComponent={cellRenderer}\n />\n );\n }\n);\n\nconst styles = StyleSheet.create({\n verticallyInverted: { transform: [{ scaleY: -1 }] },\n horizontallyInverted: { transform: [{ scaleX: -1 }] },\n});\n\nexport default ReanimatedFlatlist;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAMA,IAAAE,KAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,wBAAA,GAAAD,sBAAA,CAAAH,OAAA;AAAoE,SAAAG,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAV,wBAAAM,GAAA,EAAAI,WAAA,SAAAA,WAAA,IAAAJ,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAQ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AAC,CAAC;AAAC,IAAAC,QAAA,GAEYlB,kBAAkB;AAAAmB,OAAA,CAAA7D,OAAA,GAAA4D,QAAA"}
|
|
@@ -4,13 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _reactNative = require("react-native");
|
|
9
|
-
|
|
10
8
|
var _createAnimatedComponent = _interopRequireDefault(require("../../createAnimatedComponent"));
|
|
11
|
-
|
|
12
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
|
|
14
10
|
const AnimatedImage = (0, _createAnimatedComponent.default)(_reactNative.Image);
|
|
15
11
|
var _default = AnimatedImage;
|
|
16
12
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["AnimatedImage","createAnimatedComponent","Image"],"sources":["Image.ts"],"sourcesContent":["import { Image } from 'react-native';\nimport createAnimatedComponent from '../../createAnimatedComponent';\n\nconst AnimatedImage = createAnimatedComponent(Image as any);\n\nexport default AnimatedImage;\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_createAnimatedComponent","_interopRequireDefault","obj","__esModule","default","AnimatedImage","createAnimatedComponent","Image","_default","exports"],"sources":["Image.ts"],"sourcesContent":["import { Image } from 'react-native';\nimport createAnimatedComponent from '../../createAnimatedComponent';\n\nconst AnimatedImage = createAnimatedComponent(Image as any);\n\nexport default AnimatedImage;\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,wBAAA,GAAAC,sBAAA,CAAAF,OAAA;AAAoE,SAAAE,uBAAAC,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEpE,MAAMG,aAAa,GAAG,IAAAC,gCAAuB,EAACC,kBAAK,CAAQ;AAAC,IAAAC,QAAA,GAE7CH,aAAa;AAAAI,OAAA,CAAAL,OAAA,GAAAI,QAAA"}
|
|
@@ -4,13 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _reactNative = require("react-native");
|
|
9
|
-
|
|
10
8
|
var _createAnimatedComponent = _interopRequireDefault(require("../../createAnimatedComponent"));
|
|
11
|
-
|
|
12
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
|
|
14
10
|
const AnimatedScrollView = (0, _createAnimatedComponent.default)(_reactNative.ScrollView);
|
|
15
11
|
var _default = AnimatedScrollView;
|
|
16
12
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["AnimatedScrollView","createAnimatedComponent","ScrollView"],"sources":["ScrollView.ts"],"sourcesContent":["import { ScrollView } from 'react-native';\nimport createAnimatedComponent from '../../createAnimatedComponent';\n\nconst AnimatedScrollView = createAnimatedComponent(ScrollView);\n\nexport default AnimatedScrollView;\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_createAnimatedComponent","_interopRequireDefault","obj","__esModule","default","AnimatedScrollView","createAnimatedComponent","ScrollView","_default","exports"],"sources":["ScrollView.ts"],"sourcesContent":["import { ScrollView } from 'react-native';\nimport createAnimatedComponent from '../../createAnimatedComponent';\n\nconst AnimatedScrollView = createAnimatedComponent(ScrollView);\n\nexport default AnimatedScrollView;\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,wBAAA,GAAAC,sBAAA,CAAAF,OAAA;AAAoE,SAAAE,uBAAAC,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEpE,MAAMG,kBAAkB,GAAG,IAAAC,gCAAuB,EAACC,uBAAU,CAAC;AAAC,IAAAC,QAAA,GAEhDH,kBAAkB;AAAAI,OAAA,CAAAL,OAAA,GAAAI,QAAA"}
|
|
@@ -4,13 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _reactNative = require("react-native");
|
|
9
|
-
|
|
10
8
|
var _createAnimatedComponent = _interopRequireDefault(require("../../createAnimatedComponent"));
|
|
11
|
-
|
|
12
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
|
|
14
10
|
const AnimatedText = (0, _createAnimatedComponent.default)(_reactNative.Text);
|
|
15
11
|
var _default = AnimatedText;
|
|
16
12
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["AnimatedText","createAnimatedComponent","Text"],"sources":["Text.ts"],"sourcesContent":["import { Text } from 'react-native';\nimport createAnimatedComponent from '../../createAnimatedComponent';\n\nconst AnimatedText = createAnimatedComponent(Text as any);\n\nexport default AnimatedText;\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_createAnimatedComponent","_interopRequireDefault","obj","__esModule","default","AnimatedText","createAnimatedComponent","Text","_default","exports"],"sources":["Text.ts"],"sourcesContent":["import { Text } from 'react-native';\nimport createAnimatedComponent from '../../createAnimatedComponent';\n\nconst AnimatedText = createAnimatedComponent(Text as any);\n\nexport default AnimatedText;\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,wBAAA,GAAAC,sBAAA,CAAAF,OAAA;AAAoE,SAAAE,uBAAAC,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEpE,MAAMG,YAAY,GAAG,IAAAC,gCAAuB,EAACC,iBAAI,CAAQ;AAAC,IAAAC,QAAA,GAE3CH,YAAY;AAAAI,OAAA,CAAAL,OAAA,GAAAI,QAAA"}
|
|
@@ -4,13 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _reactNative = require("react-native");
|
|
9
|
-
|
|
10
8
|
var _createAnimatedComponent = _interopRequireDefault(require("../../createAnimatedComponent"));
|
|
11
|
-
|
|
12
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
|
|
14
10
|
const AnimatedView = (0, _createAnimatedComponent.default)(_reactNative.View);
|
|
15
11
|
var _default = AnimatedView;
|
|
16
12
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["AnimatedView","createAnimatedComponent","View"],"sources":["View.ts"],"sourcesContent":["import { View } from 'react-native';\nimport createAnimatedComponent from '../../createAnimatedComponent';\n\nconst AnimatedView = createAnimatedComponent(View);\n\nexport default AnimatedView;\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_createAnimatedComponent","_interopRequireDefault","obj","__esModule","default","AnimatedView","createAnimatedComponent","View","_default","exports"],"sources":["View.ts"],"sourcesContent":["import { View } from 'react-native';\nimport createAnimatedComponent from '../../createAnimatedComponent';\n\nconst AnimatedView = createAnimatedComponent(View);\n\nexport default AnimatedView;\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,wBAAA,GAAAC,sBAAA,CAAAF,OAAA;AAAoE,SAAAE,uBAAAC,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEpE,MAAMG,YAAY,GAAG,IAAAC,gCAAuB,EAACC,iBAAI,CAAC;AAAC,IAAAC,QAAA,GAEpCH,YAAY;AAAAI,OAAA,CAAAL,OAAA,GAAAI,QAAA"}
|