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
|
@@ -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;AAyFA,WAAYA,
|
|
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;AAyFA,WAAYA,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;AAOtB,WAAYC,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;AAqC7B,WAAYC,oBAAoB,0BAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAAA,OAApBA,oBAAoB;AAAA;AAShC,WAAYC,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"}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
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); }
|
|
2
|
-
|
|
3
2
|
import React, { forwardRef } from 'react';
|
|
4
3
|
import { FlatList, StyleSheet } from 'react-native';
|
|
5
4
|
import ReanimatedView from './View';
|
|
6
5
|
import createAnimatedComponent from '../../createAnimatedComponent';
|
|
7
6
|
const AnimatedFlatList = createAnimatedComponent(FlatList);
|
|
8
|
-
|
|
9
7
|
const createCellRenderer = (itemLayoutAnimation, cellStyle) => {
|
|
10
8
|
const cellRenderer = props => {
|
|
11
9
|
return /*#__PURE__*/React.createElement(ReanimatedView, {
|
|
@@ -14,10 +12,8 @@ const createCellRenderer = (itemLayoutAnimation, cellStyle) => {
|
|
|
14
12
|
style: cellStyle
|
|
15
13
|
}, props.children);
|
|
16
14
|
};
|
|
17
|
-
|
|
18
15
|
return cellRenderer;
|
|
19
16
|
};
|
|
20
|
-
|
|
21
17
|
const ReanimatedFlatlist = /*#__PURE__*/forwardRef((props, ref) => {
|
|
22
18
|
const {
|
|
23
19
|
itemLayoutAnimation,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","forwardRef","FlatList","StyleSheet","ReanimatedView","createAnimatedComponent","AnimatedFlatList","createCellRenderer","itemLayoutAnimation","cellStyle","cellRenderer","props","onLayout","children","ReanimatedFlatlist","ref","restProps","inverted","horizontal","styles","horizontallyInverted","verticallyInverted","undefined","useMemo","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","forwardRef","FlatList","StyleSheet","ReanimatedView","createAnimatedComponent","AnimatedFlatList","createCellRenderer","itemLayoutAnimation","cellStyle","cellRenderer","props","createElement","layout","onLayout","style","children","ReanimatedFlatlist","ref","restProps","inverted","horizontal","styles","horizontallyInverted","verticallyInverted","undefined","useMemo","_extends","CellRendererComponent","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":";AAAA,OAAOA,KAAK,IAAkBC,UAAU,QAAQ,OAAO;AACvD,SACEC,QAAQ,EAGRC,UAAU,QACL,cAAc;AACrB,OAAOC,cAAc,MAAM,QAAQ;AACnC,OAAOC,uBAAuB,MAAM,+BAA+B;AAInE,MAAMC,gBAAgB,GAAGD,uBAAuB,CAACH,QAAQ,CAAe;AAUxE,MAAMK,kBAAkB,GAAGA,CACzBC,mBAA6C,EAC7CC,SAAsB,KACnB;EACH,MAAMC,YAAY,GAAIC,KAA4B,IAAK;IACrD,oBACEX,KAAA,CAAAY,aAAA,CAACR,cAAc;MACbS,MAAM,EAAEL,mBAAoB;MAC5BM,QAAQ,EAAEH,KAAK,CAACG,QAAS;MACzBC,KAAK,EAAEN;IAAU,GAChBE,KAAK,CAACK,QAAQ,CACA;EAErB,CAAC;EAED,OAAON,YAAY;AACrB,CAAC;AAQD,MAAMO,kBAAwC,gBAAGhB,UAAU,CACzD,CAACU,KAAmC,EAAEO,GAA2B,KAAK;EACpE,MAAM;IAAEV,mBAAmB;IAAE,GAAGW;EAAU,CAAC,GAAGR,KAAK;EAEnD,MAAMF,SAAS,GAAGU,SAAS,aAATA,SAAS,eAATA,SAAS,CAAEC,QAAQ,GACjCD,SAAS,aAATA,SAAS,eAATA,SAAS,CAAEE,UAAU,GACnBC,MAAM,CAACC,oBAAoB,GAC3BD,MAAM,CAACE,kBAAkB,GAC3BC,SAAS;EAEb,MAAMf,YAAY,GAAGV,KAAK,CAAC0B,OAAO,CAChC,MAAMnB,kBAAkB,CAACC,mBAAmB,EAAEC,SAAS,CAAC,EACxD,CAACA,SAAS,CAAC,CACZ;EAED,oBACET,KAAA,CAAAY,aAAA,CAACN,gBAAgB,EAAAqB,QAAA;IACfT,GAAG,EAAEA;EAAI,GACLC,SAAS;IACbS,qBAAqB,EAAElB;EAAa,GACpC;AAEN,CAAC,CACF;AAED,MAAMY,MAAM,GAAGnB,UAAU,CAAC0B,MAAM,CAAC;EAC/BL,kBAAkB,EAAE;IAAEM,SAAS,EAAE,CAAC;MAAEC,MAAM,EAAE,CAAC;IAAE,CAAC;EAAE,CAAC;EACnDR,oBAAoB,EAAE;IAAEO,SAAS,EAAE,CAAC;MAAEE,MAAM,EAAE,CAAC;IAAE,CAAC;EAAE;AACtD,CAAC,CAAC;AAEF,eAAef,kBAAkB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Image","createAnimatedComponent","AnimatedImage"],"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,SAASA,
|
|
1
|
+
{"version":3,"names":["Image","createAnimatedComponent","AnimatedImage"],"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,SAASA,KAAK,QAAQ,cAAc;AACpC,OAAOC,uBAAuB,MAAM,+BAA+B;AAEnE,MAAMC,aAAa,GAAGD,uBAAuB,CAACD,KAAK,CAAQ;AAE3D,eAAeE,aAAa"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ScrollView","createAnimatedComponent","AnimatedScrollView"],"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,SAASA,
|
|
1
|
+
{"version":3,"names":["ScrollView","createAnimatedComponent","AnimatedScrollView"],"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,SAASA,UAAU,QAAQ,cAAc;AACzC,OAAOC,uBAAuB,MAAM,+BAA+B;AAEnE,MAAMC,kBAAkB,GAAGD,uBAAuB,CAACD,UAAU,CAAC;AAE9D,eAAeE,kBAAkB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Text","createAnimatedComponent","AnimatedText"],"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,SAASA,
|
|
1
|
+
{"version":3,"names":["Text","createAnimatedComponent","AnimatedText"],"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,SAASA,IAAI,QAAQ,cAAc;AACnC,OAAOC,uBAAuB,MAAM,+BAA+B;AAEnE,MAAMC,YAAY,GAAGD,uBAAuB,CAACD,IAAI,CAAQ;AAEzD,eAAeE,YAAY"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["View","createAnimatedComponent","AnimatedView"],"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,SAASA,
|
|
1
|
+
{"version":3,"names":["View","createAnimatedComponent","AnimatedView"],"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,SAASA,IAAI,QAAQ,cAAc;AACnC,OAAOC,uBAAuB,MAAM,+BAA+B;AAEnE,MAAMC,YAAY,GAAGD,uBAAuB,CAACD,IAAI,CAAC;AAElD,eAAeE,YAAY"}
|
|
@@ -6,26 +6,20 @@ import { makeMutable as makeMutableUnwrapped, makeRemote as makeRemoteUnwrapped
|
|
|
6
6
|
import { initializeUIRuntime } from './initializers';
|
|
7
7
|
export { stopMapper } from './mappers';
|
|
8
8
|
export { runOnJS, runOnUI } from './threads';
|
|
9
|
-
|
|
10
9
|
const testWorklet = () => {
|
|
11
10
|
'worklet';
|
|
12
11
|
};
|
|
13
|
-
|
|
14
12
|
const throwUninitializedReanimatedException = () => {
|
|
15
13
|
throw new Error("Failed to initialize react-native-reanimated library, make sure you followed installation steps here: https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/installation/ \n1) Make sure reanimated's babel plugin is installed in your babel.config.js (you should have 'react-native-reanimated/plugin' listed there - also see the above link for details) \n2) Make sure you reset build cache after updating the config, run: yarn start --reset-cache");
|
|
16
14
|
};
|
|
17
|
-
|
|
18
15
|
export const checkPluginState = function () {
|
|
19
16
|
let throwError = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
20
|
-
|
|
21
17
|
if (!testWorklet.__workletHash && !shouldBeUseWeb()) {
|
|
22
18
|
if (throwError) {
|
|
23
19
|
throwUninitializedReanimatedException();
|
|
24
20
|
}
|
|
25
|
-
|
|
26
21
|
return false;
|
|
27
22
|
}
|
|
28
|
-
|
|
29
23
|
return true;
|
|
30
24
|
};
|
|
31
25
|
export const isConfigured = function () {
|
|
@@ -46,16 +40,13 @@ export const makeShareable = __DEV__ ? configurationCheckWrapper(makeShareableUn
|
|
|
46
40
|
export const makeMutable = __DEV__ ? configurationCheckWrapper(makeMutableUnwrapped) : makeMutableUnwrapped;
|
|
47
41
|
export const makeRemote = __DEV__ ? configurationCheckWrapper(makeRemoteUnwrapped) : makeRemoteUnwrapped;
|
|
48
42
|
global._WORKLET = false;
|
|
49
|
-
|
|
50
43
|
global._log = function (s) {
|
|
51
44
|
console.log(s);
|
|
52
45
|
};
|
|
53
|
-
|
|
54
46
|
export function getViewProp(viewTag, propName) {
|
|
55
47
|
if (global._IS_FABRIC) {
|
|
56
48
|
throw new Error('[react-native-reanimated] `getViewProp` is not supported on Fabric yet');
|
|
57
49
|
}
|
|
58
|
-
|
|
59
50
|
return new Promise((resolve, reject) => {
|
|
60
51
|
return NativeReanimatedModule.getViewProp(viewTag, propName, result => {
|
|
61
52
|
if (typeof result === 'string' && result.substr(0, 6) === 'error:') {
|
|
@@ -67,18 +58,15 @@ export function getViewProp(viewTag, propName) {
|
|
|
67
58
|
});
|
|
68
59
|
}
|
|
69
60
|
export function registerEventHandler(eventHash, eventHandler) {
|
|
70
|
-
function
|
|
61
|
+
function handleAndFlushAnimationFrame(eventTimestamp, event) {
|
|
71
62
|
'worklet';
|
|
72
63
|
|
|
73
64
|
global.__frameTimestamp = eventTimestamp;
|
|
74
65
|
eventHandler(event);
|
|
75
|
-
|
|
76
66
|
global.__flushAnimationFrame(eventTimestamp);
|
|
77
|
-
|
|
78
67
|
global.__frameTimestamp = undefined;
|
|
79
68
|
}
|
|
80
|
-
|
|
81
|
-
return NativeReanimatedModule.registerEventHandler(eventHash, makeShareableCloneRecursive(handleAndFlushImmediates));
|
|
69
|
+
return NativeReanimatedModule.registerEventHandler(eventHash, makeShareableCloneRecursive(handleAndFlushAnimationFrame));
|
|
82
70
|
}
|
|
83
71
|
export function unregisterEventHandler(id) {
|
|
84
72
|
return NativeReanimatedModule.unregisterEventHandler(id);
|
|
@@ -86,19 +74,16 @@ export function unregisterEventHandler(id) {
|
|
|
86
74
|
export function subscribeForKeyboardEvents(eventHandler, options) {
|
|
87
75
|
// TODO: this should really go with the same code path as other events, that is
|
|
88
76
|
// via registerEventHandler. For now we are copying the code from there.
|
|
89
|
-
function
|
|
77
|
+
function handleAndFlushAnimationFrame(state, height) {
|
|
90
78
|
'worklet';
|
|
91
79
|
|
|
92
80
|
const now = performance.now();
|
|
93
81
|
global.__frameTimestamp = now;
|
|
94
82
|
eventHandler(state, height);
|
|
95
|
-
|
|
96
83
|
global.__flushAnimationFrame(now);
|
|
97
|
-
|
|
98
84
|
global.__frameTimestamp = undefined;
|
|
99
85
|
}
|
|
100
|
-
|
|
101
|
-
return NativeReanimatedModule.subscribeForKeyboardEvents(makeShareableCloneRecursive(handleAndFlushImmediates), options.isStatusBarTranslucentAndroid ?? false);
|
|
86
|
+
return NativeReanimatedModule.subscribeForKeyboardEvents(makeShareableCloneRecursive(handleAndFlushAnimationFrame), options.isStatusBarTranslucentAndroid ?? false);
|
|
102
87
|
}
|
|
103
88
|
export function unsubscribeFromKeyboardEvents(listenerId) {
|
|
104
89
|
return NativeReanimatedModule.unsubscribeFromKeyboardEvents(listenerId);
|
|
@@ -108,19 +93,18 @@ export function registerSensor(sensorType, interval, iosReferenceFrame, eventHan
|
|
|
108
93
|
}
|
|
109
94
|
export function unregisterSensor(listenerId) {
|
|
110
95
|
return NativeReanimatedModule.unregisterSensor(listenerId);
|
|
111
|
-
}
|
|
96
|
+
}
|
|
112
97
|
|
|
98
|
+
// initialize UI runtime if applicable
|
|
113
99
|
if (!isWeb() && isConfigured()) {
|
|
114
100
|
initializeUIRuntime();
|
|
115
101
|
}
|
|
116
|
-
|
|
117
102
|
let featuresConfig = {
|
|
118
103
|
enableLayoutAnimations: false,
|
|
119
104
|
setByUser: false
|
|
120
105
|
};
|
|
121
106
|
export function enableLayoutAnimations(flag) {
|
|
122
107
|
let isCallByUser = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
123
|
-
|
|
124
108
|
if (isCallByUser) {
|
|
125
109
|
featuresConfig = {
|
|
126
110
|
enableLayoutAnimations: flag,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeReanimatedModule","nativeShouldBeMock","shouldBeUseWeb","isWeb","makeShareableCloneRecursive","makeShareable","makeShareableUnwrapped","startMapper","startMapperUnwrapped","makeMutable","makeMutableUnwrapped","makeRemote","makeRemoteUnwrapped","initializeUIRuntime","stopMapper","runOnJS","runOnUI","testWorklet","throwUninitializedReanimatedException","Error","checkPluginState","throwError","__workletHash","isConfigured","isConfiguredCheck","configurationCheckWrapper","__DEV__","fn","global","_WORKLET","_log","s","console","log","getViewProp","viewTag","propName","_IS_FABRIC","Promise","resolve","reject","result","substr","registerEventHandler","eventHash","eventHandler","handleAndFlushImmediates","eventTimestamp","event","__frameTimestamp","__flushAnimationFrame","undefined","unregisterEventHandler","id","subscribeForKeyboardEvents","options","state","height","now","performance","isStatusBarTranslucentAndroid","unsubscribeFromKeyboardEvents","listenerId","registerSensor","sensorType","interval","iosReferenceFrame","unregisterSensor","featuresConfig","enableLayoutAnimations","setByUser","flag","isCallByUser","configureLayoutAnimations","type","config","sharedTransitionTag","configureLayoutAnimation","configureProps","uiProps","nativeProps"],"sources":["core.ts"],"sourcesContent":["import NativeReanimatedModule from './NativeReanimated';\nimport { nativeShouldBeMock, shouldBeUseWeb, isWeb } from './PlatformChecker';\nimport {\n AnimatedKeyboardOptions,\n BasicWorkletFunction,\n Value3D,\n ValueRotation,\n} from './commonTypes';\nimport {\n makeShareableCloneRecursive,\n makeShareable as makeShareableUnwrapped,\n} from './shareables';\nimport { startMapper as startMapperUnwrapped } from './mappers';\nimport {\n makeMutable as makeMutableUnwrapped,\n makeRemote as makeRemoteUnwrapped,\n} from './mutables';\nimport {\n LayoutAnimationFunction,\n LayoutAnimationType,\n} from './layoutReanimation';\nimport { initializeUIRuntime } from './initializers';\n\nexport { stopMapper } from './mappers';\nexport { runOnJS, runOnUI } from './threads';\n\nexport type ReanimatedConsole = Pick<\n Console,\n 'debug' | 'log' | 'warn' | 'info' | 'error'\n>;\n\nconst testWorklet: BasicWorkletFunction<void> = () => {\n 'worklet';\n};\n\nconst throwUninitializedReanimatedException = () => {\n throw new Error(\n \"Failed to initialize react-native-reanimated library, make sure you followed installation steps here: https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/installation/ \\n1) Make sure reanimated's babel plugin is installed in your babel.config.js (you should have 'react-native-reanimated/plugin' listed there - also see the above link for details) \\n2) Make sure you reset build cache after updating the config, run: yarn start --reset-cache\"\n );\n};\n\nexport const checkPluginState: (throwError: boolean) => boolean = (\n throwError = true\n) => {\n if (!testWorklet.__workletHash && !shouldBeUseWeb()) {\n if (throwError) {\n throwUninitializedReanimatedException();\n }\n return false;\n }\n return true;\n};\n\nexport const isConfigured: (throwError?: boolean) => boolean = (\n throwError = false\n) => {\n return checkPluginState(throwError);\n};\n\nexport const isConfiguredCheck: () => void = () => {\n checkPluginState(true);\n};\n\nconst configurationCheckWrapper = __DEV__\n ? <T extends Array<any>, U>(fn: (...args: T) => U) => {\n return (...args: T): U => {\n isConfigured(true);\n return fn(...args);\n };\n }\n : <T extends Array<any>, U>(fn: (...args: T) => U) => fn;\n\nexport const startMapper = __DEV__\n ? configurationCheckWrapper(startMapperUnwrapped)\n : startMapperUnwrapped;\n\nexport const makeShareable = __DEV__\n ? configurationCheckWrapper(makeShareableUnwrapped)\n : makeShareableUnwrapped;\n\nexport const makeMutable = __DEV__\n ? configurationCheckWrapper(makeMutableUnwrapped)\n : makeMutableUnwrapped;\n\nexport const makeRemote = __DEV__\n ? configurationCheckWrapper(makeRemoteUnwrapped)\n : makeRemoteUnwrapped;\n\nglobal._WORKLET = false;\nglobal._log = function (s: string) {\n console.log(s);\n};\n\nexport function getViewProp<T>(viewTag: string, propName: string): Promise<T> {\n if (global._IS_FABRIC) {\n throw new Error(\n '[react-native-reanimated] `getViewProp` is not supported on Fabric yet'\n );\n }\n\n return new Promise((resolve, reject) => {\n return NativeReanimatedModule.getViewProp(\n viewTag,\n propName,\n (result: T) => {\n if (typeof result === 'string' && result.substr(0, 6) === 'error:') {\n reject(result);\n } else {\n resolve(result);\n }\n }\n );\n });\n}\n\nexport function registerEventHandler<T>(\n eventHash: string,\n eventHandler: (event: T) => void\n): string {\n function handleAndFlushImmediates(eventTimestamp: number, event: T) {\n 'worklet';\n global.__frameTimestamp = eventTimestamp;\n eventHandler(event);\n global.__flushAnimationFrame(eventTimestamp);\n global.__frameTimestamp = undefined;\n }\n return NativeReanimatedModule.registerEventHandler(\n eventHash,\n makeShareableCloneRecursive(handleAndFlushImmediates)\n );\n}\n\nexport function unregisterEventHandler(id: string): void {\n return NativeReanimatedModule.unregisterEventHandler(id);\n}\n\nexport function subscribeForKeyboardEvents(\n eventHandler: (state: number, height: number) => void,\n options: AnimatedKeyboardOptions\n): number {\n // TODO: this should really go with the same code path as other events, that is\n // via registerEventHandler. For now we are copying the code from there.\n function handleAndFlushImmediates(state: number, height: number) {\n 'worklet';\n const now = performance.now();\n global.__frameTimestamp = now;\n eventHandler(state, height);\n global.__flushAnimationFrame(now);\n global.__frameTimestamp = undefined;\n }\n return NativeReanimatedModule.subscribeForKeyboardEvents(\n makeShareableCloneRecursive(handleAndFlushImmediates),\n options.isStatusBarTranslucentAndroid ?? false\n );\n}\n\nexport function unsubscribeFromKeyboardEvents(listenerId: number): void {\n return NativeReanimatedModule.unsubscribeFromKeyboardEvents(listenerId);\n}\n\nexport function registerSensor(\n sensorType: number,\n interval: number,\n iosReferenceFrame: number,\n eventHandler: (\n data: Value3D | ValueRotation,\n orientationDegrees: number\n ) => void\n): number {\n return NativeReanimatedModule.registerSensor(\n sensorType,\n interval,\n iosReferenceFrame,\n makeShareableCloneRecursive(eventHandler)\n );\n}\n\nexport function unregisterSensor(listenerId: number): void {\n return NativeReanimatedModule.unregisterSensor(listenerId);\n}\n\n// initialize UI runtime if applicable\nif (!isWeb() && isConfigured()) {\n initializeUIRuntime();\n}\n\ntype FeaturesConfig = {\n enableLayoutAnimations: boolean;\n setByUser: boolean;\n};\n\nlet featuresConfig: FeaturesConfig = {\n enableLayoutAnimations: false,\n setByUser: false,\n};\n\nexport function enableLayoutAnimations(\n flag: boolean,\n isCallByUser = true\n): void {\n if (isCallByUser) {\n featuresConfig = {\n enableLayoutAnimations: flag,\n setByUser: true,\n };\n NativeReanimatedModule.enableLayoutAnimations(flag);\n } else if (\n !featuresConfig.setByUser &&\n featuresConfig.enableLayoutAnimations !== flag\n ) {\n featuresConfig.enableLayoutAnimations = flag;\n NativeReanimatedModule.enableLayoutAnimations(flag);\n }\n}\n\nexport function configureLayoutAnimations(\n viewTag: number,\n type: LayoutAnimationType,\n config: LayoutAnimationFunction | Keyframe,\n sharedTransitionTag = ''\n): void {\n NativeReanimatedModule.configureLayoutAnimation(\n viewTag,\n type,\n sharedTransitionTag,\n makeShareableCloneRecursive(config)\n );\n}\n\nexport function configureProps(uiProps: string[], nativeProps: string[]): void {\n if (!nativeShouldBeMock()) {\n NativeReanimatedModule.configureProps(uiProps, nativeProps);\n }\n}\n"],"mappings":"AAAA,OAAOA,sBAAP,MAAmC,oBAAnC;AACA,SAASC,kBAAT,EAA6BC,cAA7B,EAA6CC,KAA7C,QAA0D,mBAA1D;AAOA,SACEC,2BADF,EAEEC,aAAa,IAAIC,sBAFnB,QAGO,cAHP;AAIA,SAASC,WAAW,IAAIC,oBAAxB,QAAoD,WAApD;AACA,SACEC,WAAW,IAAIC,oBADjB,EAEEC,UAAU,IAAIC,mBAFhB,QAGO,YAHP;AAQA,SAASC,mBAAT,QAAoC,gBAApC;AAEA,SAASC,UAAT,QAA2B,WAA3B;AACA,SAASC,OAAT,EAAkBC,OAAlB,QAAiC,WAAjC;;AAOA,MAAMC,WAAuC,GAAG,MAAM;EACpD;AACD,CAFD;;AAIA,MAAMC,qCAAqC,GAAG,MAAM;EAClD,MAAM,IAAI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BAAvB,CAA8CE,IAA9C;EACD;AACF;AAED,OAAO,SAASE,yBAAT,CACLtC,OADK,EAELuC,IAFK,EAGLC,MAHK,EAKC;EAAA,IADNC,mBACM,uEADgB,EAChB;EACN5E,sBAAsB,CAAC6E,wBAAvB,CACE1C,OADF,EAEEuC,IAFF,EAGEE,mBAHF,EAIExE,2BAA2B,CAACuE,MAAD,CAJ7B;AAMD;AAED,OAAO,SAASG,cAAT,CAAwBC,OAAxB,EAA2CC,WAA3C,EAAwE;EAC7E,IAAI,CAAC/E,kBAAkB,EAAvB,EAA2B;IACzBD,sBAAsB,CAAC8E,cAAvB,CAAsCC,OAAtC,EAA+CC,WAA/C;EACD;AACF"}
|
|
1
|
+
{"version":3,"names":["NativeReanimatedModule","nativeShouldBeMock","shouldBeUseWeb","isWeb","makeShareableCloneRecursive","makeShareable","makeShareableUnwrapped","startMapper","startMapperUnwrapped","makeMutable","makeMutableUnwrapped","makeRemote","makeRemoteUnwrapped","initializeUIRuntime","stopMapper","runOnJS","runOnUI","testWorklet","throwUninitializedReanimatedException","Error","checkPluginState","throwError","arguments","length","undefined","__workletHash","isConfigured","isConfiguredCheck","configurationCheckWrapper","__DEV__","fn","global","_WORKLET","_log","s","console","log","getViewProp","viewTag","propName","_IS_FABRIC","Promise","resolve","reject","result","substr","registerEventHandler","eventHash","eventHandler","handleAndFlushAnimationFrame","eventTimestamp","event","__frameTimestamp","__flushAnimationFrame","unregisterEventHandler","id","subscribeForKeyboardEvents","options","state","height","now","performance","isStatusBarTranslucentAndroid","unsubscribeFromKeyboardEvents","listenerId","registerSensor","sensorType","interval","iosReferenceFrame","unregisterSensor","featuresConfig","enableLayoutAnimations","setByUser","flag","isCallByUser","configureLayoutAnimations","type","config","sharedTransitionTag","configureLayoutAnimation","configureProps","uiProps","nativeProps"],"sources":["core.ts"],"sourcesContent":["import NativeReanimatedModule from './NativeReanimated';\nimport { nativeShouldBeMock, shouldBeUseWeb, isWeb } from './PlatformChecker';\nimport {\n AnimatedKeyboardOptions,\n BasicWorkletFunction,\n Value3D,\n ValueRotation,\n} from './commonTypes';\nimport {\n makeShareableCloneRecursive,\n makeShareable as makeShareableUnwrapped,\n} from './shareables';\nimport { startMapper as startMapperUnwrapped } from './mappers';\nimport {\n makeMutable as makeMutableUnwrapped,\n makeRemote as makeRemoteUnwrapped,\n} from './mutables';\nimport {\n LayoutAnimationFunction,\n LayoutAnimationType,\n} from './layoutReanimation';\nimport { initializeUIRuntime } from './initializers';\n\nexport { stopMapper } from './mappers';\nexport { runOnJS, runOnUI } from './threads';\n\nexport type ReanimatedConsole = Pick<\n Console,\n 'debug' | 'log' | 'warn' | 'info' | 'error'\n>;\n\nconst testWorklet: BasicWorkletFunction<void> = () => {\n 'worklet';\n};\n\nconst throwUninitializedReanimatedException = () => {\n throw new Error(\n \"Failed to initialize react-native-reanimated library, make sure you followed installation steps here: https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/installation/ \\n1) Make sure reanimated's babel plugin is installed in your babel.config.js (you should have 'react-native-reanimated/plugin' listed there - also see the above link for details) \\n2) Make sure you reset build cache after updating the config, run: yarn start --reset-cache\"\n );\n};\n\nexport const checkPluginState: (throwError: boolean) => boolean = (\n throwError = true\n) => {\n if (!testWorklet.__workletHash && !shouldBeUseWeb()) {\n if (throwError) {\n throwUninitializedReanimatedException();\n }\n return false;\n }\n return true;\n};\n\nexport const isConfigured: (throwError?: boolean) => boolean = (\n throwError = false\n) => {\n return checkPluginState(throwError);\n};\n\nexport const isConfiguredCheck: () => void = () => {\n checkPluginState(true);\n};\n\nconst configurationCheckWrapper = __DEV__\n ? <T extends Array<any>, U>(fn: (...args: T) => U) => {\n return (...args: T): U => {\n isConfigured(true);\n return fn(...args);\n };\n }\n : <T extends Array<any>, U>(fn: (...args: T) => U) => fn;\n\nexport const startMapper = __DEV__\n ? configurationCheckWrapper(startMapperUnwrapped)\n : startMapperUnwrapped;\n\nexport const makeShareable = __DEV__\n ? configurationCheckWrapper(makeShareableUnwrapped)\n : makeShareableUnwrapped;\n\nexport const makeMutable = __DEV__\n ? configurationCheckWrapper(makeMutableUnwrapped)\n : makeMutableUnwrapped;\n\nexport const makeRemote = __DEV__\n ? configurationCheckWrapper(makeRemoteUnwrapped)\n : makeRemoteUnwrapped;\n\nglobal._WORKLET = false;\nglobal._log = function (s: string) {\n console.log(s);\n};\n\nexport function getViewProp<T>(viewTag: string, propName: string): Promise<T> {\n if (global._IS_FABRIC) {\n throw new Error(\n '[react-native-reanimated] `getViewProp` is not supported on Fabric yet'\n );\n }\n\n return new Promise((resolve, reject) => {\n return NativeReanimatedModule.getViewProp(\n viewTag,\n propName,\n (result: T) => {\n if (typeof result === 'string' && result.substr(0, 6) === 'error:') {\n reject(result);\n } else {\n resolve(result);\n }\n }\n );\n });\n}\n\nexport function registerEventHandler<T>(\n eventHash: string,\n eventHandler: (event: T) => void\n): string {\n function handleAndFlushAnimationFrame(eventTimestamp: number, event: T) {\n 'worklet';\n global.__frameTimestamp = eventTimestamp;\n eventHandler(event);\n global.__flushAnimationFrame(eventTimestamp);\n global.__frameTimestamp = undefined;\n }\n return NativeReanimatedModule.registerEventHandler(\n eventHash,\n makeShareableCloneRecursive(handleAndFlushAnimationFrame)\n );\n}\n\nexport function unregisterEventHandler(id: string): void {\n return NativeReanimatedModule.unregisterEventHandler(id);\n}\n\nexport function subscribeForKeyboardEvents(\n eventHandler: (state: number, height: number) => void,\n options: AnimatedKeyboardOptions\n): number {\n // TODO: this should really go with the same code path as other events, that is\n // via registerEventHandler. For now we are copying the code from there.\n function handleAndFlushAnimationFrame(state: number, height: number) {\n 'worklet';\n const now = performance.now();\n global.__frameTimestamp = now;\n eventHandler(state, height);\n global.__flushAnimationFrame(now);\n global.__frameTimestamp = undefined;\n }\n return NativeReanimatedModule.subscribeForKeyboardEvents(\n makeShareableCloneRecursive(handleAndFlushAnimationFrame),\n options.isStatusBarTranslucentAndroid ?? false\n );\n}\n\nexport function unsubscribeFromKeyboardEvents(listenerId: number): void {\n return NativeReanimatedModule.unsubscribeFromKeyboardEvents(listenerId);\n}\n\nexport function registerSensor(\n sensorType: number,\n interval: number,\n iosReferenceFrame: number,\n eventHandler: (\n data: Value3D | ValueRotation,\n orientationDegrees: number\n ) => void\n): number {\n return NativeReanimatedModule.registerSensor(\n sensorType,\n interval,\n iosReferenceFrame,\n makeShareableCloneRecursive(eventHandler)\n );\n}\n\nexport function unregisterSensor(listenerId: number): void {\n return NativeReanimatedModule.unregisterSensor(listenerId);\n}\n\n// initialize UI runtime if applicable\nif (!isWeb() && isConfigured()) {\n initializeUIRuntime();\n}\n\ntype FeaturesConfig = {\n enableLayoutAnimations: boolean;\n setByUser: boolean;\n};\n\nlet featuresConfig: FeaturesConfig = {\n enableLayoutAnimations: false,\n setByUser: false,\n};\n\nexport function enableLayoutAnimations(\n flag: boolean,\n isCallByUser = true\n): void {\n if (isCallByUser) {\n featuresConfig = {\n enableLayoutAnimations: flag,\n setByUser: true,\n };\n NativeReanimatedModule.enableLayoutAnimations(flag);\n } else if (\n !featuresConfig.setByUser &&\n featuresConfig.enableLayoutAnimations !== flag\n ) {\n featuresConfig.enableLayoutAnimations = flag;\n NativeReanimatedModule.enableLayoutAnimations(flag);\n }\n}\n\nexport function configureLayoutAnimations(\n viewTag: number,\n type: LayoutAnimationType,\n config: LayoutAnimationFunction | Keyframe,\n sharedTransitionTag = ''\n): void {\n NativeReanimatedModule.configureLayoutAnimation(\n viewTag,\n type,\n sharedTransitionTag,\n makeShareableCloneRecursive(config)\n );\n}\n\nexport function configureProps(uiProps: string[], nativeProps: string[]): void {\n if (!nativeShouldBeMock()) {\n NativeReanimatedModule.configureProps(uiProps, nativeProps);\n }\n}\n"],"mappings":"AAAA,OAAOA,sBAAsB,MAAM,oBAAoB;AACvD,SAASC,kBAAkB,EAAEC,cAAc,EAAEC,KAAK,QAAQ,mBAAmB;AAO7E,SACEC,2BAA2B,EAC3BC,aAAa,IAAIC,sBAAsB,QAClC,cAAc;AACrB,SAASC,WAAW,IAAIC,oBAAo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
|
3
2
|
export function registerWorkletStackDetails(hash, stackDetails) {
|
|
4
3
|
_workletStackDetails.set(hash, stackDetails);
|
|
5
4
|
}
|
|
6
|
-
|
|
7
5
|
function getBundleOffset(error) {
|
|
8
6
|
var _error$stack, _error$stack$split;
|
|
9
|
-
|
|
10
7
|
const frame = (_error$stack = error.stack) === null || _error$stack === void 0 ? void 0 : (_error$stack$split = _error$stack.split('\n')) === null || _error$stack$split === void 0 ? void 0 : _error$stack$split[0];
|
|
11
|
-
|
|
12
8
|
if (frame) {
|
|
13
9
|
const parsedFrame = /@([^@]+):(\d+):(\d+)/.exec(frame);
|
|
14
|
-
|
|
15
10
|
if (parsedFrame) {
|
|
16
11
|
const [, file, line, col] = parsedFrame;
|
|
17
12
|
return [file, Number(line), Number(col)];
|
|
18
13
|
}
|
|
19
14
|
}
|
|
20
|
-
|
|
21
15
|
return ['unknown', 0, 0];
|
|
22
16
|
}
|
|
23
|
-
|
|
24
17
|
function processStack(stack) {
|
|
25
18
|
const workletStackEntries = stack.match(/worklet_(\d+):(\d+):(\d+)/g);
|
|
26
19
|
let result = stack;
|
|
27
20
|
workletStackEntries === null || workletStackEntries === void 0 ? void 0 : workletStackEntries.forEach(match => {
|
|
28
21
|
const [, hash, origLine, origCol] = match.split(/:|_/).map(Number);
|
|
29
|
-
|
|
30
22
|
const errorDetails = _workletStackDetails.get(hash);
|
|
31
|
-
|
|
32
23
|
if (!errorDetails) {
|
|
33
24
|
return;
|
|
34
25
|
}
|
|
35
|
-
|
|
36
26
|
const [error, lineOffset, colOffset] = errorDetails;
|
|
37
27
|
const [bundleFile, bundleLine, bundleCol] = getBundleOffset(error);
|
|
38
28
|
const line = origLine + bundleLine + lineOffset;
|
|
@@ -41,7 +31,6 @@ function processStack(stack) {
|
|
|
41
31
|
});
|
|
42
32
|
return result;
|
|
43
33
|
}
|
|
44
|
-
|
|
45
34
|
export function reportFatalErrorOnJS(_ref) {
|
|
46
35
|
let {
|
|
47
36
|
message,
|
|
@@ -50,9 +39,10 @@ export function reportFatalErrorOnJS(_ref) {
|
|
|
50
39
|
const error = new Error();
|
|
51
40
|
error.message = message;
|
|
52
41
|
error.stack = stack ? processStack(stack) : undefined;
|
|
53
|
-
error.name = 'ReanimatedError';
|
|
54
|
-
|
|
42
|
+
error.name = 'ReanimatedError';
|
|
43
|
+
// @ts-ignore React Native's ErrorUtils implementation extends the Error type with jsEngine field
|
|
55
44
|
error.jsEngine = 'reanimated';
|
|
45
|
+
// @ts-ignore the reportFatalError method is an internal method of ErrorUtils not exposed in the type definitions
|
|
56
46
|
global.ErrorUtils.reportFatalError(error);
|
|
57
47
|
}
|
|
58
48
|
//# sourceMappingURL=errors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_workletStackDetails","Map","registerWorkletStackDetails","hash","stackDetails","set","getBundleOffset","error","frame","stack","split","parsedFrame","exec","file","line","col","Number","processStack","workletStackEntries","match","result","forEach","origLine","origCol","map","errorDetails","get","lineOffset","colOffset","bundleFile","bundleLine","bundleCol","replace","reportFatalErrorOnJS","message","Error","undefined","name","jsEngine","global","ErrorUtils","reportFatalError"],"sources":["errors.ts"],"sourcesContent":["type StackDetails = [Error, number, number];\n\nconst _workletStackDetails = new Map<number, StackDetails>();\n\nexport function registerWorkletStackDetails(\n hash: number,\n stackDetails: StackDetails\n) {\n _workletStackDetails.set(hash, stackDetails);\n}\n\nfunction getBundleOffset(error: Error): [string, number, number] {\n const frame = error.stack?.split('\\n')?.[0];\n if (frame) {\n const parsedFrame = /@([^@]+):(\\d+):(\\d+)/.exec(frame);\n if (parsedFrame) {\n const [, file, line, col] = parsedFrame;\n return [file, Number(line), Number(col)];\n }\n }\n return ['unknown', 0, 0];\n}\n\nfunction processStack(stack: string): string {\n const workletStackEntries = stack.match(/worklet_(\\d+):(\\d+):(\\d+)/g);\n let result = stack;\n workletStackEntries?.forEach((match) => {\n const [, hash, origLine, origCol] = match.split(/:|_/).map(Number);\n const errorDetails = _workletStackDetails.get(hash);\n if (!errorDetails) {\n return;\n }\n const [error, lineOffset, colOffset] = errorDetails;\n const [bundleFile, bundleLine, bundleCol] = getBundleOffset(error);\n const line = origLine + bundleLine + lineOffset;\n const col = origCol + bundleCol + colOffset;\n\n result = result.replace(match, `${bundleFile}:${line}:${col}`);\n });\n return result;\n}\n\nexport function reportFatalErrorOnJS({\n message,\n stack,\n}: {\n message: string;\n stack?: string;\n}) {\n const error = new Error();\n error.message = message;\n error.stack = stack ? processStack(stack) : undefined;\n error.name = 'ReanimatedError';\n // @ts-ignore React Native's ErrorUtils implementation extends the Error type with jsEngine field\n error.jsEngine = 'reanimated';\n global.ErrorUtils.reportFatalError(error);\n}\n"],"mappings":"AAEA,MAAMA,oBAAoB,GAAG,IAAIC,
|
|
1
|
+
{"version":3,"names":["_workletStackDetails","Map","registerWorkletStackDetails","hash","stackDetails","set","getBundleOffset","error","_error$stack","_error$stack$split","frame","stack","split","parsedFrame","exec","file","line","col","Number","processStack","workletStackEntries","match","result","forEach","origLine","origCol","map","errorDetails","get","lineOffset","colOffset","bundleFile","bundleLine","bundleCol","replace","reportFatalErrorOnJS","_ref","message","Error","undefined","name","jsEngine","global","ErrorUtils","reportFatalError"],"sources":["errors.ts"],"sourcesContent":["type StackDetails = [Error, number, number];\n\nconst _workletStackDetails = new Map<number, StackDetails>();\n\nexport function registerWorkletStackDetails(\n hash: number,\n stackDetails: StackDetails\n) {\n _workletStackDetails.set(hash, stackDetails);\n}\n\nfunction getBundleOffset(error: Error): [string, number, number] {\n const frame = error.stack?.split('\\n')?.[0];\n if (frame) {\n const parsedFrame = /@([^@]+):(\\d+):(\\d+)/.exec(frame);\n if (parsedFrame) {\n const [, file, line, col] = parsedFrame;\n return [file, Number(line), Number(col)];\n }\n }\n return ['unknown', 0, 0];\n}\n\nfunction processStack(stack: string): string {\n const workletStackEntries = stack.match(/worklet_(\\d+):(\\d+):(\\d+)/g);\n let result = stack;\n workletStackEntries?.forEach((match) => {\n const [, hash, origLine, origCol] = match.split(/:|_/).map(Number);\n const errorDetails = _workletStackDetails.get(hash);\n if (!errorDetails) {\n return;\n }\n const [error, lineOffset, colOffset] = errorDetails;\n const [bundleFile, bundleLine, bundleCol] = getBundleOffset(error);\n const line = origLine + bundleLine + lineOffset;\n const col = origCol + bundleCol + colOffset;\n\n result = result.replace(match, `${bundleFile}:${line}:${col}`);\n });\n return result;\n}\n\nexport function reportFatalErrorOnJS({\n message,\n stack,\n}: {\n message: string;\n stack?: string;\n}) {\n const error = new Error();\n error.message = message;\n error.stack = stack ? processStack(stack) : undefined;\n error.name = 'ReanimatedError';\n // @ts-ignore React Native's ErrorUtils implementation extends the Error type with jsEngine field\n error.jsEngine = 'reanimated';\n // @ts-ignore the reportFatalError method is an internal method of ErrorUtils not exposed in the type definitions\n global.ErrorUtils.reportFatalError(error);\n}\n"],"mappings":"AAEA,MAAMA,oBAAoB,GAAG,IAAIC,GAAG,EAAwB;AAE5D,OAAO,SAASC,2BAA2BA,CACzCC,IAAY,EACZC,YAA0B,EAC1B;EACAJ,oBAAoB,CAACK,GAAG,CAACF,IAAI,EAAEC,YAAY,CAAC;AAC9C;AAEA,SAASE,eAAeA,CAACC,KAAY,EAA4B;EAAA,IAAAC,YAAA,EAAAC,kBAAA;EAC/D,MAAMC,KAAK,IAAAF,YAAA,GAAGD,KAAK,CAACI,KAAK,cAAAH,YAAA,wBAAAC,kBAAA,GAAXD,YAAA,CAAaI,KAAK,CAAC,IAAI,CAAC,cAAAH,kBAAA,uBAAxBA,kBAAA,CAA2B,CAAC,CAAC;EAC3C,IAAIC,KAAK,EAAE;IACT,MAAMG,WAAW,GAAG,sBAAsB,CAACC,IAAI,CAACJ,KAAK,CAAC;IACtD,IAAIG,WAAW,EAAE;MACf,MAAM,GAAGE,IAAI,EAAEC,IAAI,EAAEC,GAAG,CAAC,GAAGJ,WAAW;MACvC,OAAO,CAACE,IAAI,EAAEG,MAAM,CAACF,IAAI,CAAC,EAAEE,MAAM,CAACD,GAAG,CAAC,CAAC;IAC1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K,CAAC,GAAG4B,SAAS;EACrDhC,KAAK,CAACiC,IAAI,GAAG,iBAAiB;EAC9B;EACAjC,KAAK,CAACkC,QAAQ,GAAG,YAAY;EAC7B;EACAC,MAAM,CAACC,UAAU,CAACC,gBAAgB,CAACrC,KAAK,CAAC;AAC3C"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/* eslint-disable camelcase */
|
|
2
|
+
|
|
2
3
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3
4
|
let findHostInstance_DEPRECATED = _ref => null;
|
|
4
|
-
|
|
5
5
|
try {
|
|
6
6
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
7
7
|
findHostInstance_DEPRECATED = require('react-native/Libraries/Renderer/shims/ReactFabric').findHostInstance_DEPRECATED;
|
|
8
|
-
} catch (e) {
|
|
8
|
+
} catch (e) {
|
|
9
|
+
// do nothing
|
|
9
10
|
}
|
|
10
|
-
|
|
11
11
|
export function getShadowNodeWrapperFromHostInstance(hostInstance) {
|
|
12
12
|
// @ts-ignore Fabric
|
|
13
13
|
return hostInstance._internalInstanceHandle.stateNode.node;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["findHostInstance_DEPRECATED","_ref","require","e","getShadowNodeWrapperFromHostInstance","hostInstance","_internalInstanceHandle","stateNode","node","getShadowNodeWrapperFromRef","ref"],"sources":["fabricUtils.ts"],"sourcesContent":["/* eslint-disable camelcase */\n\nimport { ShadowNodeWrapper } from './commonTypes';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nlet findHostInstance_DEPRECATED = (_ref: React.Component) => null;\n\ntry {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n findHostInstance_DEPRECATED =\n require('react-native/Libraries/Renderer/shims/ReactFabric').findHostInstance_DEPRECATED;\n} catch (e) {\n // do nothing\n}\n\nexport function getShadowNodeWrapperFromHostInstance(\n hostInstance: unknown\n): ShadowNodeWrapper {\n // @ts-ignore Fabric\n return hostInstance._internalInstanceHandle.stateNode.node;\n}\n\nexport function getShadowNodeWrapperFromRef(\n ref: React.Component\n): ShadowNodeWrapper {\n return getShadowNodeWrapperFromHostInstance(findHostInstance_DEPRECATED(ref));\n}\n"],"mappings":"AAAA
|
|
1
|
+
{"version":3,"names":["findHostInstance_DEPRECATED","_ref","require","e","getShadowNodeWrapperFromHostInstance","hostInstance","_internalInstanceHandle","stateNode","node","getShadowNodeWrapperFromRef","ref"],"sources":["fabricUtils.ts"],"sourcesContent":["/* eslint-disable camelcase */\n\nimport { ShadowNodeWrapper } from './commonTypes';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nlet findHostInstance_DEPRECATED = (_ref: React.Component) => null;\n\ntry {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n findHostInstance_DEPRECATED =\n require('react-native/Libraries/Renderer/shims/ReactFabric').findHostInstance_DEPRECATED;\n} catch (e) {\n // do nothing\n}\n\nexport function getShadowNodeWrapperFromHostInstance(\n hostInstance: unknown\n): ShadowNodeWrapper {\n // @ts-ignore Fabric\n return hostInstance._internalInstanceHandle.stateNode.node;\n}\n\nexport function getShadowNodeWrapperFromRef(\n ref: React.Component\n): ShadowNodeWrapper {\n return getShadowNodeWrapperFromHostInstance(findHostInstance_DEPRECATED(ref));\n}\n"],"mappings":"AAAA;;AAIA;AACA,IAAIA,2BAA2B,GAAIC,IAAqB,IAAK,IAAI;AAEjE,IAAI;EACF;EACAD,2BAA2B,GACzBE,OAAO,CAAC,mDAAmD,CAAC,CAACF,2BAA2B;AAC5F,CAAC,CAAC,OAAOG,CAAC,EAAE;EACV;AAAA;AAGF,OAAO,SAASC,oCAAoCA,CAClDC,YAAqB,EACF;EACnB;EACA,OAAOA,YAAY,CAACC,uBAAuB,CAACC,SAAS,CAACC,IAAI;AAC5D;AAEA,OAAO,SAASC,2BAA2BA,CACzCC,GAAoB,EACD;EACnB,OAAON,oCAAoC,CAACJ,2BAA2B,CAACU,GAAG,CAAC,CAAC;AAC/E"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable camelcase */
|
|
2
|
+
|
|
2
3
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3
4
|
const findHostInstance_DEPRECATED = _ref => null;
|
|
4
|
-
|
|
5
5
|
export function getShadowNodeWrapperFromHostInstance(hostInstance) {
|
|
6
6
|
// @ts-ignore Fabric
|
|
7
7
|
return hostInstance._internalInstanceHandle.stateNode.node;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["findHostInstance_DEPRECATED","_ref","getShadowNodeWrapperFromHostInstance","hostInstance","_internalInstanceHandle","stateNode","node","getShadowNodeWrapperFromRef","ref"],"sources":["fabricUtils.web.ts"],"sourcesContent":["/* eslint-disable camelcase */\n\nimport { ShadowNodeWrapper } from './commonTypes';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst findHostInstance_DEPRECATED = (_ref: React.Component) => null;\n\nexport function getShadowNodeWrapperFromHostInstance(\n hostInstance: unknown\n): ShadowNodeWrapper {\n // @ts-ignore Fabric\n return hostInstance._internalInstanceHandle.stateNode.node;\n}\n\nexport function getShadowNodeWrapperFromRef(\n ref: React.Component\n): ShadowNodeWrapper {\n return getShadowNodeWrapperFromHostInstance(findHostInstance_DEPRECATED(ref));\n}\n"],"mappings":"AAAA
|
|
1
|
+
{"version":3,"names":["findHostInstance_DEPRECATED","_ref","getShadowNodeWrapperFromHostInstance","hostInstance","_internalInstanceHandle","stateNode","node","getShadowNodeWrapperFromRef","ref"],"sources":["fabricUtils.web.ts"],"sourcesContent":["/* eslint-disable camelcase */\n\nimport { ShadowNodeWrapper } from './commonTypes';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst findHostInstance_DEPRECATED = (_ref: React.Component) => null;\n\nexport function getShadowNodeWrapperFromHostInstance(\n hostInstance: unknown\n): ShadowNodeWrapper {\n // @ts-ignore Fabric\n return hostInstance._internalInstanceHandle.stateNode.node;\n}\n\nexport function getShadowNodeWrapperFromRef(\n ref: React.Component\n): ShadowNodeWrapper {\n return getShadowNodeWrapperFromHostInstance(findHostInstance_DEPRECATED(ref));\n}\n"],"mappings":"AAAA;;AAIA;AACA,MAAMA,2BAA2B,GAAIC,IAAqB,IAAK,IAAI;AAEnE,OAAO,SAASC,oCAAoCA,CAClDC,YAAqB,EACF;EACnB;EACA,OAAOA,YAAY,CAACC,uBAAuB,CAACC,SAAS,CAACC,IAAI;AAC5D;AAEA,OAAO,SAASC,2BAA2BA,CACzCC,GAAoB,EACD;EACnB,OAAON,oCAAoC,CAACF,2BAA2B,CAACQ,GAAG,CAAC,CAAC;AAC/E"}
|
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
-
|
|
1
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
3
4
|
import { runOnUI } from '../core';
|
|
4
5
|
import { prepareUIRegistry } from './FrameCallbackRegistryUI';
|
|
5
6
|
export default class FrameCallbackRegistryJS {
|
|
6
7
|
constructor() {
|
|
7
8
|
_defineProperty(this, "nextCallbackId", 0);
|
|
8
|
-
|
|
9
9
|
prepareUIRegistry();
|
|
10
10
|
}
|
|
11
|
-
|
|
12
11
|
registerFrameCallback(callback) {
|
|
13
12
|
if (!callback) {
|
|
14
13
|
return -1;
|
|
15
14
|
}
|
|
16
|
-
|
|
17
15
|
const callbackId = this.nextCallbackId;
|
|
18
16
|
this.nextCallbackId++;
|
|
19
17
|
runOnUI(() => {
|
|
@@ -23,7 +21,6 @@ export default class FrameCallbackRegistryJS {
|
|
|
23
21
|
})();
|
|
24
22
|
return callbackId;
|
|
25
23
|
}
|
|
26
|
-
|
|
27
24
|
unregisterFrameCallback(callbackId) {
|
|
28
25
|
runOnUI(() => {
|
|
29
26
|
'worklet';
|
|
@@ -31,7 +28,6 @@ export default class FrameCallbackRegistryJS {
|
|
|
31
28
|
global._frameCallbackRegistry.unregisterFrameCallback(callbackId);
|
|
32
29
|
})();
|
|
33
30
|
}
|
|
34
|
-
|
|
35
31
|
manageStateFrameCallback(callbackId, state) {
|
|
36
32
|
runOnUI(() => {
|
|
37
33
|
'worklet';
|
|
@@ -39,6 +35,5 @@ export default class FrameCallbackRegistryJS {
|
|
|
39
35
|
global._frameCallbackRegistry.manageStateFrameCallback(callbackId, state);
|
|
40
36
|
})();
|
|
41
37
|
}
|
|
42
|
-
|
|
43
38
|
}
|
|
44
39
|
//# sourceMappingURL=FrameCallbackRegistryJS.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["runOnUI","prepareUIRegistry","FrameCallbackRegistryJS","constructor","registerFrameCallback","callback","callbackId","nextCallbackId","global","_frameCallbackRegistry","unregisterFrameCallback","manageStateFrameCallback","state"],"sources":["FrameCallbackRegistryJS.ts"],"sourcesContent":["import { runOnUI } from '../core';\nimport { FrameInfo, prepareUIRegistry } from './FrameCallbackRegistryUI';\n\nexport default class FrameCallbackRegistryJS {\n private nextCallbackId = 0;\n\n constructor() {\n prepareUIRegistry();\n }\n\n registerFrameCallback(callback: (frameInfo: FrameInfo) => void): number {\n if (!callback) {\n return -1;\n }\n\n const callbackId = this.nextCallbackId;\n this.nextCallbackId++;\n\n runOnUI(() => {\n 'worklet';\n global._frameCallbackRegistry.registerFrameCallback(callback, callbackId);\n })();\n\n return callbackId;\n }\n\n unregisterFrameCallback(callbackId: number): void {\n runOnUI(() => {\n 'worklet';\n global._frameCallbackRegistry.unregisterFrameCallback(callbackId);\n })();\n }\n\n manageStateFrameCallback(callbackId: number, state: boolean): void {\n runOnUI(() => {\n 'worklet';\n global._frameCallbackRegistry.manageStateFrameCallback(callbackId, state);\n })();\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["runOnUI","prepareUIRegistry","FrameCallbackRegistryJS","constructor","_defineProperty","registerFrameCallback","callback","callbackId","nextCallbackId","global","_frameCallbackRegistry","unregisterFrameCallback","manageStateFrameCallback","state"],"sources":["FrameCallbackRegistryJS.ts"],"sourcesContent":["import { runOnUI } from '../core';\nimport { FrameInfo, prepareUIRegistry } from './FrameCallbackRegistryUI';\n\nexport default class FrameCallbackRegistryJS {\n private nextCallbackId = 0;\n\n constructor() {\n prepareUIRegistry();\n }\n\n registerFrameCallback(callback: (frameInfo: FrameInfo) => void): number {\n if (!callback) {\n return -1;\n }\n\n const callbackId = this.nextCallbackId;\n this.nextCallbackId++;\n\n runOnUI(() => {\n 'worklet';\n global._frameCallbackRegistry.registerFrameCallback(callback, callbackId);\n })();\n\n return callbackId;\n }\n\n unregisterFrameCallback(callbackId: number): void {\n runOnUI(() => {\n 'worklet';\n global._frameCallbackRegistry.unregisterFrameCallback(callbackId);\n })();\n }\n\n manageStateFrameCallback(callbackId: number, state: boolean): void {\n runOnUI(() => {\n 'worklet';\n global._frameCallbackRegistry.manageStateFrameCallback(callbackId, state);\n })();\n }\n}\n"],"mappings":";;;AAAA,SAASA,OAAO,QAAQ,SAAS;AACjC,SAAoBC,iBAAiB,QAAQ,2BAA2B;AAExE,eAAe,MAAMC,uBAAuB,CAAC;EAG3CC,WAAWA,CAAA,EAAG;IAAAC,eAAA,yBAFW,CAAC;IAGxBH,iBAAiB,EAAE;EACrB;EAEAI,qBAAqBA,CAACC,QAAwC,EAAU;IACtE,IAAI,CAACA,QAAQ,EAAE;MACb,OAAO,CAAC,CAAC;IACX;IAEA,MAAMC,UAAU,GAAG,IAAI,CAACC,cAAc;IACtC,IAAI,CAACA,cAAc,EAAE;IAErBR,OAAO,CAAC,MAAM;MACZ,SAAS;;MACTS,MAAM,CAACC,sBAAsB,CAACL,qBAAqB,CAACC,QAAQ,EAAEC,UAAU,CAAC;IAC3E,CAAC,CAAC,EAAE;IAEJ,OAAOA,UAAU;EACnB;EAEAI,uBAAuBA,CAACJ,UAAkB,EAAQ;IAChDP,OAAO,CAAC,MAAM;MACZ,SAAS;;MACTS,MAAM,CAACC,sBAAsB,CAACC,uBAAuB,CAACJ,UAAU,CAAC;IACnE,CAAC,CAAC,EAAE;EACN;EAEAK,wBAAwBA,CAACL,UAAkB,EAAEM,KAAc,EAAQ;IACjEb,OAAO,CAAC,MAAM;MACZ,SAAS;;MACTS,MAAM,CAACC,sBAAsB,CAACE,wBAAwB,CAACL,UAAU,EAAEM,KAAK,CAAC;IAC3E,CAAC,CAAC,EAAE;EACN;AACF"}
|
|
@@ -6,20 +6,21 @@ export const prepareUIRegistry = runOnUIImmediately(() => {
|
|
|
6
6
|
frameCallbackRegistry: new Map(),
|
|
7
7
|
activeFrameCallbacks: new Set(),
|
|
8
8
|
previousFrameTimestamp: null,
|
|
9
|
-
|
|
10
|
-
runCallbacks() {
|
|
9
|
+
nextCallId: 0,
|
|
10
|
+
runCallbacks(callId) {
|
|
11
11
|
const loop = timestamp => {
|
|
12
|
+
if (callId !== this.nextCallId) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
12
15
|
if (this.previousFrameTimestamp === null) {
|
|
13
16
|
this.previousFrameTimestamp = timestamp;
|
|
14
17
|
}
|
|
15
|
-
|
|
16
18
|
const delta = timestamp - this.previousFrameTimestamp;
|
|
17
19
|
this.activeFrameCallbacks.forEach(callbackId => {
|
|
18
20
|
const callbackDetails = this.frameCallbackRegistry.get(callbackId);
|
|
19
21
|
const {
|
|
20
22
|
startTime
|
|
21
23
|
} = callbackDetails;
|
|
22
|
-
|
|
23
24
|
if (startTime === null) {
|
|
24
25
|
// First frame
|
|
25
26
|
callbackDetails.startTime = timestamp;
|
|
@@ -37,50 +38,47 @@ export const prepareUIRegistry = runOnUIImmediately(() => {
|
|
|
37
38
|
});
|
|
38
39
|
}
|
|
39
40
|
});
|
|
40
|
-
|
|
41
41
|
if (this.activeFrameCallbacks.size > 0) {
|
|
42
42
|
this.previousFrameTimestamp = timestamp;
|
|
43
43
|
requestAnimationFrame(loop);
|
|
44
44
|
} else {
|
|
45
45
|
this.previousFrameTimestamp = null;
|
|
46
46
|
}
|
|
47
|
-
};
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
// runCallback() should only be called after registering a callback,
|
|
48
50
|
// so if there is only one active callback, then it means that there were
|
|
49
51
|
// zero previously and the loop isn't running yet.
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
if (this.activeFrameCallbacks.size === 1) {
|
|
52
|
+
if (this.activeFrameCallbacks.size === 1 && callId === this.nextCallId) {
|
|
53
53
|
requestAnimationFrame(loop);
|
|
54
54
|
}
|
|
55
55
|
},
|
|
56
|
-
|
|
57
56
|
registerFrameCallback(callback, callbackId) {
|
|
58
57
|
this.frameCallbackRegistry.set(callbackId, {
|
|
59
58
|
callback: callback,
|
|
60
59
|
startTime: null
|
|
61
60
|
});
|
|
62
61
|
},
|
|
63
|
-
|
|
64
62
|
unregisterFrameCallback(callbackId) {
|
|
65
63
|
this.manageStateFrameCallback(callbackId, false);
|
|
66
64
|
this.frameCallbackRegistry.delete(callbackId);
|
|
67
65
|
},
|
|
68
|
-
|
|
69
66
|
manageStateFrameCallback(callbackId, state) {
|
|
70
67
|
if (callbackId === -1) {
|
|
71
68
|
return;
|
|
72
69
|
}
|
|
73
|
-
|
|
74
70
|
if (state) {
|
|
75
71
|
this.activeFrameCallbacks.add(callbackId);
|
|
76
|
-
this.runCallbacks();
|
|
72
|
+
this.runCallbacks(this.nextCallId);
|
|
77
73
|
} else {
|
|
78
74
|
const callback = this.frameCallbackRegistry.get(callbackId);
|
|
79
75
|
callback.startTime = null;
|
|
80
76
|
this.activeFrameCallbacks.delete(callbackId);
|
|
77
|
+
if (this.activeFrameCallbacks.size === 0) {
|
|
78
|
+
this.nextCallId += 1;
|
|
79
|
+
}
|
|
81
80
|
}
|
|
82
81
|
}
|
|
83
|
-
|
|
84
82
|
};
|
|
85
83
|
global._frameCallbackRegistry = frameCallbackRegistry;
|
|
86
84
|
});
|