react-native-reanimated 2.9.1 → 2.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Common/cpp/AnimatedSensor/AnimatedSensorModule.cpp +4 -4
- package/Common/cpp/NativeModules/NativeReanimatedModule.cpp +38 -0
- package/Common/cpp/NativeModules/NativeReanimatedModuleSpec.cpp +23 -0
- package/Common/cpp/headers/NativeModules/NativeReanimatedModule.h +8 -0
- package/Common/cpp/headers/NativeModules/NativeReanimatedModuleSpec.h +8 -0
- package/Common/cpp/headers/Tools/PlatformDepMethodsHolder.h +5 -0
- package/RNReanimated.podspec +22 -3
- package/android/.gradle/7.2/dependencies-accessors/dependencies-accessors.lock +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/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/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +1 -1
- 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/CMakeLists.txt +214 -95
- package/android/build.gradle +247 -236
- package/android/react-native-reanimated-66-hermes.aar +0 -0
- package/android/react-native-reanimated-66-jsc.aar +0 -0
- package/android/react-native-reanimated-67-hermes.aar +0 -0
- package/android/react-native-reanimated-67-jsc.aar +0 -0
- package/android/react-native-reanimated-68-hermes.aar +0 -0
- package/android/react-native-reanimated-68-jsc.aar +0 -0
- package/android/react-native-reanimated-69-hermes.aar +0 -0
- package/android/react-native-reanimated-69-jsc.aar +0 -0
- package/android/react-native-reanimated-70-hermes.aar +0 -0
- package/android/react-native-reanimated-70-jsc.aar +0 -0
- package/{lib/types/lib/reanimated2/platform-specific/RNRenderer.web.d.ts → android/rnVersionPatch/70/.gitkeep} +0 -0
- package/android/src/main/cpp/NativeProxy.cpp +54 -20
- package/android/src/main/cpp/OnLoad.cpp +1 -0
- package/android/src/main/cpp/headers/NativeProxy.h +29 -0
- package/android/src/main/java/com/swmansion/reanimated/NativeProxy.java +25 -0
- package/android/src/main/java/com/swmansion/reanimated/NodesManager.java +3 -1
- package/android/src/main/java/com/swmansion/reanimated/keyboardObserver/ReanimatedKeyboardEventListener.java +165 -0
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/AnimationsManager.java +19 -16
- package/android/src/main/java/com/swmansion/reanimated/sensor/ReanimatedSensor.java +5 -1
- package/android/src/main/java/com/swmansion/reanimated/sensor/ReanimatedSensorType.java +1 -1
- package/ios/REANodesManager.m +31 -8
- package/ios/keyboardObserver/REAKeyboardEventObserver.h +17 -0
- package/ios/keyboardObserver/REAKeyboardEventObserver.m +198 -0
- package/ios/native/NativeProxy.mm +20 -1
- package/ios/native/REAInitializer.mm +8 -12
- package/ios/sensor/ReanimatedSensor.m +26 -17
- package/lib/index.js +11 -3
- package/lib/index.web.js +4 -0
- package/lib/reanimated2/Colors.js +1 -1
- package/lib/reanimated2/NativeMethods.js +3 -0
- package/lib/reanimated2/NativeReanimated/NativeReanimated.js +6 -0
- package/lib/reanimated2/animation/util.js +4 -1
- package/lib/reanimated2/commonTypes.js +8 -1
- package/lib/reanimated2/component/FlatList.js +5 -5
- package/lib/reanimated2/core.js +5 -4
- package/lib/reanimated2/frameCallback/FrameCallbackRegistryJS.js +32 -0
- package/lib/reanimated2/frameCallback/FrameCallbackRegistryUI.js +47 -0
- package/lib/reanimated2/globals.d.ts +3 -0
- package/lib/reanimated2/hook/index.js +2 -0
- package/lib/reanimated2/hook/useAnimatedKeyboard.js +31 -0
- package/lib/reanimated2/hook/useAnimatedSensor.js +3 -3
- package/lib/reanimated2/hook/useFrameCallback.js +23 -0
- package/lib/reanimated2/jestUtils.js +11 -3
- package/lib/reanimated2/js-reanimated/JSReanimated.js +7 -0
- package/lib/reanimated2/js-reanimated/global.js +33 -22
- package/lib/reanimated2/layoutReanimation/LayoutAnimationRepository.js +1 -1
- package/lib/types/{lib/Animated.d.ts → Animated.d.ts} +0 -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/index.d.ts +4 -0
- package/lib/types/{lib/index.d.ts → index.web.d.ts} +0 -1
- 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 +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/NativeReanimated/NativeReanimated.d.ts +3 -1
- 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 +12 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/component/FlatList.d.ts +2 -2
- package/lib/types/{lib/reanimated2 → reanimated2}/component/Image.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/component/ScrollView.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/component/Text.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/component/View.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/core.d.ts +0 -0
- package/lib/types/reanimated2/frameCallback/FrameCallbackRegistryJS.d.ts +7 -0
- package/lib/types/reanimated2/frameCallback/FrameCallbackRegistryUI.d.ts +10 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/hook/Hooks.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/hook/commonTypes.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/hook/index.d.ts +3 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/hook/useAnimatedGestureHandler.d.ts +0 -0
- package/lib/types/reanimated2/hook/useAnimatedKeyboard.d.ts +2 -0
- 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 +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/hook/useAnimatedSensor.d.ts +1 -1
- 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/reanimated2/hook/useFrameCallback.d.ts +6 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/hook/useSharedValue.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/hook/utils.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/index.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/interpolateColor.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/interpolation.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/jestUtils.d.ts +1 -1
- package/lib/types/{lib/reanimated2 → reanimated2}/js-reanimated/JSReanimated.d.ts +3 -1
- 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/reanimated2/js-reanimated/global.d.ts +2 -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/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/mock.js +1 -0
- package/package.json +5 -6
- package/plugin.js +7 -16
- package/react-native-reanimated.d.ts +55 -4
- package/src/index.ts +11 -3
- package/src/index.web.ts +5 -0
- package/src/reanimated2/Colors.ts +1 -1
- package/src/reanimated2/NativeMethods.ts +5 -0
- package/src/reanimated2/NativeReanimated/NativeReanimated.ts +9 -0
- package/src/reanimated2/animation/util.ts +8 -1
- package/src/reanimated2/commonTypes.ts +15 -0
- package/src/reanimated2/component/FlatList.tsx +29 -19
- package/src/reanimated2/core.ts +8 -8
- package/src/reanimated2/frameCallback/FrameCallbackRegistryJS.ts +43 -0
- package/src/reanimated2/frameCallback/FrameCallbackRegistryUI.ts +64 -0
- package/src/reanimated2/globals.d.ts +3 -0
- package/src/reanimated2/hook/index.ts +3 -0
- package/src/reanimated2/hook/useAnimatedKeyboard.ts +35 -0
- package/src/reanimated2/hook/useAnimatedSensor.ts +5 -5
- package/src/reanimated2/hook/useFrameCallback.ts +39 -0
- package/src/reanimated2/jestUtils.ts +11 -3
- package/src/reanimated2/js-reanimated/JSReanimated.ts +16 -1
- package/src/reanimated2/js-reanimated/global.ts +41 -29
- package/src/reanimated2/layoutReanimation/LayoutAnimationRepository.ts +1 -1
- package/android/react-native-reanimated-65-hermes.aar +0 -0
- package/android/react-native-reanimated-65-jsc.aar +0 -0
- package/lib/types/lib/reanimated2/js-reanimated/global.d.ts +0 -1
- package/lib/types/react-native-reanimated-tests.d.ts +0 -1
|
@@ -35,10 +35,10 @@ jsi::Value AnimatedSensorModule::registerSensor(
|
|
|
35
35
|
setter = [&, mutableObject](double newValues[]) {
|
|
36
36
|
jsi::Runtime &runtime = *runtimeManager_->runtime.get();
|
|
37
37
|
jsi::Object value(runtime);
|
|
38
|
-
value.setProperty(runtime, "
|
|
39
|
-
value.setProperty(runtime, "
|
|
40
|
-
value.setProperty(runtime, "
|
|
41
|
-
value.setProperty(runtime, "
|
|
38
|
+
value.setProperty(runtime, "qx", newValues[0]);
|
|
39
|
+
value.setProperty(runtime, "qy", newValues[1]);
|
|
40
|
+
value.setProperty(runtime, "qz", newValues[2]);
|
|
41
|
+
value.setProperty(runtime, "qw", newValues[3]);
|
|
42
42
|
value.setProperty(runtime, "yaw", newValues[4]);
|
|
43
43
|
value.setProperty(runtime, "pitch", newValues[5]);
|
|
44
44
|
value.setProperty(runtime, "roll", newValues[6]);
|
|
@@ -98,6 +98,10 @@ NativeReanimatedModule::NativeReanimatedModule(
|
|
|
98
98
|
this->onRender(timestampMs);
|
|
99
99
|
};
|
|
100
100
|
updaterFunction = platformDepMethodsHolder.updaterFunction;
|
|
101
|
+
subscribeForKeyboardEventsFunction =
|
|
102
|
+
platformDepMethodsHolder.subscribeForKeyboardEvents;
|
|
103
|
+
unsubscribeFromKeyboardEventsFunction =
|
|
104
|
+
platformDepMethodsHolder.unsubscribeFromKeyboardEvents;
|
|
101
105
|
}
|
|
102
106
|
|
|
103
107
|
void NativeReanimatedModule::installCoreFunctions(
|
|
@@ -327,4 +331,38 @@ void NativeReanimatedModule::unregisterSensor(
|
|
|
327
331
|
animatedSensorModule.unregisterSensor(sensorId);
|
|
328
332
|
}
|
|
329
333
|
|
|
334
|
+
jsi::Value NativeReanimatedModule::subscribeForKeyboardEvents(
|
|
335
|
+
jsi::Runtime &rt,
|
|
336
|
+
const jsi::Value &keyboardEventContainer) {
|
|
337
|
+
jsi::Object keyboardEventObj = keyboardEventContainer.getObject(rt);
|
|
338
|
+
std::unordered_map<std::string, std::shared_ptr<ShareableValue>>
|
|
339
|
+
sharedProperties;
|
|
340
|
+
std::shared_ptr<ShareableValue> keyboardStateShared = ShareableValue::adapt(
|
|
341
|
+
rt, keyboardEventObj.getProperty(rt, "state"), this);
|
|
342
|
+
std::shared_ptr<ShareableValue> heightShared = ShareableValue::adapt(
|
|
343
|
+
rt, keyboardEventObj.getProperty(rt, "height"), this);
|
|
344
|
+
|
|
345
|
+
auto keyboardEventDataUpdater =
|
|
346
|
+
[this, &rt, keyboardStateShared, heightShared](
|
|
347
|
+
int keyboardState, int height) {
|
|
348
|
+
auto &keyboardStateValue =
|
|
349
|
+
ValueWrapper::asMutableValue(keyboardStateShared->valueContainer);
|
|
350
|
+
keyboardStateValue->setValue(rt, jsi::Value(keyboardState));
|
|
351
|
+
|
|
352
|
+
auto &heightMutableValue =
|
|
353
|
+
ValueWrapper::asMutableValue(heightShared->valueContainer);
|
|
354
|
+
heightMutableValue->setValue(rt, jsi::Value(height));
|
|
355
|
+
|
|
356
|
+
this->mapperRegistry->execute(*this->runtime);
|
|
357
|
+
};
|
|
358
|
+
|
|
359
|
+
return subscribeForKeyboardEventsFunction(keyboardEventDataUpdater);
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
void NativeReanimatedModule::unsubscribeFromKeyboardEvents(
|
|
363
|
+
jsi::Runtime &rt,
|
|
364
|
+
const jsi::Value &listenerId) {
|
|
365
|
+
unsubscribeFromKeyboardEventsFunction(listenerId.asNumber());
|
|
366
|
+
}
|
|
367
|
+
|
|
330
368
|
} // namespace reanimated
|
|
@@ -138,6 +138,25 @@ static jsi::Value SPEC_PREFIX(configureProps)(
|
|
|
138
138
|
return jsi::Value::undefined();
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
+
static jsi::Value SPEC_PREFIX(subscribeForKeyboardEvents)(
|
|
142
|
+
jsi::Runtime &rt,
|
|
143
|
+
TurboModule &turboModule,
|
|
144
|
+
const jsi::Value *args,
|
|
145
|
+
size_t count) {
|
|
146
|
+
return static_cast<NativeReanimatedModuleSpec *>(&turboModule)
|
|
147
|
+
->subscribeForKeyboardEvents(rt, std::move(args[0]));
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
static jsi::Value SPEC_PREFIX(unsubscribeFromKeyboardEvents)(
|
|
151
|
+
jsi::Runtime &rt,
|
|
152
|
+
TurboModule &turboModule,
|
|
153
|
+
const jsi::Value *args,
|
|
154
|
+
size_t count) {
|
|
155
|
+
static_cast<NativeReanimatedModuleSpec *>(&turboModule)
|
|
156
|
+
->unsubscribeFromKeyboardEvents(rt, std::move(args[0]));
|
|
157
|
+
return jsi::Value::undefined();
|
|
158
|
+
}
|
|
159
|
+
|
|
141
160
|
NativeReanimatedModuleSpec::NativeReanimatedModuleSpec(
|
|
142
161
|
std::shared_ptr<CallInvoker> jsInvoker)
|
|
143
162
|
: TurboModule("NativeReanimated", jsInvoker) {
|
|
@@ -163,5 +182,9 @@ NativeReanimatedModuleSpec::NativeReanimatedModuleSpec(
|
|
|
163
182
|
methodMap_["unregisterSensor"] =
|
|
164
183
|
MethodMetadata{1, SPEC_PREFIX(unregisterSensor)};
|
|
165
184
|
methodMap_["configureProps"] = MethodMetadata{2, SPEC_PREFIX(configureProps)};
|
|
185
|
+
methodMap_["subscribeForKeyboardEvents"] =
|
|
186
|
+
MethodMetadata{1, SPEC_PREFIX(subscribeForKeyboardEvents)};
|
|
187
|
+
methodMap_["unsubscribeFromKeyboardEvents"] =
|
|
188
|
+
MethodMetadata{1, SPEC_PREFIX(unsubscribeFromKeyboardEvents)};
|
|
166
189
|
}
|
|
167
190
|
} // namespace reanimated
|
|
@@ -89,6 +89,12 @@ class NativeReanimatedModule : public NativeReanimatedModuleSpec,
|
|
|
89
89
|
const jsi::Value &interval,
|
|
90
90
|
const jsi::Value &sensorDataContainer) override;
|
|
91
91
|
void unregisterSensor(jsi::Runtime &rt, const jsi::Value &sensorId) override;
|
|
92
|
+
jsi::Value subscribeForKeyboardEvents(
|
|
93
|
+
jsi::Runtime &rt,
|
|
94
|
+
const jsi::Value &keyboardEventContainer) override;
|
|
95
|
+
void unsubscribeFromKeyboardEvents(
|
|
96
|
+
jsi::Runtime &rt,
|
|
97
|
+
const jsi::Value &listenerId) override;
|
|
92
98
|
|
|
93
99
|
private:
|
|
94
100
|
std::shared_ptr<MapperRegistry> mapperRegistry;
|
|
@@ -103,6 +109,8 @@ class NativeReanimatedModule : public NativeReanimatedModuleSpec,
|
|
|
103
109
|
std::shared_ptr<LayoutAnimationsProxy> layoutAnimationsProxy;
|
|
104
110
|
AnimatedSensorModule animatedSensorModule;
|
|
105
111
|
ConfigurePropsFunction configurePropsPlatformFunction;
|
|
112
|
+
KeyboardEventSubscribeFunction subscribeForKeyboardEventsFunction;
|
|
113
|
+
KeyboardEventUnsubscribeFunction unsubscribeFromKeyboardEventsFunction;
|
|
106
114
|
};
|
|
107
115
|
|
|
108
116
|
} // namespace reanimated
|
|
@@ -69,6 +69,14 @@ class JSI_EXPORT NativeReanimatedModuleSpec : public TurboModule {
|
|
|
69
69
|
jsi::Runtime &rt,
|
|
70
70
|
const jsi::Value &sensorId) = 0;
|
|
71
71
|
|
|
72
|
+
// keyboard
|
|
73
|
+
virtual jsi::Value subscribeForKeyboardEvents(
|
|
74
|
+
jsi::Runtime &rt,
|
|
75
|
+
const jsi::Value &keyboardEventContainer) = 0;
|
|
76
|
+
virtual void unsubscribeFromKeyboardEvents(
|
|
77
|
+
jsi::Runtime &rt,
|
|
78
|
+
const jsi::Value &listenerId) = 0;
|
|
79
|
+
|
|
72
80
|
// other
|
|
73
81
|
virtual jsi::Value enableLayoutAnimations(
|
|
74
82
|
jsi::Runtime &rt,
|
|
@@ -30,6 +30,9 @@ using ConfigurePropsFunction = std::function<void(
|
|
|
30
30
|
jsi::Runtime &rt,
|
|
31
31
|
const jsi::Value &uiProps,
|
|
32
32
|
const jsi::Value &nativeProps)>;
|
|
33
|
+
using KeyboardEventSubscribeFunction =
|
|
34
|
+
std::function<int(std::function<void(int, int)>)>;
|
|
35
|
+
using KeyboardEventUnsubscribeFunction = std::function<void(int)>;
|
|
33
36
|
|
|
34
37
|
struct PlatformDepMethodsHolder {
|
|
35
38
|
RequestRender requestRender;
|
|
@@ -41,6 +44,8 @@ struct PlatformDepMethodsHolder {
|
|
|
41
44
|
UnregisterSensorFunction unregisterSensor;
|
|
42
45
|
SetGestureStateFunction setGestureStateFunction;
|
|
43
46
|
ConfigurePropsFunction configurePropsFunction;
|
|
47
|
+
KeyboardEventSubscribeFunction subscribeForKeyboardEvents;
|
|
48
|
+
KeyboardEventUnsubscribeFunction unsubscribeFromKeyboardEvents;
|
|
44
49
|
};
|
|
45
50
|
|
|
46
51
|
} // namespace reanimated
|
package/RNReanimated.podspec
CHANGED
|
@@ -4,14 +4,16 @@ package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
|
|
4
4
|
|
|
5
5
|
reactVersion = '0.0.0'
|
|
6
6
|
reactTargetTvOS = false
|
|
7
|
+
isUserApp = false
|
|
7
8
|
|
|
8
9
|
begin
|
|
9
|
-
#
|
|
10
|
+
# user app
|
|
10
11
|
# /appName/node_modules/react-native-reanimated/RNReanimated.podspec
|
|
11
12
|
# /appName/node_modules/react-native/package.json
|
|
12
13
|
reactJson = JSON.parse(File.read(File.join(__dir__, "..", "..", "node_modules", "react-native", "package.json")))
|
|
13
14
|
reactVersion = reactJson["version"]
|
|
14
15
|
reactTargetTvOS = reactJson["name"] == "react-native-tvos"
|
|
16
|
+
isUserApp = true
|
|
15
17
|
rescue
|
|
16
18
|
begin
|
|
17
19
|
# monorepo
|
|
@@ -31,11 +33,25 @@ rescue
|
|
|
31
33
|
rescue
|
|
32
34
|
# should never happen
|
|
33
35
|
reactVersion = '0.68.0'
|
|
34
|
-
puts "[RNReanimated] Unable to
|
|
36
|
+
puts "[RNReanimated] Unable to recognize your `react-native` version! Default `react-native` version: " + reactVersion
|
|
35
37
|
end
|
|
36
38
|
end
|
|
37
39
|
end
|
|
38
40
|
|
|
41
|
+
if isUserApp
|
|
42
|
+
libInstances = %x[find ../../ -name "package.json" | grep "/react-native-reanimated/package.json"]
|
|
43
|
+
libInstancesArray = libInstances.split("\n")
|
|
44
|
+
if libInstancesArray.length() > 1
|
|
45
|
+
parsedLocation = ''
|
|
46
|
+
for location in libInstancesArray
|
|
47
|
+
location['../../'] = '- '
|
|
48
|
+
location['/package.json'] = ''
|
|
49
|
+
parsedLocation += location + "\n"
|
|
50
|
+
end
|
|
51
|
+
raise "[Reanimated] Multiple versions of Reanimated were detected. Only one instance of react-native-reanimated can be installed in a project. You need to resolve the conflict manually. Check out the documentation: https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/troubleshooting#multiple-versions-of-reanimated-were-detected \n\nConflict between: \n" + parsedLocation
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
|
|
39
55
|
rnVersion = reactVersion.split('.')[1]
|
|
40
56
|
|
|
41
57
|
folly_prefix = ""
|
|
@@ -46,7 +62,6 @@ end
|
|
|
46
62
|
|
|
47
63
|
folly_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -DRNVERSION=' + rnVersion
|
|
48
64
|
folly_compiler_flags = folly_flags + ' ' + '-Wno-comma -Wno-shorten-64-to-32'
|
|
49
|
-
folly_version = '2021.04.26.00'
|
|
50
65
|
boost_compiler_flags = '-Wno-documentation'
|
|
51
66
|
|
|
52
67
|
Pod::Spec.new do |s|
|
|
@@ -86,6 +101,10 @@ Pod::Spec.new do |s|
|
|
|
86
101
|
s.requires_arc = true
|
|
87
102
|
|
|
88
103
|
s.dependency "React-Core"
|
|
104
|
+
s.dependency "#{folly_prefix}Folly"
|
|
105
|
+
s.dependency "RCTRequired"
|
|
106
|
+
s.dependency "RCTTypeSafety"
|
|
107
|
+
s.dependency "ReactCommon/turbomodule/core"
|
|
89
108
|
s.dependency 'FBLazyVector'
|
|
90
109
|
s.dependency 'FBReactNativeSpec'
|
|
91
110
|
s.dependency 'RCTRequired'
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
#Fri
|
|
1
|
+
#Fri Aug 19 13:09:51 UTC 2022
|
|
2
2
|
gradle.version=7.2
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/android/CMakeLists.txt
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
project(Reanimated)
|
|
2
|
-
cmake_minimum_required(VERSION 3.
|
|
2
|
+
cmake_minimum_required(VERSION 3.12.0)
|
|
3
3
|
|
|
4
4
|
set (CMAKE_VERBOSE_MAKEFILE ON)
|
|
5
|
-
set (CMAKE_CXX_STANDARD
|
|
6
|
-
set (
|
|
5
|
+
set (CMAKE_CXX_STANDARD 17)
|
|
6
|
+
set (DEFAULT_FLAGS "-DFOLLY_NO_CONFIG=1 -DFOLLY_HAVE_CLOCK_GETTIME=1 -DFOLLY_HAVE_MEMRCHR=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_MOBILE=1 -DFOLLY_HAVE_RECVMMSG=1 -DFOLLY_HAVE_PTHREAD=1 -DON_ANDROID -DONANDROID -DANDROID -DRNVERSION=${RNVERSION} -fexceptions -fno-omit-frame-pointer -frtti -Wno-sign-compare -std=c++17 -Wall")
|
|
7
|
+
if(${IS_NEW_ARCHITECTURE_ENABLED})
|
|
8
|
+
set (ALL_FLAGS "${DEFAULT_FLAGS} -DRCT_NEW_ARCH_ENABLED")
|
|
9
|
+
else()
|
|
10
|
+
set (ALL_FLAGS ${DEFAULT_FLAGS})
|
|
11
|
+
endif()
|
|
12
|
+
set (CMAKE_CXX_FLAGS ${ALL_FLAGS})
|
|
7
13
|
|
|
8
14
|
if(${NATIVE_DEBUG})
|
|
9
15
|
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g")
|
|
@@ -17,54 +23,63 @@ set (PACKAGE_NAME "reanimated")
|
|
|
17
23
|
set (BUILD_DIR ${CMAKE_SOURCE_DIR}/build)
|
|
18
24
|
set (SRC_DIR ${CMAKE_SOURCE_DIR}/src)
|
|
19
25
|
|
|
26
|
+
set (ignoreMe "${PLAYGROUND_APP_NAME}")
|
|
27
|
+
|
|
20
28
|
if(${CLIENT_SIDE_BUILD})
|
|
21
|
-
set (NODE_MODULES_DIR "${CMAKE_SOURCE_DIR}/../../")
|
|
22
29
|
set (COMMON_SRC_DIR "${CMAKE_SOURCE_DIR}/../Common")
|
|
23
30
|
else()
|
|
24
|
-
set (NODE_MODULES_DIR "../node_modules")
|
|
25
31
|
set (COMMON_SRC_DIR "${SRC_DIR}/main/Common")
|
|
26
32
|
endif()
|
|
27
33
|
|
|
28
|
-
|
|
29
|
-
|
|
34
|
+
if(${IS_NEW_ARCHITECTURE_ENABLED})
|
|
35
|
+
if(${CLIENT_SIDE_BUILD})
|
|
36
|
+
set (RN_SO_DIR "${CMAKE_SOURCE_DIR}/../../../android/app/build/react-ndk/exported")
|
|
37
|
+
set (FBJNI_HEADERS_DIR "${CMAKE_SOURCE_DIR}/../../react-native/ReactAndroid/src/main/jni/first-party/fbjni/headers")
|
|
38
|
+
else()
|
|
39
|
+
set (RN_SO_DIR "${CMAKE_SOURCE_DIR}/../${PLAYGROUND_APP_NAME}/android/app/build/react-ndk/exported")
|
|
40
|
+
set (FBJNI_HEADERS_DIR "${CMAKE_SOURCE_DIR}/../${PLAYGROUND_APP_NAME}/node_modules/react-native/ReactAndroid/src/main/jni/first-party/fbjni/headers")
|
|
41
|
+
endif()
|
|
42
|
+
else()
|
|
43
|
+
set (RN_SO_DIR ${NODE_MODULES_DIR}/react-native/ReactAndroid/src/main/jni/first-party/react/jni)
|
|
44
|
+
set (FBJNI_HEADERS_DIR "${NODE_MODULES_DIR}/react-native/ReactAndroid/src/main/jni/first-party/fbjni/headers")
|
|
45
|
+
endif()
|
|
30
46
|
|
|
31
|
-
|
|
47
|
+
file (GLOB LIBRN_DIR "${RN_SO_DIR}/${ANDROID_ABI}")
|
|
32
48
|
|
|
33
|
-
file(
|
|
34
|
-
file(
|
|
35
|
-
file(GLOB sources_shared_items "${COMMON_SRC_DIR}/cpp/SharedItems/*.cpp")
|
|
36
|
-
file(GLOB sources_registries "${COMMON_SRC_DIR}/cpp/Registries/*.cpp")
|
|
37
|
-
file(GLOB sources_android "${SRC_DIR}/main/cpp/*.cpp")
|
|
49
|
+
file(GLOB_RECURSE SOURCES_COMMON CONFIGURE_DEPENDS "${COMMON_SRC_DIR}/cpp/**.cpp")
|
|
50
|
+
file(GLOB_RECURSE SOURCES_ANDROID CONFIGURE_DEPENDS "${SRC_DIR}/main/cpp/**.cpp")
|
|
38
51
|
|
|
39
52
|
if(${REACT_NATIVE_TARGET_VERSION} LESS 66)
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
53
|
+
set (
|
|
54
|
+
INCLUDE_JSI_CPP
|
|
55
|
+
"${NODE_MODULES_DIR}/react-native/ReactCommon/jsi/jsi/jsi.cpp"
|
|
56
|
+
)
|
|
57
|
+
set (
|
|
58
|
+
INCLUDE_JSIDYNAMIC_CPP
|
|
59
|
+
"${NODE_MODULES_DIR}/react-native/ReactCommon/jsi/jsi/JSIDynamic.cpp"
|
|
60
|
+
)
|
|
61
|
+
endif()
|
|
62
|
+
|
|
63
|
+
if(${IS_NEW_ARCHITECTURE_ENABLED})
|
|
64
|
+
set(
|
|
65
|
+
FABRIC_UTILS_CPP
|
|
66
|
+
"${COMMON_SRC_DIR}/cpp/Fabric/FabricUtils.cpp"
|
|
67
|
+
)
|
|
68
|
+
set(
|
|
69
|
+
REANIMATED_UI_MANAGER_BINDING_CPP
|
|
70
|
+
"${COMMON_SRC_DIR}/cpp/Fabric/ReanimatedUIManagerBinding.cpp"
|
|
71
|
+
)
|
|
48
72
|
endif()
|
|
49
73
|
|
|
50
74
|
add_library(
|
|
51
75
|
${PACKAGE_NAME}
|
|
52
76
|
SHARED
|
|
53
|
-
${
|
|
54
|
-
${
|
|
55
|
-
${sources_registries}
|
|
56
|
-
${sources_android}
|
|
57
|
-
${source_tools}
|
|
77
|
+
${SOURCES_COMMON}
|
|
78
|
+
${SOURCES_ANDROID}
|
|
58
79
|
${INCLUDE_JSI_CPP}
|
|
59
80
|
${INCLUDE_JSIDYNAMIC_CPP}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
"${COMMON_SRC_DIR}/cpp/Tools/RuntimeDecorator.cpp"
|
|
63
|
-
"${COMMON_SRC_DIR}/cpp/Tools/Scheduler.cpp"
|
|
64
|
-
"${COMMON_SRC_DIR}/cpp/Tools/WorkletEventHandler.cpp"
|
|
65
|
-
"${COMMON_SRC_DIR}/cpp/Tools/FeaturesConfig.cpp"
|
|
66
|
-
"${COMMON_SRC_DIR}/cpp/LayoutAnimations/LayoutAnimationsProxy.cpp"
|
|
67
|
-
"${COMMON_SRC_DIR}/cpp/AnimatedSensor/AnimatedSensorModule.cpp"
|
|
81
|
+
${FABRIC_UTILS_CPP}
|
|
82
|
+
${REANIMATED_UI_MANAGER_BINDING_CPP}
|
|
68
83
|
)
|
|
69
84
|
|
|
70
85
|
# includes
|
|
@@ -83,12 +98,15 @@ target_include_directories(
|
|
|
83
98
|
"${NODE_MODULES_DIR}/react-native/React/Base"
|
|
84
99
|
"${NODE_MODULES_DIR}/react-native/ReactAndroid/src/main/jni"
|
|
85
100
|
"${NODE_MODULES_DIR}/react-native/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni"
|
|
101
|
+
"${NODE_MODULES_DIR}/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/jni"
|
|
86
102
|
"${NODE_MODULES_DIR}/react-native/ReactCommon"
|
|
87
103
|
"${NODE_MODULES_DIR}/react-native/ReactCommon/callinvoker"
|
|
88
104
|
"${NODE_MODULES_DIR}/react-native/ReactCommon/jsi"
|
|
105
|
+
"${NODE_MODULES_DIR}/react-native/ReactCommon/react/renderer/graphics/platform/cxx"
|
|
106
|
+
"${NODE_MODULES_DIR}/react-native/ReactCommon/runtimeexecutor"
|
|
89
107
|
"${NODE_MODULES_DIR}/react-native/ReactCommon/turbomodule/core"
|
|
90
108
|
"${NODE_MODULES_DIR}/react-native/ReactCommon/turbomodule"
|
|
91
|
-
"${NODE_MODULES_DIR}/
|
|
109
|
+
"${NODE_MODULES_DIR}/react-native/ReactCommon/yoga"
|
|
92
110
|
"${COMMON_SRC_DIR}/cpp/headers/Tools"
|
|
93
111
|
"${COMMON_SRC_DIR}/cpp/headers/SpecTools"
|
|
94
112
|
"${COMMON_SRC_DIR}/cpp/headers/NativeModules"
|
|
@@ -96,62 +114,27 @@ target_include_directories(
|
|
|
96
114
|
"${COMMON_SRC_DIR}/cpp/headers/Registries"
|
|
97
115
|
"${COMMON_SRC_DIR}/cpp/headers/LayoutAnimations"
|
|
98
116
|
"${COMMON_SRC_DIR}/cpp/headers/AnimatedSensor"
|
|
117
|
+
"${COMMON_SRC_DIR}/cpp/headers/Fabric"
|
|
99
118
|
"${COMMON_SRC_DIR}/cpp/hidden_headers"
|
|
100
119
|
"${SRC_DIR}/main/cpp/headers"
|
|
101
120
|
)
|
|
102
121
|
|
|
103
|
-
# find libraries
|
|
104
|
-
|
|
105
|
-
file (GLOB LIBRN_DIR "${RN_SO_DIR}/${ANDROID_ABI}")
|
|
106
|
-
file (GLOB HERMES_DIR "${BUILD_DIR}/third-party-ndk/hermes/jni/${ANDROID_ABI}")
|
|
107
|
-
|
|
108
122
|
find_library(
|
|
109
123
|
LOG_LIB
|
|
110
124
|
log
|
|
111
125
|
)
|
|
112
|
-
find_library(
|
|
113
|
-
HERMES_LIB
|
|
114
|
-
hermes
|
|
115
|
-
PATHS ${HERMES_DIR}
|
|
116
|
-
NO_CMAKE_FIND_ROOT_PATH
|
|
117
|
-
)
|
|
118
|
-
find_library(
|
|
119
|
-
JSEXECUTOR_LIB
|
|
120
|
-
jscexecutor
|
|
121
|
-
PATHS ${LIBRN_DIR}
|
|
122
|
-
NO_CMAKE_FIND_ROOT_PATH
|
|
123
|
-
)
|
|
124
|
-
|
|
125
|
-
if(${REACT_NATIVE_TARGET_VERSION} LESS 69)
|
|
126
|
-
find_library(
|
|
127
|
-
FOLLY_LIB
|
|
128
|
-
folly_json
|
|
129
|
-
PATHS ${LIBRN_DIR}
|
|
130
|
-
NO_CMAKE_FIND_ROOT_PATH
|
|
131
|
-
)
|
|
132
|
-
else()
|
|
133
|
-
find_library(
|
|
134
|
-
FOLLY_LIB
|
|
135
|
-
folly_runtime
|
|
136
|
-
PATHS ${LIBRN_DIR}
|
|
137
|
-
NO_CMAKE_FIND_ROOT_PATH
|
|
138
|
-
)
|
|
139
|
-
endif()
|
|
140
|
-
|
|
141
126
|
find_library(
|
|
142
127
|
REACT_NATIVE_JNI_LIB
|
|
143
128
|
reactnativejni
|
|
144
129
|
PATHS ${LIBRN_DIR}
|
|
145
130
|
NO_CMAKE_FIND_ROOT_PATH
|
|
146
131
|
)
|
|
147
|
-
|
|
148
132
|
find_library(
|
|
149
133
|
GLOG_LIB
|
|
150
134
|
glog
|
|
151
135
|
PATHS ${LIBRN_DIR}
|
|
152
136
|
NO_CMAKE_FIND_ROOT_PATH
|
|
153
137
|
)
|
|
154
|
-
|
|
155
138
|
find_library(
|
|
156
139
|
FBJNI_LIB
|
|
157
140
|
fbjni
|
|
@@ -159,44 +142,180 @@ find_library(
|
|
|
159
142
|
NO_CMAKE_FIND_ROOT_PATH
|
|
160
143
|
)
|
|
161
144
|
|
|
145
|
+
if(${REACT_NATIVE_TARGET_VERSION} LESS 69)
|
|
146
|
+
find_library(
|
|
147
|
+
FOLLY_LIB
|
|
148
|
+
folly_json
|
|
149
|
+
PATHS ${LIBRN_DIR}
|
|
150
|
+
NO_CMAKE_FIND_ROOT_PATH
|
|
151
|
+
)
|
|
152
|
+
else()
|
|
153
|
+
find_library(
|
|
154
|
+
FOLLY_LIB
|
|
155
|
+
folly_runtime
|
|
156
|
+
PATHS ${LIBRN_DIR}
|
|
157
|
+
NO_CMAKE_FIND_ROOT_PATH
|
|
158
|
+
)
|
|
159
|
+
endif()
|
|
160
|
+
|
|
162
161
|
if(${REACT_NATIVE_TARGET_VERSION} LESS 66)
|
|
163
|
-
|
|
162
|
+
set (JSI_LIB "")
|
|
164
163
|
else()
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
164
|
+
find_library(
|
|
165
|
+
JSI_LIB
|
|
166
|
+
jsi
|
|
167
|
+
PATHS ${LIBRN_DIR}
|
|
168
|
+
NO_CMAKE_FIND_ROOT_PATH
|
|
169
|
+
)
|
|
170
|
+
endif()
|
|
171
|
+
|
|
172
|
+
if(${IS_NEW_ARCHITECTURE_ENABLED})
|
|
173
|
+
find_library(
|
|
174
|
+
REACT_RENDER_UIMANAGER
|
|
175
|
+
react_render_uimanager
|
|
176
|
+
PATHS ${LIBRN_DIR}
|
|
177
|
+
NO_CMAKE_FIND_ROOT_PATH
|
|
178
|
+
)
|
|
179
|
+
find_library(
|
|
180
|
+
REACT_RENDER_MOUNTING
|
|
181
|
+
react_render_mounting
|
|
182
|
+
PATHS ${LIBRN_DIR}
|
|
183
|
+
NO_CMAKE_FIND_ROOT_PATH
|
|
184
|
+
)
|
|
185
|
+
find_library(
|
|
186
|
+
REACT_RENDER_COMPONENTREGISTRY
|
|
187
|
+
react_render_componentregistry
|
|
188
|
+
PATHS ${LIBRN_DIR}
|
|
189
|
+
NO_CMAKE_FIND_ROOT_PATH
|
|
190
|
+
)
|
|
191
|
+
find_library(
|
|
192
|
+
REACT_RENDER_CORE
|
|
193
|
+
react_render_core
|
|
194
|
+
PATHS ${LIBRN_DIR}
|
|
195
|
+
NO_CMAKE_FIND_ROOT_PATH
|
|
196
|
+
)
|
|
197
|
+
find_library(
|
|
198
|
+
REACT_DEBUG
|
|
199
|
+
react_debug
|
|
200
|
+
PATHS ${LIBRN_DIR}
|
|
201
|
+
NO_CMAKE_FIND_ROOT_PATH
|
|
202
|
+
)
|
|
203
|
+
find_library(
|
|
204
|
+
REACT_RENDER_DEBUG
|
|
205
|
+
react_render_debug
|
|
206
|
+
PATHS ${LIBRN_DIR}
|
|
207
|
+
NO_CMAKE_FIND_ROOT_PATH
|
|
208
|
+
)
|
|
209
|
+
find_library(
|
|
210
|
+
RRC_ROOT
|
|
211
|
+
rrc_root
|
|
212
|
+
PATHS ${LIBRN_DIR}
|
|
213
|
+
NO_CMAKE_FIND_ROOT_PATH
|
|
214
|
+
)
|
|
215
|
+
find_library(
|
|
216
|
+
RRC_VIEW
|
|
217
|
+
rrc_view
|
|
218
|
+
PATHS ${LIBRN_DIR}
|
|
219
|
+
NO_CMAKE_FIND_ROOT_PATH
|
|
220
|
+
)
|
|
221
|
+
find_library(
|
|
222
|
+
REACT_RENDER_SCHEDULER
|
|
223
|
+
react_render_scheduler
|
|
224
|
+
PATHS ${LIBRN_DIR}
|
|
225
|
+
NO_CMAKE_FIND_ROOT_PATH
|
|
226
|
+
)
|
|
227
|
+
find_library(
|
|
228
|
+
FABRICJNI
|
|
229
|
+
fabricjni
|
|
230
|
+
PATHS ${LIBRN_DIR}
|
|
231
|
+
NO_CMAKE_FIND_ROOT_PATH
|
|
232
|
+
)
|
|
171
233
|
endif()
|
|
172
234
|
|
|
173
235
|
# build shared lib
|
|
174
236
|
|
|
175
237
|
set_target_properties(${PACKAGE_NAME} PROPERTIES LINKER_LANGUAGE CXX)
|
|
176
238
|
|
|
177
|
-
|
|
239
|
+
|
|
240
|
+
target_link_libraries(
|
|
241
|
+
${PACKAGE_NAME}
|
|
242
|
+
${LOG_LIB}
|
|
243
|
+
${JSI_LIB}
|
|
244
|
+
${GLOG_LIB}
|
|
245
|
+
${FBJNI_LIB}
|
|
246
|
+
${FOLLY_LIB}
|
|
247
|
+
${REACT_NATIVE_JNI_LIB}
|
|
248
|
+
android
|
|
249
|
+
)
|
|
250
|
+
|
|
251
|
+
if(${JS_RUNTIME} STREQUAL "hermes")
|
|
252
|
+
string(APPEND CMAKE_CXX_FLAGS " -DJS_RUNTIME_HERMES=1")
|
|
253
|
+
if(${REACT_NATIVE_TARGET_VERSION} LESS 69)
|
|
254
|
+
# From `hermes-engine` npm package
|
|
255
|
+
target_include_directories(
|
|
256
|
+
${PACKAGE_NAME}
|
|
257
|
+
PRIVATE
|
|
258
|
+
"${JS_RUNTIME_DIR}/android/include"
|
|
259
|
+
)
|
|
260
|
+
else()
|
|
261
|
+
# Bundled Hermes from module `com.facebook.react:hermes-engine` or project `:ReactAndroid:hermes-engine`
|
|
262
|
+
target_include_directories(
|
|
263
|
+
${PACKAGE_NAME}
|
|
264
|
+
PRIVATE
|
|
265
|
+
"${JS_RUNTIME_DIR}/API"
|
|
266
|
+
"${JS_RUNTIME_DIR}/public"
|
|
267
|
+
)
|
|
268
|
+
endif()
|
|
269
|
+
target_link_libraries(
|
|
270
|
+
${PACKAGE_NAME}
|
|
271
|
+
"${BUILD_DIR}/third-party-ndk/hermes/jni/${ANDROID_ABI}/libhermes.so"
|
|
272
|
+
)
|
|
273
|
+
elseif(${JS_RUNTIME} STREQUAL "v8")
|
|
274
|
+
string(APPEND CMAKE_CXX_FLAGS " -DJS_RUNTIME_V8=1")
|
|
275
|
+
target_include_directories(
|
|
276
|
+
${PACKAGE_NAME}
|
|
277
|
+
PRIVATE
|
|
278
|
+
"${JS_RUNTIME_DIR}/src"
|
|
279
|
+
)
|
|
280
|
+
file (GLOB V8_SO_DIR "${JS_RUNTIME_DIR}/android/build/intermediates/library_jni/*/jni/${ANDROID_ABI}")
|
|
281
|
+
find_library(
|
|
282
|
+
V8EXECUTOR_LIB
|
|
283
|
+
v8executor
|
|
284
|
+
PATHS ${V8_SO_DIR}
|
|
285
|
+
NO_CMAKE_FIND_ROOT_PATH
|
|
286
|
+
)
|
|
178
287
|
target_link_libraries(
|
|
179
288
|
${PACKAGE_NAME}
|
|
180
|
-
${
|
|
181
|
-
${JSI_LIB}
|
|
182
|
-
${HERMES_LIB}
|
|
183
|
-
${GLOG_LIB}
|
|
184
|
-
${FBJNI_LIB}
|
|
185
|
-
${FOLLY_LIB}
|
|
186
|
-
${REACT_NATIVE_JNI_LIB}
|
|
187
|
-
android
|
|
289
|
+
${V8EXECUTOR_LIB}
|
|
188
290
|
)
|
|
189
291
|
else()
|
|
292
|
+
set (ignoreMe "${JS_RUNTIME_DIR}")
|
|
293
|
+
string(APPEND CMAKE_CXX_FLAGS " -DJS_RUNTIME_JSC=1")
|
|
294
|
+
find_library(
|
|
295
|
+
JSEXECUTOR_LIB
|
|
296
|
+
jscexecutor
|
|
297
|
+
PATHS ${LIBRN_DIR}
|
|
298
|
+
NO_CMAKE_FIND_ROOT_PATH
|
|
299
|
+
)
|
|
190
300
|
target_link_libraries(
|
|
191
301
|
${PACKAGE_NAME}
|
|
192
|
-
${LOG_LIB}
|
|
193
|
-
${JSI_LIB}
|
|
194
302
|
${JSEXECUTOR_LIB}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
303
|
+
)
|
|
304
|
+
endif()
|
|
305
|
+
|
|
306
|
+
if(${IS_NEW_ARCHITECTURE_ENABLED})
|
|
307
|
+
target_link_libraries(
|
|
308
|
+
${PACKAGE_NAME}
|
|
309
|
+
${REACT_RENDER_UIMANAGER}
|
|
310
|
+
${REACT_RENDER_MOUNTING}
|
|
311
|
+
${REACT_RENDER_COMPONENTREGISTRY}
|
|
312
|
+
${REACT_RENDER_CORE}
|
|
313
|
+
${REACT_DEBUG}
|
|
314
|
+
${REACT_RENDER_DEBUG}
|
|
315
|
+
${RRC_ROOT}
|
|
316
|
+
${RRC_VIEW}
|
|
317
|
+
${FABRICJNI}
|
|
318
|
+
${REACT_RENDER_SCHEDULER}
|
|
200
319
|
)
|
|
201
320
|
endif()
|
|
202
321
|
|
|
@@ -208,4 +327,4 @@ if(${REACT_NATIVE_TARGET_VERSION} LESS 64)
|
|
|
208
327
|
# Provides a relative path to your source file(s).
|
|
209
328
|
./empty.cpp
|
|
210
329
|
)
|
|
211
|
-
endif()
|
|
330
|
+
endif()
|