react-native-reanimated 2.4.0 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Common/cpp/AnimatedSensor/AnimatedSensorModule.cpp +72 -0
- package/Common/cpp/NativeModules/NativeReanimatedModule.cpp +30 -1
- package/Common/cpp/NativeModules/NativeReanimatedModuleSpec.cpp +64 -39
- package/Common/cpp/Tools/RuntimeDecorator.cpp +2 -0
- package/Common/cpp/headers/AnimatedSensor/AnimatedSensorModule.h +41 -0
- package/Common/cpp/headers/NativeModules/NativeReanimatedModule.h +14 -0
- package/Common/cpp/headers/NativeModules/NativeReanimatedModuleSpec.h +14 -0
- package/Common/cpp/headers/SharedItems/MutableValue.h +4 -1
- package/Common/cpp/headers/SharedItems/ShareableValue.h +3 -0
- package/Common/cpp/headers/SharedItems/ValueWrapper.h +3 -0
- package/Common/cpp/headers/Tools/PlatformDepMethodsHolder.h +11 -0
- package/Common/cpp/headers/Tools/RuntimeDecorator.h +2 -0
- package/LICENSE +1 -1
- package/README.md +2 -2
- package/RNReanimated.podspec +15 -6
- 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 +2 -0
- 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/CMakeLists.txt +198 -0
- package/android/README.md +15 -0
- package/android/build.gradle +676 -73
- package/android/empty.cpp +1 -0
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +5 -0
- package/android/gradle.properties +25 -0
- package/android/gradlew +234 -0
- package/android/gradlew.bat +89 -0
- package/android/react-native-reanimated-64-hermes.aar +0 -0
- package/android/react-native-reanimated-64-jsc.aar +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/rnVersionPatch/62/layoutReanimation/ReanimatedNativeHierarchyManager.java +412 -0
- package/android/rnVersionPatch/62/layoutReanimation/ReanimatedUIImplementation.java +68 -0
- package/android/rnVersionPatch/63/layoutReanimation/ReanimatedUIImplementation.java +68 -0
- package/android/rnVersionPatch/64/layoutReanimation/ReanimatedUIImplementation.java +68 -0
- package/android/rnVersionPatch/65/.gitkeep +0 -0
- package/android/rnVersionPatch/66/.gitkeep +0 -0
- package/android/rnVersionPatch/67/.gitkeep +0 -0
- package/android/rnVersionPatch/68/.gitkeep +0 -0
- package/android/rnVersionPatch/backup/.gitkeep +0 -0
- package/android/settings.gradle +1 -0
- package/android/spotless.gradle +9 -0
- package/android/src/{AndroidManifest.xml → main/AndroidManifest.xml} +0 -0
- package/android/src/main/cpp/AndroidErrorHandler.cpp +42 -0
- package/android/src/main/cpp/AndroidLogger.cpp +27 -0
- package/android/src/main/cpp/AndroidScheduler.cpp +59 -0
- package/android/src/main/cpp/JNIHelper.cpp +59 -0
- package/android/src/main/cpp/LayoutAnimations.cpp +103 -0
- package/android/src/main/cpp/NativeProxy.cpp +327 -0
- package/android/src/main/cpp/OnLoad.cpp +17 -0
- package/android/src/main/cpp/TurboModule.cpp +44 -0
- package/android/src/main/cpp/headers/AndroidErrorHandler.h +30 -0
- package/android/src/main/cpp/headers/AndroidLogger.h +16 -0
- package/android/src/main/cpp/headers/AndroidScheduler.h +41 -0
- package/android/src/main/cpp/headers/JNIHelper.h +30 -0
- package/android/src/main/cpp/headers/LayoutAnimations.h +42 -0
- package/android/src/main/cpp/headers/NativeProxy.h +170 -0
- package/android/src/main/cpp/headers/TurboModule.h +70 -0
- package/android/src/main/java/com/facebook/react/uimanager/UIManagerReanimatedHelper.java +15 -0
- package/android/src/main/java/com/swmansion/common/GestureHandlerStateManager.java +5 -0
- package/android/src/main/java/com/swmansion/reanimated/AndroidErrorHandler.java +8 -0
- package/android/src/main/java/com/swmansion/reanimated/CopiedEvent.java +43 -0
- package/android/src/main/java/com/swmansion/reanimated/MapUtils.java +26 -0
- package/android/src/main/java/com/swmansion/reanimated/NativeMethodsHelper.java +117 -0
- package/android/src/main/java/com/swmansion/reanimated/NativeProxy.java +285 -0
- package/android/src/main/java/com/swmansion/reanimated/NodesManager.java +682 -0
- package/android/src/main/java/com/swmansion/reanimated/ReanimatedJSIModulePackage.java +29 -0
- package/android/src/main/java/com/swmansion/reanimated/ReanimatedModule.java +251 -0
- package/android/src/main/java/com/swmansion/reanimated/ReanimatedPackage.java +96 -0
- package/android/src/main/java/com/swmansion/reanimated/Scheduler.java +51 -0
- package/android/src/main/java/com/swmansion/reanimated/UpdateContext.java +11 -0
- package/android/src/main/java/com/swmansion/reanimated/Utils.java +32 -0
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/AnimationsManager.java +517 -0
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/LayoutAnimations.java +56 -0
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/NativeMethodsHolder.java +11 -0
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/ReanimatedNativeHierarchyManager.java +410 -0
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/ReanimatedUIImplementation.java +68 -0
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/ReanimatedUIManager.java +292 -0
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/Snapshot.java +121 -0
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/ViewHierarchyObserver.java +12 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/AlwaysNode.java +29 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/BezierNode.java +87 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/BlockNode.java +24 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/CallFuncNode.java +49 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/ClockNode.java +38 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/ClockOpNode.java +73 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/ConcatNode.java +36 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/CondNode.java +41 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/DebugNode.java +33 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/EventNode.java +83 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/FinalNode.java +5 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/FunctionNode.java +20 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/JSCallNode.java +41 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/Node.java +139 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/NoopNode.java +37 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/OperatorNode.java +377 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/ParamNode.java +71 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/PropsNode.java +153 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/SetNode.java +32 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/StyleNode.java +40 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/TransformNode.java +84 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/ValueNode.java +40 -0
- package/android/src/main/java/com/swmansion/reanimated/sensor/ReanimatedSensor.java +41 -0
- package/android/src/main/java/com/swmansion/reanimated/sensor/ReanimatedSensorContainer.java +40 -0
- package/android/src/main/java/com/swmansion/reanimated/sensor/ReanimatedSensorListener.java +31 -0
- package/android/src/main/java/com/swmansion/reanimated/sensor/ReanimatedSensorType.java +35 -0
- package/android/src/main/java/com/swmansion/reanimated/transitions/ChangeTransition.java +84 -0
- package/android/src/main/java/com/swmansion/reanimated/transitions/SaneSidePropagation.java +25 -0
- package/android/src/main/java/com/swmansion/reanimated/transitions/Scale.java +86 -0
- package/android/src/main/java/com/swmansion/reanimated/transitions/TransitionModule.java +41 -0
- package/android/src/main/java/com/swmansion/reanimated/transitions/TransitionUtils.java +161 -0
- package/ios/LayoutReanimation/REAAnimationsManager.m +14 -4
- package/ios/REAModule.m +8 -9
- package/ios/REANodesManager.h +4 -1
- package/ios/REANodesManager.m +76 -4
- package/ios/native/NativeProxy.mm +76 -4
- package/ios/sensor/ReanimatedSensor.h +25 -0
- package/ios/sensor/ReanimatedSensor.m +217 -0
- package/ios/sensor/ReanimatedSensorContainer.h +12 -0
- package/ios/sensor/ReanimatedSensorContainer.m +40 -0
- package/ios/sensor/ReanimatedSensorType.h +7 -0
- package/lib/{src/Animated.js → Animated.js} +0 -0
- package/lib/{src/ConfigHelper.js → ConfigHelper.js} +2 -2
- package/lib/{src/ReanimatedEventEmitter.js → ReanimatedEventEmitter.js} +0 -0
- package/lib/{src/ReanimatedModule.js → ReanimatedModule.js} +0 -0
- package/lib/{src/ReanimatedModule.macos.js → ReanimatedModule.macos.js} +0 -0
- package/lib/{src/ReanimatedModule.native.js → ReanimatedModule.native.js} +0 -0
- package/lib/{src/ReanimatedModule.windows.js → ReanimatedModule.windows.js} +0 -0
- package/lib/{src/ReanimatedModuleCompat.js → ReanimatedModuleCompat.js} +0 -0
- package/lib/{src/__mocks__ → __mocks__}/ReanimatedEventEmitter.js +0 -0
- package/lib/{src/__mocks__ → __mocks__}/ReanimatedModule.native.js +0 -0
- package/lib/{src/createAnimatedComponent.js → createAnimatedComponent.js} +3 -4
- package/lib/{src/index.js → index.js} +0 -0
- package/lib/{src/reanimated1 → reanimated1}/Easing.js +0 -0
- package/lib/{src/reanimated1 → reanimated1}/SpringConfig.js +0 -0
- package/lib/{src/reanimated1 → reanimated1}/Transitioning.js +0 -0
- package/lib/{src/reanimated1 → reanimated1}/animations/Animation.js +0 -0
- package/lib/{src/reanimated1 → reanimated1}/animations/SpringUtils.js +0 -0
- package/lib/{src/reanimated1 → reanimated1}/animations/backwardCompatibleAnimWrapper.js +0 -0
- package/lib/{src/reanimated1 → reanimated1}/animations/decay.js +0 -0
- package/lib/{src/reanimated1 → reanimated1}/animations/spring.js +0 -0
- package/lib/{src/reanimated1 → reanimated1}/animations/timing.js +0 -0
- package/lib/{src/reanimated1 → reanimated1}/base.js +0 -0
- package/lib/{src/reanimated1 → reanimated1}/core/AnimatedAlways.js +0 -0
- package/lib/{src/reanimated1 → reanimated1}/core/AnimatedBezier.js +0 -0
- package/lib/{src/reanimated1 → reanimated1}/core/AnimatedBlock.js +0 -0
- package/lib/{src/reanimated1 → reanimated1}/core/AnimatedCall.js +0 -0
- package/lib/{src/reanimated1 → reanimated1}/core/AnimatedCallFunc.js +0 -0
- package/lib/{src/reanimated1 → reanimated1}/core/AnimatedClock.js +0 -0
- package/lib/{src/reanimated1 → reanimated1}/core/AnimatedClockTest.js +0 -0
- package/lib/{src/reanimated1 → reanimated1}/core/AnimatedCode.js +0 -0
- package/lib/{src/reanimated1 → reanimated1}/core/AnimatedConcat.js +0 -0
- package/lib/{src/reanimated1 → reanimated1}/core/AnimatedCond.js +0 -0
- package/lib/{src/reanimated1 → reanimated1}/core/AnimatedDebug.js +0 -0
- package/lib/{src/reanimated1 → reanimated1}/core/AnimatedEvent.js +0 -0
- package/lib/{src/reanimated1 → reanimated1}/core/AnimatedFunction.js +1 -1
- package/lib/{src/reanimated1 → reanimated1}/core/AnimatedNode.js +0 -0
- package/lib/{src/reanimated1 → reanimated1}/core/AnimatedOperator.js +0 -0
- package/lib/{src/reanimated1 → reanimated1}/core/AnimatedParam.js +0 -0
- package/lib/{src/reanimated1 → reanimated1}/core/AnimatedProps.js +0 -0
- package/lib/{src/reanimated1 → reanimated1}/core/AnimatedSet.js +0 -0
- package/lib/{src/reanimated1 → reanimated1}/core/AnimatedStartClock.js +0 -0
- package/lib/{src/reanimated1 → reanimated1}/core/AnimatedStopClock.js +0 -0
- package/lib/{src/reanimated1 → reanimated1}/core/AnimatedStyle.js +0 -0
- package/lib/{src/reanimated1 → reanimated1}/core/AnimatedTransform.js +0 -0
- package/lib/{src/reanimated1 → reanimated1}/core/AnimatedValue.js +0 -0
- package/lib/{src/reanimated1 → reanimated1}/core/Core.test.js +0 -0
- package/lib/{src/reanimated1 → reanimated1}/core/InternalAnimatedValue.js +0 -0
- package/lib/{src/reanimated1 → reanimated1}/core/__mocks__/AnimatedProps.js +0 -0
- package/lib/{src/reanimated1 → reanimated1}/core/createEventObjectProxyPolyfill.js +0 -0
- package/lib/{src/reanimated1 → reanimated1}/derived/__mocks__/evaluateOnce.js +0 -0
- package/lib/{src/reanimated1 → reanimated1}/derived/acc.js +0 -0
- package/lib/{src/reanimated1 → reanimated1}/derived/color.js +0 -0
- package/lib/{src/reanimated1 → reanimated1}/derived/diff.js +0 -0
- package/lib/{src/reanimated1 → reanimated1}/derived/diffClamp.js +0 -0
- package/lib/{src/reanimated1 → reanimated1}/derived/evaluateOnce.js +0 -0
- package/lib/{src/reanimated1 → reanimated1}/derived/index.js +0 -0
- package/lib/{src/reanimated1 → reanimated1}/derived/interpolate.js +2 -4
- package/lib/{src/reanimated1 → reanimated1}/derived/interpolateColors.js +0 -0
- package/lib/{src/reanimated1 → reanimated1}/derived/onChange.js +0 -0
- package/lib/{src/reanimated1 → reanimated1}/derived/useCode.js +0 -0
- package/lib/{src/reanimated1 → reanimated1}/index.js +0 -0
- package/lib/{src/reanimated1 → reanimated1}/operators.js +0 -0
- package/lib/{src/reanimated1 → reanimated1}/useValue.js +0 -0
- package/lib/{src/reanimated1 → reanimated1}/val.js +0 -0
- package/lib/{src/reanimated2 → reanimated2}/Bezier.js +0 -0
- package/lib/{src/reanimated2 → reanimated2}/Colors.js +2 -1
- package/lib/{src/reanimated2 → reanimated2}/Easing.js +0 -0
- package/lib/{src/reanimated2 → reanimated2}/NativeMethods.js +0 -0
- package/lib/reanimated2/NativeReanimated/NativeReanimated.js +50 -0
- package/lib/{src/reanimated2 → reanimated2}/NativeReanimated/index.js +0 -4
- package/lib/{src/reanimated2 → reanimated2}/PlatformChecker.js +0 -0
- package/lib/{src/reanimated2 → reanimated2}/PropAdapters.js +0 -0
- package/lib/{src/reanimated2 → reanimated2}/UpdateProps.js +0 -0
- package/lib/{src/reanimated2 → reanimated2}/ViewDescriptorsSet.js +2 -2
- package/lib/{src/reanimated2 → reanimated2}/WorkletEventHandler.js +0 -0
- package/lib/{src/reanimated2 → reanimated2}/__mocks__/MutableValue.js +0 -0
- package/lib/{src/reanimated2 → reanimated2}/__mocks__/NativeReanimated.js +0 -0
- package/lib/{src/reanimated2 → reanimated2}/__mocks__/NativeReanimated.native.js +0 -0
- package/lib/{src/reanimated2 → reanimated2}/animation/commonTypes.js +0 -0
- package/lib/{src/reanimated2 → reanimated2}/animation/decay.js +0 -0
- package/lib/{src/reanimated2 → reanimated2}/animation/delay.js +0 -0
- package/lib/{src/reanimated2 → reanimated2}/animation/index.js +0 -0
- package/lib/{src/reanimated2 → reanimated2}/animation/repeat.js +0 -0
- package/lib/{src/reanimated2 → reanimated2}/animation/sequence.js +0 -0
- package/lib/{src/reanimated2 → reanimated2}/animation/spring.js +0 -0
- package/lib/{src/reanimated2 → reanimated2}/animation/styleAnimation.js +2 -1
- package/lib/{src/reanimated2 → reanimated2}/animation/timing.js +0 -0
- package/lib/{src/reanimated2 → reanimated2}/animation/util.js +0 -0
- package/lib/{src/reanimated2 → reanimated2}/commonTypes.js +0 -0
- package/lib/{src/reanimated2 → reanimated2}/component/FlatList.js +0 -0
- package/lib/{src/reanimated2 → reanimated2}/component/WrappedComponents.js +0 -0
- package/lib/{src/reanimated2 → reanimated2}/component/index.js +0 -0
- package/lib/{src/reanimated2 → reanimated2}/core.js +30 -24
- package/lib/{src/reanimated2 → reanimated2}/globals.d.ts +6 -0
- package/lib/{src/reanimated2 → reanimated2}/hook/Hooks.js +0 -0
- package/lib/{src/reanimated2 → reanimated2}/hook/commonTypes.js +0 -0
- package/lib/{src/reanimated2 → reanimated2}/hook/index.js +1 -0
- package/lib/{src/reanimated2 → reanimated2}/hook/useAnimatedGestureHandler.js +0 -0
- package/lib/{src/reanimated2 → reanimated2}/hook/useAnimatedReaction.js +0 -0
- package/lib/{src/reanimated2 → reanimated2}/hook/useAnimatedRef.js +0 -0
- package/lib/{src/reanimated2 → reanimated2}/hook/useAnimatedScrollHandler.js +0 -0
- package/lib/reanimated2/hook/useAnimatedSensor.js +66 -0
- package/lib/{src/reanimated2 → reanimated2}/hook/useAnimatedStyle.js +0 -0
- package/lib/{src/reanimated2 → reanimated2}/hook/useDerivedValue.js +0 -0
- package/lib/{src/reanimated2 → reanimated2}/hook/useSharedValue.js +0 -0
- package/lib/{src/reanimated2 → reanimated2}/hook/utils.js +0 -0
- package/lib/{src/reanimated2 → reanimated2}/index.js +0 -0
- package/lib/{src/reanimated2 → reanimated2}/interpolateColor.js +11 -11
- package/lib/{src/reanimated2 → reanimated2}/interpolation.js +1 -1
- package/lib/{src/reanimated2 → reanimated2}/jestUtils.js +9 -4
- package/lib/{src/reanimated2 → reanimated2}/js-reanimated/JSReanimated.js +23 -2
- package/lib/{src/reanimated2 → reanimated2}/js-reanimated/Mapper.js +0 -0
- package/lib/{src/reanimated2 → reanimated2}/js-reanimated/MapperRegistry.js +0 -0
- package/lib/{src/reanimated2 → reanimated2}/js-reanimated/MutableValue.js +0 -0
- package/lib/{src/reanimated2 → reanimated2}/js-reanimated/commonTypes.js +0 -0
- package/lib/{src/reanimated2 → reanimated2}/js-reanimated/index.js +3 -3
- package/lib/{src/reanimated2 → reanimated2}/layoutReanimation/LayoutAnimationRepository.js +0 -0
- package/lib/{src/reanimated2 → reanimated2}/layoutReanimation/animationBuilder/BaseAnimationBuilder.js +0 -0
- package/lib/{src/reanimated2 → reanimated2}/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js +8 -0
- package/lib/{src/reanimated2 → reanimated2}/layoutReanimation/animationBuilder/Keyframe.js +2 -1
- package/lib/{src/reanimated2 → reanimated2}/layoutReanimation/animationBuilder/commonTypes.js +0 -0
- package/lib/{src/reanimated2 → reanimated2}/layoutReanimation/animationBuilder/index.js +0 -0
- package/lib/{src/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Bounce.js +32 -42
- package/lib/{src/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Default.js +0 -0
- package/lib/{src/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Fade.js +20 -38
- package/lib/{src/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Flip.js +32 -44
- package/lib/{src/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Lightspeed.js +8 -16
- package/lib/{src/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Pinwheel.js +6 -10
- package/lib/{src/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Roll.js +8 -12
- package/lib/{src/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Rotate.js +20 -36
- package/lib/{src/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Slide.js +16 -20
- package/lib/{src/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Stretch.js +8 -12
- package/lib/{src/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Zoom.js +32 -48
- package/lib/{src/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/index.js +0 -0
- package/lib/{src/reanimated2 → reanimated2}/layoutReanimation/defaultTransitions/CurvedTransition.js +0 -0
- package/lib/{src/reanimated2 → reanimated2}/layoutReanimation/defaultTransitions/EntryExitTransition.js +22 -18
- package/lib/{src/reanimated2 → reanimated2}/layoutReanimation/defaultTransitions/FadingTransition.js +0 -0
- package/lib/{src/reanimated2 → reanimated2}/layoutReanimation/defaultTransitions/JumpingTransition.js +0 -0
- package/lib/{src/reanimated2 → reanimated2}/layoutReanimation/defaultTransitions/LinearTransition.js +0 -0
- package/lib/{src/reanimated2 → reanimated2}/layoutReanimation/defaultTransitions/SequencedTransition.js +0 -0
- package/lib/{src/reanimated2 → reanimated2}/layoutReanimation/defaultTransitions/index.js +0 -0
- package/lib/{src/reanimated2 → reanimated2}/layoutReanimation/index.js +0 -0
- package/lib/{src/reanimated2 → reanimated2}/mock.js +3 -2
- package/lib/{src/reanimated2 → reanimated2}/platform-specific/RNRenderer.js +0 -0
- package/lib/{src/reanimated2 → reanimated2}/platform-specific/RNRenderer.web.js +0 -0
- package/lib/{src/reanimated2 → reanimated2}/utils.js +0 -0
- package/lib/{src/setAndForwardRef.js → setAndForwardRef.js} +0 -0
- package/lib/types/lib/ConfigHelper.d.ts +12 -0
- package/lib/types/lib/ReanimatedEventEmitter.d.ts +3 -0
- package/lib/types/lib/ReanimatedModule.d.ts +2 -0
- package/lib/types/lib/ReanimatedModule.macos.d.ts +2 -0
- package/lib/types/lib/ReanimatedModule.native.d.ts +2 -0
- package/lib/types/lib/ReanimatedModule.windows.d.ts +2 -0
- package/lib/types/lib/ReanimatedModuleCompat.d.ts +14 -0
- package/lib/types/lib/createAnimatedComponent.d.ts +33 -0
- package/lib/types/lib/reanimated2/Bezier.d.ts +6 -0
- package/lib/types/lib/reanimated2/Colors.d.ts +31 -0
- package/lib/types/lib/reanimated2/Easing.d.ts +172 -0
- package/lib/types/lib/reanimated2/NativeMethods.d.ts +14 -0
- package/lib/types/lib/reanimated2/NativeReanimated/NativeReanimated.d.ts +20 -0
- package/lib/types/lib/reanimated2/NativeReanimated/index.d.ts +3 -0
- package/lib/types/lib/reanimated2/PlatformChecker.d.ts +5 -0
- package/lib/types/lib/reanimated2/PropAdapters.d.ts +4 -0
- package/lib/types/lib/reanimated2/UpdateProps.d.ts +9 -0
- package/lib/types/lib/reanimated2/ViewDescriptorsSet.d.ts +20 -0
- package/lib/types/lib/reanimated2/WorkletEventHandler.d.ts +13 -0
- package/lib/types/lib/reanimated2/__mocks__/MutableValue.d.ts +5 -0
- package/lib/types/lib/reanimated2/__mocks__/NativeReanimated.d.ts +13 -0
- package/lib/types/lib/reanimated2/__mocks__/NativeReanimated.native.d.ts +13 -0
- package/lib/types/lib/reanimated2/animation/commonTypes.d.ts +27 -0
- package/lib/types/lib/reanimated2/animation/decay.d.ts +19 -0
- package/lib/types/lib/reanimated2/animation/delay.d.ts +7 -0
- package/lib/types/lib/reanimated2/animation/index.d.ts +9 -0
- package/lib/types/lib/reanimated2/animation/repeat.d.ts +12 -0
- package/lib/types/lib/reanimated2/animation/sequence.d.ts +7 -0
- package/lib/types/lib/reanimated2/animation/spring.d.ts +22 -0
- package/lib/types/lib/reanimated2/animation/styleAnimation.d.ts +7 -0
- package/lib/types/lib/reanimated2/animation/timing.d.ts +21 -0
- package/lib/types/lib/reanimated2/animation/util.d.ts +9 -0
- package/lib/types/lib/reanimated2/commonTypes.d.ts +80 -0
- package/lib/types/lib/reanimated2/component/FlatList.d.ts +9 -0
- package/lib/types/lib/reanimated2/component/WrappedComponents.d.ts +8 -0
- package/lib/types/lib/reanimated2/component/index.d.ts +9 -0
- package/lib/types/lib/reanimated2/core.d.ts +24 -0
- package/lib/types/lib/reanimated2/hook/Hooks.d.ts +5 -0
- package/lib/types/lib/reanimated2/hook/commonTypes.d.ts +14 -0
- package/lib/types/lib/reanimated2/hook/index.d.ts +10 -0
- package/lib/types/lib/reanimated2/hook/useAnimatedGestureHandler.d.ts +35 -0
- package/lib/types/lib/reanimated2/hook/useAnimatedReaction.d.ts +12 -0
- package/lib/types/lib/reanimated2/hook/useAnimatedRef.d.ts +3 -0
- package/lib/types/lib/reanimated2/hook/useAnimatedScrollHandler.d.ts +21 -0
- package/lib/types/lib/reanimated2/hook/useAnimatedSensor.d.ts +20 -0
- package/lib/types/lib/reanimated2/hook/useAnimatedStyle.d.ts +11 -0
- package/lib/types/lib/reanimated2/hook/useDerivedValue.d.ts +4 -0
- package/lib/types/lib/reanimated2/hook/useSharedValue.d.ts +2 -0
- package/lib/types/lib/reanimated2/hook/utils.d.ts +28 -0
- package/lib/types/lib/reanimated2/index.d.ts +12 -0
- package/lib/types/lib/reanimated2/interpolateColor.d.ts +26 -0
- package/lib/types/lib/reanimated2/interpolation.d.ts +14 -0
- package/lib/types/lib/reanimated2/jestUtils.d.ts +12 -0
- package/lib/types/lib/reanimated2/js-reanimated/JSReanimated.d.ts +30 -0
- package/lib/types/lib/reanimated2/js-reanimated/Mapper.d.ts +14 -0
- package/lib/types/lib/reanimated2/js-reanimated/MapperRegistry.d.ts +14 -0
- package/lib/types/lib/reanimated2/js-reanimated/MutableValue.d.ts +14 -0
- package/lib/types/lib/reanimated2/js-reanimated/commonTypes.d.ts +44 -0
- package/lib/types/lib/reanimated2/js-reanimated/index.d.ts +15 -0
- package/lib/types/lib/reanimated2/layoutReanimation/LayoutAnimationRepository.d.ts +1 -0
- package/lib/types/lib/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.d.ts +22 -0
- package/lib/types/lib/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.d.ts +38 -0
- package/lib/types/lib/reanimated2/layoutReanimation/animationBuilder/Keyframe.d.ts +25 -0
- package/lib/types/lib/reanimated2/layoutReanimation/animationBuilder/commonTypes.d.ts +77 -0
- package/lib/types/lib/reanimated2/layoutReanimation/animationBuilder/index.d.ts +4 -0
- package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Bounce.d.ts +62 -0
- package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Default.d.ts +4 -0
- package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Fade.d.ts +42 -0
- package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Flip.d.ts +50 -0
- package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.d.ts +18 -0
- package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.d.ts +10 -0
- package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Roll.d.ts +18 -0
- package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Rotate.d.ts +34 -0
- package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Slide.d.ts +34 -0
- package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Stretch.d.ts +18 -0
- package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Zoom.d.ts +66 -0
- package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/index.d.ts +10 -0
- package/lib/types/lib/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.d.ts +19 -0
- package/lib/types/lib/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.d.ts +13 -0
- package/lib/types/lib/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.d.ts +6 -0
- package/lib/types/lib/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.d.ts +6 -0
- package/lib/types/lib/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.d.ts +7 -0
- package/lib/types/lib/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.d.ts +9 -0
- package/lib/types/lib/reanimated2/layoutReanimation/defaultTransitions/index.d.ts +6 -0
- package/lib/types/lib/reanimated2/layoutReanimation/index.d.ts +4 -0
- package/lib/types/lib/reanimated2/mock.d.ts +55 -0
- package/lib/types/lib/reanimated2/platform-specific/RNRenderer.d.ts +1 -0
- package/lib/types/lib/reanimated2/platform-specific/RNRenderer.web.d.ts +0 -0
- package/lib/types/lib/reanimated2/utils.d.ts +7 -0
- package/lib/types/lib/setAndForwardRef.d.ts +40 -0
- package/lib/types/react-native-reanimated-tests.d.ts +1 -0
- package/mock.js +5 -4
- package/package.json +44 -38
- package/plugin.js +3 -0
- package/react-native-reanimated.d.ts +64 -34
- package/src/ConfigHelper.ts +4 -4
- package/src/createAnimatedComponent.tsx +4 -4
- package/src/reanimated1/core/AnimatedFunction.js +1 -1
- package/src/reanimated1/derived/interpolate.js +2 -4
- package/src/reanimated2/Colors.ts +2 -1
- package/src/reanimated2/NativeReanimated/NativeReanimated.ts +42 -15
- package/src/reanimated2/NativeReanimated/index.ts +0 -6
- package/src/reanimated2/ViewDescriptorsSet.ts +2 -3
- package/src/reanimated2/animation/index.ts +1 -0
- package/src/reanimated2/animation/styleAnimation.ts +10 -7
- package/src/reanimated2/animation/timing.ts +3 -1
- package/src/reanimated2/animation/util.ts +10 -11
- package/src/reanimated2/commonTypes.ts +20 -0
- package/src/reanimated2/component/FlatList.tsx +3 -2
- package/src/reanimated2/core.ts +34 -26
- package/src/reanimated2/globals.d.ts +6 -0
- package/src/reanimated2/hook/index.ts +1 -0
- package/src/reanimated2/hook/useAnimatedSensor.ts +91 -0
- package/src/reanimated2/hook/utils.ts +2 -1
- package/src/reanimated2/interpolateColor.ts +11 -11
- package/src/reanimated2/interpolation.ts +2 -6
- package/src/reanimated2/jestUtils.ts +20 -4
- package/src/reanimated2/js-reanimated/JSReanimated.ts +25 -2
- package/src/reanimated2/js-reanimated/index.ts +3 -3
- package/src/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.ts +13 -0
- package/src/reanimated2/layoutReanimation/animationBuilder/Keyframe.ts +2 -3
- package/src/reanimated2/layoutReanimation/defaultAnimations/Bounce.ts +51 -21
- package/src/reanimated2/layoutReanimation/defaultAnimations/Fade.ts +40 -10
- package/src/reanimated2/layoutReanimation/defaultAnimations/Flip.ts +48 -12
- package/src/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.ts +16 -4
- package/src/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.ts +8 -2
- package/src/reanimated2/layoutReanimation/defaultAnimations/Roll.ts +16 -4
- package/src/reanimated2/layoutReanimation/defaultAnimations/Rotate.ts +32 -8
- package/src/reanimated2/layoutReanimation/defaultAnimations/Slide.ts +32 -10
- package/src/reanimated2/layoutReanimation/defaultAnimations/Stretch.ts +16 -4
- package/src/reanimated2/layoutReanimation/defaultAnimations/Zoom.ts +64 -16
- package/src/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.ts +2 -1
- package/src/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.ts +26 -19
- package/src/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.ts +2 -1
- package/src/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.ts +2 -1
- package/src/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.ts +2 -1
- package/src/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.ts +2 -1
- package/src/reanimated2/mock.ts +3 -2
- package/android/expo/linking.gradle +0 -46
- package/android/expo/src/main/java/com/swmansion/reanimated/EXReanimatedAdapter.java +0 -12
- package/android/expo/src/main/java/expo/modules/adapters/reanimated/EXReanimatedPackage.java +0 -26
- package/android/react-native-reanimated-63-hermes.aar +0 -0
- package/android/react-native-reanimated-63-jsc.aar +0 -0
- package/android/src/main/java/com/swmansion/reanimated/ReanimatedProxyPackage.java +0 -15
- package/expo-module.config.json +0 -3
- package/lib/src/reanimated2/NativeReanimated/NativeReanimated.js +0 -37
- package/libSo/fbjni/jni/arm64-v8a/libfbjni.so +0 -0
- package/libSo/fbjni/jni/armeabi-v7a/libfbjni.so +0 -0
- package/libSo/fbjni/jni/x86/libfbjni.so +0 -0
- package/libSo/fbjni/jni/x86_64/libfbjni.so +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-reanimated",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.0",
|
|
4
4
|
"description": "More powerful alternative to Animated library for React Native.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"start": "node node_modules/react-native/local-cli/cli.js start",
|
|
@@ -18,14 +18,21 @@
|
|
|
18
18
|
"format:common": "find Common/ -iname *.h -o -iname *.cpp | xargs clang-format -i",
|
|
19
19
|
"release": "npm login && release-it",
|
|
20
20
|
"type:check": "yarn tsc --noEmit",
|
|
21
|
-
"type:generate": "yarn type:generate:clean && yarn type:generate:cp-js-src && yarn type:generate:tsc && yarn type:generate:remove.ts && yarn type:generate:remove.tsx",
|
|
21
|
+
"type:generate": "yarn type:generate:clean && yarn type:generate:cp-js-src && yarn type:generate:tsc && yarn type:generate:tsc:declaration && yarn type:generate:remove.ts && yarn type:generate:remove.tsx && yarn type:generate:remove.js:from-src",
|
|
22
22
|
"type:generate:clean": "rm -rf lib/ && mkdir lib/",
|
|
23
|
-
"type:generate:cp-js-src": "cp -RL src
|
|
23
|
+
"type:generate:cp-js-src": "cp -RL src/* lib/",
|
|
24
24
|
"type:generate:tsc": "yarn tsc",
|
|
25
|
+
"type:generate:tsc:declaration": "yarn tsc --project tsconfig.json --pretty --declaration --emitDeclarationOnly --outDir lib/types",
|
|
25
26
|
"type:generate:remove.ts": "find ./lib -type f -name \"*.ts\" -and -not -name \"*.d.ts\" -delete",
|
|
26
27
|
"type:generate:remove.tsx": "find ./lib -type f -name \"*.tsx\" -and -not -name \"*.d.ts\" -delete",
|
|
28
|
+
"type:generate:remove.js:from-src": "find ./src/reanimated2 -type f -name \"*.js\" -delete",
|
|
27
29
|
"prepare": "husky install",
|
|
28
|
-
"circular_dependency_check": "yarn madge --extensions js,ts,tsx --circular ./src"
|
|
30
|
+
"circular_dependency_check": "yarn madge --extensions js,ts,tsx --circular ./src",
|
|
31
|
+
"setup": "yarn && cd Example && yarn && cd ios && pod install --verbose && cd ../..",
|
|
32
|
+
"clean": "rm -rf node_modules && cd Example && rm -rf node_modules && cd ios && pod deintegrate && cd ../..",
|
|
33
|
+
"reset": "yarn clean && yarn setup",
|
|
34
|
+
"clean:deep": "cd android && rm -rf .cxx .gradle build && cd ../Example/android && rm -rf .gradle build app/build && cd ../.. && yarn clean",
|
|
35
|
+
"reset:deep": "yarn clean:deep && yarn setup"
|
|
29
36
|
},
|
|
30
37
|
"main": "lib/Animated.js",
|
|
31
38
|
"module": "lib/Animated",
|
|
@@ -36,7 +43,6 @@
|
|
|
36
43
|
"Common/",
|
|
37
44
|
"src/",
|
|
38
45
|
"lib/",
|
|
39
|
-
"libSo/",
|
|
40
46
|
"android/src/main/AndroidManifest.xml",
|
|
41
47
|
"android/src/main/java/",
|
|
42
48
|
"android/build.gradle",
|
|
@@ -49,7 +55,6 @@
|
|
|
49
55
|
"react-native-reanimated.d.ts",
|
|
50
56
|
"mock.js",
|
|
51
57
|
"plugin.js",
|
|
52
|
-
"expo-module.config.json",
|
|
53
58
|
"!__snapshots__",
|
|
54
59
|
"!*.test.js",
|
|
55
60
|
"!*.test.js.map"
|
|
@@ -69,56 +74,57 @@
|
|
|
69
74
|
},
|
|
70
75
|
"homepage": "https://github.com/software-mansion/react-native-reanimated#readme",
|
|
71
76
|
"dependencies": {
|
|
72
|
-
"@babel/plugin-transform-object-assign": "^7.
|
|
77
|
+
"@babel/plugin-transform-object-assign": "^7.16.7",
|
|
73
78
|
"@types/invariant": "^2.2.35",
|
|
74
79
|
"invariant": "^2.2.4",
|
|
75
80
|
"lodash.isequal": "^4.5.0",
|
|
76
|
-
"
|
|
77
|
-
"
|
|
81
|
+
"react-native-screens": "^3.11.1",
|
|
82
|
+
"setimmediate": "^1.0.5",
|
|
78
83
|
"string-hash-64": "^1.0.3"
|
|
79
84
|
},
|
|
80
85
|
"peerDependencies": {
|
|
86
|
+
"@babel/preset-typescript": "*",
|
|
81
87
|
"react": "*",
|
|
82
88
|
"react-native": "*",
|
|
83
89
|
"react-native-gesture-handler": "*"
|
|
84
90
|
},
|
|
85
91
|
"devDependencies": {
|
|
86
|
-
"@babel/core": "^7.
|
|
87
|
-
"@babel/plugin-proposal-class-properties": "^7.7
|
|
88
|
-
"@babel/preset-env": "^7.
|
|
89
|
-
"@babel/preset-typescript": "^7.7
|
|
90
|
-
"@react-native-community/bob": "^0.
|
|
92
|
+
"@babel/core": "^7.17.2",
|
|
93
|
+
"@babel/plugin-proposal-class-properties": "^7.16.7",
|
|
94
|
+
"@babel/preset-env": "^7.16.11",
|
|
95
|
+
"@babel/preset-typescript": "^7.16.7",
|
|
96
|
+
"@react-native-community/bob": "^0.17.1",
|
|
91
97
|
"@react-native-community/eslint-config": "^0.0.5",
|
|
92
|
-
"@testing-library/jest-native": "^
|
|
98
|
+
"@testing-library/jest-native": "^4.0.4",
|
|
93
99
|
"@testing-library/react-hooks": "^5.0.3",
|
|
94
100
|
"@testing-library/react-native": "^7.1.0",
|
|
95
|
-
"@types/babel-types": "^7.0.
|
|
96
|
-
"@types/babel__core": "^7.1.
|
|
97
|
-
"@types/babel__generator": "^7.6.
|
|
98
|
-
"@types/babel__traverse": "^7.
|
|
99
|
-
"@types/jest": "^
|
|
100
|
-
"@types/react-native": "^0.
|
|
101
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
102
|
-
"@typescript-eslint/parser": "^
|
|
103
|
-
"babel-eslint": "^10.0
|
|
104
|
-
"babel-jest": "^
|
|
101
|
+
"@types/babel-types": "^7.0.11",
|
|
102
|
+
"@types/babel__core": "^7.1.18",
|
|
103
|
+
"@types/babel__generator": "^7.6.4",
|
|
104
|
+
"@types/babel__traverse": "^7.14.2",
|
|
105
|
+
"@types/jest": "^27.4.0",
|
|
106
|
+
"@types/react-native": "^0.66.15",
|
|
107
|
+
"@typescript-eslint/eslint-plugin": "^5.11.0",
|
|
108
|
+
"@typescript-eslint/parser": "^5.11.0",
|
|
109
|
+
"babel-eslint": "^10.1.0",
|
|
110
|
+
"babel-jest": "^27.5.1",
|
|
105
111
|
"babel-plugin-module-resolver": "^4.1.0",
|
|
106
|
-
"clang-format": "^1.
|
|
107
|
-
"eslint": "^
|
|
108
|
-
"eslint-config-prettier": "^
|
|
109
|
-
"eslint-config-standard": "^
|
|
110
|
-
"eslint-import-resolver-babel-module": "^5.
|
|
111
|
-
"eslint-plugin-import": "^2.
|
|
112
|
-
"eslint-plugin-node": "^
|
|
113
|
-
"eslint-plugin-promise": "^
|
|
114
|
-
"eslint-plugin-standard": "^
|
|
115
|
-
"husky": "^7.0.
|
|
116
|
-
"jest": "^
|
|
112
|
+
"clang-format": "^1.6.0",
|
|
113
|
+
"eslint": "^8.8.0",
|
|
114
|
+
"eslint-config-prettier": "^8.3.0",
|
|
115
|
+
"eslint-config-standard": "^16.0.3",
|
|
116
|
+
"eslint-import-resolver-babel-module": "^5.3.1",
|
|
117
|
+
"eslint-plugin-import": "^2.25.4",
|
|
118
|
+
"eslint-plugin-node": "^11.1.0",
|
|
119
|
+
"eslint-plugin-promise": "^6.0.0",
|
|
120
|
+
"eslint-plugin-standard": "^5.0.0",
|
|
121
|
+
"husky": "^7.0.4",
|
|
122
|
+
"jest": "^27.5.1",
|
|
117
123
|
"lint-staged": "^11.2.0",
|
|
118
124
|
"madge": "^5.0.1",
|
|
119
|
-
"prettier": "^2.
|
|
125
|
+
"prettier": "^2.5.1",
|
|
120
126
|
"react": "17.0.2",
|
|
121
|
-
"react-native": "0.
|
|
127
|
+
"react-native": "0.68.0",
|
|
122
128
|
"react-native-codegen": "^0.0.7",
|
|
123
129
|
"react-native-gesture-handler": "^1.6.1",
|
|
124
130
|
"react-test-renderer": "17.0.2",
|
package/plugin.js
CHANGED
|
@@ -30,7 +30,9 @@ const objectHooks = new Set([
|
|
|
30
30
|
const globals = new Set([
|
|
31
31
|
'this',
|
|
32
32
|
'console',
|
|
33
|
+
'performance',
|
|
33
34
|
'_setGlobalConsole',
|
|
35
|
+
'_chronoNow',
|
|
34
36
|
'Date',
|
|
35
37
|
'Array',
|
|
36
38
|
'ArrayBuffer',
|
|
@@ -85,6 +87,7 @@ const blacklistedFunctions = new Set([
|
|
|
85
87
|
'toString',
|
|
86
88
|
'map',
|
|
87
89
|
'filter',
|
|
90
|
+
'findIndex',
|
|
88
91
|
'forEach',
|
|
89
92
|
'valueOf',
|
|
90
93
|
'toPrecision',
|
|
@@ -7,8 +7,6 @@ declare module 'react-native-reanimated' {
|
|
|
7
7
|
ReactNode,
|
|
8
8
|
Component,
|
|
9
9
|
RefObject,
|
|
10
|
-
ComponentType,
|
|
11
|
-
ComponentProps,
|
|
12
10
|
FunctionComponent,
|
|
13
11
|
} from 'react';
|
|
14
12
|
import {
|
|
@@ -31,7 +29,6 @@ declare module 'react-native-reanimated' {
|
|
|
31
29
|
NativeScrollEvent,
|
|
32
30
|
NativeSyntheticEvent,
|
|
33
31
|
ColorValue,
|
|
34
|
-
OpaqueColorValue,
|
|
35
32
|
EasingFunction,
|
|
36
33
|
} from 'react-native';
|
|
37
34
|
import {
|
|
@@ -39,16 +36,24 @@ declare module 'react-native-reanimated' {
|
|
|
39
36
|
PanGestureHandlerGestureEvent,
|
|
40
37
|
} from 'react-native-gesture-handler';
|
|
41
38
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
39
|
+
import('./lib/reanimated2/globals');
|
|
40
|
+
|
|
41
|
+
export type TimingAnimation =
|
|
42
|
+
import('./lib/types/lib/reanimated2/animation/index').TimingAnimation;
|
|
43
|
+
export type SpringAnimation =
|
|
44
|
+
import('./lib/types/lib/reanimated2/animation/index').SpringAnimation;
|
|
45
|
+
export type DecayAnimation =
|
|
46
|
+
import('./lib/types/lib/reanimated2/animation/index').DecayAnimation;
|
|
47
|
+
export type DelayAnimation =
|
|
48
|
+
import('./lib/types/lib/reanimated2/animation/commonTypes').DelayAnimation;
|
|
49
|
+
export type RepeatAnimation =
|
|
50
|
+
import('./lib/types/lib/reanimated2/animation/index').RepeatAnimation;
|
|
51
|
+
export type SequenceAnimation =
|
|
52
|
+
import('./lib/types/lib/reanimated2/animation/index').SequenceAnimation;
|
|
53
|
+
export type StyleLayoutAnimation =
|
|
54
|
+
import('./lib/types/lib/reanimated2/animation/index').StyleLayoutAnimation;
|
|
55
|
+
export type Animation<T> =
|
|
56
|
+
import('./lib/types/lib/reanimated2/commonTypes').Animation<T>;
|
|
52
57
|
|
|
53
58
|
namespace Animated {
|
|
54
59
|
type Nullable<T> = T | null | undefined;
|
|
@@ -146,10 +151,14 @@ declare module 'react-native-reanimated' {
|
|
|
146
151
|
>;
|
|
147
152
|
};
|
|
148
153
|
|
|
154
|
+
export type StylesOrDefault<T> = 'style' extends keyof T
|
|
155
|
+
? T['style']
|
|
156
|
+
: Record<string, unknown>;
|
|
157
|
+
|
|
149
158
|
export type AnimateProps<P extends object> = {
|
|
150
|
-
[K in keyof P]: K
|
|
151
|
-
|
|
152
|
-
|
|
159
|
+
[K in keyof P]: P[K] | AnimatedNode<P[K]>;
|
|
160
|
+
} & {
|
|
161
|
+
style?: StyleProp<AnimateStyle<StylesOrDefault<P>>>;
|
|
153
162
|
} & {
|
|
154
163
|
animatedProps?: Partial<AnimateProps<P>>;
|
|
155
164
|
layout?:
|
|
@@ -390,16 +399,16 @@ declare module 'react-native-reanimated' {
|
|
|
390
399
|
value: Adaptable<number>,
|
|
391
400
|
config: InterpolationConfig
|
|
392
401
|
): AnimatedNode<number>;
|
|
393
|
-
export function interpolateColors(
|
|
402
|
+
export function interpolateColors<T extends string | number>(
|
|
394
403
|
animationValue: Adaptable<number>,
|
|
395
404
|
{
|
|
396
405
|
inputRange,
|
|
397
406
|
outputColorRange,
|
|
398
407
|
}: {
|
|
399
408
|
inputRange: ReadonlyArray<Adaptable<number>>;
|
|
400
|
-
outputColorRange: ReadonlyArray<Adaptable<
|
|
409
|
+
outputColorRange: ReadonlyArray<Adaptable<T>>;
|
|
401
410
|
}
|
|
402
|
-
): AnimatedNode<
|
|
411
|
+
): AnimatedNode<T>;
|
|
403
412
|
export const max: BinaryOperator;
|
|
404
413
|
export const min: BinaryOperator;
|
|
405
414
|
|
|
@@ -477,6 +486,23 @@ declare module 'react-native-reanimated' {
|
|
|
477
486
|
targetGlobalOriginY: number;
|
|
478
487
|
}
|
|
479
488
|
|
|
489
|
+
export enum SensorType {
|
|
490
|
+
ACCELEROMETER = 1,
|
|
491
|
+
GYROSCOPE = 2,
|
|
492
|
+
GRAVITY = 3,
|
|
493
|
+
MAGNETIC_FIELD = 4,
|
|
494
|
+
ROTATION = 5,
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
export type SensorConfig = {
|
|
498
|
+
interval: number;
|
|
499
|
+
};
|
|
500
|
+
|
|
501
|
+
export function useAnimatedSensor(
|
|
502
|
+
sensorType: SensorType,
|
|
503
|
+
userConfig?: SensorConfig
|
|
504
|
+
);
|
|
505
|
+
|
|
480
506
|
export interface ExitAnimationsValues {
|
|
481
507
|
currentOriginX: number;
|
|
482
508
|
currentOriginY: number;
|
|
@@ -553,9 +579,10 @@ declare module 'react-native-reanimated' {
|
|
|
553
579
|
finished?: boolean,
|
|
554
580
|
current?: AnimatableValue
|
|
555
581
|
) => void;
|
|
582
|
+
export type EasingFunctionFactory = { factory: () => EasingFunction };
|
|
556
583
|
export interface WithTimingConfig {
|
|
557
584
|
duration?: number;
|
|
558
|
-
easing?: EasingFunction;
|
|
585
|
+
easing?: EasingFunction | EasingFunctionFactory;
|
|
559
586
|
}
|
|
560
587
|
export interface WithDecayConfig {
|
|
561
588
|
deceleration?: number;
|
|
@@ -572,29 +599,29 @@ declare module 'react-native-reanimated' {
|
|
|
572
599
|
restDisplacementThreshold?: number;
|
|
573
600
|
velocity?: number;
|
|
574
601
|
}
|
|
575
|
-
export function withTiming(
|
|
576
|
-
toValue:
|
|
602
|
+
export function withTiming<T extends AnimatableValue>(
|
|
603
|
+
toValue: T,
|
|
577
604
|
userConfig?: WithTimingConfig,
|
|
578
605
|
callback?: AnimationCallback
|
|
579
|
-
):
|
|
580
|
-
export function withSpring(
|
|
581
|
-
toValue:
|
|
606
|
+
): T;
|
|
607
|
+
export function withSpring<T extends AnimatableValue>(
|
|
608
|
+
toValue: T,
|
|
582
609
|
userConfig?: WithSpringConfig,
|
|
583
610
|
callback?: AnimationCallback
|
|
584
|
-
):
|
|
611
|
+
): T;
|
|
585
612
|
export function withDecay(
|
|
586
613
|
userConfig: WithDecayConfig,
|
|
587
614
|
callback?: AnimationCallback
|
|
588
615
|
): number;
|
|
589
616
|
export function cancelAnimation<T>(sharedValue: SharedValue<T>): void;
|
|
590
|
-
export function withDelay(delayMS: number, delayedAnimation:
|
|
591
|
-
export function withRepeat(
|
|
592
|
-
animation:
|
|
617
|
+
export function withDelay<T extends AnimatableValue>(delayMS: number, delayedAnimation: T): T;
|
|
618
|
+
export function withRepeat<T extends AnimatableValue>(
|
|
619
|
+
animation: T,
|
|
593
620
|
numberOfReps?: number,
|
|
594
621
|
reverse?: boolean,
|
|
595
622
|
callback?: AnimationCallback
|
|
596
|
-
):
|
|
597
|
-
export function withSequence(...animations: [
|
|
623
|
+
): T;
|
|
624
|
+
export function withSequence<T extends AnimatableValue>(...animations: [T, ...T[]]): T;
|
|
598
625
|
|
|
599
626
|
// reanimated2 functions
|
|
600
627
|
export function runOnUI<A extends any[], R>(
|
|
@@ -615,12 +642,12 @@ declare module 'react-native-reanimated' {
|
|
|
615
642
|
fn: (...args: A) => R
|
|
616
643
|
): (...args: Parameters<typeof fn>) => R;
|
|
617
644
|
|
|
618
|
-
export function interpolateColor(
|
|
645
|
+
export function interpolateColor<T extends string | number>(
|
|
619
646
|
value: number,
|
|
620
647
|
inputRange: readonly number[],
|
|
621
|
-
outputRange: readonly
|
|
648
|
+
outputRange: readonly T[],
|
|
622
649
|
colorSpace?: 'RGB' | 'HSV'
|
|
623
|
-
):
|
|
650
|
+
): T;
|
|
624
651
|
|
|
625
652
|
export enum ColorSpace {
|
|
626
653
|
RGB = 0,
|
|
@@ -825,6 +852,9 @@ declare module 'react-native-reanimated' {
|
|
|
825
852
|
callback: (finished: boolean) => void
|
|
826
853
|
): ComplexAnimationBuilder;
|
|
827
854
|
|
|
855
|
+
static withInitialValues(values: StyleProps): BaseAnimationBuilder;
|
|
856
|
+
withInitialValues(values: StyleProps): BaseAnimationBuilder;
|
|
857
|
+
|
|
828
858
|
static easing(easingFunction: EasingFunction): ComplexAnimationBuilder;
|
|
829
859
|
easing(easingFunction: EasingFunction): ComplexAnimationBuilder;
|
|
830
860
|
static springify(): ComplexAnimationBuilder;
|
package/src/ConfigHelper.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { configureProps as jsiConfigureProps } from './reanimated2/core';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Styles allowed to be direcly updated in UI thread
|
|
@@ -107,9 +107,9 @@ let NATIVE_THREAD_PROPS_WHITELIST: Record<string, boolean> = {
|
|
|
107
107
|
};
|
|
108
108
|
|
|
109
109
|
function configureProps(): void {
|
|
110
|
-
|
|
111
|
-
Object.keys(
|
|
112
|
-
Object.keys(
|
|
110
|
+
jsiConfigureProps(
|
|
111
|
+
Object.keys(UI_THREAD_PROPS_WHITELIST),
|
|
112
|
+
Object.keys(NATIVE_THREAD_PROPS_WHITELIST)
|
|
113
113
|
);
|
|
114
114
|
}
|
|
115
115
|
|
|
@@ -161,7 +161,7 @@ interface ComponentRef extends Component {
|
|
|
161
161
|
getScrollableNode?: () => ComponentRef;
|
|
162
162
|
}
|
|
163
163
|
|
|
164
|
-
interface InitialComponentProps extends Record<string, unknown> {
|
|
164
|
+
export interface InitialComponentProps extends Record<string, unknown> {
|
|
165
165
|
ref?: Ref<Component>;
|
|
166
166
|
collapsable?: boolean;
|
|
167
167
|
}
|
|
@@ -194,6 +194,7 @@ export default function createAnimatedComponent(
|
|
|
194
194
|
_viewTag = -1;
|
|
195
195
|
_isFirstRender = true;
|
|
196
196
|
animatedStyle: { value: StyleProps } = { value: {} };
|
|
197
|
+
initialStyle = {};
|
|
197
198
|
sv: SharedValue<null | Record<string, unknown>> | null;
|
|
198
199
|
_propsAnimated?: PropsAnimated;
|
|
199
200
|
_component: ComponentRef | null = null;
|
|
@@ -606,13 +607,12 @@ export default function createAnimatedComponent(
|
|
|
606
607
|
// this is how we recognize styles returned by useAnimatedStyle
|
|
607
608
|
style.viewsRef.add(this);
|
|
608
609
|
if (this._isFirstRender) {
|
|
609
|
-
|
|
610
|
+
this.initialStyle = {
|
|
610
611
|
...style.initial.value,
|
|
611
612
|
...initialUpdaterRun<StyleProps>(style.initial.updater),
|
|
612
613
|
};
|
|
613
|
-
} else {
|
|
614
|
-
return style.initial.value;
|
|
615
614
|
}
|
|
615
|
+
return this.initialStyle;
|
|
616
616
|
} else {
|
|
617
617
|
return style;
|
|
618
618
|
}
|
|
@@ -37,7 +37,7 @@ export function createAnimatedFunction(cb) {
|
|
|
37
37
|
for (let i = 0; i < params.length; i++) {
|
|
38
38
|
params[i] = createAnimatedParam();
|
|
39
39
|
}
|
|
40
|
-
// eslint-disable-next-line
|
|
40
|
+
// eslint-disable-next-line node/no-callback-literal
|
|
41
41
|
const what = cb(...params);
|
|
42
42
|
const func = new AnimatedFunction(what, ...params);
|
|
43
43
|
return (...args) => {
|
|
@@ -128,15 +128,13 @@ export default function interpolate(value, config) {
|
|
|
128
128
|
const right = extrapolateRight || extrapolate;
|
|
129
129
|
let output = interpolateInternal(value, inputRange, outputRange);
|
|
130
130
|
|
|
131
|
-
if (left === Extrapolate.
|
|
132
|
-
} else if (left === Extrapolate.CLAMP) {
|
|
131
|
+
if (left === Extrapolate.CLAMP) {
|
|
133
132
|
output = cond(lessThan(value, inputRange[0]), outputRange[0], output);
|
|
134
133
|
} else if (left === Extrapolate.IDENTITY) {
|
|
135
134
|
output = cond(lessThan(value, inputRange[0]), value, output);
|
|
136
135
|
}
|
|
137
136
|
|
|
138
|
-
if (right === Extrapolate.
|
|
139
|
-
} else if (right === Extrapolate.CLAMP) {
|
|
137
|
+
if (right === Extrapolate.CLAMP) {
|
|
140
138
|
output = cond(
|
|
141
139
|
greaterThan(value, inputRange[inputRange.length - 1]),
|
|
142
140
|
outputRange[outputRange.length - 1],
|
|
@@ -64,7 +64,8 @@ function getMatchers(): Matchers {
|
|
|
64
64
|
'hsla' + call(NUMBER, PERCENTAGE, PERCENTAGE, NUMBER)
|
|
65
65
|
);
|
|
66
66
|
cachedMatchers.hex3 = /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/;
|
|
67
|
-
cachedMatchers.hex4 =
|
|
67
|
+
cachedMatchers.hex4 =
|
|
68
|
+
/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/;
|
|
68
69
|
cachedMatchers.hex6 = /^#([0-9a-fA-F]{6})$/;
|
|
69
70
|
cachedMatchers.hex8 = /^#([0-9a-fA-F]{8})$/;
|
|
70
71
|
}
|
|
@@ -1,31 +1,54 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NativeModules } from 'react-native';
|
|
2
|
+
import {
|
|
3
|
+
SharedValue,
|
|
4
|
+
SensorValue3D,
|
|
5
|
+
SensorValueRotation,
|
|
6
|
+
} from '../commonTypes';
|
|
2
7
|
import { Descriptor } from '../hook/commonTypes';
|
|
3
8
|
|
|
4
|
-
const InnerNativeModule = global.__reanimatedModuleProxy;
|
|
5
|
-
|
|
6
9
|
export class NativeReanimated {
|
|
7
10
|
native: boolean;
|
|
8
|
-
|
|
11
|
+
private InnerNativeModule: any;
|
|
9
12
|
|
|
10
13
|
constructor(native = true) {
|
|
14
|
+
if (global.__reanimatedModuleProxy === undefined) {
|
|
15
|
+
const { ReanimatedModule } = NativeModules;
|
|
16
|
+
ReanimatedModule?.installTurboModule();
|
|
17
|
+
}
|
|
18
|
+
this.InnerNativeModule = global.__reanimatedModuleProxy;
|
|
11
19
|
this.native = native;
|
|
12
|
-
this.useOnlyV1 = InnerNativeModule === null;
|
|
13
20
|
}
|
|
14
21
|
|
|
15
22
|
installCoreFunctions(valueSetter: <T>(value: T) => void): void {
|
|
16
|
-
return InnerNativeModule.installCoreFunctions(valueSetter);
|
|
23
|
+
return this.InnerNativeModule.installCoreFunctions(valueSetter);
|
|
17
24
|
}
|
|
18
25
|
|
|
19
26
|
makeShareable<T>(value: T): T {
|
|
20
|
-
return InnerNativeModule.makeShareable(value);
|
|
27
|
+
return this.InnerNativeModule.makeShareable(value);
|
|
21
28
|
}
|
|
22
29
|
|
|
23
30
|
makeMutable<T>(value: T): SharedValue<T> {
|
|
24
|
-
return InnerNativeModule.makeMutable(value);
|
|
31
|
+
return this.InnerNativeModule.makeMutable(value);
|
|
25
32
|
}
|
|
26
33
|
|
|
27
34
|
makeRemote<T>(object = {}): T {
|
|
28
|
-
return InnerNativeModule.makeRemote(object);
|
|
35
|
+
return this.InnerNativeModule.makeRemote(object);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
registerSensor(
|
|
39
|
+
sensorType: number,
|
|
40
|
+
interval: number,
|
|
41
|
+
sensorData: SensorValue3D | SensorValueRotation
|
|
42
|
+
) {
|
|
43
|
+
return this.InnerNativeModule.registerSensor(
|
|
44
|
+
sensorType,
|
|
45
|
+
interval,
|
|
46
|
+
sensorData
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
unregisterSensor(sensorId: number) {
|
|
51
|
+
return this.InnerNativeModule.unregisterSensor(sensorId);
|
|
29
52
|
}
|
|
30
53
|
|
|
31
54
|
startMapper(
|
|
@@ -35,7 +58,7 @@ export class NativeReanimated {
|
|
|
35
58
|
updater: () => void,
|
|
36
59
|
viewDescriptors: Descriptor[] | SharedValue<Descriptor[]>
|
|
37
60
|
): number {
|
|
38
|
-
return InnerNativeModule.startMapper(
|
|
61
|
+
return this.InnerNativeModule.startMapper(
|
|
39
62
|
mapper,
|
|
40
63
|
inputs,
|
|
41
64
|
outputs,
|
|
@@ -45,18 +68,18 @@ export class NativeReanimated {
|
|
|
45
68
|
}
|
|
46
69
|
|
|
47
70
|
stopMapper(mapperId: number): void {
|
|
48
|
-
return InnerNativeModule.stopMapper(mapperId);
|
|
71
|
+
return this.InnerNativeModule.stopMapper(mapperId);
|
|
49
72
|
}
|
|
50
73
|
|
|
51
74
|
registerEventHandler<T>(
|
|
52
75
|
eventHash: string,
|
|
53
76
|
eventHandler: (event: T) => void
|
|
54
77
|
): string {
|
|
55
|
-
return InnerNativeModule.registerEventHandler(eventHash, eventHandler);
|
|
78
|
+
return this.InnerNativeModule.registerEventHandler(eventHash, eventHandler);
|
|
56
79
|
}
|
|
57
80
|
|
|
58
81
|
unregisterEventHandler(id: string): void {
|
|
59
|
-
return InnerNativeModule.unregisterEventHandler(id);
|
|
82
|
+
return this.InnerNativeModule.unregisterEventHandler(id);
|
|
60
83
|
}
|
|
61
84
|
|
|
62
85
|
getViewProp<T>(
|
|
@@ -64,10 +87,14 @@ export class NativeReanimated {
|
|
|
64
87
|
propName: string,
|
|
65
88
|
callback?: (result: T) => void
|
|
66
89
|
): Promise<T> {
|
|
67
|
-
return InnerNativeModule.getViewProp(viewTag, propName, callback);
|
|
90
|
+
return this.InnerNativeModule.getViewProp(viewTag, propName, callback);
|
|
68
91
|
}
|
|
69
92
|
|
|
70
93
|
enableLayoutAnimations(flag: boolean): void {
|
|
71
|
-
InnerNativeModule.enableLayoutAnimations(flag);
|
|
94
|
+
this.InnerNativeModule.enableLayoutAnimations(flag);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
configureProps(uiProps: string[], nativeProps: string[]): void {
|
|
98
|
+
this.InnerNativeModule.configureProps(uiProps, nativeProps);
|
|
72
99
|
}
|
|
73
100
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import reanimatedJS from '../js-reanimated';
|
|
2
2
|
import { shouldBeUseWeb } from '../PlatformChecker';
|
|
3
|
-
import { Platform } from 'react-native';
|
|
4
3
|
import { NativeReanimated } from './NativeReanimated';
|
|
5
4
|
|
|
6
5
|
let exportedModule;
|
|
@@ -8,11 +7,6 @@ if (shouldBeUseWeb()) {
|
|
|
8
7
|
exportedModule = reanimatedJS;
|
|
9
8
|
} else {
|
|
10
9
|
exportedModule = new NativeReanimated();
|
|
11
|
-
if (exportedModule.useOnlyV1 && Platform.OS === 'android') {
|
|
12
|
-
console.warn(
|
|
13
|
-
`If you want to use Reanimated 2 then go through our installation steps https://docs.swmansion.com/react-native-reanimated/docs/installation`
|
|
14
|
-
);
|
|
15
|
-
}
|
|
16
10
|
}
|
|
17
11
|
|
|
18
12
|
export default exportedModule as NativeReanimated;
|
|
@@ -2,7 +2,7 @@ import { useRef } from 'react';
|
|
|
2
2
|
import { makeMutable } from './core';
|
|
3
3
|
import { SharedValue } from './commonTypes';
|
|
4
4
|
import { Descriptor } from './hook/commonTypes';
|
|
5
|
-
import {
|
|
5
|
+
import { shouldBeUseWeb } from './PlatformChecker';
|
|
6
6
|
|
|
7
7
|
export interface ViewRefSet<T> {
|
|
8
8
|
items: Set<T>;
|
|
@@ -24,8 +24,7 @@ export interface ViewDescriptorsSet {
|
|
|
24
24
|
) => void;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
const scheduleUpdates =
|
|
28
|
-
Platform.OS === 'web' ? requestAnimationFrame : setImmediate;
|
|
27
|
+
const scheduleUpdates = shouldBeUseWeb() ? requestAnimationFrame : setImmediate;
|
|
29
28
|
|
|
30
29
|
export function makeViewDescriptorsSet(): ViewDescriptorsSet {
|
|
31
30
|
const ref = useRef<ViewDescriptorsSet | null>(null);
|
|
@@ -57,9 +57,8 @@ export function setPath<T>(
|
|
|
57
57
|
currObj = currObj[keys[i]];
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
(currObj as { [key: string]: NestedObjectValues<T> })[
|
|
61
|
-
|
|
62
|
-
] = value;
|
|
60
|
+
(currObj as { [key: string]: NestedObjectValues<T> })[keys[keys.length - 1]] =
|
|
61
|
+
value;
|
|
63
62
|
}
|
|
64
63
|
|
|
65
64
|
interface NestedObjectEntry<T> {
|
|
@@ -83,7 +82,8 @@ export function withStyleAnimation(
|
|
|
83
82
|
{ value: animation.styleAnimations, path: [] },
|
|
84
83
|
];
|
|
85
84
|
while (entriesToCheck.length > 0) {
|
|
86
|
-
const currentEntry: NestedObjectEntry<AnimationObject> =
|
|
85
|
+
const currentEntry: NestedObjectEntry<AnimationObject> =
|
|
86
|
+
entriesToCheck.pop() as NestedObjectEntry<AnimationObject>;
|
|
87
87
|
if (Array.isArray(currentEntry.value)) {
|
|
88
88
|
for (let index = 0; index < currentEntry.value.length; index++) {
|
|
89
89
|
entriesToCheck.push({
|
|
@@ -103,7 +103,8 @@ export function withStyleAnimation(
|
|
|
103
103
|
});
|
|
104
104
|
}
|
|
105
105
|
} else {
|
|
106
|
-
const currentStyleAnimation: AnimationObject =
|
|
106
|
+
const currentStyleAnimation: AnimationObject =
|
|
107
|
+
currentEntry.value as AnimationObject;
|
|
107
108
|
if (currentStyleAnimation.finished) {
|
|
108
109
|
continue;
|
|
109
110
|
}
|
|
@@ -211,7 +212,8 @@ export function withStyleAnimation(
|
|
|
211
212
|
styleAnimations,
|
|
212
213
|
];
|
|
213
214
|
while (animationsToCheck.length > 0) {
|
|
214
|
-
const currentAnimation: NestedObjectValues<AnimationObject> =
|
|
215
|
+
const currentAnimation: NestedObjectValues<AnimationObject> =
|
|
216
|
+
animationsToCheck.pop() as NestedObjectValues<AnimationObject>;
|
|
215
217
|
if (Array.isArray(currentAnimation)) {
|
|
216
218
|
for (const element of currentAnimation) {
|
|
217
219
|
animationsToCheck.push(element);
|
|
@@ -224,7 +226,8 @@ export function withStyleAnimation(
|
|
|
224
226
|
animationsToCheck.push(value);
|
|
225
227
|
}
|
|
226
228
|
} else {
|
|
227
|
-
const currentStyleAnimation: AnimationObject =
|
|
229
|
+
const currentStyleAnimation: AnimationObject =
|
|
230
|
+
currentAnimation as AnimationObject;
|
|
228
231
|
if (
|
|
229
232
|
!currentStyleAnimation.finished &&
|
|
230
233
|
currentStyleAnimation.callback
|
|
@@ -80,7 +80,9 @@ export function withTiming(
|
|
|
80
80
|
// new timing over the old one with the same parameters. If so, we want
|
|
81
81
|
// to copy animation timeline properties
|
|
82
82
|
animation.startTime = (previousAnimation as TimingAnimation).startTime;
|
|
83
|
-
animation.startValue = (
|
|
83
|
+
animation.startValue = (
|
|
84
|
+
previousAnimation as TimingAnimation
|
|
85
|
+
).startValue;
|
|
84
86
|
} else {
|
|
85
87
|
animation.startTime = now;
|
|
86
88
|
animation.startValue = value;
|