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":["JSReanimated","NativeReanimated","constructor","Map","makeShareableClone","
|
|
1
|
+
{"version":3,"names":["_NativeReanimated","require","_commonTypes","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","JSReanimated","NativeReanimated","constructor","Map","makeShareableClone","__hostObjectShareableJSRef","installCoreFunctions","_callGuard","_valueUnpacker","scheduleOnUI","worklet","requestAnimationFrame","registerEventHandler","_eventHash","_eventHandler","unregisterEventHandler","_","enableLayoutAnimations","console","warn","configureLayoutAnimation","registerSensor","sensorType","interval","iosReferenceFrame","eventHandler","getSensorName","window","sensor","initializeSensor","callback","SensorType","ROTATION","qw","qx","qy","qz","quaternion","yaw","Math","atan2","pitch","sin","roll","interfaceOrientation","x","y","z","addEventListener","start","sensors","set","nextSensorId","unregisterSensor","id","get","stop","delete","subscribeForKeyboardEvents","unsubscribeFromKeyboardEvents","config","referenceFrame","frequency","ACCELEROMETER","Accelerometer","GYROSCOPE","Gyroscope","GRAVITY","GravitySensor","MAGNETIC_FIELD","Magnetometer","AbsoluteOrientationSensor","exports","default"],"sources":["JSReanimated.ts"],"sourcesContent":["import { NativeReanimated } from '../NativeReanimated/NativeReanimated';\nimport {\n SensorType,\n ShareableRef,\n Value3D,\n ValueRotation,\n} from '../commonTypes';\nimport { WebSensor } from './WebSensor';\n\nexport default class JSReanimated extends NativeReanimated {\n nextSensorId = 0;\n sensors = new Map<number, WebSensor>();\n\n constructor() {\n super(false);\n }\n\n makeShareableClone<T>(value: T): ShareableRef<T> {\n return { __hostObjectShareableJSRef: value };\n }\n\n installCoreFunctions(\n _callGuard: <T extends Array<any>, U>(\n fn: (...args: T) => U,\n ...args: T\n ) => void,\n _valueUnpacker: <T>(value: T) => T\n ): void {\n // noop\n }\n\n scheduleOnUI<T>(worklet: ShareableRef<T>) {\n // @ts-ignore web implementation has still not been updated after the rewrite, this will be addressed once the web implementation updates are ready\n requestAnimationFrame(worklet);\n }\n\n registerEventHandler<T>(\n _eventHash: string,\n _eventHandler: ShareableRef<T>\n ): string {\n // noop\n return '';\n }\n\n unregisterEventHandler(_: string): void {\n // noop\n }\n\n enableLayoutAnimations() {\n console.warn(\n '[Reanimated] Layout Animations are not supported on web yet.'\n );\n }\n\n configureLayoutAnimation() {\n // no-op\n }\n\n registerSensor(\n sensorType: SensorType,\n interval: number,\n iosReferenceFrame: number,\n eventHandler: (data: Value3D | ValueRotation) => void\n ): number {\n if (!(this.getSensorName(sensorType) in window)) {\n return -1;\n }\n\n const sensor: WebSensor = this.initializeSensor(sensorType, interval);\n let callback;\n if (sensorType === SensorType.ROTATION) {\n callback = () => {\n const [qw, qx, qy, qz] = sensor.quaternion;\n\n // reference: https://stackoverflow.com/questions/5782658/extracting-yaw-from-a-quaternion\n const yaw = Math.atan2(\n 2.0 * (qy * qz + qw * qx),\n qw * qw - qx * qx - qy * qy + qz * qz\n );\n const pitch = Math.sin(-2.0 * (qx * qz - qw * qy));\n const roll = Math.atan2(\n 2.0 * (qx * qy + qw * qz),\n qw * qw + qx * qx - qy * qy - qz * qz\n );\n eventHandler({\n qw,\n qx,\n qy,\n qz,\n yaw,\n pitch,\n roll,\n interfaceOrientation: 0,\n });\n };\n } else {\n callback = () => {\n const { x, y, z } = sensor;\n eventHandler({ x, y, z, interfaceOrientation: 0 });\n };\n }\n sensor.addEventListener('reading', callback);\n sensor.start();\n\n this.sensors.set(this.nextSensorId, sensor);\n return this.nextSensorId++;\n }\n\n unregisterSensor(id: number): void {\n const sensor: WebSensor | undefined = this.sensors.get(id);\n if (sensor !== undefined) {\n sensor.stop();\n this.sensors.delete(id);\n }\n }\n\n subscribeForKeyboardEvents(_: ShareableRef<number>): number {\n console.warn(\n '[Reanimated] useAnimatedKeyboard is not available on web yet.'\n );\n return -1;\n }\n\n unsubscribeFromKeyboardEvents(_: number): void {\n // noop\n }\n\n initializeSensor(sensorType: SensorType, interval: number): WebSensor {\n const config =\n interval <= 0\n ? { referenceFrame: 'device' }\n : { frequency: 1000 / interval };\n switch (sensorType) {\n case SensorType.ACCELEROMETER:\n return new window.Accelerometer(config);\n case SensorType.GYROSCOPE:\n return new window.Gyroscope(config);\n case SensorType.GRAVITY:\n return new window.GravitySensor(config);\n case SensorType.MAGNETIC_FIELD:\n return new window.Magnetometer(config);\n case SensorType.ROTATION:\n return new window.AbsoluteOrientationSensor(config);\n }\n }\n\n getSensorName(sensorType: SensorType): string {\n switch (sensorType) {\n case SensorType.ACCELEROMETER:\n return 'Accelerometer';\n case SensorType.GRAVITY:\n return 'GravitySensor';\n case SensorType.GYROSCOPE:\n return 'Gyroscope';\n case SensorType.MAGNETIC_FIELD:\n return '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,MAAM,GACVrC,QAAQ,IAAI,CAAC,GACT;MAAEsC,cAAc,EAAE;IAAS,CAAC,GAC5B;MAAEC,SAAS,EAAE,IAAI,GAAGvC;IAAS,CAAC;IACpC,QAAQD,UAAU;MAChB,KAAKS,uBAAU,CAACgC,aAAa;QAC3B,OAAO,IAAIpC,MAAM,CAACqC,aAAa,CAACJ,MAAM,CAAC;MACzC,KAAK7B,uBAAU,CAACkC,SAAS;QACvB,OAAO,IAAItC,MAAM,CAACuC,SAAS,CAACN,MAAM,CAAC;MACrC,KAAK7B,uBAAU,CAACoC,OAAO;QACrB,OAAO,IAAIxC,MAAM,CAACyC,aAAa,CAACR,MAAM,CAAC;MACzC,KAAK7B,uBAAU,CAACsC,cAAc;QAC5B,OAAO,IAAI1C,MAAM,CAAC2C,YAAY,CAACV,MAAM,CAAC;MACxC,KAAK7B,uBAAU,CAACC,QAAQ;QACtB,OAAO,IAAIL,MAAM,CAAC4C,yBAAyB,CAACX,MAAM,CAAC;IAAC;EAE1D;EAEAlC,aAAaA,CAACJ,UAAsB,EAAU;IAC5C,QAAQA,UAAU;MAChB,KAAKS,uBAAU,CAACgC,aAAa;QAC3B,OAAO,eAAe;MACxB,KAAKhC,uBAAU,CAACoC,OAAO;QACrB,OAAO,eAAe;MACxB,KAAKpC,uBAAU,CAACkC,SAAS;QACvB,OAAO,WAAW;MACpB,KAAKlC,uBAAU,CAACsC,cAAc;QAC5B,OAAO,cAAc;MACvB,KAAKtC,uBAAU,CAACC,QAAQ;QACtB,OAAO,2BAA2B;IAAC;EAEzC;AACF;AAACwC,OAAA,CAAAC,OAAA,GAAAzE,YAAA"}
|
|
@@ -4,60 +4,48 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _PlatformChecker = require("../PlatformChecker");
|
|
9
|
-
|
|
10
8
|
var _MutableValue = _interopRequireDefault(require("./MutableValue"));
|
|
11
|
-
|
|
12
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
|
|
14
|
-
function
|
|
15
|
-
|
|
10
|
+
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; }
|
|
11
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
12
|
+
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); }
|
|
16
13
|
class Mapper {
|
|
17
14
|
constructor(module, mapper) {
|
|
18
15
|
let inputs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
19
16
|
let outputs = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
|
|
20
|
-
|
|
21
17
|
_defineProperty(this, "id", void 0);
|
|
22
|
-
|
|
23
18
|
_defineProperty(this, "inputs", void 0);
|
|
24
|
-
|
|
25
19
|
_defineProperty(this, "outputs", void 0);
|
|
26
|
-
|
|
27
20
|
_defineProperty(this, "mapper", void 0);
|
|
28
|
-
|
|
29
21
|
_defineProperty(this, "dirty", true);
|
|
30
|
-
|
|
31
22
|
this.id = Mapper.MAPPER_ID++;
|
|
32
23
|
this.inputs = this.extractMutablesFromArray(inputs);
|
|
33
24
|
this.outputs = this.extractMutablesFromArray(outputs);
|
|
34
25
|
this.mapper = mapper;
|
|
35
|
-
|
|
36
26
|
const markDirty = () => {
|
|
37
27
|
this.dirty = true;
|
|
38
28
|
module.maybeRequestRender();
|
|
39
29
|
};
|
|
40
|
-
|
|
41
30
|
this.inputs.forEach(input => {
|
|
42
31
|
input.addListener(markDirty);
|
|
43
32
|
});
|
|
44
33
|
}
|
|
45
|
-
|
|
46
34
|
execute() {
|
|
47
35
|
this.dirty = false;
|
|
48
36
|
this.mapper();
|
|
49
37
|
}
|
|
50
|
-
|
|
51
38
|
extractMutablesFromArray(array) {
|
|
52
39
|
const res = [];
|
|
53
|
-
|
|
54
40
|
function extractMutables(value) {
|
|
55
|
-
if (value == null) {
|
|
41
|
+
if (value == null) {
|
|
42
|
+
// return;
|
|
56
43
|
} else if (value instanceof _MutableValue.default) {
|
|
57
44
|
res.push(value);
|
|
58
45
|
} else if (Array.isArray(value)) {
|
|
59
46
|
value.forEach(v => extractMutables(v));
|
|
60
|
-
} else if (isWebDomElement(value)) {
|
|
47
|
+
} else if (isWebDomElement(value)) {
|
|
48
|
+
// do nothing on dom elements
|
|
61
49
|
// without this check, we get a "Maximum call size exceeded error"
|
|
62
50
|
} else if (typeof value === 'object') {
|
|
63
51
|
Object.keys(value).forEach(key => {
|
|
@@ -65,32 +53,25 @@ class Mapper {
|
|
|
65
53
|
});
|
|
66
54
|
}
|
|
67
55
|
}
|
|
68
|
-
|
|
69
56
|
extractMutables(array);
|
|
70
57
|
return res;
|
|
71
58
|
}
|
|
72
|
-
|
|
73
59
|
}
|
|
74
|
-
|
|
75
60
|
exports.default = Mapper;
|
|
76
|
-
|
|
77
61
|
_defineProperty(Mapper, "MAPPER_ID", 1);
|
|
78
|
-
|
|
79
62
|
function isWebDomElement(value) {
|
|
80
63
|
if (!(0, _PlatformChecker.shouldBeUseWeb)()) {
|
|
81
64
|
return false;
|
|
82
|
-
}
|
|
83
|
-
|
|
65
|
+
}
|
|
84
66
|
|
|
67
|
+
// https://stackoverflow.com/a/384380/7869175
|
|
85
68
|
function isWebNode(o) {
|
|
86
69
|
return typeof Node === 'object' ? o instanceof Node : o && typeof o === 'object' && typeof o.nodeType === 'number' && typeof o.nodeName === 'string';
|
|
87
70
|
}
|
|
88
|
-
|
|
89
71
|
function isWebElement(o) {
|
|
90
72
|
return typeof HTMLElement === 'object' ? o instanceof HTMLElement // DOM2
|
|
91
73
|
: o && typeof o === 'object' && o !== null && o.nodeType === 1 && typeof o.nodeName === 'string';
|
|
92
74
|
}
|
|
93
|
-
|
|
94
75
|
return isWebNode(value) || isWebElement(value);
|
|
95
76
|
}
|
|
96
77
|
//# sourceMappingURL=Mapper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Mapper","constructor","module","mapper","inputs","outputs","id","MAPPER_ID","extractMutablesFromArray","markDirty","dirty","maybeRequestRender","forEach","
|
|
1
|
+
{"version":3,"names":["_PlatformChecker","require","_MutableValue","_interopRequireDefault","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","Mapper","constructor","module","mapper","inputs","arguments","length","outputs","id","MAPPER_ID","extractMutablesFromArray","markDirty","dirty","maybeRequestRender","forEach","addListener","execute","array","extractMutables","MutableValue","push","Array","isArray","v","isWebDomElement","keys","exports","shouldBeUseWeb","isWebNode","o","Node","nodeType","nodeName","isWebElement","HTMLElement"],"sources":["Mapper.ts"],"sourcesContent":["import { NestedObjectValues } from '../commonTypes';\nimport { shouldBeUseWeb } from '../PlatformChecker';\nimport { JSReanimated } from './commonTypes';\nimport MutableValue from './MutableValue';\n\nexport default class Mapper<T> {\n static MAPPER_ID = 1;\n id: number;\n inputs: MutableValue<T>[];\n outputs: MutableValue<T>[];\n mapper: () => void;\n\n dirty = true;\n\n constructor(\n module: JSReanimated,\n mapper: () => void,\n inputs: NestedObjectValues<MutableValue<T>>[] = [],\n outputs: NestedObjectValues<MutableValue<T>>[] = []\n ) {\n this.id = Mapper.MAPPER_ID++;\n this.inputs = this.extractMutablesFromArray(inputs);\n this.outputs = this.extractMutablesFromArray(outputs);\n this.mapper = mapper;\n\n const markDirty = () => {\n this.dirty = true;\n module.maybeRequestRender();\n };\n\n this.inputs.forEach((input) => {\n input.addListener(markDirty);\n });\n }\n\n execute(): void {\n this.dirty = false;\n this.mapper();\n }\n\n extractMutablesFromArray<T>(\n array: NestedObjectValues<MutableValue<T>>\n ): MutableValue<T>[] {\n const res: MutableValue<T>[] = [];\n\n function extractMutables(value: NestedObjectValues<MutableValue<T>>) {\n if (value == null) {\n // return;\n } else if (value instanceof MutableValue) {\n res.push(value);\n } else if (Array.isArray(value)) {\n value.forEach((v) => extractMutables(v));\n } else if (isWebDomElement(value)) {\n // do nothing on dom elements\n // without this check, we get a \"Maximum call size exceeded error\"\n } else if (typeof value === 'object') {\n Object.keys(value).forEach((key) => {\n extractMutables(value[key]);\n });\n }\n }\n\n extractMutables(array);\n return res;\n }\n}\n\nfunction isWebDomElement(value: any) {\n if (!shouldBeUseWeb()) {\n return false;\n }\n\n // https://stackoverflow.com/a/384380/7869175\n function isWebNode(o: any) {\n return typeof Node === 'object'\n ? o instanceof Node\n : o &&\n typeof o === 'object' &&\n typeof o.nodeType === 'number' &&\n typeof o.nodeName === 'string';\n }\n\n function isWebElement(o: any) {\n return typeof HTMLElement === 'object'\n ? o instanceof HTMLElement // DOM2\n : o &&\n typeof o === 'object' &&\n o !== null &&\n o.nodeType === 1 &&\n typeof o.nodeName === 'string';\n }\n\n return isWebNode(value) || isWebElement(value);\n}\n"],"mappings":";;;;;;AACA,IAAAA,gBAAA,GAAAC,OAAA;AAEA,IAAAC,aAAA,GAAAC,sBAAA,CAAAF,OAAA;AAA0C,SAAAE,uBAAAC,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,gBAAAH,GAAA,EAAAI,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAJ,GAAA,IAAAO,MAAA,CAAAC,cAAA,CAAAR,GAAA,EAAAI,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAX,GAAA,CAAAI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AC,YAAYC,IAAI,GACjBD,CAAC,IACC,OAAOA,CAAC,KAAK,QAAQ,IACrB,OAAOA,CAAC,CAACE,QAAQ,KAAK,QAAQ,IAC9B,OAAOF,CAAC,CAACG,QAAQ,KAAK,QAAQ;EACtC;EAEA,SAASC,YAAYA,CAACJ,CAAM,EAAE;IAC5B,OAAO,OAAOK,WAAW,KAAK,QAAQ,GAClCL,CAAC,YAAYK,WAAW,CAAC;IAAA,EACzBL,CAAC,IACC,OAAOA,CAAC,KAAK,QAAQ,IACrBA,CAAC,KAAK,IAAI,IACVA,CAAC,CAACE,QAAQ,KAAK,CAAC,IAChB,OAAOF,CAAC,CAACG,QAAQ,KAAK,QAAQ;EACtC;EAEA,OAAOJ,SAAS,CAAChD,KAAK,CAAC,IAAIqD,YAAY,CAACrD,KAAK,CAAC;AAChD"}
|
|
@@ -4,69 +4,56 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
function
|
|
9
|
-
|
|
7
|
+
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; }
|
|
8
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
9
|
+
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); }
|
|
10
10
|
class MapperRegistry {
|
|
11
11
|
constructor(module) {
|
|
12
12
|
_defineProperty(this, "sortedMappers", []);
|
|
13
|
-
|
|
14
13
|
_defineProperty(this, "mappers", new Map());
|
|
15
|
-
|
|
16
14
|
_defineProperty(this, "_module", void 0);
|
|
17
|
-
|
|
18
15
|
_defineProperty(this, "updatedSinceLastExecute", false);
|
|
19
|
-
|
|
20
16
|
this._module = module;
|
|
21
17
|
}
|
|
22
|
-
|
|
23
18
|
startMapper(mapper) {
|
|
24
19
|
this.mappers.set(mapper.id, mapper);
|
|
25
20
|
this.updatedSinceLastExecute = true;
|
|
26
21
|
return mapper.id;
|
|
27
22
|
}
|
|
28
|
-
|
|
29
23
|
stopMapper(id) {
|
|
30
24
|
this.mappers.delete(id);
|
|
31
25
|
this.updatedSinceLastExecute = true;
|
|
32
26
|
}
|
|
33
|
-
|
|
34
27
|
execute() {
|
|
35
28
|
if (this.updatedSinceLastExecute) {
|
|
36
29
|
this.updateOrder();
|
|
37
30
|
this.updatedSinceLastExecute = false;
|
|
38
31
|
}
|
|
39
|
-
|
|
40
32
|
for (let i = 0, len = this.sortedMappers.length; i < len; ++i) {
|
|
41
33
|
const mapper = this.sortedMappers[i];
|
|
42
|
-
|
|
43
34
|
if (mapper.dirty) {
|
|
44
35
|
mapper.execute();
|
|
45
36
|
}
|
|
46
37
|
}
|
|
47
38
|
}
|
|
48
|
-
|
|
49
39
|
updateOrder() {
|
|
50
40
|
const nodes = [...this.mappers.values()].map(mapper => new Node(mapper));
|
|
51
41
|
const mappersById = {};
|
|
52
42
|
this.mappers.forEach(mapper => {
|
|
53
43
|
mappersById[mapper.id] = mapper;
|
|
54
|
-
});
|
|
44
|
+
});
|
|
55
45
|
|
|
46
|
+
// create a graph from array of nodes
|
|
56
47
|
for (let i = 0, nodesLen = nodes.length; i < nodesLen; ++i) {
|
|
57
48
|
const node = nodes[i];
|
|
58
|
-
|
|
59
49
|
if (node.mapper.outputs.length === 0) {
|
|
60
50
|
continue;
|
|
61
51
|
}
|
|
62
|
-
|
|
63
52
|
for (let j = 0; j < nodesLen; ++j) {
|
|
64
53
|
const restNode = nodes[j];
|
|
65
|
-
|
|
66
54
|
if (i === j || restNode.mapper.inputs.length === 0) {
|
|
67
55
|
continue;
|
|
68
56
|
}
|
|
69
|
-
|
|
70
57
|
for (let outi = 0, outputsLen = node.mapper.outputs.length; outi < outputsLen; ++outi) {
|
|
71
58
|
for (let resti = 0, restLen = restNode.mapper.inputs.length; resti < restLen; ++resti) {
|
|
72
59
|
if (node.mapper.outputs[outi]._id === restNode.mapper.inputs[resti]._id) {
|
|
@@ -76,71 +63,54 @@ class MapperRegistry {
|
|
|
76
63
|
}
|
|
77
64
|
}
|
|
78
65
|
}
|
|
79
|
-
|
|
80
66
|
const post = {};
|
|
81
67
|
let postCounter = 1;
|
|
82
|
-
|
|
83
68
|
const dfs = node => {
|
|
84
69
|
const index = nodes.indexOf(node);
|
|
85
|
-
|
|
86
70
|
if (index === -1) {
|
|
87
71
|
// this node has already been handled
|
|
88
72
|
return;
|
|
89
73
|
}
|
|
90
|
-
|
|
91
74
|
++postCounter;
|
|
92
75
|
nodes.splice(index, 1);
|
|
93
|
-
|
|
94
76
|
if (node.children.length === 0 && nodes.length > 0) {
|
|
95
77
|
post[node.mapper.id] = postCounter++;
|
|
96
78
|
dfs(nodes[0]);
|
|
97
79
|
return;
|
|
98
80
|
}
|
|
99
|
-
|
|
100
81
|
for (let i = 0, len = node.children.length; i < len; ++i) {
|
|
101
82
|
dfs(node.children[i]);
|
|
102
83
|
}
|
|
103
|
-
|
|
104
84
|
post[node.mapper.id] = postCounter++;
|
|
105
85
|
};
|
|
106
|
-
|
|
107
86
|
while (nodes.length) dfs(nodes[0]);
|
|
108
|
-
|
|
109
87
|
const postArray = Object.keys(post).map(key => {
|
|
110
88
|
const num = parseInt(key);
|
|
111
89
|
return [num, post[num]];
|
|
112
90
|
});
|
|
113
91
|
postArray.sort((a, b) => {
|
|
114
92
|
return b[1] - a[1];
|
|
115
|
-
});
|
|
93
|
+
});
|
|
116
94
|
|
|
95
|
+
// clear sorted mappers
|
|
117
96
|
this.sortedMappers = [];
|
|
118
|
-
|
|
119
97
|
for (let i = 0, len = postArray.length; i < len; ++i) {
|
|
120
98
|
const [id] = postArray[i];
|
|
121
99
|
this.sortedMappers.push(mappersById[id]);
|
|
122
100
|
}
|
|
123
101
|
}
|
|
124
|
-
|
|
125
102
|
get needRunOnRender() {
|
|
126
103
|
return this.updatedSinceLastExecute;
|
|
127
104
|
}
|
|
128
|
-
|
|
129
105
|
}
|
|
130
|
-
|
|
131
106
|
exports.default = MapperRegistry;
|
|
132
|
-
|
|
133
107
|
class Node {
|
|
134
108
|
constructor(mapper) {
|
|
135
109
|
let children = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
136
|
-
|
|
137
110
|
_defineProperty(this, "mapper", void 0);
|
|
138
|
-
|
|
139
111
|
_defineProperty(this, "children", void 0);
|
|
140
|
-
|
|
141
112
|
this.mapper = mapper;
|
|
142
113
|
this.children = children;
|
|
143
114
|
}
|
|
144
|
-
|
|
145
115
|
}
|
|
146
116
|
//# sourceMappingURL=MapperRegistry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["MapperRegistry","constructor","module","Map","_module","startMapper","mapper","mappers","set","id","updatedSinceLastExecute","stopMapper","delete","execute","updateOrder","i","len","sortedMappers","length","dirty","nodes","values","map","Node","mappersById","forEach","nodesLen","node","outputs","j","restNode","inputs","outi","outputsLen","resti","restLen","_id","children","push","post","postCounter","dfs","index","indexOf","splice","postArray","Object","keys","key","num","parseInt","sort","a","b","needRunOnRender"],"sources":["MapperRegistry.ts"],"sourcesContent":["import { JSReanimated } from './commonTypes';\nimport Mapper from './Mapper';\n\nexport default class MapperRegistry<T> {\n sortedMappers: Mapper<T>[] = [];\n mappers: Map<number, Mapper<T>> = new Map();\n _module: JSReanimated;\n\n updatedSinceLastExecute = false;\n\n constructor(module: JSReanimated) {\n this._module = module;\n }\n\n startMapper(mapper: Mapper<T>): number {\n this.mappers.set(mapper.id, mapper);\n this.updatedSinceLastExecute = true;\n return mapper.id;\n }\n\n stopMapper(id: number): void {\n this.mappers.delete(id);\n this.updatedSinceLastExecute = true;\n }\n\n execute(): void {\n if (this.updatedSinceLastExecute) {\n this.updateOrder();\n this.updatedSinceLastExecute = false;\n }\n\n for (let i = 0, len = this.sortedMappers.length; i < len; ++i) {\n const mapper = this.sortedMappers[i];\n if (mapper.dirty) {\n mapper.execute();\n }\n }\n }\n\n updateOrder(): void {\n const nodes = [...this.mappers.values()].map((mapper) => new Node(mapper));\n\n const mappersById: Record<number, Mapper<T>> = {};\n this.mappers.forEach((mapper) => {\n mappersById[mapper.id] = mapper;\n });\n\n // create a graph from array of nodes\n for (let i = 0, nodesLen = nodes.length; i < nodesLen; ++i) {\n const node = nodes[i];\n if (node.mapper.outputs.length === 0) {\n continue;\n }\n for (let j = 0; j < nodesLen; ++j) {\n const restNode = nodes[j];\n if (i === j || restNode.mapper.inputs.length === 0) {\n continue;\n }\n for (\n let outi = 0, outputsLen = node.mapper.outputs.length;\n outi < outputsLen;\n ++outi\n ) {\n for (\n let resti = 0, restLen = restNode.mapper.inputs.length;\n resti < restLen;\n ++resti\n ) {\n if (\n node.mapper.outputs[outi]._id ===\n restNode.mapper.inputs[resti]._id\n ) {\n node.children.push(restNode);\n }\n }\n }\n }\n }\n\n const post: Record<number, number> = {};\n let postCounter = 1;\n const dfs = (node: Node<T>) => {\n const index = nodes.indexOf(node);\n if (index === -1) {\n // this node has already been handled\n return;\n }\n ++postCounter;\n nodes.splice(index, 1);\n if (node.children.length === 0 && nodes.length > 0) {\n post[node.mapper.id] = postCounter++;\n dfs(nodes[0]);\n return;\n }\n for (let i = 0, len = node.children.length; i < len; ++i) {\n dfs(node.children[i]);\n }\n post[node.mapper.id] = postCounter++;\n };\n\n while (nodes.length) dfs(nodes[0]);\n\n const postArray = Object.keys(post).map((key) => {\n const num = parseInt(key);\n return [num, post[num]];\n });\n postArray.sort((a, b) => {\n return b[1] - a[1];\n });\n\n // clear sorted mappers\n this.sortedMappers = [];\n\n for (let i = 0, len = postArray.length; i < len; ++i) {\n const [id] = postArray[i];\n this.sortedMappers.push(mappersById[id]);\n }\n }\n\n get needRunOnRender(): boolean {\n return this.updatedSinceLastExecute;\n }\n}\n\nclass Node<T> {\n mapper: Mapper<T>;\n children: Node<T>[];\n\n constructor(mapper: Mapper<T>, children = []) {\n this.mapper = mapper;\n this.children = children;\n }\n}\n"],"mappings":";;;;;;;;;AAGe,MAAMA,
|
|
1
|
+
{"version":3,"names":["MapperRegistry","constructor","module","_defineProperty","Map","_module","startMapper","mapper","mappers","set","id","updatedSinceLastExecute","stopMapper","delete","execute","updateOrder","i","len","sortedMappers","length","dirty","nodes","values","map","Node","mappersById","forEach","nodesLen","node","outputs","j","restNode","inputs","outi","outputsLen","resti","restLen","_id","children","push","post","postCounter","dfs","index","indexOf","splice","postArray","Object","keys","key","num","parseInt","sort","a","b","needRunOnRender","exports","default","arguments","undefined"],"sources":["MapperRegistry.ts"],"sourcesContent":["import { JSReanimated } from './commonTypes';\nimport Mapper from './Mapper';\n\nexport default class MapperRegistry<T> {\n sortedMappers: Mapper<T>[] = [];\n mappers: Map<number, Mapper<T>> = new Map();\n _module: JSReanimated;\n\n updatedSinceLastExecute = false;\n\n constructor(module: JSReanimated) {\n this._module = module;\n }\n\n startMapper(mapper: Mapper<T>): number {\n this.mappers.set(mapper.id, mapper);\n this.updatedSinceLastExecute = true;\n return mapper.id;\n }\n\n stopMapper(id: number): void {\n this.mappers.delete(id);\n this.updatedSinceLastExecute = true;\n }\n\n execute(): void {\n if (this.updatedSinceLastExecute) {\n this.updateOrder();\n this.updatedSinceLastExecute = false;\n }\n\n for (let i = 0, len = this.sortedMappers.length; i < len; ++i) {\n const mapper = this.sortedMappers[i];\n if (mapper.dirty) {\n mapper.execute();\n }\n }\n }\n\n updateOrder(): void {\n const nodes = [...this.mappers.values()].map((mapper) => new Node(mapper));\n\n const mappersById: Record<number, Mapper<T>> = {};\n this.mappers.forEach((mapper) => {\n mappersById[mapper.id] = mapper;\n });\n\n // create a graph from array of nodes\n for (let i = 0, nodesLen = nodes.length; i < nodesLen; ++i) {\n const node = nodes[i];\n if (node.mapper.outputs.length === 0) {\n continue;\n }\n for (let j = 0; j < nodesLen; ++j) {\n const restNode = nodes[j];\n if (i === j || restNode.mapper.inputs.length === 0) {\n continue;\n }\n for (\n let outi = 0, outputsLen = node.mapper.outputs.length;\n outi < outputsLen;\n ++outi\n ) {\n for (\n let resti = 0, restLen = restNode.mapper.inputs.length;\n resti < restLen;\n ++resti\n ) {\n if (\n node.mapper.outputs[outi]._id ===\n restNode.mapper.inputs[resti]._id\n ) {\n node.children.push(restNode);\n }\n }\n }\n }\n }\n\n const post: Record<number, number> = {};\n let postCounter = 1;\n const dfs = (node: Node<T>) => {\n const index = nodes.indexOf(node);\n if (index === -1) {\n // this node has already been handled\n return;\n }\n ++postCounter;\n nodes.splice(index, 1);\n if (node.children.length === 0 && nodes.length > 0) {\n post[node.mapper.id] = postCounter++;\n dfs(nodes[0]);\n return;\n }\n for (let i = 0, len = node.children.length; i < len; ++i) {\n dfs(node.children[i]);\n }\n post[node.mapper.id] = postCounter++;\n };\n\n while (nodes.length) dfs(nodes[0]);\n\n const postArray = Object.keys(post).map((key) => {\n const num = parseInt(key);\n return [num, post[num]];\n });\n postArray.sort((a, b) => {\n return b[1] - a[1];\n });\n\n // clear sorted mappers\n this.sortedMappers = [];\n\n for (let i = 0, len = postArray.length; i < len; ++i) {\n const [id] = postArray[i];\n this.sortedMappers.push(mappersById[id]);\n }\n }\n\n get needRunOnRender(): boolean {\n return this.updatedSinceLastExecute;\n }\n}\n\nclass Node<T> {\n mapper: Mapper<T>;\n children: Node<T>[];\n\n constructor(mapper: Mapper<T>, children = []) {\n this.mapper = mapper;\n this.children = children;\n }\n}\n"],"mappings":";;;;;;;;;AAGe,MAAMA,cAAc,CAAI;EAOrCC,WAAWA,CAACC,MAAoB,EAAE;IAAAC,eAAA,wBANL,EAAE;IAAAA,eAAA,kBACG,IAAIC,GAAG,EAAE;IAAAD,eAAA;IAAAA,eAAA,kCAGjB,KAAK;IAG7B,IAAI,CAACE,OAAO,GAAGH,MAAM;EACvB;EAEAI,WAAWA,C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AAC;MACzB,IAAI,CAACE,aAAa,CAACqB,IAAI,CAACd,WAAW,CAACf,EAAE,CAAC,CAAC;IAC1C;EACF;EAEA,IAAI6C,eAAeA,CAAA,EAAY;IAC7B,OAAO,IAAI,CAAC5C,uBAAuB;EACrC;AACF;AAAC6C,OAAA,CAAAC,OAAA,GAAAzD,cAAA;AAED,MAAMwB,IAAI,CAAI;EAIZvB,WAAWA,CAACM,MAAiB,EAAiB;IAAA,IAAf+B,QAAQ,GAAAoB,SAAA,CAAAvC,MAAA,QAAAuC,SAAA,QAAAC,SAAA,GAAAD,SAAA,MAAG,EAAE;IAAAvD,eAAA;IAAAA,eAAA;IAC1C,IAAI,CAACI,MAAM,GAAGA,MAAM;IACpB,IAAI,CAAC+B,QAAQ,GAAGA,QAAQ;EAC1B;AACF"}
|
|
@@ -4,54 +4,41 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
function
|
|
9
|
-
|
|
7
|
+
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; }
|
|
8
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
9
|
+
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); }
|
|
10
10
|
class MutableValue {
|
|
11
11
|
constructor(value, setter) {
|
|
12
12
|
_defineProperty(this, "_id", void 0);
|
|
13
|
-
|
|
14
13
|
_defineProperty(this, "_value", void 0);
|
|
15
|
-
|
|
16
14
|
_defineProperty(this, "_setter", void 0);
|
|
17
|
-
|
|
18
15
|
_defineProperty(this, "_animation", null);
|
|
19
|
-
|
|
20
16
|
_defineProperty(this, "_listeners", []);
|
|
21
|
-
|
|
22
17
|
this._id = MutableValue.MUTABLE_ID++;
|
|
23
18
|
this._value = value;
|
|
24
19
|
this._setter = setter;
|
|
25
20
|
}
|
|
26
|
-
|
|
27
21
|
get value() {
|
|
28
22
|
return this._value;
|
|
29
23
|
}
|
|
30
|
-
|
|
31
24
|
set value(nextValue) {
|
|
32
25
|
this._setter(nextValue);
|
|
33
|
-
}
|
|
34
|
-
|
|
26
|
+
}
|
|
35
27
|
|
|
28
|
+
// this changes the value finally and is supposed to be called from this._setter
|
|
36
29
|
_setValue(newValue) {
|
|
37
30
|
this._value = newValue;
|
|
38
|
-
|
|
39
31
|
this._triggerListener();
|
|
40
32
|
}
|
|
41
|
-
|
|
42
33
|
addListener(listener) {
|
|
43
34
|
this._listeners.push(listener);
|
|
44
35
|
}
|
|
45
|
-
|
|
46
36
|
_triggerListener() {
|
|
47
37
|
for (let i = 0, len = this._listeners.length; i < len; ++i) {
|
|
48
38
|
this._listeners[i]();
|
|
49
39
|
}
|
|
50
40
|
}
|
|
51
|
-
|
|
52
41
|
}
|
|
53
|
-
|
|
54
42
|
exports.default = MutableValue;
|
|
55
|
-
|
|
56
43
|
_defineProperty(MutableValue, "MUTABLE_ID", 1);
|
|
57
44
|
//# sourceMappingURL=MutableValue.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["MutableValue","constructor","value","setter","_id","MUTABLE_ID","_value","_setter","nextValue","_setValue","newValue","_triggerListener","addListener","listener","_listeners","push","i","len","length"],"sources":["MutableValue.ts"],"sourcesContent":["export default class MutableValue<T> {\n static MUTABLE_ID = 1;\n _id: number;\n _value: T;\n _setter: (value: T) => void;\n _animation = null;\n _listeners: (() => void)[] = [];\n\n constructor(value: T, setter: (value: T) => void) {\n this._id = MutableValue.MUTABLE_ID++;\n this._value = value;\n this._setter = setter;\n }\n\n get value(): T {\n return this._value;\n }\n\n set value(nextValue: T) {\n this._setter(nextValue);\n }\n\n // this changes the value finally and is supposed to be called from this._setter\n _setValue(newValue: T): void {\n this._value = newValue;\n this._triggerListener();\n }\n\n addListener(listener: () => void): void {\n this._listeners.push(listener);\n }\n\n _triggerListener(): void {\n for (let i = 0, len = this._listeners.length; i < len; ++i) {\n this._listeners[i]();\n }\n }\n}\n"],"mappings":";;;;;;;;;AAAe,MAAMA,
|
|
1
|
+
{"version":3,"names":["MutableValue","constructor","value","setter","_defineProperty","_id","MUTABLE_ID","_value","_setter","nextValue","_setValue","newValue","_triggerListener","addListener","listener","_listeners","push","i","len","length","exports","default"],"sources":["MutableValue.ts"],"sourcesContent":["export default class MutableValue<T> {\n static MUTABLE_ID = 1;\n _id: number;\n _value: T;\n _setter: (value: T) => void;\n _animation = null;\n _listeners: (() => void)[] = [];\n\n constructor(value: T, setter: (value: T) => void) {\n this._id = MutableValue.MUTABLE_ID++;\n this._value = value;\n this._setter = setter;\n }\n\n get value(): T {\n return this._value;\n }\n\n set value(nextValue: T) {\n this._setter(nextValue);\n }\n\n // this changes the value finally and is supposed to be called from this._setter\n _setValue(newValue: T): void {\n this._value = newValue;\n this._triggerListener();\n }\n\n addListener(listener: () => void): void {\n this._listeners.push(listener);\n }\n\n _triggerListener(): void {\n for (let i = 0, len = this._listeners.length; i < len; ++i) {\n this._listeners[i]();\n }\n }\n}\n"],"mappings":";;;;;;;;;AAAe,MAAMA,YAAY,CAAI;EAQnCC,WAAWA,CAACC,KAAQ,EAAEC,MAA0B,EAAE;IAAAC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA,qBAHrC,IAAI;IAAAA,eAAA,qBACY,EAAE;IAG7B,IAAI,CAACC,GAAG,GAAGL,YAAY,CAACM,UAAU,EAAE;IACpC,IAAI,CAACC,MAAM,GAAGL,KAAK;IACnB,IAAI,CAACM,OAAO,GAAGL,MAAM;EACvB;EAEA,IAAID,KAAKA,CAAA,EAAM;IACb,OAAO,IAAI,CAACK,MAAM;EACpB;EAEA,IAAIL,KAAKA,CAACO,SAAY,EAAE;IACtB,IAAI,CAACD,OAAO,CAACC,SAAS,CAAC;EACzB;;EAEA;EACAC,SAASA,CAACC,QAAW,EAAQ;IAC3B,IAAI,CAACJ,MAAM,GAAGI,QAAQ;IACtB,IAAI,CAACC,gBAAgB,EAAE;EACzB;EAEAC,WAAWA,CAACC,QAAoB,EAAQ;IACtC,IAAI,CAACC,UAAU,CAACC,IAAI,CAACF,QAAQ,CAAC;EAChC;EAEAF,gBAAgBA,CAAA,EAAS;IACvB,KAAK,IAAIK,CAAC,GAAG,CAAC,EAAEC,GAAG,GAAG,IAAI,CAACH,UAAU,CAACI,MAAM,EAAEF,CAAC,GAAGC,GAAG,EAAE,EAAED,CAAC,EAAE;MAC1D,IAAI,CAACF,UAAU,CAACE,CAAC,CAAC,EAAE;IACtB;EACF;AACF;AAACG,OAAA,CAAAC,OAAA,GAAArB,YAAA;AAAAI,eAAA,CArCoBJ,YAAY,gBACX,CAAC"}
|
|
@@ -4,10 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _PlatformChecker = require("../PlatformChecker");
|
|
9
|
-
|
|
10
8
|
// In order to keep bundle size down, we treat this file as a polyfill for Web.
|
|
9
|
+
|
|
11
10
|
const initializeGlobalsForWeb = () => {
|
|
12
11
|
if ((0, _PlatformChecker.shouldBeUseWeb)()) {
|
|
13
12
|
global._measure = () => {
|
|
@@ -21,22 +20,19 @@ const initializeGlobalsForWeb = () => {
|
|
|
21
20
|
pageY: 0
|
|
22
21
|
};
|
|
23
22
|
};
|
|
24
|
-
|
|
25
23
|
global._scrollTo = () => {
|
|
26
24
|
console.warn("[Reanimated] You can't use `scrollTo` with Chrome Debugger or with web version");
|
|
27
25
|
};
|
|
28
|
-
|
|
29
26
|
global._dispatchCommand = () => {
|
|
30
27
|
console.warn("[Reanimated] You can't use `scrollTo` or `dispatchCommand` methods with Chrome Debugger or with web version");
|
|
31
28
|
};
|
|
32
|
-
|
|
33
29
|
global._setGestureState = () => {
|
|
34
30
|
console.warn("[Reanimated] You can't use `setGestureState` with Chrome Debugger or with web version");
|
|
35
31
|
};
|
|
36
32
|
}
|
|
37
|
-
|
|
38
33
|
return true;
|
|
39
34
|
};
|
|
35
|
+
|
|
40
36
|
/*
|
|
41
37
|
If a file doesn't export anything, tree shaking doesn't pack
|
|
42
38
|
it into the JS bundle. In effect, the code inside of this file
|
|
@@ -44,9 +40,6 @@ const initializeGlobalsForWeb = () => {
|
|
|
44
40
|
into a function, and we call this one during creating
|
|
45
41
|
the module export object.
|
|
46
42
|
*/
|
|
47
|
-
|
|
48
|
-
|
|
49
43
|
var _default = initializeGlobalsForWeb();
|
|
50
|
-
|
|
51
44
|
exports.default = _default;
|
|
52
45
|
//# sourceMappingURL=global.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["initializeGlobalsForWeb","shouldBeUseWeb","global","_measure","console","warn","x","y","width","height","pageX","pageY","_scrollTo","_dispatchCommand","_setGestureState"],"sources":["global.ts"],"sourcesContent":["// In order to keep bundle size down, we treat this file as a polyfill for Web.\n\nimport { shouldBeUseWeb } from '../PlatformChecker';\nconst initializeGlobalsForWeb = () => {\n if (shouldBeUseWeb()) {\n global._measure = () => {\n console.warn(\n \"[Reanimated] You can't use `measure` with Chrome Debugger or with web version\"\n );\n return {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n pageX: 0,\n pageY: 0,\n };\n };\n global._scrollTo = () => {\n console.warn(\n \"[Reanimated] You can't use `scrollTo` with Chrome Debugger or with web version\"\n );\n };\n global._dispatchCommand = () => {\n console.warn(\n \"[Reanimated] You can't use `scrollTo` or `dispatchCommand` methods with Chrome Debugger or with web version\"\n );\n };\n global._setGestureState = () => {\n console.warn(\n \"[Reanimated] You can't use `setGestureState` with Chrome Debugger or with web version\"\n );\n };\n }\n return true;\n};\n\n/*\n If a file doesn't export anything, tree shaking doesn't pack\n it into the JS bundle. In effect, the code inside of this file\n will never execute. That is why we wrapped initialization code\n into a function, and we call this one during creating\n the module export object.\n*/\n\nexport default initializeGlobalsForWeb();\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_PlatformChecker","require","initializeGlobalsForWeb","shouldBeUseWeb","global","_measure","console","warn","x","y","width","height","pageX","pageY","_scrollTo","_dispatchCommand","_setGestureState","_default","exports","default"],"sources":["global.ts"],"sourcesContent":["// In order to keep bundle size down, we treat this file as a polyfill for Web.\n\nimport { shouldBeUseWeb } from '../PlatformChecker';\nconst initializeGlobalsForWeb = () => {\n if (shouldBeUseWeb()) {\n global._measure = () => {\n console.warn(\n \"[Reanimated] You can't use `measure` with Chrome Debugger or with web version\"\n );\n return {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n pageX: 0,\n pageY: 0,\n };\n };\n global._scrollTo = () => {\n console.warn(\n \"[Reanimated] You can't use `scrollTo` with Chrome Debugger or with web version\"\n );\n };\n global._dispatchCommand = () => {\n console.warn(\n \"[Reanimated] You can't use `scrollTo` or `dispatchCommand` methods with Chrome Debugger or with web version\"\n );\n };\n global._setGestureState = () => {\n console.warn(\n \"[Reanimated] You can't use `setGestureState` with Chrome Debugger or with web version\"\n );\n };\n }\n return true;\n};\n\n/*\n If a file doesn't export anything, tree shaking doesn't pack\n it into the JS bundle. In effect, the code inside of this file\n will never execute. That is why we wrapped initialization code\n into a function, and we call this one during creating\n the module export object.\n*/\n\nexport default initializeGlobalsForWeb();\n"],"mappings":";;;;;;AAEA,IAAAA,gBAAA,GAAAC,OAAA;AAFA;;AAGA,MAAMC,uBAAuB,GAAGA,CAAA,KAAM;EACpC,IAAI,IAAAC,+BAAc,GAAE,EAAE;IACpBC,MAAM,CAACC,QAAQ,GAAG,MAAM;MACtBC,OAAO,CAACC,IAAI,CACV,+EAA+E,CAChF;MACD,OAAO;QACLC,CAAC,EAAE,CAAC;QACJC,CAAC,EAAE,CAAC;QACJC,KAAK,EAAE,CAAC;QACRC,MAAM,EAAE,CAAC;QACTC,KAAK,EAAE,CAAC;QACRC,KAAK,EAAE;MACT,CAAC;IACH,CAAC;IACDT,MAAM,CAACU,SAAS,GAAG,MAAM;MACvBR,OAAO,CAACC,IAAI,CACV,gFAAgF,CACjF;IACH,CAAC;IACDH,MAAM,CAACW,gBAAgB,GAAG,MAAM;MAC9BT,OAAO,CAACC,IAAI,CACV,6GAA6G,CAC9G;IACH,CAAC;IACDH,MAAM,CAACY,gBAAgB,GAAG,MAAM;MAC9BV,OAAO,CAACC,IAAI,CACV,uFAAuF,CACxF;IACH,CAAC;EACH;EACA,OAAO,IAAI;AACb,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AANA,IAAAU,QAAA,GAQef,uBAAuB,EAAE;AAAAgB,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
|
|
@@ -4,17 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = exports._updatePropsJS = void 0;
|
|
7
|
-
|
|
8
7
|
var _JSReanimated = _interopRequireDefault(require("./JSReanimated"));
|
|
9
|
-
|
|
10
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
|
|
12
9
|
const reanimatedJS = new _JSReanimated.default();
|
|
13
|
-
|
|
14
10
|
global._makeShareableClone = c => c;
|
|
15
|
-
|
|
16
|
-
global._scheduleOnJS = setImmediate;
|
|
17
|
-
|
|
11
|
+
global._scheduleOnJS = queueMicrotask;
|
|
18
12
|
const _updatePropsJS = (updates, viewRef) => {
|
|
19
13
|
if (viewRef._component) {
|
|
20
14
|
const component = viewRef._component;
|
|
@@ -24,7 +18,6 @@ const _updatePropsJS = (updates, viewRef) => {
|
|
|
24
18
|
acc[index][key] = value;
|
|
25
19
|
return acc;
|
|
26
20
|
}, [{}, {}]);
|
|
27
|
-
|
|
28
21
|
if (typeof component.setNativeProps === 'function') {
|
|
29
22
|
setNativeProps(component, rawStyles);
|
|
30
23
|
} else if (Object.keys(component.props).length > 0) {
|
|
@@ -32,9 +25,7 @@ const _updatePropsJS = (updates, viewRef) => {
|
|
|
32
25
|
if (!rawStyles[key]) {
|
|
33
26
|
return;
|
|
34
27
|
}
|
|
35
|
-
|
|
36
28
|
const dashedKey = key.replace(/[A-Z]/g, m => '-' + m.toLowerCase());
|
|
37
|
-
|
|
38
29
|
component._touchableNode.setAttribute(dashedKey, rawStyles[key]);
|
|
39
30
|
});
|
|
40
31
|
} else {
|
|
@@ -42,12 +33,11 @@ const _updatePropsJS = (updates, viewRef) => {
|
|
|
42
33
|
}
|
|
43
34
|
}
|
|
44
35
|
};
|
|
45
|
-
|
|
46
36
|
exports._updatePropsJS = _updatePropsJS;
|
|
47
|
-
|
|
48
37
|
const setNativeProps = (component, style) => {
|
|
49
38
|
const previousStyle = component.previousStyle ? component.previousStyle : {};
|
|
50
|
-
const currentStyle = {
|
|
39
|
+
const currentStyle = {
|
|
40
|
+
...previousStyle,
|
|
51
41
|
...style
|
|
52
42
|
};
|
|
53
43
|
component.previousStyle = currentStyle;
|
|
@@ -55,7 +45,6 @@ const setNativeProps = (component, style) => {
|
|
|
55
45
|
style: currentStyle
|
|
56
46
|
});
|
|
57
47
|
};
|
|
58
|
-
|
|
59
48
|
var _default = reanimatedJS;
|
|
60
49
|
exports.default = _default;
|
|
61
50
|
//# sourceMappingURL=index.js.map
|