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
|
@@ -4,15 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.useFrameCallback = useFrameCallback;
|
|
7
|
-
|
|
8
7
|
var _react = require("react");
|
|
9
|
-
|
|
10
8
|
var _FrameCallbackRegistryJS = _interopRequireDefault(require("../frameCallback/FrameCallbackRegistryJS"));
|
|
11
|
-
|
|
12
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
|
|
14
10
|
const frameCallbackRegistry = new _FrameCallbackRegistryJS.default();
|
|
15
|
-
|
|
16
11
|
function useFrameCallback(callback) {
|
|
17
12
|
let autostart = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
18
13
|
const ref = (0, _react.useRef)({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["frameCallbackRegistry","FrameCallbackRegistryJS","useFrameCallback","callback","autostart","ref","useRef","setActive","isActive","manageStateFrameCallback","current","callbackId","useEffect","registerFrameCallback","unregisterFrameCallback"],"sources":["useFrameCallback.ts"],"sourcesContent":["import { useEffect, useRef } from 'react';\nimport FrameCallbackRegistryJS from '../frameCallback/FrameCallbackRegistryJS';\nimport { FrameInfo } from '../frameCallback/FrameCallbackRegistryUI';\n\nexport type FrameCallback = {\n setActive: (isActive: boolean) => void;\n isActive: boolean;\n callbackId: number;\n};\nconst frameCallbackRegistry = new FrameCallbackRegistryJS();\n\nexport function useFrameCallback(\n callback: (frameInfo: FrameInfo) => void,\n autostart = true\n): FrameCallback {\n const ref = useRef<FrameCallback>({\n setActive: (isActive: boolean) => {\n frameCallbackRegistry.manageStateFrameCallback(\n ref.current.callbackId,\n isActive\n );\n ref.current.isActive = isActive;\n },\n isActive: autostart,\n callbackId: -1,\n });\n\n useEffect(() => {\n ref.current.callbackId =\n frameCallbackRegistry.registerFrameCallback(callback);\n ref.current.setActive(ref.current.isActive);\n\n return () => {\n frameCallbackRegistry.unregisterFrameCallback(ref.current.callbackId);\n ref.current.callbackId = -1;\n };\n }, [callback, autostart]);\n\n return ref.current;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_react","require","_FrameCallbackRegistryJS","_interopRequireDefault","obj","__esModule","default","frameCallbackRegistry","FrameCallbackRegistryJS","useFrameCallback","callback","autostart","arguments","length","undefined","ref","useRef","setActive","isActive","manageStateFrameCallback","current","callbackId","useEffect","registerFrameCallback","unregisterFrameCallback"],"sources":["useFrameCallback.ts"],"sourcesContent":["import { useEffect, useRef } from 'react';\nimport FrameCallbackRegistryJS from '../frameCallback/FrameCallbackRegistryJS';\nimport { FrameInfo } from '../frameCallback/FrameCallbackRegistryUI';\n\nexport type FrameCallback = {\n setActive: (isActive: boolean) => void;\n isActive: boolean;\n callbackId: number;\n};\nconst frameCallbackRegistry = new FrameCallbackRegistryJS();\n\nexport function useFrameCallback(\n callback: (frameInfo: FrameInfo) => void,\n autostart = true\n): FrameCallback {\n const ref = useRef<FrameCallback>({\n setActive: (isActive: boolean) => {\n frameCallbackRegistry.manageStateFrameCallback(\n ref.current.callbackId,\n isActive\n );\n ref.current.isActive = isActive;\n },\n isActive: autostart,\n callbackId: -1,\n });\n\n useEffect(() => {\n ref.current.callbackId =\n frameCallbackRegistry.registerFrameCallback(callback);\n ref.current.setActive(ref.current.isActive);\n\n return () => {\n frameCallbackRegistry.unregisterFrameCallback(ref.current.callbackId);\n ref.current.callbackId = -1;\n };\n }, [callback, autostart]);\n\n return ref.current;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,wBAAA,GAAAC,sBAAA,CAAAF,OAAA;AAA+E,SAAAE,uBAAAC,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAQ/E,MAAMG,qBAAqB,GAAG,IAAIC,gCAAuB,EAAE;AAEpD,SAASC,gBAAgBA,CAC9BC,QAAwC,EAEzB;EAAA,IADfC,SAAS,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,IAAI;EAEhB,MAAMG,GAAG,GAAG,IAAAC,aAAM,EAAgB;IAChCC,SAAS,EAAGC,QAAiB,IAAK;MAChCX,qBAAqB,CAACY,wBAAwB,CAC5CJ,GAAG,CAACK,OAAO,CAACC,UAAU,EACtBH,QAAQ,CACT;MACDH,GAAG,CAACK,OAAO,CAACF,QAAQ,GAAGA,QAAQ;IACjC,CAAC;IACDA,QAAQ,EAAEP,SAAS;IACnBU,UAAU,EAAE,CAAC;EACf,CAAC,CAAC;EAEF,IAAAC,gBAAS,EAAC,MAAM;IACdP,GAAG,CAACK,OAAO,CAACC,UAAU,GACpBd,qBAAqB,CAACgB,qBAAqB,CAACb,QAAQ,CAAC;IACvDK,GAAG,CAACK,OAAO,CAACH,SAAS,CAACF,GAAG,CAACK,OAAO,CAACF,QAAQ,CAAC;IAE3C,OAAO,MAAM;MACXX,qBAAqB,CAACiB,uBAAuB,CAACT,GAAG,CAACK,OAAO,CAACC,UAAU,CAAC;MACrEN,GAAG,CAACK,OAAO,CAACC,UAAU,GAAG,CAAC,CAAC;IAC7B,CAAC;EACH,CAAC,EAAE,CAACX,QAAQ,EAAEC,SAAS,CAAC,CAAC;EAEzB,OAAOI,GAAG,CAACK,OAAO;AACpB"}
|
|
@@ -4,17 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.useScrollViewOffset = useScrollViewOffset;
|
|
7
|
-
|
|
8
7
|
var _react = require("react");
|
|
9
|
-
|
|
10
8
|
var _reactNative = require("react-native");
|
|
11
|
-
|
|
12
9
|
var _utils = require("./utils");
|
|
13
|
-
|
|
14
10
|
var _useSharedValue = require("./useSharedValue");
|
|
15
|
-
|
|
16
11
|
const scrollEventNames = ['onScroll', 'onScrollBeginDrag', 'onScrollEndDrag', 'onMomentumScrollBegin', 'onMomentumScrollEnd'];
|
|
17
|
-
|
|
18
12
|
function useScrollViewOffset(aref) {
|
|
19
13
|
const offsetRef = (0, _react.useRef)((0, _useSharedValue.useSharedValue)(0));
|
|
20
14
|
const event = (0, _utils.useEvent)(event => {
|
|
@@ -24,7 +18,6 @@ function useScrollViewOffset(aref) {
|
|
|
24
18
|
}, scrollEventNames);
|
|
25
19
|
(0, _react.useEffect)(() => {
|
|
26
20
|
var _event$current;
|
|
27
|
-
|
|
28
21
|
const viewTag = (0, _reactNative.findNodeHandle)(aref.current);
|
|
29
22
|
(_event$current = event.current) === null || _event$current === void 0 ? void 0 : _event$current.registerForEvents(viewTag);
|
|
30
23
|
}, [aref.current]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["scrollEventNames","useScrollViewOffset","aref","offsetRef","useRef","useSharedValue","event","useEvent","current","value","contentOffset","x","y","useEffect","viewTag","findNodeHandle","registerForEvents"],"sources":["useScrollViewOffset.ts"],"sourcesContent":["import { RefObject, useEffect, useRef } from 'react';\n\nimport type Animated from 'react-native-reanimated';\nimport { ScrollEvent } from './useAnimatedScrollHandler';\nimport { SharedValue } from '../commonTypes';\nimport { findNodeHandle } from 'react-native';\nimport { useEvent } from './utils';\nimport { useSharedValue } from './useSharedValue';\n\nconst scrollEventNames = [\n 'onScroll',\n 'onScrollBeginDrag',\n 'onScrollEndDrag',\n 'onMomentumScrollBegin',\n 'onMomentumScrollEnd',\n];\n\nexport function useScrollViewOffset(\n aref: RefObject<Animated.ScrollView>\n): SharedValue<number> {\n const offsetRef = useRef(useSharedValue(0));\n\n const event = useEvent<ScrollEvent>((event: ScrollEvent) => {\n 'worklet';\n offsetRef.current.value =\n event.contentOffset.x === 0\n ? event.contentOffset.y\n : event.contentOffset.x;\n }, scrollEventNames);\n\n useEffect(() => {\n const viewTag = findNodeHandle(aref.current);\n event.current?.registerForEvents(viewTag as number);\n }, [aref.current]);\n\n return offsetRef.current;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_utils","_useSharedValue","scrollEventNames","useScrollViewOffset","aref","offsetRef","useRef","useSharedValue","event","useEvent","current","value","contentOffset","x","y","useEffect","_event$current","viewTag","findNodeHandle","registerForEvents"],"sources":["useScrollViewOffset.ts"],"sourcesContent":["import { RefObject, useEffect, useRef } from 'react';\n\nimport type Animated from 'react-native-reanimated';\nimport { ScrollEvent } from './useAnimatedScrollHandler';\nimport { SharedValue } from '../commonTypes';\nimport { findNodeHandle } from 'react-native';\nimport { useEvent } from './utils';\nimport { useSharedValue } from './useSharedValue';\n\nconst scrollEventNames = [\n 'onScroll',\n 'onScrollBeginDrag',\n 'onScrollEndDrag',\n 'onMomentumScrollBegin',\n 'onMomentumScrollEnd',\n];\n\nexport function useScrollViewOffset(\n aref: RefObject<Animated.ScrollView>\n): SharedValue<number> {\n const offsetRef = useRef(useSharedValue(0));\n\n const event = useEvent<ScrollEvent>((event: ScrollEvent) => {\n 'worklet';\n offsetRef.current.value =\n event.contentOffset.x === 0\n ? event.contentOffset.y\n : event.contentOffset.x;\n }, scrollEventNames);\n\n useEffect(() => {\n const viewTag = findNodeHandle(aref.current);\n event.current?.registerForEvents(viewTag as number);\n }, [aref.current]);\n\n return offsetRef.current;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAKA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,eAAA,GAAAH,OAAA;AAEA,MAAMI,gBAAgB,GAAG,CACvB,UAAU,EACV,mBAAmB,EACnB,iBAAiB,EACjB,uBAAuB,EACvB,qBAAqB,CACtB;AAEM,SAASC,mBAAmBA,CACjCC,IAAoC,EACf;EACrB,MAAMC,SAAS,GAAG,IAAAC,aAAM,EAAC,IAAAC,8BAAc,EAAC,CAAC,CAAC,CAAC;EAE3C,MAAMC,KAAK,GAAG,IAAAC,eAAQ,EAAeD,KAAkB,IAAK;IAC1D,SAAS;;IACTH,SAAS,CAACK,OAAO,CAACC,KAAK,GACrBH,KAAK,CAACI,aAAa,CAACC,CAAC,KAAK,CAAC,GACvBL,KAAK,CAACI,aAAa,CAACE,CAAC,GACrBN,KAAK,CAACI,aAAa,CAACC,CAAC;EAC7B,CAAC,EAAEX,gBAAgB,CAAC;EAEpB,IAAAa,gBAAS,EAAC,MAAM;IAAA,IAAAC,cAAA;IACd,MAAMC,OAAO,GAAG,IAAAC,2BAAc,EAACd,IAAI,CAACM,OAAO,CAAC;IAC5C,CAAAM,cAAA,GAAAR,KAAK,CAACE,OAAO,cAAAM,cAAA,uBAAbA,cAAA,CAAeG,iBAAiB,CAACF,OAAO,CAAW;EACrD,CAAC,EAAE,CAACb,IAAI,CAACM,OAAO,CAAC,CAAC;EAElB,OAAOL,SAAS,CAACK,OAAO;AAC1B"}
|
|
@@ -4,28 +4,23 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.useSharedValue = useSharedValue;
|
|
7
|
-
|
|
8
7
|
var _react = require("react");
|
|
9
|
-
|
|
10
8
|
var _animation = require("../animation");
|
|
11
|
-
|
|
12
9
|
var _core = require("../core");
|
|
13
|
-
|
|
14
10
|
function useSharedValue(init) {
|
|
15
11
|
let oneWayReadsOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
16
12
|
const ref = (0, _react.useRef)((0, _core.makeMutable)(init, oneWayReadsOnly));
|
|
17
|
-
|
|
18
13
|
if (ref.current === null) {
|
|
19
14
|
ref.current = (0, _core.makeMutable)(init, oneWayReadsOnly);
|
|
20
15
|
}
|
|
21
|
-
|
|
22
16
|
(0, _react.useEffect)(() => {
|
|
23
17
|
return () => {
|
|
24
18
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
25
19
|
(0, _animation.cancelAnimation)(ref.current);
|
|
26
20
|
};
|
|
27
|
-
}, []);
|
|
21
|
+
}, []);
|
|
28
22
|
|
|
23
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
29
24
|
return ref.current;
|
|
30
25
|
}
|
|
31
26
|
//# sourceMappingURL=useSharedValue.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useSharedValue","init","oneWayReadsOnly","ref","useRef","makeMutable","current","useEffect","cancelAnimation"],"sources":["useSharedValue.ts"],"sourcesContent":["import { useEffect, useRef } from 'react';\nimport { cancelAnimation } from '../animation';\nimport { SharedValue } from '../commonTypes';\nimport { makeMutable } from '../core';\n\nexport function useSharedValue<T>(\n init: T,\n oneWayReadsOnly = false\n): SharedValue<T> {\n const ref = useRef<SharedValue<T>>(makeMutable(init, oneWayReadsOnly));\n\n if (ref.current === null) {\n ref.current = makeMutable(init, oneWayReadsOnly);\n }\n\n useEffect(() => {\n return () => {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n cancelAnimation(ref.current!);\n };\n }, []);\n\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return ref.current!;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_react","require","_animation","_core","useSharedValue","init","oneWayReadsOnly","arguments","length","undefined","ref","useRef","makeMutable","current","useEffect","cancelAnimation"],"sources":["useSharedValue.ts"],"sourcesContent":["import { useEffect, useRef } from 'react';\nimport { cancelAnimation } from '../animation';\nimport { SharedValue } from '../commonTypes';\nimport { makeMutable } from '../core';\n\nexport function useSharedValue<T>(\n init: T,\n oneWayReadsOnly = false\n): SharedValue<T> {\n const ref = useRef<SharedValue<T>>(makeMutable(init, oneWayReadsOnly));\n\n if (ref.current === null) {\n ref.current = makeMutable(init, oneWayReadsOnly);\n }\n\n useEffect(() => {\n return () => {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n cancelAnimation(ref.current!);\n };\n }, []);\n\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return ref.current!;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAEA,IAAAE,KAAA,GAAAF,OAAA;AAEO,SAASG,cAAcA,CAC5BC,IAAO,EAES;EAAA,IADhBC,eAAe,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,KAAK;EAEvB,MAAMG,GAAG,GAAG,IAAAC,aAAM,EAAiB,IAAAC,iBAAW,EAACP,IAAI,EAAEC,eAAe,CAAC,CAAC;EAEtE,IAAII,GAAG,CAACG,OAAO,KAAK,IAAI,EAAE;IACxBH,GAAG,CAACG,OAAO,GAAG,IAAAD,iBAAW,EAACP,IAAI,EAAEC,eAAe,CAAC;EAClD;EAEA,IAAAQ,gBAAS,EAAC,MAAM;IACd,OAAO,MAAM;MACX;MACA,IAAAC,0BAAe,EAACL,GAAG,CAACG,OAAO,CAAE;IAC/B,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;;EAEN;EACA,OAAOH,GAAG,CAACG,OAAO;AACpB"}
|
|
@@ -13,45 +13,32 @@ exports.shallowEqual = shallowEqual;
|
|
|
13
13
|
exports.useEvent = useEvent;
|
|
14
14
|
exports.useHandler = useHandler;
|
|
15
15
|
exports.validateAnimatedStyles = void 0;
|
|
16
|
-
|
|
17
16
|
var _react = require("react");
|
|
18
|
-
|
|
19
17
|
var _Colors = require("../Colors");
|
|
20
|
-
|
|
21
18
|
var _core = require("../core");
|
|
22
|
-
|
|
23
19
|
var _PlatformChecker = require("../PlatformChecker");
|
|
24
|
-
|
|
25
20
|
var _UpdateProps = require("../UpdateProps");
|
|
26
|
-
|
|
27
21
|
var _WorkletEventHandler = _interopRequireDefault(require("../WorkletEventHandler"));
|
|
28
|
-
|
|
29
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
30
|
-
|
|
31
23
|
function useEvent(handler) {
|
|
32
24
|
let eventNames = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
33
25
|
let rebuild = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
34
26
|
const initRef = (0, _react.useRef)(null);
|
|
35
|
-
|
|
36
27
|
if (initRef.current === null) {
|
|
37
28
|
initRef.current = new _WorkletEventHandler.default(handler, eventNames);
|
|
38
29
|
} else if (rebuild) {
|
|
39
30
|
initRef.current.updateWorklet(handler);
|
|
40
31
|
}
|
|
41
|
-
|
|
42
32
|
return initRef;
|
|
43
33
|
}
|
|
44
|
-
|
|
45
34
|
function useHandler(handlers, dependencies) {
|
|
46
35
|
const initRef = (0, _react.useRef)(null);
|
|
47
|
-
|
|
48
36
|
if (initRef.current === null) {
|
|
49
37
|
initRef.current = {
|
|
50
38
|
context: (0, _core.makeRemote)({}),
|
|
51
39
|
savedDependencies: []
|
|
52
40
|
};
|
|
53
41
|
}
|
|
54
|
-
|
|
55
42
|
(0, _react.useEffect)(() => {
|
|
56
43
|
return () => {
|
|
57
44
|
initRef.current = null;
|
|
@@ -70,18 +57,18 @@ function useHandler(handlers, dependencies) {
|
|
|
70
57
|
doDependenciesDiffer,
|
|
71
58
|
useWeb
|
|
72
59
|
};
|
|
73
|
-
}
|
|
74
|
-
|
|
60
|
+
}
|
|
75
61
|
|
|
62
|
+
// builds one big hash from multiple worklets' hashes
|
|
76
63
|
function buildWorkletsHash(handlers) {
|
|
77
|
-
return Object.values(handlers).reduce((acc, worklet) =>
|
|
64
|
+
return Object.values(handlers).reduce((acc, worklet) =>
|
|
65
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
78
66
|
acc + worklet.__workletHash.toString(), '');
|
|
79
|
-
}
|
|
80
|
-
|
|
67
|
+
}
|
|
81
68
|
|
|
69
|
+
// builds dependencies array for gesture handlers
|
|
82
70
|
function buildDependencies(dependencies, handlers) {
|
|
83
71
|
const handlersList = Object.values(handlers).filter(handler => handler !== undefined);
|
|
84
|
-
|
|
85
72
|
if (!dependencies) {
|
|
86
73
|
dependencies = handlersList.map(handler => {
|
|
87
74
|
return {
|
|
@@ -92,11 +79,10 @@ function buildDependencies(dependencies, handlers) {
|
|
|
92
79
|
} else {
|
|
93
80
|
dependencies.push(buildWorkletsHash(handlersList));
|
|
94
81
|
}
|
|
95
|
-
|
|
96
82
|
return dependencies;
|
|
97
|
-
}
|
|
98
|
-
|
|
83
|
+
}
|
|
99
84
|
|
|
85
|
+
// this is supposed to work as useEffect comparison
|
|
100
86
|
function areDependenciesEqual(nextDeps, prevDeps) {
|
|
101
87
|
function is(x, y) {
|
|
102
88
|
/* eslint-disable no-self-compare */
|
|
@@ -105,36 +91,28 @@ function areDependenciesEqual(nextDeps, prevDeps) {
|
|
|
105
91
|
}
|
|
106
92
|
|
|
107
93
|
const objectIs = typeof Object.is === 'function' ? Object.is : is;
|
|
108
|
-
|
|
109
94
|
function areHookInputsEqual(nextDeps, prevDeps) {
|
|
110
95
|
if (!nextDeps || !prevDeps || prevDeps.length !== nextDeps.length) {
|
|
111
96
|
return false;
|
|
112
97
|
}
|
|
113
|
-
|
|
114
98
|
for (let i = 0; i < prevDeps.length; ++i) {
|
|
115
99
|
if (!objectIs(nextDeps[i], prevDeps[i])) {
|
|
116
100
|
return false;
|
|
117
101
|
}
|
|
118
102
|
}
|
|
119
|
-
|
|
120
103
|
return true;
|
|
121
104
|
}
|
|
122
|
-
|
|
123
105
|
return areHookInputsEqual(nextDeps, prevDeps);
|
|
124
106
|
}
|
|
125
|
-
|
|
126
107
|
function hasColorProps(updates) {
|
|
127
108
|
const colorPropsSet = new Set(_UpdateProps.colorProps);
|
|
128
|
-
|
|
129
109
|
for (const key in updates) {
|
|
130
110
|
if (colorPropsSet.has(key)) {
|
|
131
111
|
return true;
|
|
132
112
|
}
|
|
133
113
|
}
|
|
134
|
-
|
|
135
114
|
return false;
|
|
136
115
|
}
|
|
137
|
-
|
|
138
116
|
function parseColors(updates) {
|
|
139
117
|
'worklet';
|
|
140
118
|
|
|
@@ -143,14 +121,12 @@ function parseColors(updates) {
|
|
|
143
121
|
// value could be an animation in which case processColor will recognize it and will return undefined
|
|
144
122
|
// -> in such a case we don't want to override style of that key
|
|
145
123
|
const processedColor = (0, _Colors.processColor)(updates[key]);
|
|
146
|
-
|
|
147
124
|
if (processedColor !== undefined) {
|
|
148
125
|
updates[key] = processedColor;
|
|
149
126
|
}
|
|
150
127
|
}
|
|
151
128
|
}
|
|
152
129
|
}
|
|
153
|
-
|
|
154
130
|
function isAnimated(prop) {
|
|
155
131
|
'worklet';
|
|
156
132
|
|
|
@@ -163,29 +139,23 @@ function isAnimated(prop) {
|
|
|
163
139
|
return Object.values(prop).some(isAnimated);
|
|
164
140
|
}
|
|
165
141
|
}
|
|
166
|
-
|
|
167
142
|
return false;
|
|
168
143
|
}
|
|
169
|
-
|
|
170
144
|
function shallowEqual(a, b) {
|
|
171
145
|
'worklet';
|
|
172
146
|
|
|
173
147
|
const aKeys = Object.keys(a);
|
|
174
148
|
const bKeys = Object.keys(b);
|
|
175
|
-
|
|
176
149
|
if (aKeys.length !== bKeys.length) {
|
|
177
150
|
return false;
|
|
178
151
|
}
|
|
179
|
-
|
|
180
152
|
for (let i = 0; i < aKeys.length; i++) {
|
|
181
153
|
if (a[aKeys[i]] !== b[aKeys[i]]) {
|
|
182
154
|
return false;
|
|
183
155
|
}
|
|
184
156
|
}
|
|
185
|
-
|
|
186
157
|
return true;
|
|
187
158
|
}
|
|
188
|
-
|
|
189
159
|
const validateAnimatedStyles = styles => {
|
|
190
160
|
'worklet';
|
|
191
161
|
|
|
@@ -195,6 +165,5 @@ const validateAnimatedStyles = styles => {
|
|
|
195
165
|
throw new Error('useAnimatedStyle has to return an object and cannot return static styles combined with dynamic ones. Please do merging where a component receives props.');
|
|
196
166
|
}
|
|
197
167
|
};
|
|
198
|
-
|
|
199
168
|
exports.validateAnimatedStyles = validateAnimatedStyles;
|
|
200
169
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useEvent","handler","eventNames","rebuild","initRef","useRef","current","WorkletEventHandler","updateWorklet","useHandler","handlers","dependencies","context","makeRemote","savedDependencies","useEffect","buildDependencies","doDependenciesDiffer","areDependenciesEqual","useWeb","isWeb","isJest","buildWorkletsHash","Object","values","reduce","acc","worklet","__workletHash","toString","handlersList","filter","undefined","map","workletHash","closure","_closure","push","nextDeps","prevDeps","is","x","y","objectIs","areHookInputsEqual","length","i","hasColorProps","updates","colorPropsSet","Set","colorProps","key","has","parseColors","indexOf","processedColor","processColor","isAnimated","prop","Array","isArray","some","onFrame","shallowEqual","a","b","aKeys","keys","bKeys","validateAnimatedStyles","styles","Error"],"sources":["utils.ts"],"sourcesContent":["import { MutableRefObject, useEffect, useRef } from 'react';\nimport { processColor } from '../Colors';\nimport {\n AnimatedStyle,\n Context,\n NativeEvent,\n NestedObjectValues,\n WorkletFunction,\n AnimationObject,\n} from '../commonTypes';\nimport { makeRemote } from '../core';\nimport { isWeb, isJest } from '../PlatformChecker';\nimport { colorProps } from '../UpdateProps';\nimport WorkletEventHandler from '../WorkletEventHandler';\nimport { ContextWithDependencies, DependencyList } from './commonTypes';\n\ninterface Handler<T, TContext extends Context> extends WorkletFunction {\n (event: T, context: TContext): void;\n}\n\ninterface Handlers<T, TContext extends Context> {\n [key: string]: Handler<T, TContext> | undefined;\n}\n\nexport interface UseHandlerContext<TContext extends Context> {\n context: TContext;\n doDependenciesDiffer: boolean;\n useWeb: boolean;\n}\n\nexport function useEvent<T extends NativeEvent<T>>(\n handler: (event: T) => void,\n eventNames: string[] = [],\n rebuild = false\n): MutableRefObject<WorkletEventHandler<T> | null> {\n const initRef = useRef<WorkletEventHandler<T> | null>(null);\n if (initRef.current === null) {\n initRef.current = new WorkletEventHandler(handler, eventNames);\n } else if (rebuild) {\n initRef.current.updateWorklet(handler);\n }\n\n return initRef;\n}\n\nexport function useHandler<T, TContext extends Context>(\n handlers: Handlers<T, TContext>,\n dependencies?: DependencyList\n): UseHandlerContext<TContext> {\n const initRef = useRef<ContextWithDependencies<TContext> | null>(null);\n if (initRef.current === null) {\n initRef.current = {\n context: makeRemote<TContext>({} as TContext),\n savedDependencies: [],\n };\n }\n\n useEffect(() => {\n return () => {\n initRef.current = null;\n };\n }, []);\n\n const { context, savedDependencies } = initRef.current;\n\n dependencies = buildDependencies(dependencies, handlers);\n\n const doDependenciesDiffer = !areDependenciesEqual(\n dependencies,\n savedDependencies\n );\n initRef.current.savedDependencies = dependencies;\n const useWeb = isWeb() || isJest();\n\n return { context, doDependenciesDiffer, useWeb };\n}\n\n// builds one big hash from multiple worklets' hashes\nexport function buildWorkletsHash(\n handlers: Record<string, WorkletFunction> | Array<WorkletFunction>\n): string {\n return Object.values(handlers).reduce(\n (acc: string, worklet: WorkletFunction) =>\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n acc + worklet.__workletHash!.toString(),\n ''\n );\n}\n\n// builds dependencies array for gesture handlers\nexport function buildDependencies(\n dependencies: DependencyList,\n handlers: Record<string, WorkletFunction | undefined>\n): Array<unknown> {\n const handlersList: WorkletFunction[] = Object.values(handlers).filter(\n (handler) => handler !== undefined\n ) as WorkletFunction[];\n if (!dependencies) {\n dependencies = handlersList.map((handler) => {\n return {\n workletHash: handler.__workletHash,\n closure: handler._closure,\n };\n });\n } else {\n dependencies.push(buildWorkletsHash(handlersList));\n }\n return dependencies;\n}\n\n// this is supposed to work as useEffect comparison\nexport function areDependenciesEqual(\n nextDeps: DependencyList,\n prevDeps: DependencyList\n): boolean {\n function is(x: number, y: number) {\n /* eslint-disable no-self-compare */\n return (x === y && (x !== 0 || 1 / x === 1 / y)) || (x !== x && y !== y);\n /* eslint-enable no-self-compare */\n }\n const objectIs: (nextDeps: unknown, prevDeps: unknown) => boolean =\n typeof Object.is === 'function' ? Object.is : is;\n\n function areHookInputsEqual(\n nextDeps: DependencyList,\n prevDeps: DependencyList\n ): boolean {\n if (!nextDeps || !prevDeps || prevDeps.length !== nextDeps.length) {\n return false;\n }\n for (let i = 0; i < prevDeps.length; ++i) {\n if (!objectIs(nextDeps[i], prevDeps[i])) {\n return false;\n }\n }\n return true;\n }\n\n return areHookInputsEqual(nextDeps, prevDeps);\n}\n\nexport function hasColorProps(updates: AnimatedStyle): boolean {\n const colorPropsSet = new Set(colorProps);\n for (const key in updates) {\n if (colorPropsSet.has(key)) {\n return true;\n }\n }\n return false;\n}\n\nexport function parseColors(updates: AnimatedStyle): void {\n 'worklet';\n for (const key in updates) {\n if (colorProps.indexOf(key) !== -1) {\n // value could be an animation in which case processColor will recognize it and will return undefined\n // -> in such a case we don't want to override style of that key\n const processedColor = processColor(updates[key]);\n if (processedColor !== undefined) {\n updates[key] = processedColor;\n }\n }\n }\n}\n\nexport function isAnimated(prop: NestedObjectValues<AnimationObject>): boolean {\n 'worklet';\n if (Array.isArray(prop)) {\n return prop.some(isAnimated);\n } else if (typeof prop === 'object') {\n if (prop.onFrame !== undefined) {\n return true;\n } else {\n return Object.values(prop).some(isAnimated);\n }\n }\n return false;\n}\n\nexport function shallowEqual(a: any, b: any) {\n 'worklet';\n const aKeys = Object.keys(a);\n const bKeys = Object.keys(b);\n if (aKeys.length !== bKeys.length) {\n return false;\n }\n for (let i = 0; i < aKeys.length; i++) {\n if (a[aKeys[i]] !== b[aKeys[i]]) {\n return false;\n }\n }\n return true;\n}\n\nexport const validateAnimatedStyles = (styles: AnimatedStyle): void => {\n 'worklet';\n if (typeof styles !== 'object') {\n throw new Error(\n `useAnimatedStyle has to return an object, found ${typeof styles} instead`\n );\n } else if (Array.isArray(styles)) {\n throw new Error(\n 'useAnimatedStyle has to return an object and cannot return static styles combined with dynamic ones. Please do merging where a component receives props.'\n );\n }\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;;AACA;;AASA;;AACA;;AACA;;AACA;;;;AAiBO,SAASA,QAAT,CACLC,OADK,EAI4C;EAAA,IAFjDC,UAEiD,uEAF1B,EAE0B;EAAA,IADjDC,OACiD,uEADvC,KACuC;EACjD,MAAMC,OAAO,GAAG,IAAAC,aAAA,EAAsC,IAAtC,CAAhB;;EACA,IAAID,OAAO,CAACE,OAAR,KAAoB,IAAxB,EAA8B;IAC5BF,OAAO,CAACE,OAAR,GAAkB,IAAIC,4BAAJ,CAAwBN,OAAxB,EAAiCC,UAAjC,CAAlB;EACD,CAFD,MAEO,IAAIC,OAAJ,EAAa;IAClBC,OAAO,CAACE,OAAR,CAAgBE,aAAhB,CAA8BP,OAA9B;EACD;;EAED,OAAOG,OAAP;AACD;;AAEM,SAASK,UAAT,CACLC,QADK,EAELC,YAFK,EAGwB;EAC7B,MAAMP,OAAO,GAAG,IAAAC,aAAA,EAAiD,IAAjD,CAAhB;;EACA,IAAID,OAAO,CAACE,OAAR,KAAoB,IAAxB,EAA8B;IAC5BF,OAAO,CAACE,OAAR,GAAkB;MAChBM,OAAO,EAAE,IAAAC,gBAAA,EAAqB,EAArB,CADO;MAEhB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,KAAgBoB,CAAC,CAACC,KAAK,CAACrB,CAAD,CAAN,CAArB,EAAiC;MAC/B,OAAO,KAAP;IACD;EACF;;EACD,OAAO,IAAP;AACD;;AAEM,MAAMwB,sBAAsB,GAAIC,MAAD,IAAiC;EACrE;;EACA,IAAI,OAAOA,MAAP,KAAkB,QAAtB,EAAgC;IAC9B,MAAM,IAAIC,KAAJ,CACH,mDAAkD,OAAOD,MAAO,UAD7D,CAAN;EAGD,CAJD,MAIO,IAAIX,KAAK,CAACC,OAAN,CAAcU,MAAd,CAAJ,EAA2B;IAChC,MAAM,IAAIC,KAAJ,CACJ,0JADI,CAAN;EAGD;AACF,CAXM"}
|
|
1
|
+
{"version":3,"names":["_react","require","_Colors","_core","_PlatformChecker","_UpdateProps","_WorkletEventHandler","_interopRequireDefault","obj","__esModule","default","useEvent","handler","eventNames","arguments","length","undefined","rebuild","initRef","useRef","current","WorkletEventHandler","updateWorklet","useHandler","handlers","dependencies","context","makeRemote","savedDependencies","useEffect","buildDependencies","doDependenciesDiffer","areDependenciesEqual","useWeb","isWeb","isJest","buildWorkletsHash","Object","values","reduce","acc","worklet","__workletHash","toString","handlersList","filter","map","workletHash","closure","_closure","push","nextDeps","prevDeps","is","x","y","objectIs","areHookInputsEqual","i","hasColorProps","updates","colorPropsSet","Set","colorProps","key","has","parseColors","indexOf","processedColor","processColor","isAnimated","prop","Array","isArray","some","onFrame","shallowEqual","a","b","aKeys","keys","bKeys","validateAnimatedStyles","styles","Error","exports"],"sources":["utils.ts"],"sourcesContent":["import { MutableRefObject, useEffect, useRef } from 'react';\nimport { processColor } from '../Colors';\nimport {\n AnimatedStyle,\n Context,\n NativeEvent,\n NestedObjectValues,\n WorkletFunction,\n AnimationObject,\n} from '../commonTypes';\nimport { makeRemote } from '../core';\nimport { isWeb, isJest } from '../PlatformChecker';\nimport { colorProps } from '../UpdateProps';\nimport WorkletEventHandler from '../WorkletEventHandler';\nimport { ContextWithDependencies, DependencyList } from './commonTypes';\n\ninterface Handler<T, TContext extends Context> extends WorkletFunction {\n (event: T, context: TContext): void;\n}\n\ninterface Handlers<T, TContext extends Context> {\n [key: string]: Handler<T, TContext> | undefined;\n}\n\nexport interface UseHandlerContext<TContext extends Context> {\n context: TContext;\n doDependenciesDiffer: boolean;\n useWeb: boolean;\n}\n\nexport function useEvent<T extends NativeEvent<T>>(\n handler: (event: T) => void,\n eventNames: string[] = [],\n rebuild = false\n): MutableRefObject<WorkletEventHandler<T> | null> {\n const initRef = useRef<WorkletEventHandler<T> | null>(null);\n if (initRef.current === null) {\n initRef.current = new WorkletEventHandler(handler, eventNames);\n } else if (rebuild) {\n initRef.current.updateWorklet(handler);\n }\n\n return initRef;\n}\n\nexport function useHandler<T, TContext extends Context>(\n handlers: Handlers<T, TContext>,\n dependencies?: DependencyList\n): UseHandlerContext<TContext> {\n const initRef = useRef<ContextWithDependencies<TContext> | null>(null);\n if (initRef.current === null) {\n initRef.current = {\n context: makeRemote<TContext>({} as TContext),\n savedDependencies: [],\n };\n }\n\n useEffect(() => {\n return () => {\n initRef.current = null;\n };\n }, []);\n\n const { context, savedDependencies } = initRef.current;\n\n dependencies = buildDependencies(dependencies, handlers);\n\n const doDependenciesDiffer = !areDependenciesEqual(\n dependencies,\n savedDependencies\n );\n initRef.current.savedDependencies = dependencies;\n const useWeb = isWeb() || isJest();\n\n return { context, doDependenciesDiffer, useWeb };\n}\n\n// builds one big hash from multiple worklets' hashes\nexport function buildWorkletsHash(\n handlers: Record<string, WorkletFunction> | Array<WorkletFunction>\n): string {\n return Object.values(handlers).reduce(\n (acc: string, worklet: WorkletFunction) =>\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n acc + worklet.__workletHash!.toString(),\n ''\n );\n}\n\n// builds dependencies array for gesture handlers\nexport function buildDependencies(\n dependencies: DependencyList,\n handlers: Record<string, WorkletFunction | undefined>\n): Array<unknown> {\n const handlersList: WorkletFunction[] = Object.values(handlers).filter(\n (handler) => handler !== undefined\n ) as WorkletFunction[];\n if (!dependencies) {\n dependencies = handlersList.map((handler) => {\n return {\n workletHash: handler.__workletHash,\n closure: handler._closure,\n };\n });\n } else {\n dependencies.push(buildWorkletsHash(handlersList));\n }\n return dependencies;\n}\n\n// this is supposed to work as useEffect comparison\nexport function areDependenciesEqual(\n nextDeps: DependencyList,\n prevDeps: DependencyList\n): boolean {\n function is(x: number, y: number) {\n /* eslint-disable no-self-compare */\n return (x === y && (x !== 0 || 1 / x === 1 / y)) || (x !== x && y !== y);\n /* eslint-enable no-self-compare */\n }\n const objectIs: (nextDeps: unknown, prevDeps: unknown) => boolean =\n typeof Object.is === 'function' ? Object.is : is;\n\n function areHookInputsEqual(\n nextDeps: DependencyList,\n prevDeps: DependencyList\n ): boolean {\n if (!nextDeps || !prevDeps || prevDeps.length !== nextDeps.length) {\n return false;\n }\n for (let i = 0; i < prevDeps.length; ++i) {\n if (!objectIs(nextDeps[i], prevDeps[i])) {\n return false;\n }\n }\n return true;\n }\n\n return areHookInputsEqual(nextDeps, prevDeps);\n}\n\nexport function hasColorProps(updates: AnimatedStyle): boolean {\n const colorPropsSet = new Set(colorProps);\n for (const key in updates) {\n if (colorPropsSet.has(key)) {\n return true;\n }\n }\n return false;\n}\n\nexport function parseColors(updates: AnimatedStyle): void {\n 'worklet';\n for (const key in updates) {\n if (colorProps.indexOf(key) !== -1) {\n // value could be an animation in which case processColor will recognize it and will return undefined\n // -> in such a case we don't want to override style of that key\n const processedColor = processColor(updates[key]);\n if (processedColor !== undefined) {\n updates[key] = processedColor;\n }\n }\n }\n}\n\nexport function isAnimated(prop: NestedObjectValues<AnimationObject>): boolean {\n 'worklet';\n if (Array.isArray(prop)) {\n return prop.some(isAnimated);\n } else if (typeof prop === 'object') {\n if (prop.onFrame !== undefined) {\n return true;\n } else {\n return Object.values(prop).some(isAnimated);\n }\n }\n return false;\n}\n\nexport function shallowEqual(a: any, b: any) {\n 'worklet';\n const aKeys = Object.keys(a);\n const bKeys = Object.keys(b);\n if (aKeys.length !== bKeys.length) {\n return false;\n }\n for (let i = 0; i < aKeys.length; i++) {\n if (a[aKeys[i]] !== b[aKeys[i]]) {\n return false;\n }\n }\n return true;\n}\n\nexport const validateAnimatedStyles = (styles: AnimatedStyle): void => {\n 'worklet';\n if (typeof styles !== 'object') {\n throw new Error(\n `useAnimatedStyle has to return an object, found ${typeof styles} instead`\n );\n } else if (Array.isArray(styles)) {\n throw new Error(\n 'useAnimatedStyle has to return an object and cannot return static styles combined with dynamic ones. Please do merging where a component receives props.'\n );\n }\n};\n"],"mappings":";;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AASA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,gBAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,oBAAA,GAAAC,sBAAA,CAAAN,OAAA;AAAyD,SAAAM,uBAAAC,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAiBlD,SAASG,QAAQA,CACtBC,OAA2B,EAGsB;EAAA,IAFjDC,UAAoB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,EAAE;EAAA,IACzBG,OAAO,GAAAH,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,KAAK;EAEf,MAAMI,OAAO,GAAG,IAAAC,aAAM,EAAgC,IAAI,CAAC;EAC3D,IAAID,OAAO,CAACE,OAAO,KAAK,IAAI,EAAE;IAC5BF,OAAO,CAACE,OAAO,GAAG,IAAIC,4BAAmB,CAACT,OAAO,EAAEC,UAAU,CAAC;EAChE,CAAC,MAAM,IAAII,OAAO,EAAE;IAClBC,OAAO,CAACE,OAAO,CAACE,aAAa,CAACV,OAAO,CAAC;EACxC;EAEA,OAAOM,OAAO;AAChB;AAEO,SAASK,UAAUA,CACxBC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,MAAM,KAAKkE,KAAK,CAAClE,MAAM,EAAE;IACjC,OAAO,KAAK;EACd;EACA,KAAK,IAAI2C,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGqB,KAAK,CAAChE,MAAM,EAAE2C,CAAC,EAAE,EAAE;IACrC,IAAImB,CAAC,CAACE,KAAK,CAACrB,CAAC,CAAC,CAAC,KAAKoB,CAAC,CAACC,KAAK,CAACrB,CAAC,CAAC,CAAC,EAAE;MAC/B,OAAO,KAAK;IACd;EACF;EACA,OAAO,IAAI;AACb;AAEO,MAAMwB,sBAAsB,GAAIC,MAAqB,IAAW;EACrE,SAAS;;EACT,IAAI,OAAOA,MAAM,KAAK,QAAQ,EAAE;IAC9B,MAAM,IAAIC,KAAK,CACZ,mDAAkD,OAAOD,MAAO,UAAS,CAC3E;EACH,CAAC,MAAM,IAAIX,KAAK,CAACC,OAAO,CAACU,MAAM,CAAC,EAAE;IAChC,MAAM,IAAIC,KAAK,CACb,0JAA0J,CAC3J;EACH;AACF,CAAC;AAACC,OAAA,CAAAH,sBAAA,GAAAA,sBAAA"}
|
|
@@ -3,9 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
|
|
7
6
|
var _core = require("./core");
|
|
8
|
-
|
|
9
7
|
Object.keys(_core).forEach(function (key) {
|
|
10
8
|
if (key === "default" || key === "__esModule") return;
|
|
11
9
|
if (key in exports && exports[key] === _core[key]) return;
|
|
@@ -16,9 +14,7 @@ Object.keys(_core).forEach(function (key) {
|
|
|
16
14
|
}
|
|
17
15
|
});
|
|
18
16
|
});
|
|
19
|
-
|
|
20
17
|
var _hook = require("./hook");
|
|
21
|
-
|
|
22
18
|
Object.keys(_hook).forEach(function (key) {
|
|
23
19
|
if (key === "default" || key === "__esModule") return;
|
|
24
20
|
if (key in exports && exports[key] === _hook[key]) return;
|
|
@@ -29,9 +25,7 @@ Object.keys(_hook).forEach(function (key) {
|
|
|
29
25
|
}
|
|
30
26
|
});
|
|
31
27
|
});
|
|
32
|
-
|
|
33
28
|
var _animation = require("./animation");
|
|
34
|
-
|
|
35
29
|
Object.keys(_animation).forEach(function (key) {
|
|
36
30
|
if (key === "default" || key === "__esModule") return;
|
|
37
31
|
if (key in exports && exports[key] === _animation[key]) return;
|
|
@@ -42,9 +36,7 @@ Object.keys(_animation).forEach(function (key) {
|
|
|
42
36
|
}
|
|
43
37
|
});
|
|
44
38
|
});
|
|
45
|
-
|
|
46
39
|
var _interpolation = require("./interpolation");
|
|
47
|
-
|
|
48
40
|
Object.keys(_interpolation).forEach(function (key) {
|
|
49
41
|
if (key === "default" || key === "__esModule") return;
|
|
50
42
|
if (key in exports && exports[key] === _interpolation[key]) return;
|
|
@@ -55,9 +47,7 @@ Object.keys(_interpolation).forEach(function (key) {
|
|
|
55
47
|
}
|
|
56
48
|
});
|
|
57
49
|
});
|
|
58
|
-
|
|
59
50
|
var _interpolateColor = require("./interpolateColor");
|
|
60
|
-
|
|
61
51
|
Object.keys(_interpolateColor).forEach(function (key) {
|
|
62
52
|
if (key === "default" || key === "__esModule") return;
|
|
63
53
|
if (key in exports && exports[key] === _interpolateColor[key]) return;
|
|
@@ -68,9 +58,7 @@ Object.keys(_interpolateColor).forEach(function (key) {
|
|
|
68
58
|
}
|
|
69
59
|
});
|
|
70
60
|
});
|
|
71
|
-
|
|
72
61
|
var _Easing = require("./Easing");
|
|
73
|
-
|
|
74
62
|
Object.keys(_Easing).forEach(function (key) {
|
|
75
63
|
if (key === "default" || key === "__esModule") return;
|
|
76
64
|
if (key in exports && exports[key] === _Easing[key]) return;
|
|
@@ -81,9 +69,7 @@ Object.keys(_Easing).forEach(function (key) {
|
|
|
81
69
|
}
|
|
82
70
|
});
|
|
83
71
|
});
|
|
84
|
-
|
|
85
72
|
var _NativeMethods = require("./NativeMethods");
|
|
86
|
-
|
|
87
73
|
Object.keys(_NativeMethods).forEach(function (key) {
|
|
88
74
|
if (key === "default" || key === "__esModule") return;
|
|
89
75
|
if (key in exports && exports[key] === _NativeMethods[key]) return;
|
|
@@ -94,9 +80,7 @@ Object.keys(_NativeMethods).forEach(function (key) {
|
|
|
94
80
|
}
|
|
95
81
|
});
|
|
96
82
|
});
|
|
97
|
-
|
|
98
83
|
var _Colors = require("./Colors");
|
|
99
|
-
|
|
100
84
|
Object.keys(_Colors).forEach(function (key) {
|
|
101
85
|
if (key === "default" || key === "__esModule") return;
|
|
102
86
|
if (key in exports && exports[key] === _Colors[key]) return;
|
|
@@ -107,9 +91,7 @@ Object.keys(_Colors).forEach(function (key) {
|
|
|
107
91
|
}
|
|
108
92
|
});
|
|
109
93
|
});
|
|
110
|
-
|
|
111
94
|
var _PropAdapters = require("./PropAdapters");
|
|
112
|
-
|
|
113
95
|
Object.keys(_PropAdapters).forEach(function (key) {
|
|
114
96
|
if (key === "default" || key === "__esModule") return;
|
|
115
97
|
if (key in exports && exports[key] === _PropAdapters[key]) return;
|
|
@@ -120,9 +102,7 @@ Object.keys(_PropAdapters).forEach(function (key) {
|
|
|
120
102
|
}
|
|
121
103
|
});
|
|
122
104
|
});
|
|
123
|
-
|
|
124
105
|
var _layoutReanimation = require("./layoutReanimation");
|
|
125
|
-
|
|
126
106
|
Object.keys(_layoutReanimation).forEach(function (key) {
|
|
127
107
|
if (key === "default" || key === "__esModule") return;
|
|
128
108
|
if (key in exports && exports[key] === _layoutReanimation[key]) return;
|
|
@@ -133,9 +113,7 @@ Object.keys(_layoutReanimation).forEach(function (key) {
|
|
|
133
113
|
}
|
|
134
114
|
});
|
|
135
115
|
});
|
|
136
|
-
|
|
137
116
|
var _utils = require("./utils");
|
|
138
|
-
|
|
139
117
|
Object.keys(_utils).forEach(function (key) {
|
|
140
118
|
if (key === "default" || key === "__esModule") return;
|
|
141
119
|
if (key in exports && exports[key] === _utils[key]) return;
|
|
@@ -146,9 +124,7 @@ Object.keys(_utils).forEach(function (key) {
|
|
|
146
124
|
}
|
|
147
125
|
});
|
|
148
126
|
});
|
|
149
|
-
|
|
150
127
|
var _commonTypes = require("./commonTypes");
|
|
151
|
-
|
|
152
128
|
Object.keys(_commonTypes).forEach(function (key) {
|
|
153
129
|
if (key === "default" || key === "__esModule") return;
|
|
154
130
|
if (key in exports && exports[key] === _commonTypes[key]) return;
|
|
@@ -159,9 +135,7 @@ Object.keys(_commonTypes).forEach(function (key) {
|
|
|
159
135
|
}
|
|
160
136
|
});
|
|
161
137
|
});
|
|
162
|
-
|
|
163
138
|
var _pluginUtils = require("./pluginUtils");
|
|
164
|
-
|
|
165
139
|
Object.keys(_pluginUtils).forEach(function (key) {
|
|
166
140
|
if (key === "default" || key === "__esModule") return;
|
|
167
141
|
if (key in exports && exports[key] === _pluginUtils[key]) return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from './core';\nexport * from './hook';\nexport * from './animation';\nexport * from './interpolation';\nexport * from './interpolateColor';\nexport * from './Easing';\nexport * from './NativeMethods';\nexport * from './Colors';\nexport * from './PropAdapters';\nexport * from './layoutReanimation';\nexport * from './utils';\nexport * from './commonTypes';\nexport * from './pluginUtils';\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_core","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_hook","_animation","_interpolation","_interpolateColor","_Easing","_NativeMethods","_Colors","_PropAdapters","_layoutReanimation","_utils","_commonTypes","_pluginUtils"],"sources":["index.ts"],"sourcesContent":["export * from './core';\nexport * from './hook';\nexport * from './animation';\nexport * from './interpolation';\nexport * from './interpolateColor';\nexport * from './Easing';\nexport * from './NativeMethods';\nexport * from './Colors';\nexport * from './PropAdapters';\nexport * from './layoutReanimation';\nexport * from './utils';\nexport * from './commonTypes';\nexport * from './pluginUtils';\n"],"mappings":";;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,KAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA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