react-native-reanimated 2.6.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 +20 -2
- package/Common/cpp/Tools/Mapper.cpp +23 -4
- package/Common/cpp/Tools/RuntimeDecorator.cpp +92 -46
- 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 +196 -41
- package/android/src/main/cpp/headers/NativeProxy.h +45 -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/AnimationsManager.java +13 -6
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/LayoutAnimations.java +2 -1
- package/android/src/{main → paper}/java/com/swmansion/reanimated/NativeProxy.java +26 -10
- 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/LayoutReanimation/REAAnimationsManager.h +1 -1
- package/ios/LayoutReanimation/REAAnimationsManager.m +2 -2
- package/ios/LayoutReanimation/REASnapshot.m +1 -1
- package/ios/LayoutReanimation/REAUIManager.h +1 -1
- package/ios/LayoutReanimation/REAUIManager.mm +4 -5
- package/ios/REAEventDispatcher.m +1 -2
- package/ios/REAModule.h +10 -1
- package/ios/REAModule.mm +284 -0
- package/ios/REANodesManager.h +27 -52
- package/ios/{REANodesManager.m → REANodesManager.mm} +92 -226
- package/ios/native/NativeMethods.h +1 -3
- package/ios/native/NativeMethods.mm +1 -1
- package/ios/native/NativeProxy.h +2 -2
- package/ios/native/NativeProxy.mm +162 -32
- package/ios/native/REAIOSErrorHandler.h +2 -4
- package/ios/native/REAIOSErrorHandler.mm +1 -1
- package/ios/native/REAIOSLogger.h +1 -3
- package/ios/native/REAIOSLogger.mm +1 -1
- package/ios/native/REAIOSScheduler.h +1 -3
- package/ios/native/REAIOSScheduler.mm +2 -2
- package/ios/native/REAInitializer.h +0 -7
- package/ios/native/REAInitializer.mm +14 -6
- package/ios/native/UIResponder+Reanimated.h +3 -1
- package/ios/native/UIResponder+Reanimated.mm +6 -4
- package/ios/sensor/ReanimatedSensor.h +1 -1
- package/ios/sensor/ReanimatedSensor.m +1 -1
- package/ios/sensor/ReanimatedSensorContainer.h +1 -1
- package/ios/sensor/ReanimatedSensorContainer.m +2 -2
- package/lib/Animated.js +0 -13
- package/lib/ConfigHelper.js +0 -1
- package/lib/createAnimatedComponent.js +30 -169
- package/lib/index.js +0 -13
- package/lib/reanimated2/Easing.js +8 -44
- package/lib/reanimated2/NativeMethods.js +20 -3
- package/lib/reanimated2/UpdateProps.js +25 -10
- package/lib/reanimated2/core.js +4 -37
- package/lib/reanimated2/fabricUtils.js +18 -0
- package/lib/reanimated2/globals.d.ts +18 -3
- 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 -2
- 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 +1 -3
- 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 +10 -10
- package/plugin.js +29 -33
- package/react-native-reanimated.d.ts +15 -3
- package/src/Animated.js +0 -13
- package/src/ConfigHelper.ts +0 -1
- package/src/createAnimatedComponent.tsx +37 -197
- package/src/reanimated2/Easing.ts +8 -55
- package/src/reanimated2/NativeMethods.ts +39 -7
- package/src/reanimated2/UpdateProps.ts +38 -19
- package/src/reanimated2/commonTypes.ts +4 -2
- package/src/reanimated2/component/FlatList.tsx +8 -5
- package/src/reanimated2/core.ts +7 -48
- package/src/reanimated2/fabricUtils.ts +27 -0
- package/src/reanimated2/globals.d.ts +18 -3
- 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/useAnimatedSensor.ts +1 -3
- 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 -104
- 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 -9
- 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 -115
- 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 -98
- 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 -28
- package/ios/Nodes/REATransformNode.h +0 -5
- package/ios/Nodes/REATransformNode.m +0 -36
- package/ios/Nodes/REAValueNode.h +0 -11
- package/ios/Nodes/REAValueNode.m +0 -26
- package/ios/REAModule.m +0 -185
- package/ios/Transitioning/RCTConvert+REATransition.h +0 -12
- package/ios/Transitioning/RCTConvert+REATransition.m +0 -53
- package/ios/Transitioning/REAAllTransitions.h +0 -26
- package/ios/Transitioning/REAAllTransitions.m +0 -297
- package/ios/Transitioning/REATransition.h +0 -65
- package/ios/Transitioning/REATransition.m +0 -211
- package/ios/Transitioning/REATransitionAnimation.h +0 -17
- package/ios/Transitioning/REATransitionAnimation.m +0 -80
- package/ios/Transitioning/REATransitionManager.h +0 -9
- package/ios/Transitioning/REATransitionManager.m +0 -62
- package/ios/Transitioning/REATransitionValues.h +0 -15
- package/ios/Transitioning/REATransitionValues.m +0 -26
- 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,29 +1,20 @@
|
|
|
1
|
-
#import
|
|
2
|
-
|
|
1
|
+
#import <RNReanimated/REAModule.h>
|
|
2
|
+
#import <RNReanimated/REANodesManager.h>
|
|
3
3
|
#import <React/RCTConvert.h>
|
|
4
4
|
|
|
5
|
-
#
|
|
5
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
6
|
+
#import <React/RCTComponentViewRegistry.h>
|
|
7
|
+
#import <React/RCTMountingManager.h>
|
|
8
|
+
#import <React/RCTSurfacePresenter.h>
|
|
9
|
+
#import <react/renderer/core/ShadowNode.h>
|
|
10
|
+
#import <react/renderer/uimanager/UIManager.h>
|
|
11
|
+
#else
|
|
6
12
|
#import <stdatomic.h>
|
|
7
|
-
#
|
|
8
|
-
|
|
9
|
-
#
|
|
10
|
-
|
|
11
|
-
#
|
|
12
|
-
#import "Nodes/REAConcatNode.h"
|
|
13
|
-
#import "Nodes/REACondNode.h"
|
|
14
|
-
#import "Nodes/READebugNode.h"
|
|
15
|
-
#import "Nodes/REAEventNode.h"
|
|
16
|
-
#import "Nodes/REAFunctionNode.h"
|
|
17
|
-
#import "Nodes/REAJSCallNode.h"
|
|
18
|
-
#import "Nodes/REANode.h"
|
|
19
|
-
#import "Nodes/REAOperatorNode.h"
|
|
20
|
-
#import "Nodes/REAParamNode.h"
|
|
21
|
-
#import "Nodes/REAPropsNode.h"
|
|
22
|
-
#import "Nodes/REASetNode.h"
|
|
23
|
-
#import "Nodes/REAStyleNode.h"
|
|
24
|
-
#import "Nodes/REATransformNode.h"
|
|
25
|
-
#import "Nodes/REAValueNode.h"
|
|
26
|
-
#import "REAModule.h"
|
|
13
|
+
#endif
|
|
14
|
+
|
|
15
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
16
|
+
using namespace facebook::react;
|
|
17
|
+
#endif
|
|
27
18
|
|
|
28
19
|
// Interface below has been added in order to use private methods of RCTUIManager,
|
|
29
20
|
// RCTUIManager#UpdateView is a React Method which is exported to JS but in
|
|
@@ -99,32 +90,53 @@
|
|
|
99
90
|
@end
|
|
100
91
|
|
|
101
92
|
@implementation REANodesManager {
|
|
102
|
-
NSMutableDictionary<REANodeID, REANode *> *_nodes;
|
|
103
|
-
NSMapTable<NSString *, REANode *> *_eventMapping;
|
|
104
|
-
NSMutableArray<id<RCTEvent>> *_eventQueue;
|
|
105
93
|
CADisplayLink *_displayLink;
|
|
106
|
-
REAUpdateContext *_updateContext;
|
|
107
94
|
BOOL _wantRunUpdates;
|
|
108
|
-
BOOL _processingDirectEvent;
|
|
109
95
|
NSMutableArray<REAOnAnimationCallback> *_onAnimationCallbacks;
|
|
110
|
-
NSMutableArray<REANativeAnimationOp> *_operationsInBatch;
|
|
111
96
|
BOOL _tryRunBatchUpdatesSynchronously;
|
|
112
97
|
REAEventHandler _eventHandler;
|
|
113
98
|
volatile void (^_mounting)(void);
|
|
114
99
|
NSMutableDictionary<NSNumber *, ComponentUpdate *> *_componentUpdateBuffer;
|
|
115
|
-
volatile atomic_bool _shouldFlushUpdateBuffer;
|
|
116
100
|
NSMutableDictionary<NSNumber *, UIView *> *_viewRegistry;
|
|
101
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
102
|
+
__weak RCTBridge *_bridge;
|
|
103
|
+
REAPerformOperations _performOperations;
|
|
104
|
+
__weak id<RCTSurfacePresenterStub> _surfacePresenter;
|
|
105
|
+
NSMutableDictionary<NSNumber *, NSMutableDictionary *> *_operationsInBatch;
|
|
106
|
+
#else
|
|
107
|
+
NSMutableArray<REANativeAnimationOp> *_operationsInBatch;
|
|
108
|
+
volatile atomic_bool _shouldFlushUpdateBuffer;
|
|
109
|
+
#endif
|
|
117
110
|
}
|
|
118
111
|
|
|
112
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
113
|
+
- (nonnull instancetype)initWithModule:(REAModule *)reanimatedModule
|
|
114
|
+
bridge:(RCTBridge *)bridge
|
|
115
|
+
surfacePresenter:(id<RCTSurfacePresenterStub>)surfacePresenter
|
|
116
|
+
{
|
|
117
|
+
if ((self = [super init])) {
|
|
118
|
+
_bridge = bridge;
|
|
119
|
+
_surfacePresenter = surfacePresenter;
|
|
120
|
+
_reanimatedModule = reanimatedModule;
|
|
121
|
+
_wantRunUpdates = NO;
|
|
122
|
+
_onAnimationCallbacks = [NSMutableArray new];
|
|
123
|
+
_operationsInBatch = [NSMutableDictionary new];
|
|
124
|
+
_componentUpdateBuffer = [NSMutableDictionary new];
|
|
125
|
+
_viewRegistry = [_uiManager valueForKey:@"_viewRegistry"];
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
_displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(onAnimationFrame:)];
|
|
129
|
+
_displayLink.preferredFramesPerSecond = 120; // will fallback to 60 fps for devices without Pro Motion display
|
|
130
|
+
[_displayLink addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes];
|
|
131
|
+
[_displayLink setPaused:true];
|
|
132
|
+
return self;
|
|
133
|
+
}
|
|
134
|
+
#else
|
|
119
135
|
- (instancetype)initWithModule:(REAModule *)reanimatedModule uiManager:(RCTUIManager *)uiManager
|
|
120
136
|
{
|
|
121
137
|
if ((self = [super init])) {
|
|
122
138
|
_reanimatedModule = reanimatedModule;
|
|
123
139
|
_uiManager = uiManager;
|
|
124
|
-
_nodes = [NSMutableDictionary new];
|
|
125
|
-
_eventMapping = [NSMapTable strongToWeakObjectsMapTable];
|
|
126
|
-
_eventQueue = [NSMutableArray new];
|
|
127
|
-
_updateContext = [REAUpdateContext new];
|
|
128
140
|
_wantRunUpdates = NO;
|
|
129
141
|
_onAnimationCallbacks = [NSMutableArray new];
|
|
130
142
|
_operationsInBatch = [NSMutableArray new];
|
|
@@ -139,6 +151,7 @@
|
|
|
139
151
|
[_displayLink setPaused:true];
|
|
140
152
|
return self;
|
|
141
153
|
}
|
|
154
|
+
#endif
|
|
142
155
|
|
|
143
156
|
- (void)invalidate
|
|
144
157
|
{
|
|
@@ -146,6 +159,13 @@
|
|
|
146
159
|
[_displayLink invalidate];
|
|
147
160
|
}
|
|
148
161
|
|
|
162
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
163
|
+
- (void)setSurfacePresenter:(id<RCTSurfacePresenterStub>)surfacePresenter
|
|
164
|
+
{
|
|
165
|
+
_surfacePresenter = surfacePresenter;
|
|
166
|
+
}
|
|
167
|
+
#endif
|
|
168
|
+
|
|
149
169
|
- (void)operationsBatchDidComplete
|
|
150
170
|
{
|
|
151
171
|
if (![_displayLink isPaused]) {
|
|
@@ -160,29 +180,23 @@
|
|
|
160
180
|
}
|
|
161
181
|
}
|
|
162
182
|
|
|
163
|
-
- (REANode *)findNodeByID:(REANodeID)nodeID
|
|
164
|
-
{
|
|
165
|
-
return _nodes[nodeID];
|
|
166
|
-
}
|
|
167
|
-
|
|
168
183
|
- (void)postOnAnimation:(REAOnAnimationCallback)clb
|
|
169
184
|
{
|
|
170
185
|
[_onAnimationCallbacks addObject:clb];
|
|
171
186
|
[self startUpdatingOnAnimationFrame];
|
|
172
187
|
}
|
|
173
188
|
|
|
174
|
-
- (void)
|
|
189
|
+
- (void)registerEventHandler:(REAEventHandler)eventHandler
|
|
175
190
|
{
|
|
176
|
-
|
|
177
|
-
if (!_processingDirectEvent) {
|
|
178
|
-
[self startUpdatingOnAnimationFrame];
|
|
179
|
-
}
|
|
191
|
+
_eventHandler = eventHandler;
|
|
180
192
|
}
|
|
181
193
|
|
|
182
|
-
|
|
194
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
195
|
+
- (void)registerPerformOperations:(REAPerformOperations)performOperations
|
|
183
196
|
{
|
|
184
|
-
|
|
197
|
+
_performOperations = performOperations;
|
|
185
198
|
}
|
|
199
|
+
#endif
|
|
186
200
|
|
|
187
201
|
- (void)startUpdatingOnAnimationFrame
|
|
188
202
|
{
|
|
@@ -207,13 +221,6 @@
|
|
|
207
221
|
{
|
|
208
222
|
_currentAnimationTimestamp = _displayLink.timestamp;
|
|
209
223
|
|
|
210
|
-
// We process all enqueued events first
|
|
211
|
-
for (NSUInteger i = 0; i < _eventQueue.count; i++) {
|
|
212
|
-
id<RCTEvent> event = _eventQueue[i];
|
|
213
|
-
[self processEvent:event];
|
|
214
|
-
}
|
|
215
|
-
[_eventQueue removeAllObjects];
|
|
216
|
-
|
|
217
224
|
NSArray<REAOnAnimationCallback> *callbacks = _onAnimationCallbacks;
|
|
218
225
|
_onAnimationCallbacks = [NSMutableArray new];
|
|
219
226
|
|
|
@@ -240,9 +247,10 @@
|
|
|
240
247
|
|
|
241
248
|
- (void)performOperations
|
|
242
249
|
{
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
250
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
251
|
+
_performOperations(); // calls NativeReanimatedModule::performOperations
|
|
252
|
+
_wantRunUpdates = NO;
|
|
253
|
+
#else
|
|
246
254
|
if (_operationsInBatch.count != 0) {
|
|
247
255
|
NSMutableArray<REANativeAnimationOp> *copiedOperationsQueue = _operationsInBatch;
|
|
248
256
|
_operationsInBatch = [NSMutableArray new];
|
|
@@ -250,7 +258,7 @@
|
|
|
250
258
|
BOOL trySynchronously = _tryRunBatchUpdatesSynchronously;
|
|
251
259
|
_tryRunBatchUpdatesSynchronously = NO;
|
|
252
260
|
|
|
253
|
-
__weak
|
|
261
|
+
__weak __typeof__(self) weakSelf = self;
|
|
254
262
|
dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
|
|
255
263
|
RCTExecuteOnUIManagerQueue(^{
|
|
256
264
|
__typeof__(self) strongSelf = weakSelf;
|
|
@@ -285,8 +293,12 @@
|
|
|
285
293
|
}
|
|
286
294
|
}
|
|
287
295
|
_wantRunUpdates = NO;
|
|
296
|
+
#endif
|
|
288
297
|
}
|
|
289
298
|
|
|
299
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
300
|
+
// nothing
|
|
301
|
+
#else
|
|
290
302
|
- (void)enqueueUpdateViewOnNativeThread:(nonnull NSNumber *)reactTag
|
|
291
303
|
viewName:(NSString *)viewName
|
|
292
304
|
nativeProps:(NSMutableDictionary *)nativeProps
|
|
@@ -299,153 +311,7 @@
|
|
|
299
311
|
[uiManager updateView:reactTag viewName:viewName props:nativeProps];
|
|
300
312
|
}];
|
|
301
313
|
}
|
|
302
|
-
|
|
303
|
-
- (void)getValue:(REANodeID)nodeID callback:(RCTResponseSenderBlock)callback
|
|
304
|
-
{
|
|
305
|
-
id val = _nodes[nodeID].value;
|
|
306
|
-
if (val) {
|
|
307
|
-
callback(@[ val ]);
|
|
308
|
-
} else {
|
|
309
|
-
// NULL is not an object and it's not possible to pass it as callback's argument
|
|
310
|
-
callback(@[ [NSNull null] ]);
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
#pragma mark-- Graph
|
|
315
|
-
|
|
316
|
-
- (void)createNode:(REANodeID)nodeID config:(NSDictionary<NSString *, id> *)config
|
|
317
|
-
{
|
|
318
|
-
static NSDictionary *map;
|
|
319
|
-
static dispatch_once_t mapToken;
|
|
320
|
-
dispatch_once(&mapToken, ^{
|
|
321
|
-
map = @{
|
|
322
|
-
@"props" : [REAPropsNode class],
|
|
323
|
-
@"style" : [REAStyleNode class],
|
|
324
|
-
@"transform" : [REATransformNode class],
|
|
325
|
-
@"value" : [REAValueNode class],
|
|
326
|
-
@"block" : [REABlockNode class],
|
|
327
|
-
@"cond" : [REACondNode class],
|
|
328
|
-
@"op" : [REAOperatorNode class],
|
|
329
|
-
@"set" : [REASetNode class],
|
|
330
|
-
@"debug" : [READebugNode class],
|
|
331
|
-
@"clock" : [REAClockNode class],
|
|
332
|
-
@"clockStart" : [REAClockStartNode class],
|
|
333
|
-
@"clockStop" : [REAClockStopNode class],
|
|
334
|
-
@"clockTest" : [REAClockTestNode class],
|
|
335
|
-
@"call" : [REAJSCallNode class],
|
|
336
|
-
@"bezier" : [REABezierNode class],
|
|
337
|
-
@"event" : [REAEventNode class],
|
|
338
|
-
@"always" : [REAAlwaysNode class],
|
|
339
|
-
@"concat" : [REAConcatNode class],
|
|
340
|
-
@"param" : [REAParamNode class],
|
|
341
|
-
@"func" : [REAFunctionNode class],
|
|
342
|
-
@"callfunc" : [REACallFuncNode class]
|
|
343
|
-
// @"listener": nil,
|
|
344
|
-
};
|
|
345
|
-
});
|
|
346
|
-
|
|
347
|
-
NSString *nodeType = [RCTConvert NSString:config[@"type"]];
|
|
348
|
-
|
|
349
|
-
Class nodeClass = map[nodeType];
|
|
350
|
-
if (!nodeClass) {
|
|
351
|
-
RCTLogError(@"Animated node type %@ not supported natively", nodeType);
|
|
352
|
-
return;
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
REANode *node = [[nodeClass alloc] initWithID:nodeID config:config];
|
|
356
|
-
node.nodesManager = self;
|
|
357
|
-
node.updateContext = _updateContext;
|
|
358
|
-
_nodes[nodeID] = node;
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
- (void)dropNode:(REANodeID)nodeID
|
|
362
|
-
{
|
|
363
|
-
REANode *node = _nodes[nodeID];
|
|
364
|
-
if (node) {
|
|
365
|
-
[node onDrop];
|
|
366
|
-
[_nodes removeObjectForKey:nodeID];
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
- (void)connectNodes:(nonnull NSNumber *)parentID childID:(nonnull REANodeID)childID
|
|
371
|
-
{
|
|
372
|
-
RCTAssertParam(parentID);
|
|
373
|
-
RCTAssertParam(childID);
|
|
374
|
-
|
|
375
|
-
REANode *parentNode = _nodes[parentID];
|
|
376
|
-
REANode *childNode = _nodes[childID];
|
|
377
|
-
|
|
378
|
-
RCTAssertParam(childNode);
|
|
379
|
-
|
|
380
|
-
[parentNode addChild:childNode];
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
- (void)disconnectNodes:(REANodeID)parentID childID:(REANodeID)childID
|
|
384
|
-
{
|
|
385
|
-
RCTAssertParam(parentID);
|
|
386
|
-
RCTAssertParam(childID);
|
|
387
|
-
|
|
388
|
-
REANode *parentNode = _nodes[parentID];
|
|
389
|
-
REANode *childNode = _nodes[childID];
|
|
390
|
-
|
|
391
|
-
RCTAssertParam(childNode);
|
|
392
|
-
|
|
393
|
-
[parentNode removeChild:childNode];
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
- (void)connectNodeToView:(REANodeID)nodeID viewTag:(NSNumber *)viewTag viewName:(NSString *)viewName
|
|
397
|
-
{
|
|
398
|
-
RCTAssertParam(nodeID);
|
|
399
|
-
REANode *node = _nodes[nodeID];
|
|
400
|
-
RCTAssertParam(node);
|
|
401
|
-
|
|
402
|
-
if ([node isKindOfClass:[REAPropsNode class]]) {
|
|
403
|
-
[(REAPropsNode *)node connectToView:viewTag viewName:viewName];
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
- (void)disconnectNodeFromView:(REANodeID)nodeID viewTag:(NSNumber *)viewTag
|
|
408
|
-
{
|
|
409
|
-
RCTAssertParam(nodeID);
|
|
410
|
-
REANode *node = _nodes[nodeID];
|
|
411
|
-
RCTAssertParam(node);
|
|
412
|
-
|
|
413
|
-
if ([node isKindOfClass:[REAPropsNode class]]) {
|
|
414
|
-
[(REAPropsNode *)node disconnectFromView:viewTag];
|
|
415
|
-
}
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
- (void)attachEvent:(NSNumber *)viewTag eventName:(NSString *)eventName eventNodeID:(REANodeID)eventNodeID
|
|
419
|
-
{
|
|
420
|
-
RCTAssertParam(eventNodeID);
|
|
421
|
-
REANode *eventNode = _nodes[eventNodeID];
|
|
422
|
-
RCTAssert([eventNode isKindOfClass:[REAEventNode class]], @"Event node is of an invalid type");
|
|
423
|
-
|
|
424
|
-
NSString *key = [NSString stringWithFormat:@"%@%@", viewTag, RCTNormalizeInputEventName(eventName)];
|
|
425
|
-
RCTAssert([_eventMapping objectForKey:key] == nil, @"Event handler already set for the given view and event type");
|
|
426
|
-
[_eventMapping setObject:eventNode forKey:key];
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
- (void)detachEvent:(NSNumber *)viewTag eventName:(NSString *)eventName eventNodeID:(REANodeID)eventNodeID
|
|
430
|
-
{
|
|
431
|
-
NSString *key = [NSString stringWithFormat:@"%@%@", viewTag, RCTNormalizeInputEventName(eventName)];
|
|
432
|
-
[_eventMapping removeObjectForKey:key];
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
- (void)processEvent:(id<RCTEvent>)event
|
|
436
|
-
{
|
|
437
|
-
NSString *key = [NSString stringWithFormat:@"%@%@", event.viewTag, RCTNormalizeInputEventName(event.eventName)];
|
|
438
|
-
REAEventNode *eventNode = [_eventMapping objectForKey:key];
|
|
439
|
-
[eventNode processEvent:event];
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
- (void)processDirectEvent:(id<RCTEvent>)event
|
|
443
|
-
{
|
|
444
|
-
_processingDirectEvent = YES;
|
|
445
|
-
[self processEvent:event];
|
|
446
|
-
[self performOperations];
|
|
447
|
-
_processingDirectEvent = NO;
|
|
448
|
-
}
|
|
314
|
+
#endif
|
|
449
315
|
|
|
450
316
|
- (BOOL)isDirectEvent:(id<RCTEvent>)event
|
|
451
317
|
{
|
|
@@ -473,7 +339,7 @@
|
|
|
473
339
|
|
|
474
340
|
if (_eventHandler != nil) {
|
|
475
341
|
__weak REAEventHandler eventHandler = _eventHandler;
|
|
476
|
-
__weak
|
|
342
|
+
__weak __typeof__(self) weakSelf = self;
|
|
477
343
|
RCTExecuteOnMainQueue(^void() {
|
|
478
344
|
__typeof__(self) strongSelf = weakSelf;
|
|
479
345
|
if (strongSelf == nil) {
|
|
@@ -488,44 +354,42 @@
|
|
|
488
354
|
}
|
|
489
355
|
});
|
|
490
356
|
}
|
|
491
|
-
|
|
492
|
-
REANode *eventNode = [_eventMapping objectForKey:key];
|
|
493
|
-
|
|
494
|
-
if (eventNode != nil) {
|
|
495
|
-
if ([self isDirectEvent:event]) {
|
|
496
|
-
// Bypass the event queue/animation frames and process scroll events
|
|
497
|
-
// immediately to avoid getting out of sync with the scroll position
|
|
498
|
-
[self processDirectEvent:event];
|
|
499
|
-
} else {
|
|
500
|
-
// enqueue node to be processed
|
|
501
|
-
[_eventQueue addObject:event];
|
|
502
|
-
[self startUpdatingOnAnimationFrame];
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
357
|
}
|
|
506
358
|
|
|
359
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
360
|
+
// nothing
|
|
361
|
+
#else
|
|
507
362
|
- (void)configureUiProps:(nonnull NSSet<NSString *> *)uiPropsSet
|
|
508
363
|
andNativeProps:(nonnull NSSet<NSString *> *)nativePropsSet
|
|
509
364
|
{
|
|
510
365
|
_uiProps = uiPropsSet;
|
|
511
366
|
_nativeProps = nativePropsSet;
|
|
512
367
|
}
|
|
368
|
+
#endif
|
|
513
369
|
|
|
514
370
|
- (BOOL)isNotNativeViewFullyMounted:(NSNumber *)viewTag
|
|
515
371
|
{
|
|
516
372
|
return _viewRegistry[viewTag].superview == nil;
|
|
517
373
|
}
|
|
518
374
|
|
|
519
|
-
|
|
520
|
-
{
|
|
521
|
-
RCTAssertParam(nodeID);
|
|
375
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
522
376
|
|
|
523
|
-
|
|
377
|
+
- (void)synchronouslyUpdateViewOnUIThread:(nonnull NSNumber *)viewTag props:(nonnull NSDictionary *)uiProps
|
|
378
|
+
{
|
|
379
|
+
// adapted from RCTPropsAnimatedNode.m
|
|
380
|
+
RCTSurfacePresenter *surfacePresenter = _bridge.surfacePresenter ?: _surfacePresenter;
|
|
381
|
+
[surfacePresenter synchronouslyUpdateViewOnUIThread:viewTag props:uiProps];
|
|
524
382
|
|
|
525
|
-
|
|
526
|
-
|
|
383
|
+
// `synchronouslyUpdateViewOnUIThread` does not flush props like `backgroundColor` etc.
|
|
384
|
+
// so that's why we need to call `finalizeUpdates` here.
|
|
385
|
+
RCTComponentViewRegistry *componentViewRegistry = surfacePresenter.mountingManager.componentViewRegistry;
|
|
386
|
+
UIView<RCTComponentViewProtocol> *componentView =
|
|
387
|
+
[componentViewRegistry findComponentViewWithTag:[viewTag integerValue]];
|
|
388
|
+
[componentView finalizeUpdates:RNComponentViewUpdateMask{}];
|
|
527
389
|
}
|
|
528
390
|
|
|
391
|
+
#else
|
|
392
|
+
|
|
529
393
|
- (void)updateProps:(nonnull NSDictionary *)props
|
|
530
394
|
ofViewWithTag:(nonnull NSNumber *)viewTag
|
|
531
395
|
withName:(nonnull NSString *)viewName
|
|
@@ -603,7 +467,7 @@
|
|
|
603
467
|
return;
|
|
604
468
|
}
|
|
605
469
|
|
|
606
|
-
__weak
|
|
470
|
+
__weak __typeof__(self) weakSelf = self;
|
|
607
471
|
[_uiManager addUIBlock:^(__unused RCTUIManager *manager, __unused NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
|
608
472
|
__typeof__(self) strongSelf = weakSelf;
|
|
609
473
|
if (strongSelf == nil) {
|
|
@@ -625,4 +489,6 @@
|
|
|
625
489
|
}];
|
|
626
490
|
}
|
|
627
491
|
|
|
492
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
493
|
+
|
|
628
494
|
@end
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
#import <Foundation/Foundation.h>
|
|
2
|
-
#import <RNGestureHandlerStateManager.h>
|
|
2
|
+
#import <RNReanimated/RNGestureHandlerStateManager.h>
|
|
3
3
|
#import <React/RCTUIManager.h>
|
|
4
4
|
#include <string>
|
|
5
|
-
#import <string>
|
|
6
5
|
#include <utility>
|
|
7
6
|
#include <vector>
|
|
8
|
-
#import <vector>
|
|
9
7
|
|
|
10
8
|
namespace reanimated {
|
|
11
9
|
|