react-native-reanimated 2.8.0 → 3.0.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Common/cpp/Fabric/FabricUtils.cpp +128 -0
- package/Common/cpp/Fabric/ReanimatedUIManagerBinding.cpp +197 -0
- package/Common/cpp/NativeModules/NativeReanimatedModule.cpp +311 -6
- 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 +78 -0
- package/Common/cpp/headers/Fabric/ReanimatedUIManagerBinding.h +46 -0
- package/Common/cpp/headers/NativeModules/NativeReanimatedModule.h +72 -2
- 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 +43 -8
- package/Common/cpp/headers/Tools/RuntimeDecorator.h +8 -3
- package/README.md +4 -0
- package/RNReanimated.podspec +22 -11
- package/android/CMakeLists.txt +139 -27
- package/android/build.gradle +86 -209
- package/android/local.properties +1 -0
- package/android/src/fabric/java/com/swmansion/reanimated/NativeProxy.java +310 -0
- package/android/src/fabric/java/com/swmansion/reanimated/ReaCompatibility.java +25 -0
- package/android/src/main/cpp/NativeProxy.cpp +178 -33
- package/android/src/main/cpp/headers/NativeProxy.h +43 -7
- package/android/src/main/java/com/swmansion/reanimated/NodesManager.java +13 -245
- package/android/src/main/java/com/swmansion/reanimated/ReanimatedModule.java +0 -125
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/LayoutAnimations.java +2 -1
- package/android/src/{main → paper}/java/com/swmansion/reanimated/NativeProxy.java +15 -2
- 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.m → REANodesManager.mm} +91 -223
- package/ios/native/NativeProxy.mm +144 -17
- package/ios/native/REAInitializer.mm +12 -4
- package/ios/native/UIResponder+Reanimated.h +3 -1
- package/ios/native/UIResponder+Reanimated.mm +3 -1
- package/lib/Animated.js +0 -4
- package/lib/createAnimatedComponent.js +30 -169
- package/lib/index.js +0 -4
- package/lib/reanimated2/Easing.js +0 -42
- package/lib/reanimated2/NativeMethods.js +20 -3
- package/lib/reanimated2/UpdateProps.js +25 -10
- package/lib/reanimated2/core.js +4 -1
- package/lib/reanimated2/fabricUtils.js +18 -0
- package/lib/reanimated2/globals.d.ts +17 -1
- package/lib/reanimated2/hook/useAnimatedRef.js +6 -2
- package/lib/reanimated2/hook/utils.js +0 -5
- package/lib/reanimated2/interpolateColor.js +5 -2
- package/lib/reanimated2/interpolation.js +0 -15
- package/lib/reanimated2/js-reanimated/index.js +3 -0
- package/lib/types/{lib/ConfigHelper.d.ts → ConfigHelper.d.ts} +0 -0
- package/lib/types/{lib/ReanimatedEventEmitter.d.ts → ReanimatedEventEmitter.d.ts} +0 -0
- package/lib/types/{lib/ReanimatedModule.d.ts → ReanimatedModule.d.ts} +0 -0
- package/lib/types/{lib/ReanimatedModule.macos.d.ts → ReanimatedModule.macos.d.ts} +0 -0
- package/lib/types/{lib/ReanimatedModule.native.d.ts → ReanimatedModule.native.d.ts} +0 -0
- package/lib/types/{lib/ReanimatedModule.windows.d.ts → ReanimatedModule.windows.d.ts} +0 -0
- package/lib/types/{lib/ReanimatedModuleCompat.d.ts → ReanimatedModuleCompat.d.ts} +0 -0
- package/lib/types/{lib/createAnimatedComponent.d.ts → createAnimatedComponent.d.ts} +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/Bezier.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/Colors.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/Easing.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/NativeMethods.d.ts +2 -1
- package/lib/types/{lib/reanimated2 → reanimated2}/NativeReanimated/NativeReanimated.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/NativeReanimated/index.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/PlatformChecker.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/PropAdapters.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/UpdateProps.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/ViewDescriptorsSet.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/WorkletEventHandler.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/__mocks__/MutableValue.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/__mocks__/NativeReanimated.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/__mocks__/NativeReanimated.native.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/animation/commonTypes.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/animation/decay.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/animation/delay.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/animation/index.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/animation/repeat.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/animation/sequence.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/animation/spring.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/animation/styleAnimation.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/animation/timing.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/animation/util.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/commonTypes.d.ts +2 -1
- package/lib/types/{lib/reanimated2 → reanimated2}/component/FlatList.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/component/WrappedComponents.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/component/index.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/core.d.ts +0 -0
- package/lib/types/reanimated2/fabricUtils.d.ts +4 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/hook/Hooks.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/hook/commonTypes.d.ts +2 -1
- package/lib/types/{lib/reanimated2 → reanimated2}/hook/index.d.ts +1 -1
- package/lib/types/{lib/reanimated2 → reanimated2}/hook/useAnimatedGestureHandler.d.ts +2 -2
- package/lib/types/{lib/reanimated2 → reanimated2}/hook/useAnimatedReaction.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/hook/useAnimatedRef.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/hook/useAnimatedScrollHandler.d.ts +2 -2
- package/lib/types/{lib/reanimated2 → reanimated2}/hook/useAnimatedSensor.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/hook/useAnimatedStyle.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/hook/useDerivedValue.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/hook/useSharedValue.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/hook/utils.d.ts +2 -2
- package/lib/types/{lib/reanimated2 → reanimated2}/index.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/interpolateColor.d.ts +5 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/interpolation.d.ts +1 -4
- package/lib/types/{lib/reanimated2 → reanimated2}/jestUtils.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/js-reanimated/JSReanimated.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/js-reanimated/Mapper.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/js-reanimated/MapperRegistry.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/js-reanimated/MutableValue.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/js-reanimated/commonTypes.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/js-reanimated/index.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/LayoutAnimationRepository.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/animationBuilder/BaseAnimationBuilder.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/animationBuilder/ComplexAnimationBuilder.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/animationBuilder/Keyframe.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/animationBuilder/commonTypes.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/animationBuilder/index.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Bounce.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Default.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Fade.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Flip.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Lightspeed.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Pinwheel.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Roll.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Rotate.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Slide.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Stretch.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Zoom.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/index.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultTransitions/CurvedTransition.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultTransitions/EntryExitTransition.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultTransitions/FadingTransition.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultTransitions/JumpingTransition.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultTransitions/LinearTransition.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultTransitions/SequencedTransition.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultTransitions/index.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/index.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/mock.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/platform-specific/RNRenderer.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/platform-specific/RNRenderer.web.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/utils.d.ts +0 -0
- package/lib/types/{lib/setAndForwardRef.d.ts → setAndForwardRef.d.ts} +0 -0
- package/package.json +7 -5
- package/plugin.js +4 -1
- package/src/Animated.js +0 -4
- package/src/createAnimatedComponent.tsx +37 -197
- package/src/reanimated2/Easing.ts +0 -53
- package/src/reanimated2/NativeMethods.ts +39 -7
- package/src/reanimated2/UpdateProps.ts +38 -19
- package/src/reanimated2/commonTypes.ts +4 -1
- package/src/reanimated2/component/FlatList.tsx +8 -5
- package/src/reanimated2/core.ts +7 -1
- package/src/reanimated2/fabricUtils.ts +27 -0
- package/src/reanimated2/globals.d.ts +17 -1
- package/src/reanimated2/hook/commonTypes.ts +4 -2
- package/src/reanimated2/hook/index.ts +1 -1
- package/src/reanimated2/hook/useAnimatedGestureHandler.ts +2 -2
- package/src/reanimated2/hook/useAnimatedRef.ts +8 -3
- package/src/reanimated2/hook/useAnimatedScrollHandler.ts +2 -2
- package/src/reanimated2/hook/utils.ts +2 -11
- package/src/reanimated2/interpolateColor.ts +6 -2
- package/src/reanimated2/interpolation.ts +1 -26
- package/src/reanimated2/js-reanimated/index.ts +5 -0
- 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-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/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/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/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/types/react-native-reanimated-tests.d.ts +0 -1
- 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
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
#import <RNReanimated/RCTConvert+REATransition.h>
|
|
2
|
-
|
|
3
|
-
@implementation RCTConvert (REATransition)
|
|
4
|
-
|
|
5
|
-
RCT_ENUM_CONVERTER(
|
|
6
|
-
REATransitionType,
|
|
7
|
-
(@{
|
|
8
|
-
@"none" : @(REATransitionTypeNone),
|
|
9
|
-
@"group" : @(REATransitionTypeGroup),
|
|
10
|
-
@"in" : @(REATransitionTypeIn),
|
|
11
|
-
@"out" : @(REATransitionTypeOut),
|
|
12
|
-
@"change" : @(REATransitionTypeChange),
|
|
13
|
-
}),
|
|
14
|
-
REATransitionTypeNone,
|
|
15
|
-
integerValue)
|
|
16
|
-
|
|
17
|
-
RCT_ENUM_CONVERTER(
|
|
18
|
-
REATransitionAnimationType,
|
|
19
|
-
(@{
|
|
20
|
-
@"none" : @(REATransitionAnimationTypeNone),
|
|
21
|
-
@"fade" : @(REATransitionAnimationTypeFade),
|
|
22
|
-
@"scale" : @(REATransitionAnimationTypeScale),
|
|
23
|
-
@"slide-top" : @(REATransitionAnimationTypeSlideTop),
|
|
24
|
-
@"slide-bottom" : @(REATransitionAnimationTypeSlideBottom),
|
|
25
|
-
@"slide-right" : @(REATransitionAnimationTypeSlideRight),
|
|
26
|
-
@"slide-left" : @(REATransitionAnimationTypeSlideLeft)
|
|
27
|
-
}),
|
|
28
|
-
REATransitionAnimationTypeNone,
|
|
29
|
-
integerValue)
|
|
30
|
-
|
|
31
|
-
RCT_ENUM_CONVERTER(
|
|
32
|
-
REATransitionInterpolationType,
|
|
33
|
-
(@{
|
|
34
|
-
@"linear" : @(REATransitionInterpolationLinear),
|
|
35
|
-
@"easeIn" : @(REATransitionInterpolationEaseIn),
|
|
36
|
-
@"easeOut" : @(REATransitionInterpolationEaseOut),
|
|
37
|
-
@"easeInOut" : @(REATransitionInterpolationEaseInOut),
|
|
38
|
-
}),
|
|
39
|
-
REATransitionInterpolationLinear,
|
|
40
|
-
integerValue)
|
|
41
|
-
|
|
42
|
-
RCT_ENUM_CONVERTER(
|
|
43
|
-
REATransitionPropagationType,
|
|
44
|
-
(@{
|
|
45
|
-
@"none" : @(REATransitionPropagationNone),
|
|
46
|
-
@"top" : @(REATransitionPropagationTop),
|
|
47
|
-
@"bottom" : @(REATransitionPropagationBottom),
|
|
48
|
-
@"left" : @(REATransitionPropagationLeft),
|
|
49
|
-
@"right" : @(REATransitionPropagationRight)
|
|
50
|
-
}),
|
|
51
|
-
REATransitionPropagationNone,
|
|
52
|
-
integerValue)
|
|
53
|
-
@end
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
#import <RNReanimated/REATransition.h>
|
|
2
|
-
|
|
3
|
-
@interface REATransitionGroup : REATransition
|
|
4
|
-
@property (nonatomic) BOOL sequence;
|
|
5
|
-
@property (nonatomic) NSArray *transitions;
|
|
6
|
-
- (instancetype)initWithConfig:(NSDictionary *)config;
|
|
7
|
-
@end
|
|
8
|
-
|
|
9
|
-
@interface REAVisibilityTransition : REATransition
|
|
10
|
-
@property (nonatomic) REATransitionAnimationType animationType;
|
|
11
|
-
- (REATransitionAnimation *)appearView:(UIView *)view inParent:(UIView *)parent;
|
|
12
|
-
- (REATransitionAnimation *)disappearView:(UIView *)view fromParent:(UIView *)parent;
|
|
13
|
-
- (instancetype)initWithConfig:(NSDictionary *)config;
|
|
14
|
-
@end
|
|
15
|
-
|
|
16
|
-
@interface REAInTransition : REAVisibilityTransition
|
|
17
|
-
- (instancetype)initWithConfig:(NSDictionary *)config;
|
|
18
|
-
@end
|
|
19
|
-
|
|
20
|
-
@interface REAOutTransition : REAVisibilityTransition
|
|
21
|
-
- (instancetype)initWithConfig:(NSDictionary *)config;
|
|
22
|
-
@end
|
|
23
|
-
|
|
24
|
-
@interface REAChangeTransition : REATransition
|
|
25
|
-
- (instancetype)initWithConfig:(NSDictionary *)config;
|
|
26
|
-
@end
|
|
@@ -1,296 +0,0 @@
|
|
|
1
|
-
#import <RNReanimated/RCTConvert+REATransition.h>
|
|
2
|
-
#import <RNReanimated/REAAllTransitions.h>
|
|
3
|
-
#import <React/RCTViewManager.h>
|
|
4
|
-
|
|
5
|
-
@interface REASnapshotRemover : NSObject <CAAnimationDelegate>
|
|
6
|
-
@end
|
|
7
|
-
|
|
8
|
-
@implementation REASnapshotRemover {
|
|
9
|
-
UIView *_view;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
- (instancetype)initWithView:(UIView *)view;
|
|
13
|
-
{
|
|
14
|
-
self = [super init];
|
|
15
|
-
if (self) {
|
|
16
|
-
_view = view;
|
|
17
|
-
}
|
|
18
|
-
return self;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
- (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag
|
|
22
|
-
{
|
|
23
|
-
[_view removeFromSuperview];
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
@end
|
|
27
|
-
|
|
28
|
-
@implementation REATransitionGroup
|
|
29
|
-
|
|
30
|
-
- (instancetype)initWithConfig:(NSDictionary *)config
|
|
31
|
-
{
|
|
32
|
-
if (self = [super initWithConfig:config]) {
|
|
33
|
-
_sequence = [RCTConvert BOOL:config[@"sequence"]];
|
|
34
|
-
NSArray *transitions = [RCTConvert NSArray:config[@"transitions"]];
|
|
35
|
-
NSMutableArray<REATransition *> *inflated = [NSMutableArray new];
|
|
36
|
-
for (NSDictionary *transitionConfig in transitions) {
|
|
37
|
-
[inflated addObject:[REATransition inflate:transitionConfig]];
|
|
38
|
-
inflated.lastObject.parent = self;
|
|
39
|
-
}
|
|
40
|
-
_transitions = inflated;
|
|
41
|
-
}
|
|
42
|
-
return self;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
- (instancetype)init
|
|
46
|
-
{
|
|
47
|
-
if (self = [super init]) {
|
|
48
|
-
_transitions = [NSMutableArray new];
|
|
49
|
-
}
|
|
50
|
-
return self;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
- (NSArray<REATransitionAnimation *> *)
|
|
54
|
-
animationsForTransitioning:(NSMutableDictionary<NSNumber *, REATransitionValues *> *)startValues
|
|
55
|
-
endValues:(NSMutableDictionary<NSNumber *, REATransitionValues *> *)endValues
|
|
56
|
-
forRoot:(UIView *)root
|
|
57
|
-
{
|
|
58
|
-
CFTimeInterval delay = self.delay;
|
|
59
|
-
NSMutableArray *animations = [NSMutableArray new];
|
|
60
|
-
for (REATransition *transition in _transitions) {
|
|
61
|
-
NSArray *subanims = [transition animationsForTransitioning:startValues endValues:endValues forRoot:root];
|
|
62
|
-
CFTimeInterval finishTime = CACurrentMediaTime();
|
|
63
|
-
for (REATransitionAnimation *anim in subanims) {
|
|
64
|
-
[anim delayBy:delay];
|
|
65
|
-
finishTime = MAX(finishTime, anim.finishTime);
|
|
66
|
-
}
|
|
67
|
-
[animations addObjectsFromArray:subanims];
|
|
68
|
-
if (_sequence) {
|
|
69
|
-
delay = finishTime - CACurrentMediaTime();
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
return animations;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
@end
|
|
76
|
-
|
|
77
|
-
@implementation REAVisibilityTransition
|
|
78
|
-
|
|
79
|
-
- (instancetype)initWithConfig:(NSDictionary *)config
|
|
80
|
-
{
|
|
81
|
-
if (self = [super initWithConfig:config]) {
|
|
82
|
-
_animationType = [RCTConvert REATransitionAnimationType:config[@"animation"]];
|
|
83
|
-
}
|
|
84
|
-
return self;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
- (REATransitionAnimation *)appearView:(UIView *)view inParent:(UIView *)parent forRoot:(UIView *)root
|
|
88
|
-
{
|
|
89
|
-
return nil;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
- (REATransitionAnimation *)disappearView:(UIView *)view fromParent:(UIView *)parent forRoot:(UIView *)root
|
|
93
|
-
{
|
|
94
|
-
return nil;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
- (REATransitionAnimation *)animationForTransitioning:(REATransitionValues *)startValues
|
|
98
|
-
endValues:(REATransitionValues *)endValues
|
|
99
|
-
forRoot:(UIView *)root
|
|
100
|
-
{
|
|
101
|
-
BOOL isViewAppearing = (startValues == nil);
|
|
102
|
-
if (isViewAppearing && !IS_LAYOUT_ONLY(endValues.view)) {
|
|
103
|
-
NSNumber *parentKey = endValues.reactParent.reactTag;
|
|
104
|
-
REATransitionValues *parentStartValues = [self findStartValuesForKey:parentKey];
|
|
105
|
-
REATransitionValues *parentEndValues = [self findEndValuesForKey:parentKey];
|
|
106
|
-
BOOL isParentAppearing = (parentStartValues == nil && parentEndValues != nil);
|
|
107
|
-
if (!isParentAppearing) {
|
|
108
|
-
return [self appearView:endValues.view inParent:endValues.parent forRoot:root];
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
if (endValues == nil && !IS_LAYOUT_ONLY(startValues.view) && startValues.reactParent.window != nil) {
|
|
113
|
-
startValues.view.center = startValues.centerInReactParent;
|
|
114
|
-
return [self disappearView:startValues.view fromParent:startValues.reactParent forRoot:root];
|
|
115
|
-
}
|
|
116
|
-
return nil;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
@end
|
|
120
|
-
|
|
121
|
-
@implementation REAInTransition
|
|
122
|
-
- (instancetype)initWithConfig:(NSDictionary *)config
|
|
123
|
-
{
|
|
124
|
-
if (self = [super initWithConfig:config]) {
|
|
125
|
-
}
|
|
126
|
-
return self;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
- (REATransitionAnimation *)appearView:(UIView *)view inParent:(UIView *)parent forRoot:(UIView *)root
|
|
130
|
-
{
|
|
131
|
-
CABasicAnimation *animation;
|
|
132
|
-
switch (self.animationType) {
|
|
133
|
-
case REATransitionAnimationTypeNone:
|
|
134
|
-
return nil;
|
|
135
|
-
case REATransitionAnimationTypeFade: {
|
|
136
|
-
CGFloat finalOpacity = view.layer.opacity;
|
|
137
|
-
animation = [CABasicAnimation animationWithKeyPath:@"opacity"];
|
|
138
|
-
animation.fromValue = @(0.0f);
|
|
139
|
-
animation.toValue = @(finalOpacity);
|
|
140
|
-
break;
|
|
141
|
-
}
|
|
142
|
-
case REATransitionAnimationTypeScale: {
|
|
143
|
-
CATransform3D finalTransform = view.layer.transform;
|
|
144
|
-
animation = [CABasicAnimation animationWithKeyPath:@"transform"];
|
|
145
|
-
animation.fromValue = [NSValue valueWithCATransform3D:CATransform3DMakeScale(0.0, 0.0, 0)];
|
|
146
|
-
animation.toValue = [NSValue valueWithCATransform3D:finalTransform];
|
|
147
|
-
break;
|
|
148
|
-
}
|
|
149
|
-
case REATransitionAnimationTypeSlideTop:
|
|
150
|
-
case REATransitionAnimationTypeSlideBottom:
|
|
151
|
-
case REATransitionAnimationTypeSlideLeft:
|
|
152
|
-
case REATransitionAnimationTypeSlideRight: {
|
|
153
|
-
CGPoint finalPosition = view.layer.position;
|
|
154
|
-
CGPoint startPosition = finalPosition;
|
|
155
|
-
switch (self.animationType) {
|
|
156
|
-
case REATransitionAnimationTypeSlideTop:
|
|
157
|
-
startPosition.y -= root.frame.size.height;
|
|
158
|
-
break;
|
|
159
|
-
case REATransitionAnimationTypeSlideBottom:
|
|
160
|
-
startPosition.y += root.frame.size.height;
|
|
161
|
-
break;
|
|
162
|
-
case REATransitionAnimationTypeSlideLeft:
|
|
163
|
-
startPosition.x -= root.frame.size.width;
|
|
164
|
-
break;
|
|
165
|
-
case REATransitionAnimationTypeSlideRight:
|
|
166
|
-
startPosition.x += root.frame.size.width;
|
|
167
|
-
break;
|
|
168
|
-
}
|
|
169
|
-
animation = [CABasicAnimation animationWithKeyPath:@"position"];
|
|
170
|
-
animation.fromValue = @(startPosition);
|
|
171
|
-
animation.toValue = @(finalPosition);
|
|
172
|
-
break;
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
animation.fillMode = kCAFillModeBackwards;
|
|
176
|
-
|
|
177
|
-
return [REATransitionAnimation transitionWithAnimation:animation layer:view.layer andKeyPath:animation.keyPath];
|
|
178
|
-
}
|
|
179
|
-
@end
|
|
180
|
-
|
|
181
|
-
@implementation REAOutTransition
|
|
182
|
-
- (instancetype)initWithConfig:(NSDictionary *)config
|
|
183
|
-
{
|
|
184
|
-
if (self = [super initWithConfig:config]) {
|
|
185
|
-
}
|
|
186
|
-
return self;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
- (REATransitionAnimation *)disappearView:(UIView *)view fromParent:(UIView *)parent forRoot:(UIView *)root
|
|
190
|
-
{
|
|
191
|
-
if (self.animationType == REATransitionAnimationTypeNone) {
|
|
192
|
-
return nil;
|
|
193
|
-
}
|
|
194
|
-
// Add view back to parent temporarily in order to take snapshot
|
|
195
|
-
[parent addSubview:view];
|
|
196
|
-
UIView *snapshotView = [view snapshotViewAfterScreenUpdates:NO];
|
|
197
|
-
[view removeFromSuperview];
|
|
198
|
-
snapshotView.frame = view.frame;
|
|
199
|
-
[parent addSubview:snapshotView];
|
|
200
|
-
CALayer *snapshot = snapshotView.layer;
|
|
201
|
-
|
|
202
|
-
CABasicAnimation *animation;
|
|
203
|
-
switch (self.animationType) {
|
|
204
|
-
case REATransitionAnimationTypeFade: {
|
|
205
|
-
CGFloat fromValue = snapshot.opacity;
|
|
206
|
-
snapshot.opacity = 0.0f;
|
|
207
|
-
animation = [CABasicAnimation animationWithKeyPath:@"opacity"];
|
|
208
|
-
animation.fromValue = @(fromValue);
|
|
209
|
-
animation.toValue = @(0.0f);
|
|
210
|
-
break;
|
|
211
|
-
}
|
|
212
|
-
case REATransitionAnimationTypeScale: {
|
|
213
|
-
CATransform3D fromValue = snapshot.transform;
|
|
214
|
-
snapshot.transform = CATransform3DMakeScale(0.001, 0.001, 0.001);
|
|
215
|
-
animation = [CABasicAnimation animationWithKeyPath:@"transform"];
|
|
216
|
-
animation.fromValue = [NSValue valueWithCATransform3D:fromValue];
|
|
217
|
-
animation.toValue = [NSValue valueWithCATransform3D:CATransform3DMakeScale(0.001, 0.001, 0.001)];
|
|
218
|
-
break;
|
|
219
|
-
}
|
|
220
|
-
case REATransitionAnimationTypeSlideTop:
|
|
221
|
-
case REATransitionAnimationTypeSlideBottom:
|
|
222
|
-
case REATransitionAnimationTypeSlideLeft:
|
|
223
|
-
case REATransitionAnimationTypeSlideRight: {
|
|
224
|
-
CGPoint startPosition = snapshot.position;
|
|
225
|
-
CGPoint finalPosition = startPosition;
|
|
226
|
-
switch (self.animationType) {
|
|
227
|
-
case REATransitionAnimationTypeSlideTop:
|
|
228
|
-
finalPosition.y -= root.frame.size.height;
|
|
229
|
-
break;
|
|
230
|
-
case REATransitionAnimationTypeSlideBottom:
|
|
231
|
-
finalPosition.y += root.frame.size.height;
|
|
232
|
-
break;
|
|
233
|
-
case REATransitionAnimationTypeSlideLeft:
|
|
234
|
-
finalPosition.x -= root.frame.size.width;
|
|
235
|
-
break;
|
|
236
|
-
case REATransitionAnimationTypeSlideRight:
|
|
237
|
-
finalPosition.x += root.frame.size.width;
|
|
238
|
-
break;
|
|
239
|
-
}
|
|
240
|
-
snapshot.position = finalPosition;
|
|
241
|
-
animation = [CABasicAnimation animationWithKeyPath:@"position"];
|
|
242
|
-
animation.fromValue = @(startPosition);
|
|
243
|
-
animation.toValue = @(finalPosition);
|
|
244
|
-
break;
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
animation.fillMode = kCAFillModeBackwards;
|
|
248
|
-
animation.delegate = [[REASnapshotRemover alloc] initWithView:snapshotView];
|
|
249
|
-
|
|
250
|
-
return [REATransitionAnimation transitionWithAnimation:animation layer:snapshot andKeyPath:animation.keyPath];
|
|
251
|
-
}
|
|
252
|
-
@end
|
|
253
|
-
|
|
254
|
-
@implementation REAChangeTransition
|
|
255
|
-
|
|
256
|
-
- (REATransitionAnimation *)animationForTransitioning:(REATransitionValues *)startValues
|
|
257
|
-
endValues:(REATransitionValues *)endValues
|
|
258
|
-
forRoot:(UIView *)root
|
|
259
|
-
{
|
|
260
|
-
if (startValues == nil || endValues == nil || endValues.view.window == nil) {
|
|
261
|
-
return nil;
|
|
262
|
-
}
|
|
263
|
-
BOOL animatePosition = !CGPointEqualToPoint(startValues.center, endValues.center);
|
|
264
|
-
BOOL animateBounds = !CGRectEqualToRect(startValues.bounds, endValues.bounds);
|
|
265
|
-
|
|
266
|
-
if (!animatePosition && !animateBounds) {
|
|
267
|
-
return nil;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
CALayer *layer = endValues.view.layer;
|
|
271
|
-
|
|
272
|
-
CAAnimationGroup *group = [CAAnimationGroup animation];
|
|
273
|
-
group.fillMode = kCAFillModeBackwards;
|
|
274
|
-
|
|
275
|
-
NSMutableArray *animations = [NSMutableArray new];
|
|
276
|
-
|
|
277
|
-
if (animatePosition) {
|
|
278
|
-
CGPoint fromValue = layer.presentationLayer.position;
|
|
279
|
-
CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"position"];
|
|
280
|
-
animation.fromValue = [NSValue valueWithCGPoint:fromValue];
|
|
281
|
-
animation.toValue = [NSValue valueWithCGPoint:endValues.center];
|
|
282
|
-
[animations addObject:animation];
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
if (animateBounds) {
|
|
286
|
-
CGRect fromValue = layer.presentationLayer.bounds;
|
|
287
|
-
CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"bounds"];
|
|
288
|
-
animation.fromValue = [NSValue valueWithCGRect:fromValue];
|
|
289
|
-
animation.toValue = [NSValue valueWithCGRect:endValues.bounds];
|
|
290
|
-
[animations addObject:animation];
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
group.animations = animations;
|
|
294
|
-
return [REATransitionAnimation transitionWithAnimation:group layer:layer andKeyPath:nil];
|
|
295
|
-
}
|
|
296
|
-
@end
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
#import <QuartzCore/QuartzCore.h>
|
|
2
|
-
#import <RNReanimated/REATransitionAnimation.h>
|
|
3
|
-
#import <RNReanimated/REATransitionValues.h>
|
|
4
|
-
#import <React/RCTView.h>
|
|
5
|
-
#import <UIKit/UIKit.h>
|
|
6
|
-
|
|
7
|
-
// TODO: fix below implementation
|
|
8
|
-
#define IS_LAYOUT_ONLY(view) ([view isKindOfClass:[RCTView class]] && view.backgroundColor == nil)
|
|
9
|
-
|
|
10
|
-
typedef NS_ENUM(NSInteger, REATransitionType) {
|
|
11
|
-
REATransitionTypeNone = 0,
|
|
12
|
-
REATransitionTypeGroup,
|
|
13
|
-
REATransitionTypeIn,
|
|
14
|
-
REATransitionTypeOut,
|
|
15
|
-
REATransitionTypeChange
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
typedef NS_ENUM(NSInteger, REATransitionAnimationType) {
|
|
19
|
-
REATransitionAnimationTypeNone = 0,
|
|
20
|
-
REATransitionAnimationTypeFade,
|
|
21
|
-
REATransitionAnimationTypeScale,
|
|
22
|
-
REATransitionAnimationTypeSlideTop,
|
|
23
|
-
REATransitionAnimationTypeSlideBottom,
|
|
24
|
-
REATransitionAnimationTypeSlideRight,
|
|
25
|
-
REATransitionAnimationTypeSlideLeft,
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
typedef NS_ENUM(NSInteger, REATransitionInterpolationType) {
|
|
29
|
-
REATransitionInterpolationLinear = 0,
|
|
30
|
-
REATransitionInterpolationEaseIn,
|
|
31
|
-
REATransitionInterpolationEaseOut,
|
|
32
|
-
REATransitionInterpolationEaseInOut,
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
typedef NS_ENUM(NSInteger, REATransitionPropagationType) {
|
|
36
|
-
REATransitionPropagationNone = 0,
|
|
37
|
-
REATransitionPropagationTop,
|
|
38
|
-
REATransitionPropagationBottom,
|
|
39
|
-
REATransitionPropagationLeft,
|
|
40
|
-
REATransitionPropagationRight,
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
@interface REATransition : NSObject
|
|
44
|
-
@property (nonatomic, weak) REATransition *parent;
|
|
45
|
-
@property (nonatomic) CFTimeInterval duration;
|
|
46
|
-
@property (nonatomic) CFTimeInterval delay;
|
|
47
|
-
@property (nonatomic) REATransitionInterpolationType interpolation;
|
|
48
|
-
@property (nonatomic) REATransitionPropagationType propagation;
|
|
49
|
-
- (instancetype)initWithConfig:(NSDictionary *)config;
|
|
50
|
-
- (CAMediaTimingFunction *)mediaTiming;
|
|
51
|
-
- (void)startCaptureInRoot:(UIView *)root;
|
|
52
|
-
- (void)playInRoot:(UIView *)root;
|
|
53
|
-
- (REATransitionValues *)findStartValuesForKey:(NSNumber *)key;
|
|
54
|
-
- (REATransitionValues *)findEndValuesForKey:(NSNumber *)key;
|
|
55
|
-
- (REATransitionAnimation *)animationForTransitioning:(REATransitionValues *)startValues
|
|
56
|
-
endValues:(REATransitionValues *)endValues
|
|
57
|
-
forRoot:(UIView *)root;
|
|
58
|
-
- (NSArray<REATransitionAnimation *> *)
|
|
59
|
-
animationsForTransitioning:(NSMutableDictionary<NSNumber *, REATransitionValues *> *)startValues
|
|
60
|
-
endValues:(NSMutableDictionary<NSNumber *, REATransitionValues *> *)endValues
|
|
61
|
-
forRoot:(UIView *)root;
|
|
62
|
-
|
|
63
|
-
+ (REATransition *)inflate:(NSDictionary *)config;
|
|
64
|
-
@end
|
|
@@ -1,210 +0,0 @@
|
|
|
1
|
-
#import <QuartzCore/QuartzCore.h>
|
|
2
|
-
#import <RNReanimated/RCTConvert+REATransition.h>
|
|
3
|
-
#import <RNReanimated/REATransition.h>
|
|
4
|
-
#import <RNReanimated/REATransitionValues.h>
|
|
5
|
-
#import <React/RCTConvert.h>
|
|
6
|
-
#import <React/RCTViewManager.h>
|
|
7
|
-
#import <UIKit/UIKit.h>
|
|
8
|
-
|
|
9
|
-
#define DEFAULT_PROPAGATION_SPEED 3
|
|
10
|
-
|
|
11
|
-
@interface REATransitionGroup : REATransition
|
|
12
|
-
@property (nonatomic) BOOL sequence;
|
|
13
|
-
@property (nonatomic) NSArray *transitions;
|
|
14
|
-
- (instancetype)initWithConfig:(NSDictionary *)config;
|
|
15
|
-
@end
|
|
16
|
-
|
|
17
|
-
@interface REAVisibilityTransition : REATransition
|
|
18
|
-
@property (nonatomic) REATransitionAnimationType animationType;
|
|
19
|
-
- (REATransitionAnimation *)appearView:(UIView *)view inParent:(UIView *)parent;
|
|
20
|
-
- (REATransitionAnimation *)disappearView:(UIView *)view fromParent:(UIView *)parent;
|
|
21
|
-
- (instancetype)initWithConfig:(NSDictionary *)config;
|
|
22
|
-
@end
|
|
23
|
-
|
|
24
|
-
@interface REAInTransition : REAVisibilityTransition
|
|
25
|
-
- (instancetype)initWithConfig:(NSDictionary *)config;
|
|
26
|
-
@end
|
|
27
|
-
|
|
28
|
-
@interface REAOutTransition : REAVisibilityTransition
|
|
29
|
-
- (instancetype)initWithConfig:(NSDictionary *)config;
|
|
30
|
-
@end
|
|
31
|
-
|
|
32
|
-
@interface REAChangeTransition : REATransition
|
|
33
|
-
- (instancetype)initWithConfig:(NSDictionary *)config;
|
|
34
|
-
@end
|
|
35
|
-
|
|
36
|
-
@implementation REATransition {
|
|
37
|
-
__weak UIView *_root;
|
|
38
|
-
NSMutableDictionary<NSNumber *, REATransitionValues *> *_startValues;
|
|
39
|
-
NSMutableDictionary<NSNumber *, REATransitionValues *> *_endValues;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
+ (REATransition *)inflate:(NSDictionary *)config
|
|
43
|
-
{
|
|
44
|
-
REATransitionType type = [RCTConvert REATransitionType:config[@"type"]];
|
|
45
|
-
switch (type) {
|
|
46
|
-
case REATransitionTypeGroup:
|
|
47
|
-
return [[REATransitionGroup alloc] initWithConfig:config];
|
|
48
|
-
case REATransitionTypeIn:
|
|
49
|
-
return [[REAInTransition alloc] initWithConfig:config];
|
|
50
|
-
case REATransitionTypeOut:
|
|
51
|
-
return [[REAOutTransition alloc] initWithConfig:config];
|
|
52
|
-
case REATransitionTypeChange:
|
|
53
|
-
return [[REAChangeTransition alloc] initWithConfig:config];
|
|
54
|
-
case REATransitionTypeNone:
|
|
55
|
-
default:
|
|
56
|
-
RCTLogError(@"Invalid transitioning type %@", config[@"type"]);
|
|
57
|
-
}
|
|
58
|
-
return nil;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
- (instancetype)initWithConfig:(NSDictionary *)config
|
|
62
|
-
{
|
|
63
|
-
if (self = [super init]) {
|
|
64
|
-
_duration = [RCTConvert double:config[@"durationMs"]] / 1000.0;
|
|
65
|
-
_delay = [RCTConvert double:config[@"delayMs"]] / 1000.0;
|
|
66
|
-
_interpolation = [RCTConvert REATransitionInterpolationType:config[@"interpolation"]];
|
|
67
|
-
_propagation = [RCTConvert REATransitionPropagationType:config[@"propagation"]];
|
|
68
|
-
}
|
|
69
|
-
return self;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
- (void)captureRecursiveIn:(UIView *)view
|
|
73
|
-
to:(NSMutableDictionary<NSNumber *, REATransitionValues *> *)map
|
|
74
|
-
forRoot:(UIView *)root
|
|
75
|
-
{
|
|
76
|
-
NSNumber *tag = view.reactTag;
|
|
77
|
-
if (tag != nil) {
|
|
78
|
-
map[tag] = [[REATransitionValues alloc] initWithView:view forRoot:root];
|
|
79
|
-
for (UIView *subview in view.reactSubviews) {
|
|
80
|
-
[self captureRecursiveIn:subview to:map forRoot:root];
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
- (void)startCaptureInRoot:(UIView *)root
|
|
86
|
-
{
|
|
87
|
-
_startValues = [NSMutableDictionary new];
|
|
88
|
-
[self captureRecursiveIn:root to:_startValues forRoot:root];
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
- (void)playInRoot:(UIView *)root
|
|
92
|
-
{
|
|
93
|
-
_endValues = [NSMutableDictionary new];
|
|
94
|
-
[self captureRecursiveIn:root to:_endValues forRoot:root];
|
|
95
|
-
NSArray *animations = [self animationsForTransitioning:_startValues endValues:_endValues forRoot:root];
|
|
96
|
-
for (REATransitionAnimation *animation in animations) {
|
|
97
|
-
[animation play];
|
|
98
|
-
}
|
|
99
|
-
_startValues = nil;
|
|
100
|
-
_endValues = nil;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
- (REATransitionValues *)findStartValuesForKey:(NSNumber *)key
|
|
104
|
-
{
|
|
105
|
-
if (_parent != nil) {
|
|
106
|
-
return [_parent findStartValuesForKey:key];
|
|
107
|
-
}
|
|
108
|
-
return _startValues[key];
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
- (REATransitionValues *)findEndValuesForKey:(NSNumber *)key
|
|
112
|
-
{
|
|
113
|
-
if (_parent != nil) {
|
|
114
|
-
return [_parent findEndValuesForKey:key];
|
|
115
|
-
}
|
|
116
|
-
return _endValues[key];
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
- (CFTimeInterval)propagationDelayForTransitioning:(REATransitionValues *)startValues
|
|
120
|
-
endValues:(REATransitionValues *)endValues
|
|
121
|
-
forRoot:(UIView *)root
|
|
122
|
-
{
|
|
123
|
-
if (self.propagation == REATransitionPropagationNone) {
|
|
124
|
-
return 0.;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
REATransitionValues *values = endValues;
|
|
128
|
-
if (values == nil) {
|
|
129
|
-
values = startValues;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
double fraction = 0.;
|
|
133
|
-
switch (self.propagation) {
|
|
134
|
-
case REATransitionPropagationLeft:
|
|
135
|
-
fraction = values.centerRelativeToRoot.x / root.layer.bounds.size.width;
|
|
136
|
-
break;
|
|
137
|
-
case REATransitionPropagationRight:
|
|
138
|
-
fraction = 1. - values.centerRelativeToRoot.x / root.layer.bounds.size.width;
|
|
139
|
-
break;
|
|
140
|
-
case REATransitionPropagationTop:
|
|
141
|
-
fraction = values.centerRelativeToRoot.y / root.layer.bounds.size.height;
|
|
142
|
-
break;
|
|
143
|
-
case REATransitionPropagationBottom:
|
|
144
|
-
fraction = 1. - values.centerRelativeToRoot.y / root.layer.bounds.size.height;
|
|
145
|
-
break;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
return _duration * MIN(MAX(0., fraction), 1.) / DEFAULT_PROPAGATION_SPEED;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
- (CAMediaTimingFunction *)mediaTiming
|
|
152
|
-
{
|
|
153
|
-
switch (self.interpolation) {
|
|
154
|
-
case REATransitionInterpolationLinear:
|
|
155
|
-
return [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear];
|
|
156
|
-
case REATransitionInterpolationEaseIn:
|
|
157
|
-
return [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn];
|
|
158
|
-
case REATransitionInterpolationEaseOut:
|
|
159
|
-
return [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut];
|
|
160
|
-
case REATransitionInterpolationEaseInOut:
|
|
161
|
-
return [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
- (REATransitionAnimation *)animationForTransitioning:(REATransitionValues *)startValues
|
|
166
|
-
endValues:(REATransitionValues *)endValues
|
|
167
|
-
forRoot:(UIView *)root
|
|
168
|
-
{
|
|
169
|
-
return nil;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
- (NSArray<REATransitionAnimation *> *)
|
|
173
|
-
animationsForTransitioning:(NSMutableDictionary<NSNumber *, REATransitionValues *> *)startValues
|
|
174
|
-
endValues:(NSMutableDictionary<NSNumber *, REATransitionValues *> *)endValues
|
|
175
|
-
forRoot:(UIView *)root
|
|
176
|
-
{
|
|
177
|
-
NSMutableArray *animations = [NSMutableArray new];
|
|
178
|
-
[startValues enumerateKeysAndObjectsUsingBlock:^(NSNumber *key, REATransitionValues *startValue, BOOL *stop) {
|
|
179
|
-
REATransitionValues *endValue = endValues[key];
|
|
180
|
-
REATransitionAnimation *animation = [self animationForTransitioning:startValue endValues:endValue forRoot:root];
|
|
181
|
-
if (animation != nil) {
|
|
182
|
-
animation.animation.timingFunction = self.mediaTiming;
|
|
183
|
-
animation.animation.duration = self.duration;
|
|
184
|
-
[animation delayBy:self.delay];
|
|
185
|
-
CFTimeInterval propagationDelay = [self propagationDelayForTransitioning:startValue
|
|
186
|
-
endValues:endValue
|
|
187
|
-
forRoot:root];
|
|
188
|
-
[animation delayBy:propagationDelay];
|
|
189
|
-
// animation.animation.duration -= propagationDelay;
|
|
190
|
-
[animations addObject:animation];
|
|
191
|
-
}
|
|
192
|
-
}];
|
|
193
|
-
[endValues enumerateKeysAndObjectsUsingBlock:^(NSNumber *key, REATransitionValues *endValue, BOOL *stop) {
|
|
194
|
-
if (startValues[key] == nil) {
|
|
195
|
-
REATransitionAnimation *animation = [self animationForTransitioning:nil endValues:endValue forRoot:root];
|
|
196
|
-
if (animation != nil) {
|
|
197
|
-
animation.animation.timingFunction = self.mediaTiming;
|
|
198
|
-
animation.animation.duration = self.duration;
|
|
199
|
-
[animation delayBy:self.delay];
|
|
200
|
-
CFTimeInterval propagationDelay = [self propagationDelayForTransitioning:nil endValues:endValue forRoot:root];
|
|
201
|
-
[animation delayBy:propagationDelay];
|
|
202
|
-
// animation.animation.duration -= propagationDelay;
|
|
203
|
-
[animations addObject:animation];
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
}];
|
|
207
|
-
return animations;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
@end
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
#import <Foundation/Foundation.h>
|
|
2
|
-
|
|
3
|
-
@interface REATransitionAnimation : NSObject
|
|
4
|
-
|
|
5
|
-
@property (nonatomic) CAAnimation *animation;
|
|
6
|
-
@property (nonatomic) CALayer *layer;
|
|
7
|
-
@property (nonatomic) NSString *keyPath;
|
|
8
|
-
|
|
9
|
-
+ (REATransitionAnimation *)transitionWithAnimation:(CAAnimation *)animation
|
|
10
|
-
layer:(CALayer *)layer
|
|
11
|
-
andKeyPath:(NSString *)keyPath;
|
|
12
|
-
- (void)play;
|
|
13
|
-
- (void)delayBy:(CFTimeInterval)delay;
|
|
14
|
-
- (CFTimeInterval)finishTime;
|
|
15
|
-
- (CFTimeInterval)duration;
|
|
16
|
-
|
|
17
|
-
@end
|