react-native-reanimated 2.9.1 → 3.0.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Common/cpp/AnimatedSensor/AnimatedSensorModule.cpp +4 -4
- package/Common/cpp/Fabric/FabricUtils.cpp +133 -0
- package/Common/cpp/Fabric/ReanimatedUIManagerBinding.cpp +220 -0
- package/Common/cpp/Fabric/ShadowTreeCloner.cpp +92 -0
- package/Common/cpp/NativeModules/NativeReanimatedModule.cpp +336 -6
- package/Common/cpp/NativeModules/NativeReanimatedModuleSpec.cpp +23 -0
- package/Common/cpp/Registries/EventHandlerRegistry.cpp +14 -1
- package/Common/cpp/Registries/NewestShadowNodesRegistry.cpp +68 -0
- package/Common/cpp/SharedItems/ShareableValue.cpp +18 -0
- package/Common/cpp/Tools/Mapper.cpp +23 -4
- package/Common/cpp/Tools/RuntimeDecorator.cpp +92 -32
- package/Common/cpp/Tools/Scheduler.cpp +4 -0
- package/Common/cpp/headers/Fabric/FabricUtils.h +79 -0
- package/Common/cpp/headers/Fabric/ReanimatedUIManagerBinding.h +47 -0
- package/Common/cpp/headers/Fabric/ShadowTreeCloner.h +41 -0
- package/Common/cpp/headers/NativeModules/NativeReanimatedModule.h +81 -2
- package/Common/cpp/headers/NativeModules/NativeReanimatedModuleSpec.h +8 -0
- package/Common/cpp/headers/Registries/EventHandlerRegistry.h +8 -0
- package/Common/cpp/headers/Registries/NewestShadowNodesRegistry.h +41 -0
- package/Common/cpp/headers/SharedItems/SharedParent.h +3 -0
- package/Common/cpp/headers/SharedItems/ValueWrapper.h +25 -0
- package/Common/cpp/headers/SpecTools/ErrorHandler.h +5 -0
- package/Common/cpp/headers/Tools/Mapper.h +1 -1
- package/Common/cpp/headers/Tools/PlatformDepMethodsHolder.h +48 -8
- package/Common/cpp/headers/Tools/RuntimeDecorator.h +8 -3
- package/README.md +4 -0
- package/RNReanimated.podspec +48 -15
- package/android/CMakeLists.txt +205 -86
- package/android/build.gradle +242 -236
- package/android/src/fabric/java/com/swmansion/reanimated/NativeProxy.java +335 -0
- package/android/src/fabric/java/com/swmansion/reanimated/ReaCompatibility.java +25 -0
- package/android/src/main/cpp/NativeProxy.cpp +220 -51
- package/android/src/main/cpp/OnLoad.cpp +1 -0
- package/android/src/main/cpp/headers/NativeProxy.h +72 -7
- package/android/src/main/java/com/swmansion/reanimated/NodesManager.java +16 -246
- package/android/src/main/java/com/swmansion/reanimated/ReanimatedModule.java +0 -125
- package/android/src/main/java/com/swmansion/reanimated/keyboardObserver/ReanimatedKeyboardEventListener.java +165 -0
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/AnimationsManager.java +19 -16
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/LayoutAnimations.java +2 -1
- package/android/src/main/java/com/swmansion/reanimated/sensor/ReanimatedSensor.java +5 -1
- package/android/src/main/java/com/swmansion/reanimated/sensor/ReanimatedSensorType.java +1 -1
- package/android/src/paper/java/com/swmansion/reanimated/NativeProxy.java +326 -0
- package/android/src/paper/java/com/swmansion/reanimated/ReaCompatibility.java +17 -0
- package/ios/Fabric/REAInitializerRCTFabricSurface.h +12 -0
- package/ios/Fabric/REAInitializerRCTFabricSurface.mm +73 -0
- package/ios/REAEventDispatcher.m +0 -1
- package/ios/REAModule.h +10 -1
- package/ios/REAModule.mm +284 -0
- package/ios/REANodesManager.h +27 -51
- package/ios/REANodesManager.mm +517 -0
- package/ios/keyboardObserver/REAKeyboardEventObserver.h +17 -0
- package/ios/keyboardObserver/REAKeyboardEventObserver.m +198 -0
- package/ios/native/NativeProxy.mm +95 -17
- package/ios/native/REAInitializer.mm +10 -12
- package/ios/native/REAJSIUtils.h +66 -0
- package/ios/native/UIResponder+Reanimated.h +3 -1
- package/ios/native/UIResponder+Reanimated.mm +3 -1
- package/ios/sensor/ReanimatedSensor.m +26 -17
- package/lib/commonjs/Animated.js +70 -0
- package/lib/commonjs/Animated.js.map +1 -0
- package/lib/commonjs/ConfigHelper.js +173 -0
- package/lib/commonjs/ConfigHelper.js.map +1 -0
- package/lib/commonjs/createAnimatedComponent.js +474 -0
- package/lib/commonjs/createAnimatedComponent.js.map +1 -0
- package/lib/commonjs/index.js +44 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/index.web.js +32 -0
- package/lib/commonjs/index.web.js.map +1 -0
- package/lib/commonjs/reanimated2/Bezier.js +166 -0
- package/lib/commonjs/reanimated2/Bezier.js.map +1 -0
- package/lib/commonjs/reanimated2/Colors.js +673 -0
- package/lib/commonjs/reanimated2/Colors.js.map +1 -0
- package/lib/commonjs/reanimated2/Easing.js +274 -0
- package/lib/commonjs/reanimated2/Easing.js.map +1 -0
- package/lib/commonjs/reanimated2/NativeMethods.js +100 -0
- package/lib/commonjs/reanimated2/NativeMethods.js.map +1 -0
- package/lib/commonjs/reanimated2/NativeReanimated/NativeReanimated.js +99 -0
- package/lib/commonjs/reanimated2/NativeReanimated/NativeReanimated.js.map +1 -0
- package/lib/commonjs/reanimated2/NativeReanimated/index.js +26 -0
- package/lib/commonjs/reanimated2/NativeReanimated/index.js.map +1 -0
- package/lib/commonjs/reanimated2/PlatformChecker.js +33 -0
- package/lib/commonjs/reanimated2/PlatformChecker.js.map +1 -0
- package/lib/commonjs/reanimated2/PropAdapters.js +68 -0
- package/lib/commonjs/reanimated2/PropAdapters.js.map +1 -0
- package/lib/commonjs/reanimated2/UpdateProps.js +82 -0
- package/lib/commonjs/reanimated2/UpdateProps.js.map +1 -0
- package/lib/commonjs/reanimated2/ViewDescriptorsSet.js +96 -0
- package/lib/commonjs/reanimated2/ViewDescriptorsSet.js.map +1 -0
- package/lib/commonjs/reanimated2/WorkletEventHandler.js +75 -0
- package/lib/commonjs/reanimated2/WorkletEventHandler.js.map +1 -0
- package/lib/commonjs/reanimated2/animation/commonTypes.js +6 -0
- package/lib/commonjs/reanimated2/animation/commonTypes.js.map +1 -0
- package/lib/commonjs/reanimated2/animation/decay.js +132 -0
- package/lib/commonjs/reanimated2/animation/decay.js.map +1 -0
- package/lib/commonjs/reanimated2/animation/delay.js +89 -0
- package/lib/commonjs/reanimated2/animation/delay.js.map +1 -0
- package/lib/commonjs/reanimated2/animation/index.js +82 -0
- package/lib/commonjs/reanimated2/animation/index.js.map +1 -0
- package/lib/commonjs/reanimated2/animation/repeat.js +107 -0
- package/lib/commonjs/reanimated2/animation/repeat.js.map +1 -0
- package/lib/commonjs/reanimated2/animation/sequence.js +103 -0
- package/lib/commonjs/reanimated2/animation/sequence.js.map +1 -0
- package/lib/commonjs/reanimated2/animation/spring.js +121 -0
- package/lib/commonjs/reanimated2/animation/spring.js.map +1 -0
- package/lib/commonjs/reanimated2/animation/styleAnimation.js +206 -0
- package/lib/commonjs/reanimated2/animation/styleAnimation.js.map +1 -0
- package/lib/commonjs/reanimated2/animation/timing.js +82 -0
- package/lib/commonjs/reanimated2/animation/timing.js.map +1 -0
- package/lib/commonjs/reanimated2/animation/util.js +233 -0
- package/lib/commonjs/reanimated2/animation/util.js.map +1 -0
- package/lib/commonjs/reanimated2/commonTypes.js +17 -0
- package/lib/commonjs/reanimated2/commonTypes.js.map +1 -0
- package/lib/commonjs/reanimated2/component/FlatList.js +53 -0
- package/lib/commonjs/reanimated2/component/FlatList.js.map +1 -0
- package/lib/commonjs/reanimated2/component/Image.js +17 -0
- package/lib/commonjs/reanimated2/component/Image.js.map +1 -0
- package/lib/commonjs/reanimated2/component/ScrollView.js +17 -0
- package/lib/commonjs/reanimated2/component/ScrollView.js.map +1 -0
- package/lib/commonjs/reanimated2/component/Text.js +17 -0
- package/lib/commonjs/reanimated2/component/Text.js.map +1 -0
- package/lib/commonjs/reanimated2/component/View.js +17 -0
- package/lib/commonjs/reanimated2/component/View.js.map +1 -0
- package/lib/commonjs/reanimated2/core.js +360 -0
- package/lib/commonjs/reanimated2/core.js.map +1 -0
- package/lib/commonjs/reanimated2/fabricUtils.js +27 -0
- package/lib/commonjs/reanimated2/fabricUtils.js.map +1 -0
- package/lib/commonjs/reanimated2/fabricUtils.web.js +21 -0
- package/lib/commonjs/reanimated2/fabricUtils.web.js.map +1 -0
- package/lib/commonjs/reanimated2/frameCallback/FrameCallbackRegistryJS.js +55 -0
- package/lib/commonjs/reanimated2/frameCallback/FrameCallbackRegistryJS.js.map +1 -0
- package/lib/commonjs/reanimated2/frameCallback/FrameCallbackRegistryUI.js +64 -0
- package/lib/commonjs/reanimated2/frameCallback/FrameCallbackRegistryUI.js.map +1 -0
- package/lib/commonjs/reanimated2/globals.d.js +6 -0
- package/lib/commonjs/reanimated2/globals.d.js.map +1 -0
- package/lib/commonjs/reanimated2/hook/Hooks.js +35 -0
- package/lib/commonjs/reanimated2/hook/Hooks.js.map +1 -0
- package/lib/commonjs/reanimated2/hook/commonTypes.js +6 -0
- package/lib/commonjs/reanimated2/hook/commonTypes.js.map +1 -0
- package/lib/commonjs/reanimated2/hook/index.js +118 -0
- package/lib/commonjs/reanimated2/hook/index.js.map +1 -0
- package/lib/commonjs/reanimated2/hook/useAnimatedGestureHandler.js +66 -0
- package/lib/commonjs/reanimated2/hook/useAnimatedGestureHandler.js.map +1 -0
- package/lib/commonjs/reanimated2/hook/useAnimatedKeyboard.js +48 -0
- package/lib/commonjs/reanimated2/hook/useAnimatedKeyboard.js.map +1 -0
- package/lib/commonjs/reanimated2/hook/useAnimatedReaction.js +44 -0
- package/lib/commonjs/reanimated2/hook/useAnimatedReaction.js.map +1 -0
- package/lib/commonjs/reanimated2/hook/useAnimatedRef.js +43 -0
- package/lib/commonjs/reanimated2/hook/useAnimatedRef.js.map +1 -0
- package/lib/commonjs/reanimated2/hook/useAnimatedScrollHandler.js +62 -0
- package/lib/commonjs/reanimated2/hook/useAnimatedScrollHandler.js.map +1 -0
- package/lib/commonjs/reanimated2/hook/useAnimatedSensor.js +94 -0
- package/lib/commonjs/reanimated2/hook/useAnimatedSensor.js.map +1 -0
- package/lib/commonjs/reanimated2/hook/useAnimatedStyle.js +471 -0
- package/lib/commonjs/reanimated2/hook/useAnimatedStyle.js.map +1 -0
- package/lib/commonjs/reanimated2/hook/useDerivedValue.js +49 -0
- package/lib/commonjs/reanimated2/hook/useDerivedValue.js.map +1 -0
- package/lib/commonjs/reanimated2/hook/useFrameCallback.js +36 -0
- package/lib/commonjs/reanimated2/hook/useFrameCallback.js.map +1 -0
- package/lib/commonjs/reanimated2/hook/useSharedValue.js +30 -0
- package/lib/commonjs/reanimated2/hook/useSharedValue.js.map +1 -0
- package/lib/commonjs/reanimated2/hook/utils.js +247 -0
- package/lib/commonjs/reanimated2/hook/utils.js.map +1 -0
- package/lib/commonjs/reanimated2/index.js +162 -0
- package/lib/commonjs/reanimated2/index.js.map +1 -0
- package/lib/commonjs/reanimated2/interpolateColor.js +154 -0
- package/lib/commonjs/reanimated2/interpolateColor.js.map +1 -0
- package/lib/commonjs/reanimated2/interpolation.js +143 -0
- package/lib/commonjs/reanimated2/interpolation.js.map +1 -0
- package/lib/commonjs/reanimated2/jestUtils.js +239 -0
- package/lib/commonjs/reanimated2/jestUtils.js.map +1 -0
- package/lib/commonjs/reanimated2/js-reanimated/JSReanimated.js +160 -0
- package/lib/commonjs/reanimated2/js-reanimated/JSReanimated.js.map +1 -0
- package/lib/commonjs/reanimated2/js-reanimated/Mapper.js +74 -0
- package/lib/commonjs/reanimated2/js-reanimated/Mapper.js.map +1 -0
- package/lib/commonjs/reanimated2/js-reanimated/MapperRegistry.js +146 -0
- package/lib/commonjs/reanimated2/js-reanimated/MapperRegistry.js.map +1 -0
- package/lib/commonjs/reanimated2/js-reanimated/MutableValue.js +57 -0
- package/lib/commonjs/reanimated2/js-reanimated/MutableValue.js.map +1 -0
- package/lib/commonjs/reanimated2/js-reanimated/commonTypes.js +6 -0
- package/lib/commonjs/reanimated2/js-reanimated/commonTypes.js.map +1 -0
- package/lib/commonjs/reanimated2/js-reanimated/global.js +57 -0
- package/lib/commonjs/reanimated2/js-reanimated/global.js.map +1 -0
- package/lib/commonjs/reanimated2/js-reanimated/index.js +57 -0
- package/lib/commonjs/reanimated2/js-reanimated/index.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/LayoutAnimationRepository.js +97 -0
- package/lib/commonjs/reanimated2/layoutReanimation/LayoutAnimationRepository.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js +100 -0
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js +203 -0
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/Keyframe.js +244 -0
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/Keyframe.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/commonTypes.js +6 -0
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/commonTypes.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/index.js +30 -0
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/index.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Bounce.js +570 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Bounce.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Default.js +55 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Default.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Fade.js +409 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Fade.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Flip.js +559 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Flip.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js +221 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js +101 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Roll.js +189 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Roll.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Rotate.js +403 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Rotate.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Slide.js +298 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Slide.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Stretch.js +167 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Stretch.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Zoom.js +700 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Zoom.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/index.js +136 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/index.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js +120 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js +180 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js +66 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js +64 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js +52 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js +68 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/index.js +84 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/index.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/index.js +47 -0
- package/lib/commonjs/reanimated2/layoutReanimation/index.js.map +1 -0
- package/lib/commonjs/reanimated2/mock.js +88 -0
- package/lib/commonjs/reanimated2/mock.js.map +1 -0
- package/lib/commonjs/reanimated2/platform-specific/RNRenderer.js +16 -0
- package/lib/commonjs/reanimated2/platform-specific/RNRenderer.js.map +1 -0
- package/lib/commonjs/reanimated2/platform-specific/RNRenderer.web.js +5 -0
- package/lib/commonjs/reanimated2/platform-specific/RNRenderer.web.js.map +1 -0
- package/lib/commonjs/reanimated2/utils.js +19 -0
- package/lib/commonjs/reanimated2/utils.js.map +1 -0
- package/lib/commonjs/setAndForwardRef.js +63 -0
- package/lib/commonjs/setAndForwardRef.js.map +1 -0
- package/lib/module/Animated.js +8 -0
- package/lib/module/Animated.js.map +1 -0
- package/lib/module/ConfigHelper.js +161 -0
- package/lib/module/ConfigHelper.js.map +1 -0
- package/lib/module/createAnimatedComponent.js +452 -0
- package/lib/module/createAnimatedComponent.js.map +1 -0
- package/lib/module/index.js +15 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/index.web.js +6 -0
- package/lib/module/index.web.js.map +1 -0
- package/lib/module/reanimated2/Bezier.js +159 -0
- package/lib/module/reanimated2/Bezier.js.map +1 -0
- package/lib/module/reanimated2/Colors.js +632 -0
- package/lib/module/reanimated2/Colors.js.map +1 -0
- package/lib/module/reanimated2/Easing.js +311 -0
- package/lib/module/reanimated2/Easing.js.map +1 -0
- package/lib/module/reanimated2/NativeMethods.js +82 -0
- package/lib/module/reanimated2/NativeMethods.js.map +1 -0
- package/lib/module/reanimated2/NativeReanimated/NativeReanimated.js +89 -0
- package/lib/module/reanimated2/NativeReanimated/NativeReanimated.js.map +1 -0
- package/lib/module/reanimated2/NativeReanimated/index.js +13 -0
- package/lib/module/reanimated2/NativeReanimated/index.js.map +1 -0
- package/lib/module/reanimated2/PlatformChecker.js +17 -0
- package/lib/module/reanimated2/PlatformChecker.js.map +1 -0
- package/lib/module/reanimated2/PropAdapters.js +56 -0
- package/lib/module/reanimated2/PropAdapters.js.map +1 -0
- package/lib/module/reanimated2/UpdateProps.js +64 -0
- package/lib/module/reanimated2/UpdateProps.js.map +1 -0
- package/lib/module/reanimated2/ViewDescriptorsSet.js +83 -0
- package/lib/module/reanimated2/ViewDescriptorsSet.js.map +1 -0
- package/lib/module/reanimated2/WorkletEventHandler.js +64 -0
- package/lib/module/reanimated2/WorkletEventHandler.js.map +1 -0
- package/lib/module/reanimated2/animation/commonTypes.js +2 -0
- package/lib/module/reanimated2/animation/commonTypes.js.map +1 -0
- package/lib/module/reanimated2/animation/decay.js +123 -0
- package/lib/module/reanimated2/animation/decay.js.map +1 -0
- package/lib/module/reanimated2/animation/delay.js +79 -0
- package/lib/module/reanimated2/animation/delay.js.map +1 -0
- package/lib/module/reanimated2/animation/index.js +9 -0
- package/lib/module/reanimated2/animation/index.js.map +1 -0
- package/lib/module/reanimated2/animation/repeat.js +95 -0
- package/lib/module/reanimated2/animation/repeat.js.map +1 -0
- package/lib/module/reanimated2/animation/sequence.js +93 -0
- package/lib/module/reanimated2/animation/sequence.js.map +1 -0
- package/lib/module/reanimated2/animation/spring.js +113 -0
- package/lib/module/reanimated2/animation/spring.js.map +1 -0
- package/lib/module/reanimated2/animation/styleAnimation.js +191 -0
- package/lib/module/reanimated2/animation/styleAnimation.js.map +1 -0
- package/lib/module/reanimated2/animation/timing.js +73 -0
- package/lib/module/reanimated2/animation/timing.js.map +1 -0
- package/lib/module/reanimated2/animation/util.js +216 -0
- package/lib/module/reanimated2/animation/util.js.map +1 -0
- package/lib/module/reanimated2/commonTypes.js +10 -0
- package/lib/module/reanimated2/commonTypes.js.map +1 -0
- package/lib/module/reanimated2/component/FlatList.js +33 -0
- package/lib/module/reanimated2/component/FlatList.js.map +1 -0
- package/lib/module/reanimated2/component/Image.js +5 -0
- package/lib/module/reanimated2/component/Image.js.map +1 -0
- package/lib/module/reanimated2/component/ScrollView.js +5 -0
- package/lib/module/reanimated2/component/ScrollView.js.map +1 -0
- package/lib/module/reanimated2/component/Text.js +5 -0
- package/lib/module/reanimated2/component/Text.js.map +1 -0
- package/lib/module/reanimated2/component/View.js +5 -0
- package/lib/module/reanimated2/component/View.js.map +1 -0
- package/lib/module/reanimated2/core.js +314 -0
- package/lib/module/reanimated2/core.js.map +1 -0
- package/lib/module/reanimated2/fabricUtils.js +18 -0
- package/lib/module/reanimated2/fabricUtils.js.map +1 -0
- package/lib/module/reanimated2/fabricUtils.web.js +12 -0
- package/lib/module/reanimated2/fabricUtils.web.js.map +1 -0
- package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryJS.js +44 -0
- package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryJS.js.map +1 -0
- package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryUI.js +55 -0
- package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryUI.js.map +1 -0
- package/lib/module/reanimated2/globals.d.js +2 -0
- package/lib/module/reanimated2/globals.d.js.map +1 -0
- package/lib/module/reanimated2/hook/Hooks.js +10 -0
- package/lib/module/reanimated2/hook/Hooks.js.map +1 -0
- package/lib/module/reanimated2/hook/commonTypes.js +2 -0
- package/lib/module/reanimated2/hook/commonTypes.js.map +1 -0
- package/lib/module/reanimated2/hook/index.js +12 -0
- package/lib/module/reanimated2/hook/index.js.map +1 -0
- package/lib/module/reanimated2/hook/useAnimatedGestureHandler.js +56 -0
- package/lib/module/reanimated2/hook/useAnimatedGestureHandler.js.map +1 -0
- package/lib/module/reanimated2/hook/useAnimatedKeyboard.js +34 -0
- package/lib/module/reanimated2/hook/useAnimatedKeyboard.js.map +1 -0
- package/lib/module/reanimated2/hook/useAnimatedReaction.js +35 -0
- package/lib/module/reanimated2/hook/useAnimatedReaction.js.map +1 -0
- package/lib/module/reanimated2/hook/useAnimatedRef.js +32 -0
- package/lib/module/reanimated2/hook/useAnimatedRef.js.map +1 -0
- package/lib/module/reanimated2/hook/useAnimatedScrollHandler.js +54 -0
- package/lib/module/reanimated2/hook/useAnimatedScrollHandler.js.map +1 -0
- package/lib/module/reanimated2/hook/useAnimatedSensor.js +79 -0
- package/lib/module/reanimated2/hook/useAnimatedSensor.js.map +1 -0
- package/lib/module/reanimated2/hook/useAnimatedStyle.js +450 -0
- package/lib/module/reanimated2/hook/useAnimatedStyle.js.map +1 -0
- package/lib/module/reanimated2/hook/useDerivedValue.js +39 -0
- package/lib/module/reanimated2/hook/useDerivedValue.js.map +1 -0
- package/lib/module/reanimated2/hook/useFrameCallback.js +24 -0
- package/lib/module/reanimated2/hook/useFrameCallback.js.map +1 -0
- package/lib/module/reanimated2/hook/useSharedValue.js +20 -0
- package/lib/module/reanimated2/hook/useSharedValue.js.map +1 -0
- package/lib/module/reanimated2/hook/utils.js +208 -0
- package/lib/module/reanimated2/hook/utils.js.map +1 -0
- package/lib/module/reanimated2/index.js +13 -0
- package/lib/module/reanimated2/index.js.map +1 -0
- package/lib/module/reanimated2/interpolateColor.js +135 -0
- package/lib/module/reanimated2/interpolateColor.js.map +1 -0
- package/lib/module/reanimated2/interpolation.js +135 -0
- package/lib/module/reanimated2/interpolation.js.map +1 -0
- package/lib/module/reanimated2/jestUtils.js +217 -0
- package/lib/module/reanimated2/jestUtils.js.map +1 -0
- package/lib/module/reanimated2/js-reanimated/JSReanimated.js +144 -0
- package/lib/module/reanimated2/js-reanimated/JSReanimated.js.map +1 -0
- package/lib/module/reanimated2/js-reanimated/Mapper.js +62 -0
- package/lib/module/reanimated2/js-reanimated/Mapper.js.map +1 -0
- package/lib/module/reanimated2/js-reanimated/MapperRegistry.js +137 -0
- package/lib/module/reanimated2/js-reanimated/MapperRegistry.js.map +1 -0
- package/lib/module/reanimated2/js-reanimated/MutableValue.js +48 -0
- package/lib/module/reanimated2/js-reanimated/MutableValue.js.map +1 -0
- package/lib/module/reanimated2/js-reanimated/commonTypes.js +2 -0
- package/lib/module/reanimated2/js-reanimated/commonTypes.js.map +1 -0
- package/lib/module/reanimated2/js-reanimated/global.js +48 -0
- package/lib/module/reanimated2/js-reanimated/global.js.map +1 -0
- package/lib/module/reanimated2/js-reanimated/index.js +43 -0
- package/lib/module/reanimated2/js-reanimated/index.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/LayoutAnimationRepository.js +91 -0
- package/lib/module/reanimated2/layoutReanimation/LayoutAnimationRepository.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js +90 -0
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js +192 -0
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/Keyframe.js +233 -0
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/Keyframe.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/commonTypes.js +2 -0
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/commonTypes.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/index.js +4 -0
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/index.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Bounce.js +530 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Bounce.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Default.js +40 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Default.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Fade.js +372 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Fade.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Flip.js +516 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Flip.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js +199 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js +88 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Roll.js +168 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Roll.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Rotate.js +372 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Rotate.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Slide.js +265 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Slide.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Stretch.js +148 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Stretch.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Zoom.js +643 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Zoom.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/index.js +11 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/index.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js +108 -0
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js +166 -0
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js +55 -0
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js +52 -0
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js +41 -0
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js +57 -0
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/index.js +7 -0
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/index.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/index.js +5 -0
- package/lib/module/reanimated2/layoutReanimation/index.js.map +1 -0
- package/lib/module/reanimated2/mock.js +86 -0
- package/lib/module/reanimated2/mock.js.map +1 -0
- package/lib/module/reanimated2/platform-specific/RNRenderer.js +4 -0
- package/lib/module/reanimated2/platform-specific/RNRenderer.js.map +1 -0
- package/lib/module/reanimated2/platform-specific/RNRenderer.web.js +3 -0
- package/lib/module/reanimated2/platform-specific/RNRenderer.web.js.map +1 -0
- package/lib/module/reanimated2/utils.js +11 -0
- package/lib/module/reanimated2/utils.js.map +1 -0
- package/lib/module/setAndForwardRef.js +55 -0
- package/lib/module/setAndForwardRef.js.map +1 -0
- package/mock.js +1 -0
- package/package.json +29 -25
- package/plugin.js +11 -17
- package/react-native-reanimated.d.ts +57 -4
- package/src/Animated.ts +0 -2
- package/src/createAnimatedComponent.tsx +37 -197
- package/src/index.ts +11 -5
- package/src/index.web.ts +5 -0
- package/src/reanimated2/Colors.ts +1 -1
- package/src/reanimated2/Easing.ts +0 -53
- package/src/reanimated2/NativeMethods.ts +44 -7
- package/src/reanimated2/NativeReanimated/NativeReanimated.ts +9 -0
- package/src/reanimated2/UpdateProps.ts +38 -19
- package/src/reanimated2/animation/decay.ts +79 -30
- package/src/reanimated2/animation/index.ts +7 -4
- package/src/reanimated2/animation/util.ts +8 -1
- package/src/reanimated2/commonTypes.ts +17 -1
- package/src/reanimated2/component/FlatList.tsx +29 -19
- package/src/reanimated2/core.ts +15 -9
- package/src/reanimated2/fabricUtils.ts +27 -0
- package/src/reanimated2/fabricUtils.web.ts +19 -0
- package/src/reanimated2/frameCallback/FrameCallbackRegistryJS.ts +43 -0
- package/src/reanimated2/frameCallback/FrameCallbackRegistryUI.ts +64 -0
- package/src/reanimated2/globals.d.ts +20 -1
- package/src/reanimated2/hook/commonTypes.ts +4 -2
- package/src/reanimated2/hook/index.ts +14 -14
- package/src/reanimated2/hook/useAnimatedGestureHandler.ts +2 -2
- package/src/reanimated2/hook/useAnimatedKeyboard.ts +35 -0
- package/src/reanimated2/hook/useAnimatedRef.ts +8 -3
- package/src/reanimated2/hook/useAnimatedScrollHandler.ts +2 -2
- package/src/reanimated2/hook/useAnimatedSensor.ts +5 -5
- package/src/reanimated2/hook/useFrameCallback.ts +39 -0
- package/src/reanimated2/hook/utils.ts +2 -5
- package/src/reanimated2/interpolateColor.ts +6 -2
- package/src/reanimated2/interpolation.ts +1 -26
- package/src/reanimated2/jestUtils.ts +11 -3
- package/src/reanimated2/js-reanimated/JSReanimated.ts +16 -1
- package/src/reanimated2/js-reanimated/global.ts +46 -29
- package/src/reanimated2/layoutReanimation/LayoutAnimationRepository.ts +1 -1
- package/src/reanimated2/layoutReanimation/animationBuilder/index.ts +1 -1
- package/android/.gradle/7.2/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/7.2/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/7.2/executionHistory/executionHistory.bin +0 -0
- package/android/.gradle/7.2/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/7.2/fileChanges/last-build.bin +0 -0
- package/android/.gradle/7.2/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/7.2/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/7.2/fileHashes/resourceHashesCache.bin +0 -0
- package/android/.gradle/7.2/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
- package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- package/android/.gradle/checksums/checksums.lock +0 -0
- package/android/.gradle/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/react-native-reanimated-65-hermes.aar +0 -0
- package/android/react-native-reanimated-65-jsc.aar +0 -0
- package/android/react-native-reanimated-66-hermes.aar +0 -0
- package/android/react-native-reanimated-66-jsc.aar +0 -0
- package/android/react-native-reanimated-67-hermes.aar +0 -0
- package/android/react-native-reanimated-67-jsc.aar +0 -0
- package/android/react-native-reanimated-68-hermes.aar +0 -0
- package/android/react-native-reanimated-68-jsc.aar +0 -0
- package/android/react-native-reanimated-69-hermes.aar +0 -0
- package/android/react-native-reanimated-69-jsc.aar +0 -0
- package/android/rnVersionPatch/69/.gitkeep +0 -0
- package/android/src/main/java/com/swmansion/reanimated/NativeProxy.java +0 -288
- package/android/src/main/java/com/swmansion/reanimated/UpdateContext.java +0 -11
- package/android/src/main/java/com/swmansion/reanimated/nodes/AlwaysNode.java +0 -29
- package/android/src/main/java/com/swmansion/reanimated/nodes/BezierNode.java +0 -87
- package/android/src/main/java/com/swmansion/reanimated/nodes/BlockNode.java +0 -24
- package/android/src/main/java/com/swmansion/reanimated/nodes/CallFuncNode.java +0 -49
- package/android/src/main/java/com/swmansion/reanimated/nodes/ClockNode.java +0 -38
- package/android/src/main/java/com/swmansion/reanimated/nodes/ClockOpNode.java +0 -73
- package/android/src/main/java/com/swmansion/reanimated/nodes/ConcatNode.java +0 -36
- package/android/src/main/java/com/swmansion/reanimated/nodes/CondNode.java +0 -41
- package/android/src/main/java/com/swmansion/reanimated/nodes/DebugNode.java +0 -33
- package/android/src/main/java/com/swmansion/reanimated/nodes/EventNode.java +0 -83
- package/android/src/main/java/com/swmansion/reanimated/nodes/FinalNode.java +0 -5
- package/android/src/main/java/com/swmansion/reanimated/nodes/FunctionNode.java +0 -20
- package/android/src/main/java/com/swmansion/reanimated/nodes/JSCallNode.java +0 -41
- package/android/src/main/java/com/swmansion/reanimated/nodes/Node.java +0 -139
- package/android/src/main/java/com/swmansion/reanimated/nodes/NoopNode.java +0 -37
- package/android/src/main/java/com/swmansion/reanimated/nodes/OperatorNode.java +0 -377
- package/android/src/main/java/com/swmansion/reanimated/nodes/ParamNode.java +0 -71
- package/android/src/main/java/com/swmansion/reanimated/nodes/PropsNode.java +0 -153
- package/android/src/main/java/com/swmansion/reanimated/nodes/SetNode.java +0 -32
- package/android/src/main/java/com/swmansion/reanimated/nodes/StyleNode.java +0 -40
- package/android/src/main/java/com/swmansion/reanimated/nodes/TransformNode.java +0 -84
- package/android/src/main/java/com/swmansion/reanimated/nodes/ValueNode.java +0 -40
- package/android/src/main/java/com/swmansion/reanimated/transitions/ChangeTransition.java +0 -84
- package/android/src/main/java/com/swmansion/reanimated/transitions/SaneSidePropagation.java +0 -25
- package/android/src/main/java/com/swmansion/reanimated/transitions/Scale.java +0 -86
- package/android/src/main/java/com/swmansion/reanimated/transitions/TransitionModule.java +0 -41
- package/android/src/main/java/com/swmansion/reanimated/transitions/TransitionUtils.java +0 -161
- package/ios/Nodes/REAAlwaysNode.h +0 -4
- package/ios/Nodes/REAAlwaysNode.m +0 -35
- package/ios/Nodes/REABezierNode.h +0 -5
- package/ios/Nodes/REABezierNode.m +0 -103
- package/ios/Nodes/REABlockNode.h +0 -5
- package/ios/Nodes/REABlockNode.m +0 -25
- package/ios/Nodes/REACallFuncNode.h +0 -6
- package/ios/Nodes/REACallFuncNode.m +0 -69
- package/ios/Nodes/REAClockNodes.h +0 -19
- package/ios/Nodes/REAClockNodes.m +0 -118
- package/ios/Nodes/REAConcatNode.h +0 -5
- package/ios/Nodes/REAConcatNode.m +0 -32
- package/ios/Nodes/REACondNode.h +0 -5
- package/ios/Nodes/REACondNode.m +0 -36
- package/ios/Nodes/READebugNode.h +0 -5
- package/ios/Nodes/READebugNode.m +0 -30
- package/ios/Nodes/REAEventNode.h +0 -8
- package/ios/Nodes/REAEventNode.m +0 -35
- package/ios/Nodes/REAFunctionNode.h +0 -6
- package/ios/Nodes/REAFunctionNode.m +0 -24
- package/ios/Nodes/REAJSCallNode.h +0 -5
- package/ios/Nodes/REAJSCallNode.m +0 -30
- package/ios/Nodes/REANode.h +0 -40
- package/ios/Nodes/REANode.m +0 -155
- package/ios/Nodes/REAOperatorNode.h +0 -5
- package/ios/Nodes/REAOperatorNode.m +0 -114
- package/ios/Nodes/REAParamNode.h +0 -10
- package/ios/Nodes/REAParamNode.m +0 -79
- package/ios/Nodes/REAPropsNode.h +0 -9
- package/ios/Nodes/REAPropsNode.m +0 -96
- package/ios/Nodes/REASetNode.h +0 -5
- package/ios/Nodes/REASetNode.m +0 -34
- package/ios/Nodes/REAStyleNode.h +0 -5
- package/ios/Nodes/REAStyleNode.m +0 -27
- package/ios/Nodes/REATransformNode.h +0 -5
- package/ios/Nodes/REATransformNode.m +0 -36
- package/ios/Nodes/REAValueNode.h +0 -9
- package/ios/Nodes/REAValueNode.m +0 -26
- package/ios/REAModule.m +0 -184
- package/ios/REANodesManager.m +0 -626
- package/ios/Transitioning/RCTConvert+REATransition.h +0 -11
- package/ios/Transitioning/RCTConvert+REATransition.m +0 -53
- package/ios/Transitioning/REAAllTransitions.h +0 -26
- package/ios/Transitioning/REAAllTransitions.m +0 -296
- package/ios/Transitioning/REATransition.h +0 -64
- package/ios/Transitioning/REATransition.m +0 -210
- package/ios/Transitioning/REATransitionAnimation.h +0 -17
- package/ios/Transitioning/REATransitionAnimation.m +0 -79
- package/ios/Transitioning/REATransitionManager.h +0 -9
- package/ios/Transitioning/REATransitionManager.m +0 -60
- package/ios/Transitioning/REATransitionValues.h +0 -15
- package/ios/Transitioning/REATransitionValues.m +0 -25
- package/lib/Animated.js +0 -9
- package/lib/ConfigHelper.js +0 -145
- package/lib/ReanimatedEventEmitter.js +0 -3
- package/lib/ReanimatedModule.js +0 -2
- package/lib/ReanimatedModule.macos.js +0 -2
- package/lib/ReanimatedModule.native.js +0 -12
- package/lib/ReanimatedModule.windows.js +0 -2
- package/lib/ReanimatedModuleCompat.js +0 -66
- package/lib/__mocks__/ReanimatedEventEmitter.js +0 -8
- package/lib/__mocks__/ReanimatedModule.native.js +0 -11
- package/lib/createAnimatedComponent.js +0 -514
- package/lib/index.js +0 -6
- package/lib/reanimated1/Easing.js +0 -231
- package/lib/reanimated1/SpringConfig.js +0 -79
- package/lib/reanimated1/Transitioning.js +0 -158
- package/lib/reanimated1/animations/Animation.js +0 -32
- package/lib/reanimated1/animations/SpringUtils.js +0 -199
- package/lib/reanimated1/animations/backwardCompatibleAnimWrapper.js +0 -117
- package/lib/reanimated1/animations/decay.js +0 -54
- package/lib/reanimated1/animations/spring.js +0 -198
- package/lib/reanimated1/animations/timing.js +0 -74
- package/lib/reanimated1/base.js +0 -13
- package/lib/reanimated1/core/AnimatedAlways.js +0 -33
- package/lib/reanimated1/core/AnimatedBezier.js +0 -150
- package/lib/reanimated1/core/AnimatedBlock.js +0 -52
- package/lib/reanimated1/core/AnimatedCall.js +0 -55
- package/lib/reanimated1/core/AnimatedCallFunc.js +0 -72
- package/lib/reanimated1/core/AnimatedClock.js +0 -90
- package/lib/reanimated1/core/AnimatedClockTest.js +0 -22
- package/lib/reanimated1/core/AnimatedCode.js +0 -32
- package/lib/reanimated1/core/AnimatedConcat.js +0 -32
- package/lib/reanimated1/core/AnimatedCond.js +0 -57
- package/lib/reanimated1/core/AnimatedDebug.js +0 -62
- package/lib/reanimated1/core/AnimatedEvent.js +0 -126
- package/lib/reanimated1/core/AnimatedFunction.js +0 -55
- package/lib/reanimated1/core/AnimatedNode.js +0 -223
- package/lib/reanimated1/core/AnimatedOperator.js +0 -103
- package/lib/reanimated1/core/AnimatedParam.js +0 -88
- package/lib/reanimated1/core/AnimatedProps.js +0 -108
- package/lib/reanimated1/core/AnimatedSet.js +0 -38
- package/lib/reanimated1/core/AnimatedStartClock.js +0 -30
- package/lib/reanimated1/core/AnimatedStopClock.js +0 -30
- package/lib/reanimated1/core/AnimatedStyle.js +0 -78
- package/lib/reanimated1/core/AnimatedTransform.js +0 -78
- package/lib/reanimated1/core/AnimatedValue.js +0 -38
- package/lib/reanimated1/core/Core.test.js +0 -30
- package/lib/reanimated1/core/InternalAnimatedValue.js +0 -87
- package/lib/reanimated1/core/__mocks__/AnimatedProps.js +0 -86
- package/lib/reanimated1/core/createEventObjectProxyPolyfill.js +0 -44
- package/lib/reanimated1/derived/__mocks__/evaluateOnce.js +0 -14
- package/lib/reanimated1/derived/acc.js +0 -11
- package/lib/reanimated1/derived/color.js +0 -47
- package/lib/reanimated1/derived/diff.js +0 -16
- package/lib/reanimated1/derived/diffClamp.js +0 -11
- package/lib/reanimated1/derived/evaluateOnce.js +0 -35
- package/lib/reanimated1/derived/index.js +0 -8
- package/lib/reanimated1/derived/interpolate.js +0 -152
- package/lib/reanimated1/derived/interpolateColors.js +0 -62
- package/lib/reanimated1/derived/onChange.js +0 -14
- package/lib/reanimated1/derived/useCode.js +0 -41
- package/lib/reanimated1/index.js +0 -53
- package/lib/reanimated1/operators.js +0 -35
- package/lib/reanimated1/useValue.js +0 -10
- package/lib/reanimated1/val.js +0 -3
- package/lib/reanimated2/Bezier.js +0 -126
- package/lib/reanimated2/Colors.js +0 -522
- package/lib/reanimated2/Easing.js +0 -248
- package/lib/reanimated2/NativeMethods.js +0 -42
- package/lib/reanimated2/NativeReanimated/NativeReanimated.js +0 -50
- package/lib/reanimated2/NativeReanimated/index.js +0 -11
- package/lib/reanimated2/PlatformChecker.js +0 -16
- package/lib/reanimated2/PropAdapters.js +0 -55
- package/lib/reanimated2/UpdateProps.js +0 -55
- package/lib/reanimated2/ViewDescriptorsSet.js +0 -75
- package/lib/reanimated2/WorkletEventHandler.js +0 -37
- package/lib/reanimated2/__mocks__/MutableValue.js +0 -13
- package/lib/reanimated2/__mocks__/NativeReanimated.js +0 -20
- package/lib/reanimated2/__mocks__/NativeReanimated.native.js +0 -20
- package/lib/reanimated2/animation/commonTypes.js +0 -1
- package/lib/reanimated2/animation/decay.js +0 -71
- package/lib/reanimated2/animation/delay.js +0 -64
- package/lib/reanimated2/animation/index.js +0 -8
- package/lib/reanimated2/animation/repeat.js +0 -69
- package/lib/reanimated2/animation/sequence.js +0 -69
- package/lib/reanimated2/animation/spring.js +0 -103
- package/lib/reanimated2/animation/styleAnimation.js +0 -171
- package/lib/reanimated2/animation/timing.js +0 -64
- package/lib/reanimated2/animation/util.js +0 -180
- package/lib/reanimated2/commonTypes.js +0 -1
- package/lib/reanimated2/component/FlatList.js +0 -30
- package/lib/reanimated2/component/Image.js +0 -4
- package/lib/reanimated2/component/ScrollView.js +0 -4
- package/lib/reanimated2/component/Text.js +0 -4
- package/lib/reanimated2/component/View.js +0 -4
- package/lib/reanimated2/core.js +0 -268
- package/lib/reanimated2/globals.d.ts +0 -60
- package/lib/reanimated2/hook/Hooks.js +0 -9
- package/lib/reanimated2/hook/commonTypes.js +0 -1
- package/lib/reanimated2/hook/index.js +0 -9
- package/lib/reanimated2/hook/useAnimatedGestureHandler.js +0 -49
- package/lib/reanimated2/hook/useAnimatedReaction.js +0 -37
- package/lib/reanimated2/hook/useAnimatedRef.js +0 -25
- package/lib/reanimated2/hook/useAnimatedScrollHandler.js +0 -41
- package/lib/reanimated2/hook/useAnimatedSensor.js +0 -66
- package/lib/reanimated2/hook/useAnimatedStyle.js +0 -393
- package/lib/reanimated2/hook/useDerivedValue.js +0 -36
- package/lib/reanimated2/hook/useSharedValue.js +0 -17
- package/lib/reanimated2/hook/utils.js +0 -173
- package/lib/reanimated2/index.js +0 -12
- package/lib/reanimated2/interpolateColor.js +0 -98
- package/lib/reanimated2/interpolation.js +0 -127
- package/lib/reanimated2/jestUtils.js +0 -160
- package/lib/reanimated2/js-reanimated/JSReanimated.js +0 -99
- package/lib/reanimated2/js-reanimated/Mapper.js +0 -43
- package/lib/reanimated2/js-reanimated/MapperRegistry.js +0 -101
- package/lib/reanimated2/js-reanimated/MutableValue.js +0 -29
- package/lib/reanimated2/js-reanimated/commonTypes.js +0 -1
- package/lib/reanimated2/js-reanimated/global.js +0 -25
- package/lib/reanimated2/js-reanimated/index.js +0 -35
- package/lib/reanimated2/layoutReanimation/LayoutAnimationRepository.js +0 -67
- package/lib/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js +0 -69
- package/lib/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js +0 -133
- package/lib/reanimated2/layoutReanimation/animationBuilder/Keyframe.js +0 -194
- package/lib/reanimated2/layoutReanimation/animationBuilder/commonTypes.js +0 -1
- package/lib/reanimated2/layoutReanimation/animationBuilder/index.js +0 -3
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Bounce.js +0 -376
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Default.js +0 -36
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Fade.js +0 -275
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Flip.js +0 -385
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js +0 -138
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js +0 -81
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Roll.js +0 -115
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Rotate.js +0 -273
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Slide.js +0 -203
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Stretch.js +0 -101
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Zoom.js +0 -451
- package/lib/reanimated2/layoutReanimation/defaultAnimations/index.js +0 -10
- package/lib/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js +0 -90
- package/lib/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js +0 -132
- package/lib/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js +0 -37
- package/lib/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js +0 -41
- package/lib/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js +0 -34
- package/lib/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js +0 -46
- package/lib/reanimated2/layoutReanimation/defaultTransitions/index.js +0 -6
- package/lib/reanimated2/layoutReanimation/index.js +0 -4
- package/lib/reanimated2/mock.js +0 -75
- package/lib/reanimated2/platform-specific/RNRenderer.js +0 -3
- package/lib/reanimated2/platform-specific/RNRenderer.web.js +0 -3
- package/lib/reanimated2/utils.js +0 -9
- package/lib/setAndForwardRef.js +0 -19
- package/lib/types/lib/Animated.d.ts +0 -8
- package/lib/types/lib/ConfigHelper.d.ts +0 -12
- package/lib/types/lib/ReanimatedEventEmitter.d.ts +0 -3
- package/lib/types/lib/ReanimatedModule.d.ts +0 -2
- package/lib/types/lib/ReanimatedModule.macos.d.ts +0 -2
- package/lib/types/lib/ReanimatedModule.native.d.ts +0 -2
- package/lib/types/lib/ReanimatedModule.windows.d.ts +0 -2
- package/lib/types/lib/ReanimatedModuleCompat.d.ts +0 -14
- package/lib/types/lib/createAnimatedComponent.d.ts +0 -33
- package/lib/types/lib/index.d.ts +0 -4
- package/lib/types/lib/reanimated2/Bezier.d.ts +0 -6
- package/lib/types/lib/reanimated2/Colors.d.ts +0 -31
- package/lib/types/lib/reanimated2/Easing.d.ts +0 -172
- package/lib/types/lib/reanimated2/NativeMethods.d.ts +0 -14
- package/lib/types/lib/reanimated2/NativeReanimated/NativeReanimated.d.ts +0 -20
- package/lib/types/lib/reanimated2/NativeReanimated/index.d.ts +0 -3
- package/lib/types/lib/reanimated2/PlatformChecker.d.ts +0 -5
- package/lib/types/lib/reanimated2/PropAdapters.d.ts +0 -4
- package/lib/types/lib/reanimated2/UpdateProps.d.ts +0 -9
- package/lib/types/lib/reanimated2/ViewDescriptorsSet.d.ts +0 -20
- package/lib/types/lib/reanimated2/WorkletEventHandler.d.ts +0 -13
- package/lib/types/lib/reanimated2/__mocks__/MutableValue.d.ts +0 -5
- package/lib/types/lib/reanimated2/__mocks__/NativeReanimated.d.ts +0 -13
- package/lib/types/lib/reanimated2/__mocks__/NativeReanimated.native.d.ts +0 -13
- package/lib/types/lib/reanimated2/animation/commonTypes.d.ts +0 -27
- package/lib/types/lib/reanimated2/animation/decay.d.ts +0 -19
- package/lib/types/lib/reanimated2/animation/delay.d.ts +0 -7
- package/lib/types/lib/reanimated2/animation/index.d.ts +0 -9
- package/lib/types/lib/reanimated2/animation/repeat.d.ts +0 -12
- package/lib/types/lib/reanimated2/animation/sequence.d.ts +0 -7
- package/lib/types/lib/reanimated2/animation/spring.d.ts +0 -22
- package/lib/types/lib/reanimated2/animation/styleAnimation.d.ts +0 -7
- package/lib/types/lib/reanimated2/animation/timing.d.ts +0 -21
- package/lib/types/lib/reanimated2/animation/util.d.ts +0 -9
- package/lib/types/lib/reanimated2/commonTypes.d.ts +0 -79
- package/lib/types/lib/reanimated2/component/FlatList.d.ts +0 -9
- package/lib/types/lib/reanimated2/component/Image.d.ts +0 -3
- package/lib/types/lib/reanimated2/component/ScrollView.d.ts +0 -3
- package/lib/types/lib/reanimated2/component/Text.d.ts +0 -3
- package/lib/types/lib/reanimated2/component/View.d.ts +0 -3
- package/lib/types/lib/reanimated2/core.d.ts +0 -24
- package/lib/types/lib/reanimated2/hook/Hooks.d.ts +0 -5
- package/lib/types/lib/reanimated2/hook/commonTypes.d.ts +0 -14
- package/lib/types/lib/reanimated2/hook/index.d.ts +0 -10
- package/lib/types/lib/reanimated2/hook/useAnimatedGestureHandler.d.ts +0 -35
- package/lib/types/lib/reanimated2/hook/useAnimatedReaction.d.ts +0 -12
- package/lib/types/lib/reanimated2/hook/useAnimatedRef.d.ts +0 -3
- package/lib/types/lib/reanimated2/hook/useAnimatedScrollHandler.d.ts +0 -21
- package/lib/types/lib/reanimated2/hook/useAnimatedSensor.d.ts +0 -18
- package/lib/types/lib/reanimated2/hook/useAnimatedStyle.d.ts +0 -11
- package/lib/types/lib/reanimated2/hook/useDerivedValue.d.ts +0 -4
- package/lib/types/lib/reanimated2/hook/useSharedValue.d.ts +0 -2
- package/lib/types/lib/reanimated2/hook/utils.d.ts +0 -28
- package/lib/types/lib/reanimated2/index.d.ts +0 -12
- package/lib/types/lib/reanimated2/interpolateColor.d.ts +0 -26
- package/lib/types/lib/reanimated2/interpolation.d.ts +0 -14
- package/lib/types/lib/reanimated2/jestUtils.d.ts +0 -12
- package/lib/types/lib/reanimated2/js-reanimated/JSReanimated.d.ts +0 -30
- package/lib/types/lib/reanimated2/js-reanimated/Mapper.d.ts +0 -14
- package/lib/types/lib/reanimated2/js-reanimated/MapperRegistry.d.ts +0 -14
- package/lib/types/lib/reanimated2/js-reanimated/MutableValue.d.ts +0 -14
- package/lib/types/lib/reanimated2/js-reanimated/commonTypes.d.ts +0 -44
- package/lib/types/lib/reanimated2/js-reanimated/global.d.ts +0 -1
- package/lib/types/lib/reanimated2/js-reanimated/index.d.ts +0 -15
- package/lib/types/lib/reanimated2/layoutReanimation/LayoutAnimationRepository.d.ts +0 -1
- package/lib/types/lib/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.d.ts +0 -22
- package/lib/types/lib/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.d.ts +0 -38
- package/lib/types/lib/reanimated2/layoutReanimation/animationBuilder/Keyframe.d.ts +0 -25
- package/lib/types/lib/reanimated2/layoutReanimation/animationBuilder/commonTypes.d.ts +0 -77
- package/lib/types/lib/reanimated2/layoutReanimation/animationBuilder/index.d.ts +0 -4
- package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Bounce.d.ts +0 -62
- package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Default.d.ts +0 -4
- package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Fade.d.ts +0 -42
- package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Flip.d.ts +0 -50
- package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.d.ts +0 -18
- package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.d.ts +0 -10
- package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Roll.d.ts +0 -18
- package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Rotate.d.ts +0 -34
- package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Slide.d.ts +0 -34
- package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Stretch.d.ts +0 -18
- package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Zoom.d.ts +0 -66
- package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/index.d.ts +0 -10
- package/lib/types/lib/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.d.ts +0 -19
- package/lib/types/lib/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.d.ts +0 -13
- package/lib/types/lib/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.d.ts +0 -6
- package/lib/types/lib/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.d.ts +0 -6
- package/lib/types/lib/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.d.ts +0 -7
- package/lib/types/lib/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.d.ts +0 -9
- package/lib/types/lib/reanimated2/layoutReanimation/defaultTransitions/index.d.ts +0 -6
- package/lib/types/lib/reanimated2/layoutReanimation/index.d.ts +0 -4
- package/lib/types/lib/reanimated2/mock.d.ts +0 -61
- package/lib/types/lib/reanimated2/platform-specific/RNRenderer.d.ts +0 -1
- package/lib/types/lib/reanimated2/platform-specific/RNRenderer.web.d.ts +0 -0
- package/lib/types/lib/reanimated2/utils.d.ts +0 -7
- package/lib/types/lib/setAndForwardRef.d.ts +0 -40
- package/lib/types/react-native-reanimated-tests.d.ts +0 -1
- package/src/ReanimatedEventEmitter.ts +0 -4
- package/src/ReanimatedModule.macos.ts +0 -3
- package/src/ReanimatedModule.native.ts +0 -13
- package/src/ReanimatedModule.ts +0 -3
- package/src/ReanimatedModule.windows.ts +0 -3
- package/src/ReanimatedModuleCompat.ts +0 -51
- package/src/__mocks__/ReanimatedEventEmitter.js +0 -8
- package/src/__mocks__/ReanimatedModule.native.js +0 -11
- package/src/reanimated1/Easing.js +0 -231
- package/src/reanimated1/SpringConfig.js +0 -79
- package/src/reanimated1/Transitioning.js +0 -158
- package/src/reanimated1/animations/Animation.js +0 -32
- package/src/reanimated1/animations/SpringUtils.js +0 -199
- package/src/reanimated1/animations/backwardCompatibleAnimWrapper.js +0 -117
- package/src/reanimated1/animations/decay.js +0 -54
- package/src/reanimated1/animations/spring.js +0 -198
- package/src/reanimated1/animations/timing.js +0 -74
- package/src/reanimated1/base.js +0 -13
- package/src/reanimated1/core/AnimatedAlways.js +0 -33
- package/src/reanimated1/core/AnimatedBezier.js +0 -150
- package/src/reanimated1/core/AnimatedBlock.js +0 -52
- package/src/reanimated1/core/AnimatedCall.js +0 -55
- package/src/reanimated1/core/AnimatedCallFunc.js +0 -72
- package/src/reanimated1/core/AnimatedClock.js +0 -90
- package/src/reanimated1/core/AnimatedClockTest.js +0 -22
- package/src/reanimated1/core/AnimatedCode.js +0 -32
- package/src/reanimated1/core/AnimatedConcat.js +0 -32
- package/src/reanimated1/core/AnimatedCond.js +0 -57
- package/src/reanimated1/core/AnimatedDebug.js +0 -62
- package/src/reanimated1/core/AnimatedEvent.js +0 -126
- package/src/reanimated1/core/AnimatedFunction.js +0 -55
- package/src/reanimated1/core/AnimatedNode.js +0 -223
- package/src/reanimated1/core/AnimatedOperator.js +0 -103
- package/src/reanimated1/core/AnimatedParam.js +0 -88
- package/src/reanimated1/core/AnimatedProps.js +0 -108
- package/src/reanimated1/core/AnimatedSet.js +0 -38
- package/src/reanimated1/core/AnimatedStartClock.js +0 -30
- package/src/reanimated1/core/AnimatedStopClock.js +0 -30
- package/src/reanimated1/core/AnimatedStyle.js +0 -78
- package/src/reanimated1/core/AnimatedTransform.js +0 -78
- package/src/reanimated1/core/AnimatedValue.js +0 -38
- package/src/reanimated1/core/Core.test.js +0 -30
- package/src/reanimated1/core/InternalAnimatedValue.js +0 -87
- package/src/reanimated1/core/__mocks__/AnimatedProps.js +0 -86
- package/src/reanimated1/core/createEventObjectProxyPolyfill.js +0 -44
- package/src/reanimated1/derived/__mocks__/evaluateOnce.js +0 -14
- package/src/reanimated1/derived/acc.js +0 -11
- package/src/reanimated1/derived/color.js +0 -47
- package/src/reanimated1/derived/diff.js +0 -16
- package/src/reanimated1/derived/diffClamp.js +0 -11
- package/src/reanimated1/derived/evaluateOnce.js +0 -35
- package/src/reanimated1/derived/index.js +0 -8
- package/src/reanimated1/derived/interpolate.js +0 -152
- package/src/reanimated1/derived/interpolateColors.js +0 -62
- package/src/reanimated1/derived/onChange.js +0 -14
- package/src/reanimated1/derived/useCode.js +0 -41
- package/src/reanimated1/index.js +0 -53
- package/src/reanimated1/operators.js +0 -35
- package/src/reanimated1/useValue.js +0 -10
- package/src/reanimated1/val.js +0 -3
- package/src/reanimated2/__mocks__/MutableValue.ts +0 -15
- package/src/reanimated2/__mocks__/NativeReanimated.ts +0 -23
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _MapperRegistry = _interopRequireDefault(require("./MapperRegistry"));
|
|
9
|
+
|
|
10
|
+
var _Mapper = _interopRequireDefault(require("./Mapper"));
|
|
11
|
+
|
|
12
|
+
var _MutableValue = _interopRequireDefault(require("./MutableValue"));
|
|
13
|
+
|
|
14
|
+
var _NativeReanimated = require("../NativeReanimated/NativeReanimated");
|
|
15
|
+
|
|
16
|
+
var _PlatformChecker = require("../PlatformChecker");
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
|
|
20
|
+
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; }
|
|
21
|
+
|
|
22
|
+
class JSReanimated extends _NativeReanimated.NativeReanimated {
|
|
23
|
+
constructor() {
|
|
24
|
+
super(false);
|
|
25
|
+
|
|
26
|
+
_defineProperty(this, "_valueSetter", undefined);
|
|
27
|
+
|
|
28
|
+
_defineProperty(this, "_renderRequested", false);
|
|
29
|
+
|
|
30
|
+
_defineProperty(this, "_mapperRegistry", new _MapperRegistry.default(this));
|
|
31
|
+
|
|
32
|
+
_defineProperty(this, "_frames", []);
|
|
33
|
+
|
|
34
|
+
_defineProperty(this, "timeProvider", void 0);
|
|
35
|
+
|
|
36
|
+
if ((0, _PlatformChecker.isJest)()) {
|
|
37
|
+
this.timeProvider = {
|
|
38
|
+
now: () => global.ReanimatedDataMock.now()
|
|
39
|
+
};
|
|
40
|
+
} else {
|
|
41
|
+
this.timeProvider = {
|
|
42
|
+
now: () => window.performance.now()
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
pushFrame(frame) {
|
|
48
|
+
this._frames.push(frame);
|
|
49
|
+
|
|
50
|
+
this.maybeRequestRender();
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
getTimestamp() {
|
|
54
|
+
return this.timeProvider.now();
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
maybeRequestRender() {
|
|
58
|
+
if (!this._renderRequested) {
|
|
59
|
+
this._renderRequested = true;
|
|
60
|
+
requestAnimationFrame(_timestampMs => {
|
|
61
|
+
this._renderRequested = false;
|
|
62
|
+
|
|
63
|
+
this._onRender(this.getTimestamp());
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
_onRender(timestampMs) {
|
|
69
|
+
this._mapperRegistry.execute();
|
|
70
|
+
|
|
71
|
+
const frames = [...this._frames];
|
|
72
|
+
this._frames = [];
|
|
73
|
+
|
|
74
|
+
for (let i = 0, len = frames.length; i < len; ++i) {
|
|
75
|
+
frames[i](timestampMs);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if (this._mapperRegistry.needRunOnRender) {
|
|
79
|
+
this._mapperRegistry.execute();
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
installCoreFunctions(valueSetter) {
|
|
84
|
+
this._valueSetter = valueSetter;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
makeShareable(value) {
|
|
88
|
+
return value;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
makeMutable(value) {
|
|
92
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
93
|
+
return new _MutableValue.default(value, this._valueSetter);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
makeRemote() {
|
|
97
|
+
let object = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
98
|
+
return object;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
startMapper(mapper) {
|
|
102
|
+
let inputs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
103
|
+
let outputs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
104
|
+
const instance = new _Mapper.default(this, mapper, inputs, outputs);
|
|
105
|
+
|
|
106
|
+
const mapperId = this._mapperRegistry.startMapper(instance);
|
|
107
|
+
|
|
108
|
+
this.maybeRequestRender();
|
|
109
|
+
return mapperId;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
stopMapper(mapperId) {
|
|
113
|
+
this._mapperRegistry.stopMapper(mapperId);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
registerEventHandler(_, __) {
|
|
117
|
+
// noop
|
|
118
|
+
return '';
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
unregisterEventHandler(_) {// noop
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
enableLayoutAnimations() {
|
|
125
|
+
console.warn('[Reanimated] enableLayoutAnimations is not available for WEB yet');
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
registerSensor() {
|
|
129
|
+
console.warn('[Reanimated] useAnimatedSensor is not available on web yet.');
|
|
130
|
+
return -1;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
unregisterSensor() {// noop
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
jestResetModule() {
|
|
137
|
+
if ((0, _PlatformChecker.isJest)()) {
|
|
138
|
+
/**
|
|
139
|
+
* If someone used timers to stop animation before the end,
|
|
140
|
+
* then _renderRequested was set as true
|
|
141
|
+
* and any new update from another test wasn't applied.
|
|
142
|
+
*/
|
|
143
|
+
this._renderRequested = false;
|
|
144
|
+
} else {
|
|
145
|
+
throw Error('This method can be only use in Jest testing.');
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
subscribeForKeyboardEvents(_) {
|
|
150
|
+
console.warn('[Reanimated] useAnimatedKeyboard is not available on web yet.');
|
|
151
|
+
return -1;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
unsubscribeFromKeyboardEvents(_) {// noop
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
exports.default = JSReanimated;
|
|
160
|
+
//# sourceMappingURL=JSReanimated.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["JSReanimated","NativeReanimated","constructor","undefined","MapperRegistry","isJest","timeProvider","now","global","ReanimatedDataMock","window","performance","pushFrame","frame","_frames","push","maybeRequestRender","getTimestamp","_renderRequested","requestAnimationFrame","_timestampMs","_onRender","timestampMs","_mapperRegistry","execute","frames","i","len","length","needRunOnRender","installCoreFunctions","valueSetter","_valueSetter","makeShareable","value","makeMutable","MutableValue","makeRemote","object","startMapper","mapper","inputs","outputs","instance","Mapper","mapperId","stopMapper","registerEventHandler","_","__","unregisterEventHandler","enableLayoutAnimations","console","warn","registerSensor","unregisterSensor","jestResetModule","Error","subscribeForKeyboardEvents","unsubscribeFromKeyboardEvents"],"sources":["JSReanimated.ts"],"sourcesContent":["import MapperRegistry from './MapperRegistry';\nimport Mapper from './Mapper';\nimport MutableValue from './MutableValue';\nimport { NativeReanimated } from '../NativeReanimated/NativeReanimated';\nimport {\n Timestamp,\n NestedObjectValues,\n AnimatedKeyboardInfo,\n} from '../commonTypes';\nimport { isJest } from '../PlatformChecker';\n\nexport default class JSReanimated extends NativeReanimated {\n _valueSetter?: <T>(value: T) => void = undefined;\n\n _renderRequested = false;\n _mapperRegistry: MapperRegistry<any> = new MapperRegistry(this);\n _frames: ((timestamp: Timestamp) => void)[] = [];\n timeProvider: { now: () => number };\n\n constructor() {\n super(false);\n if (isJest()) {\n this.timeProvider = { now: () => global.ReanimatedDataMock.now() };\n } else {\n this.timeProvider = { now: () => window.performance.now() };\n }\n }\n\n pushFrame(frame: (timestamp: Timestamp) => void): void {\n this._frames.push(frame);\n this.maybeRequestRender();\n }\n\n getTimestamp(): number {\n return this.timeProvider.now();\n }\n\n maybeRequestRender(): void {\n if (!this._renderRequested) {\n this._renderRequested = true;\n\n requestAnimationFrame((_timestampMs) => {\n this._renderRequested = false;\n\n this._onRender(this.getTimestamp());\n });\n }\n }\n\n _onRender(timestampMs: number): void {\n this._mapperRegistry.execute();\n\n const frames = [...this._frames];\n this._frames = [];\n\n for (let i = 0, len = frames.length; i < len; ++i) {\n frames[i](timestampMs);\n }\n\n if (this._mapperRegistry.needRunOnRender) {\n this._mapperRegistry.execute();\n }\n }\n\n installCoreFunctions(valueSetter: <T>(value: T) => void): void {\n this._valueSetter = valueSetter;\n }\n\n makeShareable<T>(value: T): T {\n return value;\n }\n\n makeMutable<T>(value: T): MutableValue<T> {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return new MutableValue(value, this._valueSetter!);\n }\n\n makeRemote<T>(object = {}): T {\n return object as T;\n }\n\n startMapper(\n mapper: () => void,\n inputs: NestedObjectValues<MutableValue<unknown>>[] = [],\n outputs: NestedObjectValues<MutableValue<unknown>>[] = []\n ): number {\n const instance = new Mapper(this, mapper, inputs, outputs);\n const mapperId = this._mapperRegistry.startMapper(instance);\n this.maybeRequestRender();\n return mapperId;\n }\n\n stopMapper(mapperId: number): void {\n this._mapperRegistry.stopMapper(mapperId);\n }\n\n registerEventHandler<T>(_: string, __: (event: T) => void): string {\n // noop\n return '';\n }\n\n unregisterEventHandler(_: string): void {\n // noop\n }\n\n enableLayoutAnimations() {\n console.warn(\n '[Reanimated] enableLayoutAnimations is not available for WEB yet'\n );\n }\n\n registerSensor(): number {\n console.warn('[Reanimated] useAnimatedSensor is not available on web yet.');\n return -1;\n }\n\n unregisterSensor(): void {\n // noop\n }\n\n jestResetModule() {\n if (isJest()) {\n /**\n * If someone used timers to stop animation before the end,\n * then _renderRequested was set as true\n * and any new update from another test wasn't applied.\n */\n this._renderRequested = false;\n } else {\n throw Error('This method can be only use in Jest testing.');\n }\n }\n\n subscribeForKeyboardEvents(_: AnimatedKeyboardInfo): 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"],"mappings":"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"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _MutableValue = _interopRequireDefault(require("./MutableValue"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
12
|
+
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; }
|
|
13
|
+
|
|
14
|
+
class Mapper {
|
|
15
|
+
constructor(module, mapper) {
|
|
16
|
+
let inputs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
17
|
+
let outputs = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
|
|
18
|
+
|
|
19
|
+
_defineProperty(this, "id", void 0);
|
|
20
|
+
|
|
21
|
+
_defineProperty(this, "inputs", void 0);
|
|
22
|
+
|
|
23
|
+
_defineProperty(this, "outputs", void 0);
|
|
24
|
+
|
|
25
|
+
_defineProperty(this, "mapper", void 0);
|
|
26
|
+
|
|
27
|
+
_defineProperty(this, "dirty", true);
|
|
28
|
+
|
|
29
|
+
this.id = Mapper.MAPPER_ID++;
|
|
30
|
+
this.inputs = this.extractMutablesFromArray(inputs);
|
|
31
|
+
this.outputs = this.extractMutablesFromArray(outputs);
|
|
32
|
+
this.mapper = mapper;
|
|
33
|
+
|
|
34
|
+
const markDirty = () => {
|
|
35
|
+
this.dirty = true;
|
|
36
|
+
module.maybeRequestRender();
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
this.inputs.forEach(input => {
|
|
40
|
+
input.addListener(markDirty);
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
execute() {
|
|
45
|
+
this.dirty = false;
|
|
46
|
+
this.mapper();
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
extractMutablesFromArray(array) {
|
|
50
|
+
const res = [];
|
|
51
|
+
|
|
52
|
+
function extractMutables(value) {
|
|
53
|
+
if (value == null) {// return;
|
|
54
|
+
} else if (value instanceof _MutableValue.default) {
|
|
55
|
+
res.push(value);
|
|
56
|
+
} else if (Array.isArray(value)) {
|
|
57
|
+
value.forEach(v => extractMutables(v));
|
|
58
|
+
} else if (typeof value === 'object') {
|
|
59
|
+
Object.keys(value).forEach(key => {
|
|
60
|
+
extractMutables(value[key]);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
extractMutables(array);
|
|
66
|
+
return res;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
exports.default = Mapper;
|
|
72
|
+
|
|
73
|
+
_defineProperty(Mapper, "MAPPER_ID", 1);
|
|
74
|
+
//# sourceMappingURL=Mapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Mapper","constructor","module","mapper","inputs","outputs","id","MAPPER_ID","extractMutablesFromArray","markDirty","dirty","maybeRequestRender","forEach","input","addListener","execute","array","res","extractMutables","value","MutableValue","push","Array","isArray","v","Object","keys","key"],"sources":["Mapper.ts"],"sourcesContent":["import { NestedObjectValues } from '../commonTypes';\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 (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"],"mappings":";;;;;;;AAEA;;;;;;AAEe,MAAMA,MAAN,CAAgB;EAS7BC,WAAW,CACTC,MADS,EAETC,MAFS,EAKT;IAAA,IAFAC,MAEA,uEAFgD,EAEhD;IAAA,IADAC,OACA,uEADiD,EACjD;;IAAA;;IAAA;;IAAA;;IAAA;;IAAA,+BAPM,IAON;;IACA,KAAKC,EAAL,GAAUN,MAAM,CAACO,SAAP,EAAV;IACA,KAAKH,MAAL,GAAc,KAAKI,wBAAL,CAA8BJ,MAA9B,CAAd;IACA,KAAKC,OAAL,GAAe,KAAKG,wBAAL,CAA8BH,OAA9B,CAAf;IACA,KAAKF,MAAL,GAAcA,MAAd;;IAEA,MAAMM,SAAS,GAAG,MAAM;MACtB,KAAKC,KAAL,GAAa,IAAb;MACAR,MAAM,CAACS,kBAAP;IACD,CAHD;;IAKA,KAAKP,MAAL,CAAYQ,OAAZ,CAAqBC,KAAD,IAAW;MAC7BA,KAAK,CAACC,WAAN,CAAkBL,SAAlB;IACD,CAFD;EAGD;;EAEDM,OAAO,GAAS;IACd,KAAKL,KAAL,GAAa,KAAb;IACA,KAAKP,MAAL;EACD;;EAEDK,wBAAwB,CACtBQ,KADsB,EAEH;IACnB,MAAMC,GAAsB,GAAG,EAA/B;;IAEA,SAASC,eAAT,CAAyBC,KAAzB,EAAqE;MACnE,IAAIA,KAAK,IAAI,IAAb,EAAmB,CACjB;MACD,CAFD,MAEO,IAAIA,KAAK,YAAYC,qBAArB,EAAmC;QACxCH,GAAG,CAACI,IAAJ,CAASF,KAAT;MACD,CAFM,MAEA,IAAIG,KAAK,CAACC,OAAN,CAAcJ,KAAd,CAAJ,EAA0B;QAC/BA,KAAK,CAACP,OAAN,CAAeY,CAAD,IAAON,eAAe,CAACM,CAAD,CAApC;MACD,CAFM,MAEA,IAAI,OAAOL,KAAP,KAAiB,QAArB,EAA+B;QACpCM,MAAM,CAACC,IAAP,CAAYP,KAAZ,EAAmBP,OAAnB,CAA4Be,GAAD,IAAS;UAClCT,eAAe,CAACC,KAAK,CAACQ,GAAD,CAAN,CAAf;QACD,CAFD;MAGD;IACF;;IAEDT,eAAe,CAACF,KAAD,CAAf;IACA,OAAOC,GAAP;EACD;;AAxD4B;;;;gBAAVjB,M,eACA,C"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
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; }
|
|
9
|
+
|
|
10
|
+
class MapperRegistry {
|
|
11
|
+
constructor(module) {
|
|
12
|
+
_defineProperty(this, "sortedMappers", []);
|
|
13
|
+
|
|
14
|
+
_defineProperty(this, "mappers", new Map());
|
|
15
|
+
|
|
16
|
+
_defineProperty(this, "_module", void 0);
|
|
17
|
+
|
|
18
|
+
_defineProperty(this, "updatedSinceLastExecute", false);
|
|
19
|
+
|
|
20
|
+
this._module = module;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
startMapper(mapper) {
|
|
24
|
+
this.mappers.set(mapper.id, mapper);
|
|
25
|
+
this.updatedSinceLastExecute = true;
|
|
26
|
+
return mapper.id;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
stopMapper(id) {
|
|
30
|
+
this.mappers.delete(id);
|
|
31
|
+
this.updatedSinceLastExecute = true;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
execute() {
|
|
35
|
+
if (this.updatedSinceLastExecute) {
|
|
36
|
+
this.updateOrder();
|
|
37
|
+
this.updatedSinceLastExecute = false;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
for (let i = 0, len = this.sortedMappers.length; i < len; ++i) {
|
|
41
|
+
const mapper = this.sortedMappers[i];
|
|
42
|
+
|
|
43
|
+
if (mapper.dirty) {
|
|
44
|
+
mapper.execute();
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
updateOrder() {
|
|
50
|
+
const nodes = [...this.mappers.values()].map(mapper => new Node(mapper));
|
|
51
|
+
const mappersById = {};
|
|
52
|
+
this.mappers.forEach(mapper => {
|
|
53
|
+
mappersById[mapper.id] = mapper;
|
|
54
|
+
}); // create a graph from array of nodes
|
|
55
|
+
|
|
56
|
+
for (let i = 0, nodesLen = nodes.length; i < nodesLen; ++i) {
|
|
57
|
+
const node = nodes[i];
|
|
58
|
+
|
|
59
|
+
if (node.mapper.outputs.length === 0) {
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
for (let j = 0; j < nodesLen; ++j) {
|
|
64
|
+
const restNode = nodes[j];
|
|
65
|
+
|
|
66
|
+
if (i === j || restNode.mapper.inputs.length === 0) {
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
for (let outi = 0, outputsLen = node.mapper.outputs.length; outi < outputsLen; ++outi) {
|
|
71
|
+
for (let resti = 0, restLen = restNode.mapper.inputs.length; resti < restLen; ++resti) {
|
|
72
|
+
if (node.mapper.outputs[outi]._id === restNode.mapper.inputs[resti]._id) {
|
|
73
|
+
node.children.push(restNode);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const post = {};
|
|
81
|
+
let postCounter = 1;
|
|
82
|
+
|
|
83
|
+
const dfs = node => {
|
|
84
|
+
const index = nodes.indexOf(node);
|
|
85
|
+
|
|
86
|
+
if (index === -1) {
|
|
87
|
+
// this node has already been handled
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
++postCounter;
|
|
92
|
+
nodes.splice(index, 1);
|
|
93
|
+
|
|
94
|
+
if (node.children.length === 0 && nodes.length > 0) {
|
|
95
|
+
post[node.mapper.id] = postCounter++;
|
|
96
|
+
dfs(nodes[0]);
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
for (let i = 0, len = node.children.length; i < len; ++i) {
|
|
101
|
+
dfs(node.children[i]);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
post[node.mapper.id] = postCounter++;
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
while (nodes.length) dfs(nodes[0]);
|
|
108
|
+
|
|
109
|
+
const postArray = Object.keys(post).map(key => {
|
|
110
|
+
const num = parseInt(key);
|
|
111
|
+
return [num, post[num]];
|
|
112
|
+
});
|
|
113
|
+
postArray.sort((a, b) => {
|
|
114
|
+
return b[1] - a[1];
|
|
115
|
+
}); // clear sorted mappers
|
|
116
|
+
|
|
117
|
+
this.sortedMappers = [];
|
|
118
|
+
|
|
119
|
+
for (let i = 0, len = postArray.length; i < len; ++i) {
|
|
120
|
+
const [id] = postArray[i];
|
|
121
|
+
this.sortedMappers.push(mappersById[id]);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
get needRunOnRender() {
|
|
126
|
+
return this.updatedSinceLastExecute;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
exports.default = MapperRegistry;
|
|
132
|
+
|
|
133
|
+
class Node {
|
|
134
|
+
constructor(mapper) {
|
|
135
|
+
let children = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
136
|
+
|
|
137
|
+
_defineProperty(this, "mapper", void 0);
|
|
138
|
+
|
|
139
|
+
_defineProperty(this, "children", void 0);
|
|
140
|
+
|
|
141
|
+
this.mapper = mapper;
|
|
142
|
+
this.children = children;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
}
|
|
146
|
+
//# sourceMappingURL=MapperRegistry.js.map
|
|
@@ -0,0 +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":"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"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
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; }
|
|
9
|
+
|
|
10
|
+
class MutableValue {
|
|
11
|
+
constructor(value, setter) {
|
|
12
|
+
_defineProperty(this, "_id", void 0);
|
|
13
|
+
|
|
14
|
+
_defineProperty(this, "_value", void 0);
|
|
15
|
+
|
|
16
|
+
_defineProperty(this, "_setter", void 0);
|
|
17
|
+
|
|
18
|
+
_defineProperty(this, "_animation", null);
|
|
19
|
+
|
|
20
|
+
_defineProperty(this, "_listeners", []);
|
|
21
|
+
|
|
22
|
+
this._id = MutableValue.MUTABLE_ID++;
|
|
23
|
+
this._value = value;
|
|
24
|
+
this._setter = setter;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
get value() {
|
|
28
|
+
return this._value;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
set value(nextValue) {
|
|
32
|
+
this._setter(nextValue);
|
|
33
|
+
} // this changes the value finally and is supposed to be called from this._setter
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
_setValue(newValue) {
|
|
37
|
+
this._value = newValue;
|
|
38
|
+
|
|
39
|
+
this._triggerListener();
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
addListener(listener) {
|
|
43
|
+
this._listeners.push(listener);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
_triggerListener() {
|
|
47
|
+
for (let i = 0, len = this._listeners.length; i < len; ++i) {
|
|
48
|
+
this._listeners[i]();
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
exports.default = MutableValue;
|
|
55
|
+
|
|
56
|
+
_defineProperty(MutableValue, "MUTABLE_ID", 1);
|
|
57
|
+
//# sourceMappingURL=MutableValue.js.map
|
|
@@ -0,0 +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,YAAN,CAAsB;EAQnCC,WAAW,CAACC,KAAD,EAAWC,MAAX,EAAuC;IAAA;;IAAA;;IAAA;;IAAA,oCAHrC,IAGqC;;IAAA,oCAFrB,EAEqB;;IAChD,KAAKC,GAAL,GAAWJ,YAAY,CAACK,UAAb,EAAX;IACA,KAAKC,MAAL,GAAcJ,KAAd;IACA,KAAKK,OAAL,GAAeJ,MAAf;EACD;;EAEQ,IAALD,KAAK,GAAM;IACb,OAAO,KAAKI,MAAZ;EACD;;EAEQ,IAALJ,KAAK,CAACM,SAAD,EAAe;IACtB,KAAKD,OAAL,CAAaC,SAAb;EACD,CApBkC,CAsBnC;;;EACAC,SAAS,CAACC,QAAD,EAAoB;IAC3B,KAAKJ,MAAL,GAAcI,QAAd;;IACA,KAAKC,gBAAL;EACD;;EAEDC,WAAW,CAACC,QAAD,EAA6B;IACtC,KAAKC,UAAL,CAAgBC,IAAhB,CAAqBF,QAArB;EACD;;EAEDF,gBAAgB,GAAS;IACvB,KAAK,IAAIK,CAAC,GAAG,CAAR,EAAWC,GAAG,GAAG,KAAKH,UAAL,CAAgBI,MAAtC,EAA8CF,CAAC,GAAGC,GAAlD,EAAuD,EAAED,CAAzD,EAA4D;MAC1D,KAAKF,UAAL,CAAgBE,CAAhB;IACD;EACF;;AApCkC;;;;gBAAhBhB,Y,gBACC,C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["commonTypes.ts"],"sourcesContent":["import { Timestamp, NestedObjectValues } from '../commonTypes';\nimport MutableValue from './MutableValue';\n\nexport interface Mapper<T> {\n MAPPER_ID?: number;\n id: number;\n inputs: MutableValue<T>[];\n outputs: MutableValue<T>[];\n mapper: () => void;\n dirty: boolean;\n execute(): void;\n extractMutablesFromArray<T>(\n array: NestedObjectValues<MutableValue<T>>\n ): MutableValue<T>[];\n}\n\nexport interface MapperRegistry<T> {\n sortedMappers: Mapper<T>[];\n mappers: Map<number, Mapper<T>>;\n _module: JSReanimated;\n updatedSinceLastExecute: boolean;\n startMapper(mapper: Mapper<T>): number;\n stopMapper(id: number): void;\n execute(): void;\n updateOrder(): void;\n}\n\nexport interface JSReanimated {\n _valueSetter?: <T>(value: T) => void;\n _renderRequested: boolean;\n _mapperRegistry: MapperRegistry<any>;\n _frames: ((timestamp: Timestamp) => void)[];\n timeProvider: { now: () => number };\n pushFrame(frame: (timestamp: Timestamp) => void): void;\n getTimestamp(): number;\n maybeRequestRender(): void;\n _onRender(timestampMs: number): void;\n installCoreFunctions(valueSetter: <T>(value: T) => void): void;\n makeShareable<T>(value: T): T;\n makeMutable<T>(value: T): MutableValue<T>;\n makeRemote<T>(object: Record<string, any>): T;\n startMapper(\n mapper: () => void,\n inputs: NestedObjectValues<MutableValue<unknown>>[],\n outputs: NestedObjectValues<MutableValue<unknown>>[]\n ): number;\n stopMapper(mapperId: number): void;\n registerEventHandler<T>(_: string, __: (event: T) => void): string;\n unregisterEventHandler(_: string): void;\n enableLayoutAnimations(): void;\n}\n"],"mappings":""}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _PlatformChecker = require("../PlatformChecker");
|
|
9
|
+
|
|
10
|
+
// In order to keep bundle size down, we treat this file as a polyfill for Web.
|
|
11
|
+
const initializeGlobalsForWeb = () => {
|
|
12
|
+
if ((0, _PlatformChecker.shouldBeUseWeb)()) {
|
|
13
|
+
global._frameTimestamp = null;
|
|
14
|
+
|
|
15
|
+
global._setGlobalConsole = _val => {// noop
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
global._measure = () => {
|
|
19
|
+
console.warn("[Reanimated] You can't use `measure` with Chrome Debugger or with web version");
|
|
20
|
+
return {
|
|
21
|
+
x: 0,
|
|
22
|
+
y: 0,
|
|
23
|
+
width: 0,
|
|
24
|
+
height: 0,
|
|
25
|
+
pageX: 0,
|
|
26
|
+
pageY: 0
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
global._scrollTo = () => {
|
|
31
|
+
console.warn("[Reanimated] You can't use `scrollTo` with Chrome Debugger or with web version");
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
global._dispatchCommand = () => {
|
|
35
|
+
console.warn("[Reanimated] You can't use `scrollTo` or `dispatchCommand` methods with Chrome Debugger or with web version");
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
global._setGestureState = () => {
|
|
39
|
+
console.warn("[Reanimated] You can't use `setGestureState` with Chrome Debugger or with web version");
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return true;
|
|
44
|
+
};
|
|
45
|
+
/*
|
|
46
|
+
If a file doesn't export anything, tree shaking doesn't pack
|
|
47
|
+
it into the JS bundle. In effect, the code inside of this file
|
|
48
|
+
will never execute. That is why we wrapped initialization code
|
|
49
|
+
into a function, and we call this one during creating
|
|
50
|
+
the module export object.
|
|
51
|
+
*/
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
var _default = initializeGlobalsForWeb();
|
|
55
|
+
|
|
56
|
+
exports.default = _default;
|
|
57
|
+
//# sourceMappingURL=global.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["initializeGlobalsForWeb","shouldBeUseWeb","global","_frameTimestamp","_setGlobalConsole","_val","_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._frameTimestamp = null;\n global._setGlobalConsole = (_val) => {\n // noop\n };\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;;AAFA;AAGA,MAAMA,uBAAuB,GAAG,MAAM;EACpC,IAAI,IAAAC,+BAAA,GAAJ,EAAsB;IACpBC,MAAM,CAACC,eAAP,GAAyB,IAAzB;;IACAD,MAAM,CAACE,iBAAP,GAA4BC,IAAD,IAAU,CACnC;IACD,CAFD;;IAGAH,MAAM,CAACI,QAAP,GAAkB,MAAM;MACtBC,OAAO,CAACC,IAAR,CACE,+EADF;MAGA,OAAO;QACLC,CAAC,EAAE,CADE;QAELC,CAAC,EAAE,CAFE;QAGLC,KAAK,EAAE,CAHF;QAILC,MAAM,EAAE,CAJH;QAKLC,KAAK,EAAE,CALF;QAMLC,KAAK,EAAE;MANF,CAAP;IAQD,CAZD;;IAaAZ,MAAM,CAACa,SAAP,GAAmB,MAAM;MACvBR,OAAO,CAACC,IAAR,CACE,gFADF;IAGD,CAJD;;IAKAN,MAAM,CAACc,gBAAP,GAA0B,MAAM;MAC9BT,OAAO,CAACC,IAAR,CACE,6GADF;IAGD,CAJD;;IAKAN,MAAM,CAACe,gBAAP,GAA0B,MAAM;MAC9BV,OAAO,CAACC,IAAR,CACE,uFADF;IAGD,CAJD;EAKD;;EACD,OAAO,IAAP;AACD,CApCD;AAsCA;AACA;AACA;AACA;AACA;AACA;AACA;;;eAEeR,uBAAuB,E"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports._updatePropsJS = void 0;
|
|
7
|
+
|
|
8
|
+
var _JSReanimated = _interopRequireDefault(require("./JSReanimated"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
12
|
+
const reanimatedJS = new _JSReanimated.default();
|
|
13
|
+
|
|
14
|
+
const _updatePropsJS = (updates, viewRef) => {
|
|
15
|
+
if (viewRef._component) {
|
|
16
|
+
const component = viewRef._component;
|
|
17
|
+
const [rawStyles] = Object.keys(updates).reduce((acc, key) => {
|
|
18
|
+
const value = updates[key];
|
|
19
|
+
const index = typeof value === 'function' ? 1 : 0;
|
|
20
|
+
acc[index][key] = value;
|
|
21
|
+
return acc;
|
|
22
|
+
}, [{}, {}]);
|
|
23
|
+
|
|
24
|
+
if (typeof component.setNativeProps === 'function') {
|
|
25
|
+
setNativeProps(component, rawStyles);
|
|
26
|
+
} else if (Object.keys(component.props).length > 0) {
|
|
27
|
+
Object.keys(component.props).forEach(key => {
|
|
28
|
+
if (!rawStyles[key]) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const dashedKey = key.replace(/[A-Z]/g, m => '-' + m.toLowerCase());
|
|
33
|
+
|
|
34
|
+
component._touchableNode.setAttribute(dashedKey, rawStyles[key]);
|
|
35
|
+
});
|
|
36
|
+
} else {
|
|
37
|
+
console.warn('It is not possible to manipulate component');
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
exports._updatePropsJS = _updatePropsJS;
|
|
43
|
+
|
|
44
|
+
const setNativeProps = (component, style) => {
|
|
45
|
+
const previousStyle = component.previousStyle ? component.previousStyle : {};
|
|
46
|
+
const currentStyle = { ...previousStyle,
|
|
47
|
+
...style
|
|
48
|
+
};
|
|
49
|
+
component.previousStyle = currentStyle;
|
|
50
|
+
component.setNativeProps({
|
|
51
|
+
style: currentStyle
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
var _default = reanimatedJS;
|
|
56
|
+
exports.default = _default;
|
|
57
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["reanimatedJS","JSReanimated","_updatePropsJS","updates","viewRef","_component","component","rawStyles","Object","keys","reduce","acc","key","value","index","setNativeProps","props","length","forEach","dashedKey","replace","m","toLowerCase","_touchableNode","setAttribute","console","warn","style","previousStyle","currentStyle"],"sources":["index.ts"],"sourcesContent":["import JSReanimated from './JSReanimated';\nimport { AnimatedStyle, StyleProps } from '../commonTypes';\n\nconst reanimatedJS = new JSReanimated();\n\ninterface JSReanimatedComponent {\n previousStyle: StyleProps;\n setNativeProps: (style: StyleProps) => void;\n props: Record<string, string | number>;\n _touchableNode: {\n setAttribute: (key: string, props: unknown) => void;\n };\n}\n\nexport const _updatePropsJS = (\n updates: StyleProps | AnimatedStyle,\n viewRef: { _component?: JSReanimatedComponent }\n): void => {\n if (viewRef._component) {\n const component = viewRef._component;\n const [rawStyles] = Object.keys(updates).reduce(\n (acc: [StyleProps, AnimatedStyle], key) => {\n const value = updates[key];\n const index = typeof value === 'function' ? 1 : 0;\n acc[index][key] = value;\n return acc;\n },\n [{}, {}]\n );\n\n if (typeof component.setNativeProps === 'function') {\n setNativeProps(component, rawStyles);\n } else if (Object.keys(component.props).length > 0) {\n Object.keys(component.props).forEach((key) => {\n if (!rawStyles[key]) {\n return;\n }\n const dashedKey = key.replace(/[A-Z]/g, (m) => '-' + m.toLowerCase());\n component._touchableNode.setAttribute(dashedKey, rawStyles[key]);\n });\n } else {\n console.warn('It is not possible to manipulate component');\n }\n }\n};\n\nconst setNativeProps = (\n component: JSReanimatedComponent,\n style: StyleProps\n): void => {\n const previousStyle = component.previousStyle ? component.previousStyle : {};\n const currentStyle = { ...previousStyle, ...style };\n component.previousStyle = currentStyle;\n component.setNativeProps({ style: currentStyle });\n};\n\nexport default reanimatedJS;\n"],"mappings":";;;;;;;AAAA;;;;AAGA,MAAMA,YAAY,GAAG,IAAIC,qBAAJ,EAArB;;AAWO,MAAMC,cAAc,GAAG,CAC5BC,OAD4B,EAE5BC,OAF4B,KAGnB;EACT,IAAIA,OAAO,CAACC,UAAZ,EAAwB;IACtB,MAAMC,SAAS,GAAGF,OAAO,CAACC,UAA1B;IACA,MAAM,CAACE,SAAD,IAAcC,MAAM,CAACC,IAAP,CAAYN,OAAZ,EAAqBO,MAArB,CAClB,CAACC,GAAD,EAAmCC,GAAnC,KAA2C;MACzC,MAAMC,KAAK,GAAGV,OAAO,CAACS,GAAD,CAArB;MACA,MAAME,KAAK,GAAG,OAAOD,KAAP,KAAiB,UAAjB,GAA8B,CAA9B,GAAkC,CAAhD;MACAF,GAAG,CAACG,KAAD,CAAH,CAAWF,GAAX,IAAkBC,KAAlB;MACA,OAAOF,GAAP;IACD,CANiB,EAOlB,CAAC,EAAD,EAAK,EAAL,CAPkB,CAApB;;IAUA,IAAI,OAAOL,SAAS,CAACS,cAAjB,KAAoC,UAAxC,EAAoD;MAClDA,cAAc,CAACT,SAAD,EAAYC,SAAZ,CAAd;IACD,CAFD,MAEO,IAAIC,MAAM,CAACC,IAAP,CAAYH,SAAS,CAACU,KAAtB,EAA6BC,MAA7B,GAAsC,CAA1C,EAA6C;MAClDT,MAAM,CAACC,IAAP,CAAYH,SAAS,CAACU,KAAtB,EAA6BE,OAA7B,CAAsCN,GAAD,IAAS;QAC5C,IAAI,CAACL,SAAS,CAACK,GAAD,CAAd,EAAqB;UACnB;QACD;;QACD,MAAMO,SAAS,GAAGP,GAAG,CAACQ,OAAJ,CAAY,QAAZ,EAAuBC,CAAD,IAAO,MAAMA,CAAC,CAACC,WAAF,EAAnC,CAAlB;;QACAhB,SAAS,CAACiB,cAAV,CAAyBC,YAAzB,CAAsCL,SAAtC,EAAiDZ,SAAS,CAACK,GAAD,CAA1D;MACD,CAND;IAOD,CARM,MAQA;MACLa,OAAO,CAACC,IAAR,CAAa,4CAAb;IACD;EACF;AACF,CA9BM;;;;AAgCP,MAAMX,cAAc,GAAG,CACrBT,SADqB,EAErBqB,KAFqB,KAGZ;EACT,MAAMC,aAAa,GAAGtB,SAAS,CAACsB,aAAV,GAA0BtB,SAAS,CAACsB,aAApC,GAAoD,EAA1E;EACA,MAAMC,YAAY,GAAG,EAAE,GAAGD,aAAL;IAAoB,GAAGD;EAAvB,CAArB;EACArB,SAAS,CAACsB,aAAV,GAA0BC,YAA1B;EACAvB,SAAS,CAACS,cAAV,CAAyB;IAAEY,KAAK,EAAEE;EAAT,CAAzB;AACD,CARD;;eAUe7B,Y"}
|