react-native-reanimated 2.3.0-alpha.3 → 2.3.0-beta.4
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/LayoutAnimations/LayoutAnimationsProxy.cpp +15 -8
- package/Common/cpp/NativeModules/NativeReanimatedModule.cpp +176 -154
- package/Common/cpp/NativeModules/NativeReanimatedModuleSpec.cpp +49 -33
- package/Common/cpp/Registries/EventHandlerRegistry.cpp +14 -7
- package/Common/cpp/Registries/MapperRegistry.cpp +24 -20
- package/Common/cpp/Registries/WorkletsCache.cpp +19 -9
- package/Common/cpp/SharedItems/FrozenObject.cpp +17 -8
- package/Common/cpp/SharedItems/MutableValue.cpp +38 -25
- package/Common/cpp/SharedItems/MutableValueSetterProxy.cpp +11 -7
- package/Common/cpp/SharedItems/RemoteObject.cpp +9 -5
- package/Common/cpp/SharedItems/ShareableValue.cpp +211 -160
- package/Common/cpp/Tools/FeaturesConfig.cpp +5 -0
- package/Common/cpp/Tools/JSIStoreValueUser.cpp +25 -6
- package/Common/cpp/Tools/Mapper.cpp +30 -30
- package/Common/cpp/Tools/RuntimeDecorator.cpp +124 -86
- package/Common/cpp/Tools/Scheduler.cpp +6 -5
- package/Common/cpp/Tools/WorkletEventHandler.cpp +4 -2
- package/Common/cpp/headers/LayoutAnimations/LayoutAnimationsProxy.h +12 -11
- package/Common/cpp/headers/NativeModules/NativeReanimatedModule.h +50 -31
- package/Common/cpp/headers/NativeModules/NativeReanimatedModuleSpec.h +34 -16
- package/Common/cpp/headers/Registries/EventHandlerRegistry.h +15 -8
- package/Common/cpp/headers/Registries/MapperRegistry.h +5 -4
- package/Common/cpp/headers/Registries/WorkletsCache.h +9 -7
- package/Common/cpp/headers/SharedItems/FrozenObject.h +19 -11
- package/Common/cpp/headers/SharedItems/HostFunctionHandler.h +8 -4
- package/Common/cpp/headers/SharedItems/MutableValue.h +23 -12
- package/Common/cpp/headers/SharedItems/MutableValueSetterProxy.h +12 -7
- package/Common/cpp/headers/SharedItems/RemoteObject.h +19 -8
- package/Common/cpp/headers/SharedItems/RuntimeManager.h +26 -25
- package/Common/cpp/headers/SharedItems/ShareableValue.h +32 -27
- package/Common/cpp/headers/SharedItems/SharedParent.h +10 -7
- package/Common/cpp/headers/SharedItems/ValueWrapper.h +95 -72
- package/Common/cpp/headers/SpecTools/ErrorHandler.h +18 -19
- package/Common/cpp/headers/Tools/FeaturesConfig.h +19 -0
- package/Common/cpp/headers/Tools/JSIStoreValueUser.h +13 -16
- package/Common/cpp/headers/Tools/Mapper.h +19 -16
- package/Common/cpp/headers/Tools/PlatformDepMethodsHolder.h +17 -7
- package/Common/cpp/headers/Tools/ReanimatedHiddenHeaders.h +7 -11
- package/Common/cpp/headers/Tools/RuntimeDecorator.h +36 -27
- package/Common/cpp/headers/Tools/Scheduler.h +30 -35
- package/Common/cpp/headers/Tools/WorkletEventHandler.h +11 -8
- package/Common/cpp/hidden_headers/Logger.h +14 -14
- package/Common/cpp/hidden_headers/LoggerInterface.h +8 -9
- package/Common/cpp/hidden_headers/SpeedChecker.h +7 -8
- package/README.md +1 -1
- package/RNReanimated.podspec +24 -6
- package/android/build.gradle +38 -29
- package/android/react-native-reanimated-63-hermes.aar +0 -0
- package/android/react-native-reanimated-63-jsc.aar +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/ios/LayoutReanimation/REAAnimationsManager.h +10 -8
- package/ios/LayoutReanimation/REAAnimationsManager.m +91 -87
- package/ios/LayoutReanimation/REASnapshot.h +2 -2
- package/ios/LayoutReanimation/REASnapshot.m +8 -7
- package/ios/LayoutReanimation/REAUIManager.h +4 -4
- package/ios/LayoutReanimation/REAUIManager.mm +116 -70
- package/ios/Nodes/REAAlwaysNode.m +14 -15
- package/ios/Nodes/REABezierNode.m +8 -7
- package/ios/Nodes/REABlockNode.m +1 -1
- package/ios/Nodes/REACallFuncNode.h +0 -1
- package/ios/Nodes/REACallFuncNode.m +10 -8
- package/ios/Nodes/REAClockNodes.m +22 -20
- package/ios/Nodes/REAConcatNode.h +0 -1
- package/ios/Nodes/REAConcatNode.m +2 -2
- package/ios/Nodes/REACondNode.m +7 -5
- package/ios/Nodes/READebugNode.m +5 -4
- package/ios/Nodes/REAEventNode.m +1 -1
- package/ios/Nodes/REAFunctionNode.h +0 -1
- package/ios/Nodes/REAFunctionNode.m +2 -2
- package/ios/Nodes/REAJSCallNode.m +4 -5
- package/ios/Nodes/REANode.h +3 -4
- package/ios/Nodes/REANode.m +9 -11
- package/ios/Nodes/REAOperatorNode.m +68 -67
- package/ios/Nodes/REAParamNode.h +1 -3
- package/ios/Nodes/REAParamNode.m +15 -17
- package/ios/Nodes/REAPropsNode.h +1 -3
- package/ios/Nodes/REAPropsNode.m +19 -22
- package/ios/Nodes/REASetNode.h +0 -1
- package/ios/Nodes/REASetNode.m +7 -5
- package/ios/Nodes/REAStyleNode.h +0 -1
- package/ios/Nodes/REAStyleNode.m +2 -4
- package/ios/Nodes/REATransformNode.h +0 -1
- package/ios/Nodes/REATransformNode.m +3 -5
- package/ios/Nodes/REAValueNode.m +5 -7
- package/ios/REAEventDispatcher.m +4 -4
- package/ios/REAModule.h +0 -2
- package/ios/REAModule.m +29 -38
- package/ios/REANodesManager.h +11 -19
- package/ios/REANodesManager.m +106 -130
- package/ios/REAUtils.h +5 -3
- package/ios/RNGestureHandlerStateManager.h +5 -0
- package/ios/Transitioning/RCTConvert+REATransition.m +45 -29
- package/ios/Transitioning/REAAllTransitions.h +2 -2
- package/ios/Transitioning/REAAllTransitions.m +14 -25
- package/ios/Transitioning/REATransition.h +8 -7
- package/ios/Transitioning/REATransition.m +19 -16
- package/ios/Transitioning/REATransitionAnimation.h +1 -1
- package/ios/Transitioning/REATransitionAnimation.m +2 -3
- package/ios/Transitioning/REATransitionManager.m +3 -3
- package/ios/native/NativeMethods.h +20 -5
- package/ios/native/NativeMethods.mm +14 -6
- package/ios/native/NativeProxy.h +4 -2
- package/ios/native/NativeProxy.mm +84 -63
- package/ios/native/REAIOSErrorHandler.h +13 -10
- package/ios/native/REAIOSErrorHandler.mm +19 -15
- package/ios/native/REAIOSLogger.h +8 -8
- package/ios/native/REAIOSLogger.mm +10 -6
- package/ios/native/REAIOSScheduler.h +5 -5
- package/ios/native/REAIOSScheduler.mm +17 -10
- package/ios/native/REAInitializer.h +5 -7
- package/ios/native/REAInitializer.mm +43 -31
- package/ios/native/UIResponder+Reanimated.mm +2 -2
- package/lib/Animated.js +9 -1
- package/lib/ConfigHelper.js +121 -138
- package/lib/ReanimatedEventEmitter.js +0 -1
- package/lib/ReanimatedModule.js +0 -1
- package/lib/ReanimatedModule.macos.js +0 -1
- package/lib/ReanimatedModule.native.js +5 -6
- package/lib/ReanimatedModule.windows.js +0 -1
- package/lib/ReanimatedModuleCompat.js +64 -35
- package/lib/createAnimatedComponent.js +468 -487
- package/lib/index.js +9 -1
- package/lib/reanimated2/NativeMethods.js +7 -12
- package/lib/reanimated2/NativeReanimated/NativeReanimated.js +37 -0
- package/lib/reanimated2/NativeReanimated/index.js +15 -0
- package/lib/reanimated2/PropAdapters.js +0 -1
- package/lib/reanimated2/UpdateProps.js +6 -7
- package/lib/reanimated2/ViewDescriptorsSet.js +4 -4
- package/lib/reanimated2/WorkletEventHandler.js +15 -13
- package/lib/reanimated2/animation/delay.js +8 -2
- package/lib/reanimated2/animation/spring.js +2 -0
- package/lib/reanimated2/animation/styleAnimation.js +7 -3
- package/lib/reanimated2/animation/util.js +25 -2
- package/lib/reanimated2/core.js +41 -17
- package/lib/reanimated2/globals.d.ts +21 -1
- package/lib/reanimated2/hook/useAnimatedRef.js +1 -1
- package/lib/reanimated2/hook/useAnimatedStyle.js +3 -3
- package/lib/reanimated2/index.js +1 -0
- package/lib/reanimated2/interpolation.js +95 -87
- package/lib/reanimated2/js-reanimated/JSReanimated.js +13 -10
- package/lib/reanimated2/js-reanimated/Mapper.js +4 -3
- package/lib/reanimated2/js-reanimated/MapperRegistry.js +3 -6
- package/lib/reanimated2/js-reanimated/MutableValue.js +0 -2
- package/lib/reanimated2/js-reanimated/index.js +10 -8
- package/lib/reanimated2/layoutReanimation/LayoutAnimationRepository.js +33 -2
- package/lib/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js +27 -124
- package/lib/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js +125 -0
- package/lib/reanimated2/layoutReanimation/animationBuilder/index.js +1 -2
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Bounce.js +115 -45
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Default.js +7 -2
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Fade.js +21 -21
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Flip.js +25 -25
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js +19 -17
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js +5 -5
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Roll.js +9 -9
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Rotate.js +17 -17
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Slide.js +19 -19
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Stretch.js +9 -9
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Zoom.js +33 -33
- package/lib/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js +78 -0
- package/lib/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js +128 -0
- package/lib/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js +37 -0
- package/lib/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js +41 -0
- package/lib/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js +34 -0
- package/lib/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js +46 -0
- package/lib/reanimated2/layoutReanimation/defaultTransitions/index.js +6 -0
- package/lib/reanimated2/layoutReanimation/index.js +1 -0
- package/lib/reanimated2/mock.js +3 -1
- package/lib/reanimated2/utils.js +9 -0
- package/lib/setAndForwardRef.js +14 -48
- package/libSo/fbjni/jni/arm64-v8a/libfbjni.so +0 -0
- package/libSo/fbjni/jni/armeabi-v7a/libfbjni.so +0 -0
- package/libSo/fbjni/jni/x86/libfbjni.so +0 -0
- package/libSo/fbjni/jni/x86_64/libfbjni.so +0 -0
- package/mock.js +1 -1
- package/package.json +28 -17
- package/plugin.js +220 -39
- package/react-native-reanimated.d.ts +542 -547
- package/src/Animated.js +9 -1
- package/src/{ConfigHelper.js → ConfigHelper.ts} +15 -7
- package/src/{ReanimatedEventEmitter.js → ReanimatedEventEmitter.ts} +0 -0
- package/src/{ReanimatedModule.js → ReanimatedModule.macos.ts} +0 -0
- package/src/{ReanimatedModule.native.js → ReanimatedModule.native.ts} +0 -0
- package/src/{ReanimatedModule.macos.js → ReanimatedModule.ts} +0 -0
- package/src/{ReanimatedModule.windows.js → ReanimatedModule.windows.ts} +0 -0
- package/src/ReanimatedModuleCompat.ts +51 -0
- package/src/{createAnimatedComponent.js → createAnimatedComponent.tsx} +285 -126
- package/src/reanimated2/NativeMethods.ts +34 -13
- package/src/reanimated2/NativeReanimated/NativeReanimated.ts +72 -0
- package/src/reanimated2/NativeReanimated/index.ts +18 -0
- package/src/reanimated2/PropAdapters.ts +0 -1
- package/src/reanimated2/UpdateProps.ts +31 -15
- package/src/reanimated2/ViewDescriptorsSet.ts +15 -12
- package/src/reanimated2/WorkletEventHandler.ts +41 -23
- package/src/reanimated2/animation/commonTypes.ts +4 -4
- package/src/reanimated2/animation/decay.ts +2 -2
- package/src/reanimated2/animation/delay.ts +11 -5
- package/src/reanimated2/animation/index.ts +7 -7
- package/src/reanimated2/animation/repeat.ts +4 -4
- package/src/reanimated2/animation/sequence.ts +2 -2
- package/src/reanimated2/animation/spring.ts +6 -5
- package/src/reanimated2/animation/styleAnimation.ts +27 -15
- package/src/reanimated2/animation/timing.ts +5 -5
- package/src/reanimated2/animation/util.ts +47 -8
- package/src/reanimated2/commonTypes.ts +3 -0
- package/src/reanimated2/core.ts +80 -34
- package/src/reanimated2/globals.d.ts +21 -1
- package/src/reanimated2/hook/useAnimatedGestureHandler.ts +1 -1
- package/src/reanimated2/hook/useAnimatedRef.ts +13 -15
- package/src/reanimated2/hook/useAnimatedScrollHandler.ts +3 -3
- package/src/reanimated2/hook/useAnimatedStyle.ts +7 -7
- package/src/reanimated2/hook/utils.ts +4 -3
- package/src/reanimated2/index.ts +1 -0
- package/src/reanimated2/interpolation.ts +170 -103
- package/src/reanimated2/js-reanimated/JSReanimated.ts +37 -23
- package/src/reanimated2/js-reanimated/Mapper.ts +22 -9
- package/src/reanimated2/js-reanimated/MapperRegistry.ts +22 -19
- package/src/reanimated2/js-reanimated/MutableValue.ts +11 -11
- package/src/reanimated2/js-reanimated/index.ts +31 -14
- package/src/reanimated2/layoutReanimation/LayoutAnimationRepository.ts +75 -0
- package/src/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.ts +29 -159
- package/src/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.ts +169 -0
- package/src/reanimated2/layoutReanimation/animationBuilder/Keyframe.ts +2 -2
- package/src/reanimated2/layoutReanimation/animationBuilder/commonTypes.ts +3 -9
- package/src/reanimated2/layoutReanimation/animationBuilder/index.ts +1 -5
- package/src/reanimated2/layoutReanimation/defaultAnimations/Bounce.ts +162 -82
- package/src/reanimated2/layoutReanimation/defaultAnimations/Default.ts +7 -2
- package/src/reanimated2/layoutReanimation/defaultAnimations/Fade.ts +32 -32
- package/src/reanimated2/layoutReanimation/defaultAnimations/Flip.ts +38 -38
- package/src/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.ts +34 -32
- package/src/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.ts +8 -8
- package/src/reanimated2/layoutReanimation/defaultAnimations/Roll.ts +14 -14
- package/src/reanimated2/layoutReanimation/defaultAnimations/Rotate.ts +26 -26
- package/src/reanimated2/layoutReanimation/defaultAnimations/Slide.ts +28 -28
- package/src/reanimated2/layoutReanimation/defaultAnimations/Stretch.ts +14 -14
- package/src/reanimated2/layoutReanimation/defaultAnimations/Zoom.ts +50 -50
- package/src/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.ts +104 -0
- package/src/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.ts +213 -0
- package/src/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.ts +60 -0
- package/src/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.ts +58 -0
- package/src/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.ts +41 -0
- package/src/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.ts +78 -0
- package/src/reanimated2/layoutReanimation/defaultTransitions/index.ts +6 -0
- package/src/reanimated2/layoutReanimation/index.ts +1 -0
- package/src/reanimated2/mock.ts +3 -1
- package/src/reanimated2/utils.ts +21 -0
- package/src/{setAndForwardRef.js → setAndForwardRef.ts} +12 -2
- package/android/react-native-reanimated-62-hermes.aar +0 -0
- package/android/react-native-reanimated-62-jsc.aar +0 -0
- package/lib/reanimated2/NativeReanimated.js +0 -48
- package/lib/reanimated2/layoutReanimation/animationBuilder/BaseBounceAnimationBuilder.js +0 -55
- package/lib/reanimated2/layoutReanimation/animationBuilder/LayoutAnimationBuilder.js +0 -165
- package/src/ReanimatedModuleCompat.js +0 -37
- package/src/reanimated2/NativeReanimated.ts +0 -70
- package/src/reanimated2/layoutReanimation/LayoutAnimationRepository.tsx +0 -41
- package/src/reanimated2/layoutReanimation/animationBuilder/BaseBounceAnimationBuilder.ts +0 -82
- package/src/reanimated2/layoutReanimation/animationBuilder/LayoutAnimationBuilder.ts +0 -217
|
@@ -1,20 +1,27 @@
|
|
|
1
1
|
#include "LayoutAnimationsProxy.h"
|
|
2
|
+
#include "FrozenObject.h"
|
|
2
3
|
#include "MutableValue.h"
|
|
3
|
-
#include "ValueWrapper.h"
|
|
4
4
|
#include "ShareableValue.h"
|
|
5
|
-
#include "
|
|
5
|
+
#include "ValueWrapper.h"
|
|
6
6
|
|
|
7
7
|
namespace reanimated {
|
|
8
8
|
|
|
9
9
|
const long long idOffset = 1e9;
|
|
10
10
|
|
|
11
|
-
LayoutAnimationsProxy::LayoutAnimationsProxy(
|
|
12
|
-
|
|
11
|
+
LayoutAnimationsProxy::LayoutAnimationsProxy(
|
|
12
|
+
std::function<void(int, jsi::Object newProps)> _notifyAboutProgress,
|
|
13
|
+
std::function<void(int, bool)> _notifyAboutEnd)
|
|
14
|
+
: notifyAboutProgress(std::move(_notifyAboutProgress)),
|
|
15
|
+
notifyAboutEnd(std::move(_notifyAboutEnd)) {}
|
|
13
16
|
|
|
14
|
-
void LayoutAnimationsProxy::startObserving(
|
|
17
|
+
void LayoutAnimationsProxy::startObserving(
|
|
18
|
+
int tag,
|
|
19
|
+
std::shared_ptr<MutableValue> sv,
|
|
20
|
+
jsi::Runtime &rt) {
|
|
15
21
|
observedValues[tag] = sv;
|
|
16
|
-
sv->addListener(tag + idOffset, [sv, tag, this, &rt](){
|
|
17
|
-
std::shared_ptr<FrozenObject> newValue =
|
|
22
|
+
sv->addListener(tag + idOffset, [sv, tag, this, &rt]() {
|
|
23
|
+
std::shared_ptr<FrozenObject> newValue =
|
|
24
|
+
ValueWrapper::asFrozenObject(sv->value->valueContainer);
|
|
18
25
|
this->notifyAboutProgress(tag, newValue->shallowClone(rt));
|
|
19
26
|
});
|
|
20
27
|
}
|
|
@@ -33,4 +40,4 @@ void LayoutAnimationsProxy::notifyAboutCancellation(int tag) {
|
|
|
33
40
|
this->notifyAboutEnd(tag, false);
|
|
34
41
|
}
|
|
35
42
|
|
|
36
|
-
}
|
|
43
|
+
} // namespace reanimated
|
|
@@ -1,77 +1,76 @@
|
|
|
1
1
|
#include "NativeReanimatedModule.h"
|
|
2
|
-
#include "ShareableValue.h"
|
|
3
|
-
#include "MapperRegistry.h"
|
|
4
|
-
#include "Mapper.h"
|
|
5
|
-
#include "RuntimeDecorator.h"
|
|
6
|
-
#include "EventHandlerRegistry.h"
|
|
7
|
-
#include "WorkletEventHandler.h"
|
|
8
|
-
#include "FrozenObject.h"
|
|
9
2
|
#include <functional>
|
|
10
|
-
#include <thread>
|
|
11
3
|
#include <memory>
|
|
4
|
+
#include <thread>
|
|
5
|
+
#include "EventHandlerRegistry.h"
|
|
6
|
+
#include "FeaturesConfig.h"
|
|
7
|
+
#include "FrozenObject.h"
|
|
12
8
|
#include "JSIStoreValueUser.h"
|
|
9
|
+
#include "Mapper.h"
|
|
10
|
+
#include "MapperRegistry.h"
|
|
13
11
|
#include "ReanimatedHiddenHeaders.h"
|
|
12
|
+
#include "RuntimeDecorator.h"
|
|
13
|
+
#include "ShareableValue.h"
|
|
14
|
+
#include "WorkletEventHandler.h"
|
|
14
15
|
|
|
15
16
|
using namespace facebook;
|
|
16
17
|
|
|
17
|
-
namespace reanimated
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
{
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
res.push_back(mutableValue);
|
|
29
|
-
break;
|
|
30
|
-
}
|
|
31
|
-
case ValueType::FrozenArrayType:
|
|
32
|
-
for (auto &it : ValueWrapper::asFrozenArray(sv->valueContainer))
|
|
33
|
-
{
|
|
34
|
-
extractMutables(rt, it, res);
|
|
18
|
+
namespace reanimated {
|
|
19
|
+
|
|
20
|
+
void extractMutables(
|
|
21
|
+
jsi::Runtime &rt,
|
|
22
|
+
std::shared_ptr<ShareableValue> sv,
|
|
23
|
+
std::vector<std::shared_ptr<MutableValue>> &res) {
|
|
24
|
+
switch (sv->type) {
|
|
25
|
+
case ValueType::MutableValueType: {
|
|
26
|
+
auto &mutableValue = ValueWrapper::asMutableValue(sv->valueContainer);
|
|
27
|
+
res.push_back(mutableValue);
|
|
28
|
+
break;
|
|
35
29
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
30
|
+
case ValueType::FrozenArrayType:
|
|
31
|
+
for (auto &it : ValueWrapper::asFrozenArray(sv->valueContainer)) {
|
|
32
|
+
extractMutables(rt, it, res);
|
|
33
|
+
}
|
|
34
|
+
break;
|
|
35
|
+
case ValueType::RemoteObjectType:
|
|
36
|
+
case ValueType::FrozenObjectType:
|
|
37
|
+
for (auto &it : ValueWrapper::asFrozenObject(sv->valueContainer)->map) {
|
|
38
|
+
extractMutables(rt, it.second, res);
|
|
39
|
+
}
|
|
40
|
+
break;
|
|
41
|
+
default:
|
|
42
|
+
break;
|
|
46
43
|
}
|
|
47
44
|
}
|
|
48
45
|
|
|
49
|
-
std::vector<std::shared_ptr<MutableValue>> extractMutablesFromArray(
|
|
50
|
-
|
|
46
|
+
std::vector<std::shared_ptr<MutableValue>> extractMutablesFromArray(
|
|
47
|
+
jsi::Runtime &rt,
|
|
48
|
+
const jsi::Array &array,
|
|
49
|
+
NativeReanimatedModule *module) {
|
|
51
50
|
std::vector<std::shared_ptr<MutableValue>> res;
|
|
52
|
-
for (size_t i = 0, size = array.size(rt); i < size; i++)
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
for (size_t i = 0, size = array.size(rt); i < size; i++) {
|
|
52
|
+
auto shareable =
|
|
53
|
+
ShareableValue::adapt(rt, array.getValueAtIndex(rt, i), module);
|
|
55
54
|
extractMutables(rt, shareable, res);
|
|
56
55
|
}
|
|
57
56
|
return res;
|
|
58
57
|
}
|
|
59
58
|
|
|
60
|
-
NativeReanimatedModule::NativeReanimatedModule(
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
59
|
+
NativeReanimatedModule::NativeReanimatedModule(
|
|
60
|
+
std::shared_ptr<CallInvoker> jsInvoker,
|
|
61
|
+
std::shared_ptr<Scheduler> scheduler,
|
|
62
|
+
std::shared_ptr<jsi::Runtime> rt,
|
|
63
|
+
std::shared_ptr<ErrorHandler> errorHandler,
|
|
64
|
+
std::function<jsi::Value(jsi::Runtime &, const int, const jsi::String &)>
|
|
65
|
+
propObtainer,
|
|
66
|
+
std::shared_ptr<LayoutAnimationsProxy> layoutAnimationsProxy,
|
|
67
|
+
PlatformDepMethodsHolder platformDepMethodsHolder)
|
|
68
|
+
: NativeReanimatedModuleSpec(jsInvoker),
|
|
69
|
+
RuntimeManager(rt, errorHandler, scheduler, RuntimeType::UI),
|
|
70
|
+
mapperRegistry(std::make_shared<MapperRegistry>()),
|
|
71
|
+
eventHandlerRegistry(std::make_shared<EventHandlerRegistry>()),
|
|
72
|
+
requestRender(platformDepMethodsHolder.requestRender),
|
|
73
|
+
propObtainer(propObtainer) {
|
|
75
74
|
auto requestAnimationFrame = [=](FrameCallback callback) {
|
|
76
75
|
frameCallbacks.push_back(callback);
|
|
77
76
|
maybeRequestRender();
|
|
@@ -79,86 +78,100 @@ NativeReanimatedModule::NativeReanimatedModule(std::shared_ptr<CallInvoker> jsIn
|
|
|
79
78
|
|
|
80
79
|
this->layoutAnimationsProxy = layoutAnimationsProxy;
|
|
81
80
|
|
|
82
|
-
RuntimeDecorator::decorateUIRuntime(
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
81
|
+
RuntimeDecorator::decorateUIRuntime(
|
|
82
|
+
*runtime,
|
|
83
|
+
platformDepMethodsHolder.updaterFunction,
|
|
84
|
+
requestAnimationFrame,
|
|
85
|
+
platformDepMethodsHolder.scrollToFunction,
|
|
86
|
+
platformDepMethodsHolder.measuringFunction,
|
|
87
|
+
platformDepMethodsHolder.getCurrentTime,
|
|
88
|
+
platformDepMethodsHolder.setGestureStateFunction,
|
|
89
|
+
layoutAnimationsProxy);
|
|
90
|
+
onRenderCallback = [this](double timestampMs) {
|
|
90
91
|
this->renderRequested = false;
|
|
91
92
|
this->onRender(timestampMs);
|
|
92
93
|
};
|
|
93
94
|
updaterFunction = platformDepMethodsHolder.updaterFunction;
|
|
94
95
|
}
|
|
95
96
|
|
|
96
|
-
void NativeReanimatedModule::installCoreFunctions(
|
|
97
|
-
|
|
97
|
+
void NativeReanimatedModule::installCoreFunctions(
|
|
98
|
+
jsi::Runtime &rt,
|
|
99
|
+
const jsi::Value &valueSetter) {
|
|
98
100
|
this->valueSetter = ShareableValue::adapt(rt, valueSetter, this);
|
|
99
101
|
}
|
|
100
102
|
|
|
101
|
-
jsi::Value NativeReanimatedModule::makeShareable(
|
|
102
|
-
|
|
103
|
+
jsi::Value NativeReanimatedModule::makeShareable(
|
|
104
|
+
jsi::Runtime &rt,
|
|
105
|
+
const jsi::Value &value) {
|
|
103
106
|
return ShareableValue::adapt(rt, value, this)->getValue(rt);
|
|
104
107
|
}
|
|
105
108
|
|
|
106
|
-
jsi::Value NativeReanimatedModule::makeMutable(
|
|
107
|
-
|
|
108
|
-
|
|
109
|
+
jsi::Value NativeReanimatedModule::makeMutable(
|
|
110
|
+
jsi::Runtime &rt,
|
|
111
|
+
const jsi::Value &value) {
|
|
112
|
+
return ShareableValue::adapt(rt, value, this, ValueType::MutableValueType)
|
|
113
|
+
->getValue(rt);
|
|
109
114
|
}
|
|
110
115
|
|
|
111
|
-
jsi::Value NativeReanimatedModule::makeRemote(
|
|
112
|
-
|
|
113
|
-
|
|
116
|
+
jsi::Value NativeReanimatedModule::makeRemote(
|
|
117
|
+
jsi::Runtime &rt,
|
|
118
|
+
const jsi::Value &value) {
|
|
119
|
+
return ShareableValue::adapt(rt, value, this, ValueType::RemoteObjectType)
|
|
120
|
+
->getValue(rt);
|
|
114
121
|
}
|
|
115
122
|
|
|
116
123
|
jsi::Value NativeReanimatedModule::startMapper(
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
{
|
|
124
|
+
jsi::Runtime &rt,
|
|
125
|
+
const jsi::Value &worklet,
|
|
126
|
+
const jsi::Value &inputs,
|
|
127
|
+
const jsi::Value &outputs,
|
|
128
|
+
const jsi::Value &updater,
|
|
129
|
+
const jsi::Value &viewDescriptors) {
|
|
124
130
|
static unsigned long MAPPER_ID = 1;
|
|
125
131
|
|
|
126
132
|
unsigned long newMapperId = MAPPER_ID++;
|
|
127
133
|
auto mapperShareable = ShareableValue::adapt(rt, worklet, this);
|
|
128
|
-
auto inputMutables =
|
|
129
|
-
|
|
134
|
+
auto inputMutables =
|
|
135
|
+
extractMutablesFromArray(rt, inputs.asObject(rt).asArray(rt), this);
|
|
136
|
+
auto outputMutables =
|
|
137
|
+
extractMutablesFromArray(rt, outputs.asObject(rt).asArray(rt), this);
|
|
130
138
|
|
|
131
139
|
int optimalizationLvl = 0;
|
|
132
|
-
auto optimalization =
|
|
133
|
-
|
|
140
|
+
auto optimalization =
|
|
141
|
+
updater.asObject(rt).getProperty(rt, "__optimalization");
|
|
142
|
+
if (optimalization.isNumber()) {
|
|
134
143
|
optimalizationLvl = optimalization.asNumber();
|
|
135
144
|
}
|
|
136
145
|
auto updaterSV = ShareableValue::adapt(rt, updater, this);
|
|
137
146
|
auto viewDescriptorsSV = ShareableValue::adapt(rt, viewDescriptors, this);
|
|
138
147
|
|
|
139
148
|
scheduler->scheduleOnUI([=] {
|
|
140
|
-
auto mapperFunction =
|
|
141
|
-
|
|
149
|
+
auto mapperFunction =
|
|
150
|
+
mapperShareable->getValue(*runtime).asObject(*runtime).asFunction(
|
|
151
|
+
*runtime);
|
|
152
|
+
std::shared_ptr<jsi::Function> mapperFunctionPointer =
|
|
153
|
+
std::make_shared<jsi::Function>(std::move(mapperFunction));
|
|
142
154
|
|
|
143
155
|
std::shared_ptr<Mapper> mapperPointer = std::make_shared<Mapper>(
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
156
|
+
this,
|
|
157
|
+
newMapperId,
|
|
158
|
+
mapperFunctionPointer,
|
|
159
|
+
inputMutables,
|
|
160
|
+
outputMutables);
|
|
161
|
+
if (optimalizationLvl > 0) {
|
|
162
|
+
mapperPointer->enableFastMode(
|
|
163
|
+
optimalizationLvl, updaterSV, viewDescriptorsSV);
|
|
152
164
|
}
|
|
153
165
|
mapperRegistry->startMapper(mapperPointer);
|
|
154
166
|
maybeRequestRender();
|
|
155
167
|
});
|
|
156
168
|
|
|
157
|
-
return jsi::Value((
|
|
169
|
+
return jsi::Value(static_cast<double>(newMapperId));
|
|
158
170
|
}
|
|
159
171
|
|
|
160
|
-
void NativeReanimatedModule::stopMapper(
|
|
161
|
-
|
|
172
|
+
void NativeReanimatedModule::stopMapper(
|
|
173
|
+
jsi::Runtime &rt,
|
|
174
|
+
const jsi::Value &mapperId) {
|
|
162
175
|
unsigned long id = mapperId.asNumber();
|
|
163
176
|
scheduler->scheduleOnUI([=] {
|
|
164
177
|
mapperRegistry->stopMapper(id);
|
|
@@ -166,8 +179,10 @@ void NativeReanimatedModule::stopMapper(jsi::Runtime &rt, const jsi::Value &mapp
|
|
|
166
179
|
});
|
|
167
180
|
}
|
|
168
181
|
|
|
169
|
-
jsi::Value NativeReanimatedModule::registerEventHandler(
|
|
170
|
-
|
|
182
|
+
jsi::Value NativeReanimatedModule::registerEventHandler(
|
|
183
|
+
jsi::Runtime &rt,
|
|
184
|
+
const jsi::Value &eventHash,
|
|
185
|
+
const jsi::Value &worklet) {
|
|
171
186
|
static unsigned long EVENT_HANDLER_ID = 1;
|
|
172
187
|
|
|
173
188
|
unsigned long newRegistrationId = EVENT_HANDLER_ID++;
|
|
@@ -175,37 +190,45 @@ jsi::Value NativeReanimatedModule::registerEventHandler(jsi::Runtime &rt, const
|
|
|
175
190
|
auto handlerShareable = ShareableValue::adapt(rt, worklet, this);
|
|
176
191
|
|
|
177
192
|
scheduler->scheduleOnUI([=] {
|
|
178
|
-
auto handlerFunction =
|
|
179
|
-
|
|
193
|
+
auto handlerFunction =
|
|
194
|
+
handlerShareable->getValue(*runtime).asObject(*runtime).asFunction(
|
|
195
|
+
*runtime);
|
|
196
|
+
auto handler = std::make_shared<WorkletEventHandler>(
|
|
197
|
+
newRegistrationId, eventName, std::move(handlerFunction));
|
|
180
198
|
eventHandlerRegistry->registerEventHandler(handler);
|
|
181
199
|
});
|
|
182
200
|
|
|
183
|
-
return jsi::Value((
|
|
201
|
+
return jsi::Value(static_cast<double>(newRegistrationId));
|
|
184
202
|
}
|
|
185
203
|
|
|
186
|
-
void NativeReanimatedModule::unregisterEventHandler(
|
|
187
|
-
|
|
204
|
+
void NativeReanimatedModule::unregisterEventHandler(
|
|
205
|
+
jsi::Runtime &rt,
|
|
206
|
+
const jsi::Value ®istrationId) {
|
|
188
207
|
unsigned long id = registrationId.asNumber();
|
|
189
|
-
scheduler->scheduleOnUI(
|
|
190
|
-
|
|
191
|
-
});
|
|
208
|
+
scheduler->scheduleOnUI(
|
|
209
|
+
[=] { eventHandlerRegistry->unregisterEventHandler(id); });
|
|
192
210
|
}
|
|
193
211
|
|
|
194
|
-
jsi::Value NativeReanimatedModule::getViewProp(
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
212
|
+
jsi::Value NativeReanimatedModule::getViewProp(
|
|
213
|
+
jsi::Runtime &rt,
|
|
214
|
+
const jsi::Value &viewTag,
|
|
215
|
+
const jsi::Value &propName,
|
|
216
|
+
const jsi::Value &callback) {
|
|
217
|
+
const int viewTagInt = static_cast<int>(viewTag.asNumber());
|
|
198
218
|
std::string propNameStr = propName.asString(rt).utf8(rt);
|
|
199
219
|
jsi::Function fun = callback.getObject(rt).asFunction(rt);
|
|
200
|
-
std::shared_ptr<jsi::Function> funPtr =
|
|
220
|
+
std::shared_ptr<jsi::Function> funPtr =
|
|
221
|
+
std::make_shared<jsi::Function>(std::move(fun));
|
|
201
222
|
|
|
202
223
|
scheduler->scheduleOnUI([&rt, viewTagInt, funPtr, this, propNameStr]() {
|
|
203
|
-
const jsi::String propNameValue =
|
|
224
|
+
const jsi::String propNameValue =
|
|
225
|
+
jsi::String::createFromUtf8(rt, propNameStr);
|
|
204
226
|
jsi::Value result = propObtainer(rt, viewTagInt, propNameValue);
|
|
205
227
|
std::string resultStr = result.asString(rt).utf8(rt);
|
|
206
228
|
|
|
207
229
|
scheduler->scheduleOnJS([&rt, resultStr, funPtr]() {
|
|
208
|
-
const jsi::String resultValue =
|
|
230
|
+
const jsi::String resultValue =
|
|
231
|
+
jsi::String::createFromUtf8(rt, resultStr);
|
|
209
232
|
funPtr->call(rt, resultValue);
|
|
210
233
|
});
|
|
211
234
|
});
|
|
@@ -213,63 +236,62 @@ jsi::Value NativeReanimatedModule::getViewProp(jsi::Runtime &rt, const jsi::Valu
|
|
|
213
236
|
return jsi::Value::undefined();
|
|
214
237
|
}
|
|
215
238
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
239
|
+
jsi::Value NativeReanimatedModule::enableLayoutAnimations(
|
|
240
|
+
jsi::Runtime &rt,
|
|
241
|
+
const jsi::Value &config) {
|
|
242
|
+
FeaturesConfig::setLayoutAnimationEnabled(config.getBool());
|
|
243
|
+
return jsi::Value::undefined();
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
void NativeReanimatedModule::onEvent(
|
|
247
|
+
std::string eventName,
|
|
248
|
+
std::string eventAsString) {
|
|
249
|
+
try {
|
|
250
|
+
eventHandlerRegistry->processEvent(*runtime, eventName, eventAsString);
|
|
251
|
+
mapperRegistry->execute(*runtime);
|
|
252
|
+
if (mapperRegistry->needRunOnRender()) {
|
|
253
|
+
maybeRequestRender();
|
|
226
254
|
}
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
255
|
+
} catch (std::exception &e) {
|
|
256
|
+
std::string str = e.what();
|
|
257
|
+
this->errorHandler->setError(str);
|
|
258
|
+
this->errorHandler->raise();
|
|
259
|
+
} catch (...) {
|
|
260
|
+
std::string str = "OnEvent error";
|
|
261
|
+
this->errorHandler->setError(str);
|
|
262
|
+
this->errorHandler->raise();
|
|
235
263
|
}
|
|
236
264
|
}
|
|
237
265
|
|
|
238
|
-
bool NativeReanimatedModule::isAnyHandlerWaitingForEvent(
|
|
266
|
+
bool NativeReanimatedModule::isAnyHandlerWaitingForEvent(
|
|
267
|
+
std::string eventName) {
|
|
239
268
|
return eventHandlerRegistry->isAnyHandlerWaitingForEvent(eventName);
|
|
240
269
|
}
|
|
241
270
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
{
|
|
245
|
-
if (!renderRequested)
|
|
246
|
-
{
|
|
271
|
+
void NativeReanimatedModule::maybeRequestRender() {
|
|
272
|
+
if (!renderRequested) {
|
|
247
273
|
renderRequested = true;
|
|
248
274
|
requestRender(onRenderCallback, *this->runtime);
|
|
249
275
|
}
|
|
250
276
|
}
|
|
251
277
|
|
|
252
|
-
void NativeReanimatedModule::onRender(double timestampMs)
|
|
253
|
-
{
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
callback(timestampMs);
|
|
261
|
-
}
|
|
262
|
-
mapperRegistry->execute(*runtime);
|
|
278
|
+
void NativeReanimatedModule::onRender(double timestampMs) {
|
|
279
|
+
try {
|
|
280
|
+
std::vector<FrameCallback> callbacks = frameCallbacks;
|
|
281
|
+
frameCallbacks.clear();
|
|
282
|
+
for (auto &callback : callbacks) {
|
|
283
|
+
callback(timestampMs);
|
|
284
|
+
}
|
|
285
|
+
mapperRegistry->execute(*runtime);
|
|
263
286
|
|
|
264
|
-
if (mapperRegistry->needRunOnRender())
|
|
265
|
-
{
|
|
287
|
+
if (mapperRegistry->needRunOnRender()) {
|
|
266
288
|
maybeRequestRender();
|
|
267
289
|
}
|
|
268
|
-
} catch(std::exception &e) {
|
|
290
|
+
} catch (std::exception &e) {
|
|
269
291
|
std::string str = e.what();
|
|
270
292
|
this->errorHandler->setError(str);
|
|
271
293
|
this->errorHandler->raise();
|
|
272
|
-
} catch(...) {
|
|
294
|
+
} catch (...) {
|
|
273
295
|
std::string str = "OnRender error";
|
|
274
296
|
this->errorHandler->setError(str);
|
|
275
297
|
this->errorHandler->raise();
|
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
namespace reanimated {
|
|
4
4
|
|
|
5
|
-
static jsi::Value
|
|
5
|
+
static jsi::Value
|
|
6
|
+
__hostFunction_NativeReanimatedModuleSpec_installCoreFunctions(
|
|
6
7
|
jsi::Runtime &rt,
|
|
7
8
|
TurboModule &turboModule,
|
|
8
9
|
const jsi::Value *args,
|
|
9
10
|
size_t count) {
|
|
10
11
|
static_cast<NativeReanimatedModuleSpec *>(&turboModule)
|
|
11
|
-
|
|
12
|
+
->installCoreFunctions(rt, std::move(args[0]));
|
|
12
13
|
return jsi::Value::undefined();
|
|
13
14
|
}
|
|
14
15
|
|
|
@@ -20,7 +21,7 @@ static jsi::Value __hostFunction_NativeReanimatedModuleSpec_makeShareable(
|
|
|
20
21
|
const jsi::Value *args,
|
|
21
22
|
size_t count) {
|
|
22
23
|
return static_cast<NativeReanimatedModuleSpec *>(&turboModule)
|
|
23
|
-
|
|
24
|
+
->makeShareable(rt, std::move(args[0]));
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
static jsi::Value __hostFunction_NativeReanimatedModuleSpec_makeMutable(
|
|
@@ -29,7 +30,7 @@ static jsi::Value __hostFunction_NativeReanimatedModuleSpec_makeMutable(
|
|
|
29
30
|
const jsi::Value *args,
|
|
30
31
|
size_t count) {
|
|
31
32
|
return static_cast<NativeReanimatedModuleSpec *>(&turboModule)
|
|
32
|
-
|
|
33
|
+
->makeMutable(rt, std::move(args[0]));
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
static jsi::Value __hostFunction_NativeReanimatedModuleSpec_makeRemote(
|
|
@@ -38,7 +39,7 @@ static jsi::Value __hostFunction_NativeReanimatedModuleSpec_makeRemote(
|
|
|
38
39
|
const jsi::Value *args,
|
|
39
40
|
size_t count) {
|
|
40
41
|
return static_cast<NativeReanimatedModuleSpec *>(&turboModule)
|
|
41
|
-
|
|
42
|
+
->makeRemote(rt, std::move(args[0]));
|
|
42
43
|
}
|
|
43
44
|
|
|
44
45
|
static jsi::Value __hostFunction_NativeReanimatedModuleSpec_startMapper(
|
|
@@ -47,12 +48,13 @@ static jsi::Value __hostFunction_NativeReanimatedModuleSpec_startMapper(
|
|
|
47
48
|
const jsi::Value *args,
|
|
48
49
|
size_t count) {
|
|
49
50
|
return static_cast<NativeReanimatedModuleSpec *>(&turboModule)
|
|
50
|
-
->startMapper(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
51
|
+
->startMapper(
|
|
52
|
+
rt,
|
|
53
|
+
std::move(args[0]),
|
|
54
|
+
std::move(args[1]),
|
|
55
|
+
std::move(args[2]),
|
|
56
|
+
std::move(args[3]),
|
|
57
|
+
std::move(args[4]));
|
|
56
58
|
}
|
|
57
59
|
|
|
58
60
|
static jsi::Value __hostFunction_NativeReanimatedModuleSpec_stopMapper(
|
|
@@ -65,7 +67,8 @@ static jsi::Value __hostFunction_NativeReanimatedModuleSpec_stopMapper(
|
|
|
65
67
|
return jsi::Value::undefined();
|
|
66
68
|
}
|
|
67
69
|
|
|
68
|
-
static jsi::Value
|
|
70
|
+
static jsi::Value
|
|
71
|
+
__hostFunction_NativeReanimatedModuleSpec_registerEventHandler(
|
|
69
72
|
jsi::Runtime &rt,
|
|
70
73
|
TurboModule &turboModule,
|
|
71
74
|
const jsi::Value *args,
|
|
@@ -74,7 +77,8 @@ static jsi::Value __hostFunction_NativeReanimatedModuleSpec_registerEventHandler
|
|
|
74
77
|
->registerEventHandler(rt, std::move(args[0]), std::move(args[1]));
|
|
75
78
|
}
|
|
76
79
|
|
|
77
|
-
static jsi::Value
|
|
80
|
+
static jsi::Value
|
|
81
|
+
__hostFunction_NativeReanimatedModuleSpec_unregisterEventHandler(
|
|
78
82
|
jsi::Runtime &rt,
|
|
79
83
|
TurboModule &turboModule,
|
|
80
84
|
const jsi::Value *args,
|
|
@@ -90,37 +94,49 @@ static jsi::Value __hostFunction_NativeReanimatedModuleSpec_getViewProp(
|
|
|
90
94
|
const jsi::Value *args,
|
|
91
95
|
size_t count) {
|
|
92
96
|
static_cast<NativeReanimatedModuleSpec *>(&turboModule)
|
|
93
|
-
|
|
94
|
-
|
|
97
|
+
->getViewProp(
|
|
98
|
+
rt, std::move(args[0]), std::move(args[1]), std::move(args[2]));
|
|
99
|
+
return jsi::Value::undefined();
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
static jsi::Value
|
|
103
|
+
__hostFunction_NativeReanimatedModuleSpec_enableLayoutAnimations(
|
|
104
|
+
jsi::Runtime &rt,
|
|
105
|
+
TurboModule &turboModule,
|
|
106
|
+
const jsi::Value *args,
|
|
107
|
+
size_t count) {
|
|
108
|
+
static_cast<NativeReanimatedModuleSpec *>(&turboModule)
|
|
109
|
+
->enableLayoutAnimations(rt, std::move(args[0]));
|
|
110
|
+
return jsi::Value::undefined();
|
|
95
111
|
}
|
|
96
112
|
|
|
97
|
-
NativeReanimatedModuleSpec::NativeReanimatedModuleSpec(
|
|
113
|
+
NativeReanimatedModuleSpec::NativeReanimatedModuleSpec(
|
|
114
|
+
std::shared_ptr<CallInvoker> jsInvoker)
|
|
98
115
|
: TurboModule("NativeReanimated", jsInvoker) {
|
|
99
116
|
methodMap_["installCoreFunctions"] = MethodMetadata{
|
|
100
|
-
|
|
101
|
-
|
|
117
|
+
1, __hostFunction_NativeReanimatedModuleSpec_installCoreFunctions};
|
|
102
118
|
|
|
103
119
|
methodMap_["makeShareable"] = MethodMetadata{
|
|
104
120
|
1, __hostFunction_NativeReanimatedModuleSpec_makeShareable};
|
|
105
|
-
methodMap_["makeMutable"] =
|
|
106
|
-
1, __hostFunction_NativeReanimatedModuleSpec_makeMutable};
|
|
107
|
-
methodMap_["makeRemote"] =
|
|
108
|
-
1, __hostFunction_NativeReanimatedModuleSpec_makeRemote};
|
|
109
|
-
|
|
121
|
+
methodMap_["makeMutable"] =
|
|
122
|
+
MethodMetadata{1, __hostFunction_NativeReanimatedModuleSpec_makeMutable};
|
|
123
|
+
methodMap_["makeRemote"] =
|
|
124
|
+
MethodMetadata{1, __hostFunction_NativeReanimatedModuleSpec_makeRemote};
|
|
110
125
|
|
|
111
|
-
methodMap_["startMapper"] =
|
|
112
|
-
|
|
113
|
-
methodMap_["stopMapper"] =
|
|
114
|
-
|
|
126
|
+
methodMap_["startMapper"] =
|
|
127
|
+
MethodMetadata{5, __hostFunction_NativeReanimatedModuleSpec_startMapper};
|
|
128
|
+
methodMap_["stopMapper"] =
|
|
129
|
+
MethodMetadata{1, __hostFunction_NativeReanimatedModuleSpec_stopMapper};
|
|
115
130
|
|
|
116
131
|
methodMap_["registerEventHandler"] = MethodMetadata{
|
|
117
|
-
|
|
132
|
+
2, __hostFunction_NativeReanimatedModuleSpec_registerEventHandler};
|
|
118
133
|
methodMap_["unregisterEventHandler"] = MethodMetadata{
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
methodMap_["getViewProp"] = MethodMetadata{
|
|
122
|
-
3, __hostFunction_NativeReanimatedModuleSpec_getViewProp};
|
|
123
|
-
}
|
|
134
|
+
1, __hostFunction_NativeReanimatedModuleSpec_unregisterEventHandler};
|
|
124
135
|
|
|
136
|
+
methodMap_["getViewProp"] =
|
|
137
|
+
MethodMetadata{3, __hostFunction_NativeReanimatedModuleSpec_getViewProp};
|
|
138
|
+
methodMap_["enableLayoutAnimations"] = MethodMetadata{
|
|
139
|
+
2, __hostFunction_NativeReanimatedModuleSpec_enableLayoutAnimations};
|
|
125
140
|
}
|
|
126
141
|
|
|
142
|
+
} // namespace reanimated
|