@react-native-ohos/react-native-reanimated 3.18.1-rc.6 → 3.18.2-rc.2
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/LICENSE +21 -21
- package/README.OpenSource +10 -10
- package/README.md +10 -10
- package/harmony/reanimated/BuildProfile.ets +16 -16
- package/harmony/reanimated/build-profile.json5 +11 -11
- package/harmony/reanimated/oh-package.json5 +11 -11
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/AnimatedSensor/AnimatedSensorModule.cpp +86 -86
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/AnimatedSensor/AnimatedSensorModule.h +47 -47
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/PropsRegistry.cpp +68 -68
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/PropsRegistry.h +68 -68
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ReanimatedCommitHook.cpp +101 -101
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ReanimatedCommitHook.h +51 -51
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ReanimatedCommitShadowNode.h +49 -49
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ReanimatedMountHook.cpp +96 -87
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ReanimatedMountHook.h +33 -33
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ShadowTreeCloner.cpp +95 -95
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ShadowTreeCloner.h +29 -29
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationType.h +9 -9
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsManager.cpp +232 -232
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsManager.h +90 -90
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy.cpp +870 -870
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy.h +147 -147
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsUtils.cpp +91 -91
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsUtils.h +176 -176
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxy.cpp +971 -971
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxy.h +252 -252
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxySpec.cpp +231 -231
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxySpec.h +109 -109
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/RuntimeDecorators/RNRuntimeDecorator.cpp +56 -56
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/RuntimeDecorators/RNRuntimeDecorator.h +20 -20
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/RuntimeDecorators/UIRuntimeDecorator.cpp +70 -70
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/RuntimeDecorators/UIRuntimeDecorator.h +35 -35
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/CollectionUtils.h +14 -14
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/FeaturesConfig.cpp +5 -5
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/FeaturesConfig.h +19 -19
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/PlatformDepMethodsHolder.h +98 -98
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/ReanimatedSystraceSection.h +135 -135
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/NativeModules/WorkletsModuleProxy.cpp +47 -47
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/NativeModules/WorkletsModuleProxy.h +59 -59
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/NativeModules/WorkletsModuleProxySpec.cpp +27 -27
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/NativeModules/WorkletsModuleProxySpec.h +25 -25
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Registries/EventHandlerRegistry.cpp +94 -94
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Registries/EventHandlerRegistry.h +49 -49
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Registries/WorkletRuntimeRegistry.cpp +8 -8
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Registries/WorkletRuntimeRegistry.h +39 -39
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/SharedItems/Shareables.cpp +326 -326
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/SharedItems/Shareables.h +345 -345
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/AsyncQueue.cpp +52 -52
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/AsyncQueue.h +35 -35
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/Defs.h +10 -10
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/JSISerializer.cpp +342 -342
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/JSISerializer.h +47 -47
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/JSLogger.cpp +16 -16
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/JSLogger.h +20 -20
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/JSScheduler.cpp +20 -20
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/JSScheduler.h +29 -29
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/PlatformLogger.h +16 -16
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/ReanimatedJSIUtils.cpp +26 -26
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/ReanimatedJSIUtils.h +199 -199
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/ReanimatedVersion.cpp +95 -95
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/ReanimatedVersion.h +19 -19
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/SingleInstanceChecker.h +72 -72
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/ThreadSafeQueue.h +49 -49
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/UIScheduler.cpp +20 -20
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/UIScheduler.h +22 -22
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/WorkletEventHandler.cpp +29 -29
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/WorkletEventHandler.h +41 -41
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/RNRuntimeWorkletDecorator.cpp +16 -16
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/RNRuntimeWorkletDecorator.h +19 -19
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/ReanimatedHermesRuntime.cpp +112 -112
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/ReanimatedHermesRuntime.h +127 -127
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/ReanimatedRuntime.cpp +53 -53
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/ReanimatedRuntime.h +22 -22
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/RuntimeInitialization.md +191 -191
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/WorkletRuntime.cpp +173 -155
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/WorkletRuntime.h +90 -90
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/WorkletRuntimeCollector.h +36 -36
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/WorkletRuntimeDecorator.cpp +189 -182
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/WorkletRuntimeDecorator.h +22 -22
- package/harmony/reanimated/src/main/cpp/WorkletsModule.cpp +60 -60
- package/harmony/reanimated/src/main/cpp/patches/AnimatedSensor/AnimatedSensorModule.cpp +89 -89
- package/harmony/reanimated/src/main/ets/ReanimatedModule.ts +7 -0
- package/harmony/reanimated/src/main/module.json5 +12 -12
- package/harmony/reanimated/src/main/resources/base/element/color.json +7 -7
- package/harmony/reanimated/src/main/resources/base/element/string.json +15 -15
- package/harmony/reanimated/src/main/resources/base/profile/main_pages.json +5 -5
- package/harmony/reanimated/src/main/resources/en_US/element/string.json +15 -15
- package/harmony/reanimated/src/main/resources/zh_CN/element/string.json +15 -15
- package/harmony/reanimated/ts.ts +6 -6
- package/harmony/reanimated.har +0 -0
- package/package.json +50 -50
|
@@ -1,231 +1,231 @@
|
|
|
1
|
-
#include <reanimated/NativeModules/ReanimatedModuleProxySpec.h>
|
|
2
|
-
|
|
3
|
-
#include <utility>
|
|
4
|
-
|
|
5
|
-
#define REANIMATED_SPEC_PREFIX(FN_NAME) \
|
|
6
|
-
__hostFunction_ReanimatedModuleProxySpec_##FN_NAME
|
|
7
|
-
|
|
8
|
-
namespace reanimated {
|
|
9
|
-
|
|
10
|
-
// scheduler
|
|
11
|
-
|
|
12
|
-
static jsi::Value REANIMATED_SPEC_PREFIX(scheduleOnUI)(
|
|
13
|
-
jsi::Runtime &rt,
|
|
14
|
-
TurboModule &turboModule,
|
|
15
|
-
const jsi::Value *args,
|
|
16
|
-
size_t) {
|
|
17
|
-
static_cast<ReanimatedModuleProxySpec *>(&turboModule)
|
|
18
|
-
->scheduleOnUI(rt, std::move(args[0]));
|
|
19
|
-
return jsi::Value::undefined();
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
static jsi::Value REANIMATED_SPEC_PREFIX(executeOnUIRuntimeSync)(
|
|
23
|
-
jsi::Runtime &rt,
|
|
24
|
-
TurboModule &turboModule,
|
|
25
|
-
const jsi::Value *args,
|
|
26
|
-
size_t) {
|
|
27
|
-
return static_cast<ReanimatedModuleProxySpec *>(&turboModule)
|
|
28
|
-
->executeOnUIRuntimeSync(rt, std::move(args[0]));
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
static jsi::Value REANIMATED_SPEC_PREFIX(createWorkletRuntime)(
|
|
32
|
-
jsi::Runtime &rt,
|
|
33
|
-
TurboModule &turboModule,
|
|
34
|
-
const jsi::Value *args,
|
|
35
|
-
size_t) {
|
|
36
|
-
return static_cast<ReanimatedModuleProxySpec *>(&turboModule)
|
|
37
|
-
->createWorkletRuntime(rt, std::move(args[0]), std::move(args[1]));
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
static jsi::Value REANIMATED_SPEC_PREFIX(scheduleOnRuntime)(
|
|
41
|
-
jsi::Runtime &rt,
|
|
42
|
-
TurboModule &turboModule,
|
|
43
|
-
const jsi::Value *args,
|
|
44
|
-
size_t) {
|
|
45
|
-
return static_cast<ReanimatedModuleProxySpec *>(&turboModule)
|
|
46
|
-
->scheduleOnRuntime(rt, std::move(args[0]), std::move(args[1]));
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
static jsi::Value REANIMATED_SPEC_PREFIX(registerEventHandler)(
|
|
50
|
-
jsi::Runtime &rt,
|
|
51
|
-
TurboModule &turboModule,
|
|
52
|
-
const jsi::Value *args,
|
|
53
|
-
size_t) {
|
|
54
|
-
return static_cast<ReanimatedModuleProxySpec *>(&turboModule)
|
|
55
|
-
->registerEventHandler(
|
|
56
|
-
rt, std::move(args[0]), std::move(args[1]), std::move(args[2]));
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
static jsi::Value REANIMATED_SPEC_PREFIX(unregisterEventHandler)(
|
|
60
|
-
jsi::Runtime &rt,
|
|
61
|
-
TurboModule &turboModule,
|
|
62
|
-
const jsi::Value *args,
|
|
63
|
-
size_t) {
|
|
64
|
-
static_cast<ReanimatedModuleProxySpec *>(&turboModule)
|
|
65
|
-
->unregisterEventHandler(rt, std::move(args[0]));
|
|
66
|
-
return jsi::Value::undefined();
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
static jsi::Value REANIMATED_SPEC_PREFIX(getViewProp)(
|
|
70
|
-
jsi::Runtime &rt,
|
|
71
|
-
TurboModule &turboModule,
|
|
72
|
-
const jsi::Value *args,
|
|
73
|
-
size_t) {
|
|
74
|
-
static_cast<ReanimatedModuleProxySpec *>(&turboModule)
|
|
75
|
-
->getViewProp(
|
|
76
|
-
rt, std::move(args[0]), std::move(args[1]), std::move(args[2]));
|
|
77
|
-
return jsi::Value::undefined();
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
static jsi::Value REANIMATED_SPEC_PREFIX(enableLayoutAnimations)(
|
|
81
|
-
jsi::Runtime &rt,
|
|
82
|
-
TurboModule &turboModule,
|
|
83
|
-
const jsi::Value *args,
|
|
84
|
-
size_t) {
|
|
85
|
-
static_cast<ReanimatedModuleProxySpec *>(&turboModule)
|
|
86
|
-
->enableLayoutAnimations(rt, std::move(args[0]));
|
|
87
|
-
return jsi::Value::undefined();
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
static jsi::Value REANIMATED_SPEC_PREFIX(registerSensor)(
|
|
91
|
-
jsi::Runtime &rt,
|
|
92
|
-
TurboModule &turboModule,
|
|
93
|
-
const jsi::Value *args,
|
|
94
|
-
size_t) {
|
|
95
|
-
return static_cast<ReanimatedModuleProxySpec *>(&turboModule)
|
|
96
|
-
->registerSensor(
|
|
97
|
-
rt,
|
|
98
|
-
std::move(args[0]),
|
|
99
|
-
std::move(args[1]),
|
|
100
|
-
std::move(args[2]),
|
|
101
|
-
std::move(args[3]));
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
static jsi::Value REANIMATED_SPEC_PREFIX(unregisterSensor)(
|
|
105
|
-
jsi::Runtime &rt,
|
|
106
|
-
TurboModule &turboModule,
|
|
107
|
-
const jsi::Value *args,
|
|
108
|
-
size_t) {
|
|
109
|
-
static_cast<ReanimatedModuleProxySpec *>(&turboModule)
|
|
110
|
-
->unregisterSensor(rt, std::move(args[0]));
|
|
111
|
-
return jsi::Value::undefined();
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
static jsi::Value REANIMATED_SPEC_PREFIX(configureProps)(
|
|
115
|
-
jsi::Runtime &rt,
|
|
116
|
-
TurboModule &turboModule,
|
|
117
|
-
const jsi::Value *args,
|
|
118
|
-
size_t) {
|
|
119
|
-
static_cast<ReanimatedModuleProxySpec *>(&turboModule)
|
|
120
|
-
->configureProps(rt, std::move(args[0]), std::move(args[1]));
|
|
121
|
-
return jsi::Value::undefined();
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
static jsi::Value REANIMATED_SPEC_PREFIX(subscribeForKeyboardEvents)(
|
|
125
|
-
jsi::Runtime &rt,
|
|
126
|
-
TurboModule &turboModule,
|
|
127
|
-
const jsi::Value *args,
|
|
128
|
-
size_t) {
|
|
129
|
-
return static_cast<ReanimatedModuleProxySpec *>(&turboModule)
|
|
130
|
-
->subscribeForKeyboardEvents(
|
|
131
|
-
rt, std::move(args[0]), std::move(args[1]), std::move(args[2]));
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
static jsi::Value REANIMATED_SPEC_PREFIX(unsubscribeFromKeyboardEvents)(
|
|
135
|
-
jsi::Runtime &rt,
|
|
136
|
-
TurboModule &turboModule,
|
|
137
|
-
const jsi::Value *args,
|
|
138
|
-
size_t) {
|
|
139
|
-
static_cast<ReanimatedModuleProxySpec *>(&turboModule)
|
|
140
|
-
->unsubscribeFromKeyboardEvents(rt, std::move(args[0]));
|
|
141
|
-
return jsi::Value::undefined();
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
static jsi::Value REANIMATED_SPEC_PREFIX(configureLayoutAnimationBatch)(
|
|
145
|
-
jsi::Runtime &rt,
|
|
146
|
-
TurboModule &turboModule,
|
|
147
|
-
const jsi::Value *args,
|
|
148
|
-
size_t) {
|
|
149
|
-
return static_cast<ReanimatedModuleProxySpec *>(&turboModule)
|
|
150
|
-
->configureLayoutAnimationBatch(rt, std::move(args[0]));
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
static jsi::Value REANIMATED_SPEC_PREFIX(setShouldAnimateExiting)(
|
|
154
|
-
jsi::Runtime &rt,
|
|
155
|
-
TurboModule &turboModule,
|
|
156
|
-
const jsi::Value *args,
|
|
157
|
-
size_t) {
|
|
158
|
-
static_cast<ReanimatedModuleProxySpec *>(&turboModule)
|
|
159
|
-
->setShouldAnimateExiting(rt, std::move(args[0]), std::move(args[1]));
|
|
160
|
-
return jsi::Value::undefined();
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
#ifdef RCT_NEW_ARCH_ENABLED
|
|
164
|
-
|
|
165
|
-
static jsi::Value REANIMATED_SPEC_PREFIX(markNodeAsRemovable)(
|
|
166
|
-
jsi::Runtime &rt,
|
|
167
|
-
TurboModule &turboModule,
|
|
168
|
-
const jsi::Value *args,
|
|
169
|
-
size_t) {
|
|
170
|
-
static_cast<ReanimatedModuleProxySpec *>(&turboModule)
|
|
171
|
-
->markNodeAsRemovable(rt, std::move(args[0]));
|
|
172
|
-
return jsi::Value::undefined();
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
static jsi::Value REANIMATED_SPEC_PREFIX(unmarkNodeAsRemovable)(
|
|
176
|
-
jsi::Runtime &rt,
|
|
177
|
-
TurboModule &turboModule,
|
|
178
|
-
const jsi::Value *args,
|
|
179
|
-
size_t) {
|
|
180
|
-
static_cast<ReanimatedModuleProxySpec *>(&turboModule)
|
|
181
|
-
->unmarkNodeAsRemovable(rt, std::move(args[0]));
|
|
182
|
-
return jsi::Value::undefined();
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
#endif // RCT_NEW_ARCH_ENABLED
|
|
186
|
-
|
|
187
|
-
ReanimatedModuleProxySpec::ReanimatedModuleProxySpec(
|
|
188
|
-
const std::shared_ptr<CallInvoker> &jsInvoker)
|
|
189
|
-
: TurboModule("NativeReanimated", jsInvoker) {
|
|
190
|
-
methodMap_["scheduleOnUI"] =
|
|
191
|
-
MethodMetadata{1, REANIMATED_SPEC_PREFIX(scheduleOnUI)};
|
|
192
|
-
methodMap_["executeOnUIRuntimeSync"] =
|
|
193
|
-
MethodMetadata{1, REANIMATED_SPEC_PREFIX(executeOnUIRuntimeSync)};
|
|
194
|
-
methodMap_["createWorkletRuntime"] =
|
|
195
|
-
MethodMetadata{2, REANIMATED_SPEC_PREFIX(createWorkletRuntime)};
|
|
196
|
-
methodMap_["scheduleOnRuntime"] =
|
|
197
|
-
MethodMetadata{2, REANIMATED_SPEC_PREFIX(scheduleOnRuntime)};
|
|
198
|
-
|
|
199
|
-
methodMap_["registerEventHandler"] =
|
|
200
|
-
MethodMetadata{3, REANIMATED_SPEC_PREFIX(registerEventHandler)};
|
|
201
|
-
methodMap_["unregisterEventHandler"] =
|
|
202
|
-
MethodMetadata{1, REANIMATED_SPEC_PREFIX(unregisterEventHandler)};
|
|
203
|
-
|
|
204
|
-
methodMap_["getViewProp"] =
|
|
205
|
-
MethodMetadata{3, REANIMATED_SPEC_PREFIX(getViewProp)};
|
|
206
|
-
methodMap_["enableLayoutAnimations"] =
|
|
207
|
-
MethodMetadata{2, REANIMATED_SPEC_PREFIX(enableLayoutAnimations)};
|
|
208
|
-
methodMap_["registerSensor"] =
|
|
209
|
-
MethodMetadata{4, REANIMATED_SPEC_PREFIX(registerSensor)};
|
|
210
|
-
methodMap_["unregisterSensor"] =
|
|
211
|
-
MethodMetadata{1, REANIMATED_SPEC_PREFIX(unregisterSensor)};
|
|
212
|
-
methodMap_["configureProps"] =
|
|
213
|
-
MethodMetadata{2, REANIMATED_SPEC_PREFIX(configureProps)};
|
|
214
|
-
methodMap_["subscribeForKeyboardEvents"] =
|
|
215
|
-
MethodMetadata{2, REANIMATED_SPEC_PREFIX(subscribeForKeyboardEvents)};
|
|
216
|
-
methodMap_["unsubscribeFromKeyboardEvents"] =
|
|
217
|
-
MethodMetadata{1, REANIMATED_SPEC_PREFIX(unsubscribeFromKeyboardEvents)};
|
|
218
|
-
|
|
219
|
-
methodMap_["configureLayoutAnimationBatch"] =
|
|
220
|
-
MethodMetadata{1, REANIMATED_SPEC_PREFIX(configureLayoutAnimationBatch)};
|
|
221
|
-
methodMap_["setShouldAnimateExitingForTag"] =
|
|
222
|
-
MethodMetadata{2, REANIMATED_SPEC_PREFIX(setShouldAnimateExiting)};
|
|
223
|
-
|
|
224
|
-
#ifdef RCT_NEW_ARCH_ENABLED
|
|
225
|
-
methodMap_["markNodeAsRemovable"] =
|
|
226
|
-
MethodMetadata{1, REANIMATED_SPEC_PREFIX(markNodeAsRemovable)};
|
|
227
|
-
methodMap_["unmarkNodeAsRemovable"] =
|
|
228
|
-
MethodMetadata{1, REANIMATED_SPEC_PREFIX(unmarkNodeAsRemovable)};
|
|
229
|
-
#endif // RCT_NEW_ARCH_ENABLED
|
|
230
|
-
}
|
|
231
|
-
} // namespace reanimated
|
|
1
|
+
#include <reanimated/NativeModules/ReanimatedModuleProxySpec.h>
|
|
2
|
+
|
|
3
|
+
#include <utility>
|
|
4
|
+
|
|
5
|
+
#define REANIMATED_SPEC_PREFIX(FN_NAME) \
|
|
6
|
+
__hostFunction_ReanimatedModuleProxySpec_##FN_NAME
|
|
7
|
+
|
|
8
|
+
namespace reanimated {
|
|
9
|
+
|
|
10
|
+
// scheduler
|
|
11
|
+
|
|
12
|
+
static jsi::Value REANIMATED_SPEC_PREFIX(scheduleOnUI)(
|
|
13
|
+
jsi::Runtime &rt,
|
|
14
|
+
TurboModule &turboModule,
|
|
15
|
+
const jsi::Value *args,
|
|
16
|
+
size_t) {
|
|
17
|
+
static_cast<ReanimatedModuleProxySpec *>(&turboModule)
|
|
18
|
+
->scheduleOnUI(rt, std::move(args[0]));
|
|
19
|
+
return jsi::Value::undefined();
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
static jsi::Value REANIMATED_SPEC_PREFIX(executeOnUIRuntimeSync)(
|
|
23
|
+
jsi::Runtime &rt,
|
|
24
|
+
TurboModule &turboModule,
|
|
25
|
+
const jsi::Value *args,
|
|
26
|
+
size_t) {
|
|
27
|
+
return static_cast<ReanimatedModuleProxySpec *>(&turboModule)
|
|
28
|
+
->executeOnUIRuntimeSync(rt, std::move(args[0]));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
static jsi::Value REANIMATED_SPEC_PREFIX(createWorkletRuntime)(
|
|
32
|
+
jsi::Runtime &rt,
|
|
33
|
+
TurboModule &turboModule,
|
|
34
|
+
const jsi::Value *args,
|
|
35
|
+
size_t) {
|
|
36
|
+
return static_cast<ReanimatedModuleProxySpec *>(&turboModule)
|
|
37
|
+
->createWorkletRuntime(rt, std::move(args[0]), std::move(args[1]));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
static jsi::Value REANIMATED_SPEC_PREFIX(scheduleOnRuntime)(
|
|
41
|
+
jsi::Runtime &rt,
|
|
42
|
+
TurboModule &turboModule,
|
|
43
|
+
const jsi::Value *args,
|
|
44
|
+
size_t) {
|
|
45
|
+
return static_cast<ReanimatedModuleProxySpec *>(&turboModule)
|
|
46
|
+
->scheduleOnRuntime(rt, std::move(args[0]), std::move(args[1]));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
static jsi::Value REANIMATED_SPEC_PREFIX(registerEventHandler)(
|
|
50
|
+
jsi::Runtime &rt,
|
|
51
|
+
TurboModule &turboModule,
|
|
52
|
+
const jsi::Value *args,
|
|
53
|
+
size_t) {
|
|
54
|
+
return static_cast<ReanimatedModuleProxySpec *>(&turboModule)
|
|
55
|
+
->registerEventHandler(
|
|
56
|
+
rt, std::move(args[0]), std::move(args[1]), std::move(args[2]));
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
static jsi::Value REANIMATED_SPEC_PREFIX(unregisterEventHandler)(
|
|
60
|
+
jsi::Runtime &rt,
|
|
61
|
+
TurboModule &turboModule,
|
|
62
|
+
const jsi::Value *args,
|
|
63
|
+
size_t) {
|
|
64
|
+
static_cast<ReanimatedModuleProxySpec *>(&turboModule)
|
|
65
|
+
->unregisterEventHandler(rt, std::move(args[0]));
|
|
66
|
+
return jsi::Value::undefined();
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
static jsi::Value REANIMATED_SPEC_PREFIX(getViewProp)(
|
|
70
|
+
jsi::Runtime &rt,
|
|
71
|
+
TurboModule &turboModule,
|
|
72
|
+
const jsi::Value *args,
|
|
73
|
+
size_t) {
|
|
74
|
+
static_cast<ReanimatedModuleProxySpec *>(&turboModule)
|
|
75
|
+
->getViewProp(
|
|
76
|
+
rt, std::move(args[0]), std::move(args[1]), std::move(args[2]));
|
|
77
|
+
return jsi::Value::undefined();
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
static jsi::Value REANIMATED_SPEC_PREFIX(enableLayoutAnimations)(
|
|
81
|
+
jsi::Runtime &rt,
|
|
82
|
+
TurboModule &turboModule,
|
|
83
|
+
const jsi::Value *args,
|
|
84
|
+
size_t) {
|
|
85
|
+
static_cast<ReanimatedModuleProxySpec *>(&turboModule)
|
|
86
|
+
->enableLayoutAnimations(rt, std::move(args[0]));
|
|
87
|
+
return jsi::Value::undefined();
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
static jsi::Value REANIMATED_SPEC_PREFIX(registerSensor)(
|
|
91
|
+
jsi::Runtime &rt,
|
|
92
|
+
TurboModule &turboModule,
|
|
93
|
+
const jsi::Value *args,
|
|
94
|
+
size_t) {
|
|
95
|
+
return static_cast<ReanimatedModuleProxySpec *>(&turboModule)
|
|
96
|
+
->registerSensor(
|
|
97
|
+
rt,
|
|
98
|
+
std::move(args[0]),
|
|
99
|
+
std::move(args[1]),
|
|
100
|
+
std::move(args[2]),
|
|
101
|
+
std::move(args[3]));
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
static jsi::Value REANIMATED_SPEC_PREFIX(unregisterSensor)(
|
|
105
|
+
jsi::Runtime &rt,
|
|
106
|
+
TurboModule &turboModule,
|
|
107
|
+
const jsi::Value *args,
|
|
108
|
+
size_t) {
|
|
109
|
+
static_cast<ReanimatedModuleProxySpec *>(&turboModule)
|
|
110
|
+
->unregisterSensor(rt, std::move(args[0]));
|
|
111
|
+
return jsi::Value::undefined();
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
static jsi::Value REANIMATED_SPEC_PREFIX(configureProps)(
|
|
115
|
+
jsi::Runtime &rt,
|
|
116
|
+
TurboModule &turboModule,
|
|
117
|
+
const jsi::Value *args,
|
|
118
|
+
size_t) {
|
|
119
|
+
static_cast<ReanimatedModuleProxySpec *>(&turboModule)
|
|
120
|
+
->configureProps(rt, std::move(args[0]), std::move(args[1]));
|
|
121
|
+
return jsi::Value::undefined();
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
static jsi::Value REANIMATED_SPEC_PREFIX(subscribeForKeyboardEvents)(
|
|
125
|
+
jsi::Runtime &rt,
|
|
126
|
+
TurboModule &turboModule,
|
|
127
|
+
const jsi::Value *args,
|
|
128
|
+
size_t) {
|
|
129
|
+
return static_cast<ReanimatedModuleProxySpec *>(&turboModule)
|
|
130
|
+
->subscribeForKeyboardEvents(
|
|
131
|
+
rt, std::move(args[0]), std::move(args[1]), std::move(args[2]));
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
static jsi::Value REANIMATED_SPEC_PREFIX(unsubscribeFromKeyboardEvents)(
|
|
135
|
+
jsi::Runtime &rt,
|
|
136
|
+
TurboModule &turboModule,
|
|
137
|
+
const jsi::Value *args,
|
|
138
|
+
size_t) {
|
|
139
|
+
static_cast<ReanimatedModuleProxySpec *>(&turboModule)
|
|
140
|
+
->unsubscribeFromKeyboardEvents(rt, std::move(args[0]));
|
|
141
|
+
return jsi::Value::undefined();
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
static jsi::Value REANIMATED_SPEC_PREFIX(configureLayoutAnimationBatch)(
|
|
145
|
+
jsi::Runtime &rt,
|
|
146
|
+
TurboModule &turboModule,
|
|
147
|
+
const jsi::Value *args,
|
|
148
|
+
size_t) {
|
|
149
|
+
return static_cast<ReanimatedModuleProxySpec *>(&turboModule)
|
|
150
|
+
->configureLayoutAnimationBatch(rt, std::move(args[0]));
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
static jsi::Value REANIMATED_SPEC_PREFIX(setShouldAnimateExiting)(
|
|
154
|
+
jsi::Runtime &rt,
|
|
155
|
+
TurboModule &turboModule,
|
|
156
|
+
const jsi::Value *args,
|
|
157
|
+
size_t) {
|
|
158
|
+
static_cast<ReanimatedModuleProxySpec *>(&turboModule)
|
|
159
|
+
->setShouldAnimateExiting(rt, std::move(args[0]), std::move(args[1]));
|
|
160
|
+
return jsi::Value::undefined();
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
164
|
+
|
|
165
|
+
static jsi::Value REANIMATED_SPEC_PREFIX(markNodeAsRemovable)(
|
|
166
|
+
jsi::Runtime &rt,
|
|
167
|
+
TurboModule &turboModule,
|
|
168
|
+
const jsi::Value *args,
|
|
169
|
+
size_t) {
|
|
170
|
+
static_cast<ReanimatedModuleProxySpec *>(&turboModule)
|
|
171
|
+
->markNodeAsRemovable(rt, std::move(args[0]));
|
|
172
|
+
return jsi::Value::undefined();
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
static jsi::Value REANIMATED_SPEC_PREFIX(unmarkNodeAsRemovable)(
|
|
176
|
+
jsi::Runtime &rt,
|
|
177
|
+
TurboModule &turboModule,
|
|
178
|
+
const jsi::Value *args,
|
|
179
|
+
size_t) {
|
|
180
|
+
static_cast<ReanimatedModuleProxySpec *>(&turboModule)
|
|
181
|
+
->unmarkNodeAsRemovable(rt, std::move(args[0]));
|
|
182
|
+
return jsi::Value::undefined();
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
186
|
+
|
|
187
|
+
ReanimatedModuleProxySpec::ReanimatedModuleProxySpec(
|
|
188
|
+
const std::shared_ptr<CallInvoker> &jsInvoker)
|
|
189
|
+
: TurboModule("NativeReanimated", jsInvoker) {
|
|
190
|
+
methodMap_["scheduleOnUI"] =
|
|
191
|
+
MethodMetadata{1, REANIMATED_SPEC_PREFIX(scheduleOnUI)};
|
|
192
|
+
methodMap_["executeOnUIRuntimeSync"] =
|
|
193
|
+
MethodMetadata{1, REANIMATED_SPEC_PREFIX(executeOnUIRuntimeSync)};
|
|
194
|
+
methodMap_["createWorkletRuntime"] =
|
|
195
|
+
MethodMetadata{2, REANIMATED_SPEC_PREFIX(createWorkletRuntime)};
|
|
196
|
+
methodMap_["scheduleOnRuntime"] =
|
|
197
|
+
MethodMetadata{2, REANIMATED_SPEC_PREFIX(scheduleOnRuntime)};
|
|
198
|
+
|
|
199
|
+
methodMap_["registerEventHandler"] =
|
|
200
|
+
MethodMetadata{3, REANIMATED_SPEC_PREFIX(registerEventHandler)};
|
|
201
|
+
methodMap_["unregisterEventHandler"] =
|
|
202
|
+
MethodMetadata{1, REANIMATED_SPEC_PREFIX(unregisterEventHandler)};
|
|
203
|
+
|
|
204
|
+
methodMap_["getViewProp"] =
|
|
205
|
+
MethodMetadata{3, REANIMATED_SPEC_PREFIX(getViewProp)};
|
|
206
|
+
methodMap_["enableLayoutAnimations"] =
|
|
207
|
+
MethodMetadata{2, REANIMATED_SPEC_PREFIX(enableLayoutAnimations)};
|
|
208
|
+
methodMap_["registerSensor"] =
|
|
209
|
+
MethodMetadata{4, REANIMATED_SPEC_PREFIX(registerSensor)};
|
|
210
|
+
methodMap_["unregisterSensor"] =
|
|
211
|
+
MethodMetadata{1, REANIMATED_SPEC_PREFIX(unregisterSensor)};
|
|
212
|
+
methodMap_["configureProps"] =
|
|
213
|
+
MethodMetadata{2, REANIMATED_SPEC_PREFIX(configureProps)};
|
|
214
|
+
methodMap_["subscribeForKeyboardEvents"] =
|
|
215
|
+
MethodMetadata{2, REANIMATED_SPEC_PREFIX(subscribeForKeyboardEvents)};
|
|
216
|
+
methodMap_["unsubscribeFromKeyboardEvents"] =
|
|
217
|
+
MethodMetadata{1, REANIMATED_SPEC_PREFIX(unsubscribeFromKeyboardEvents)};
|
|
218
|
+
|
|
219
|
+
methodMap_["configureLayoutAnimationBatch"] =
|
|
220
|
+
MethodMetadata{1, REANIMATED_SPEC_PREFIX(configureLayoutAnimationBatch)};
|
|
221
|
+
methodMap_["setShouldAnimateExitingForTag"] =
|
|
222
|
+
MethodMetadata{2, REANIMATED_SPEC_PREFIX(setShouldAnimateExiting)};
|
|
223
|
+
|
|
224
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
225
|
+
methodMap_["markNodeAsRemovable"] =
|
|
226
|
+
MethodMetadata{1, REANIMATED_SPEC_PREFIX(markNodeAsRemovable)};
|
|
227
|
+
methodMap_["unmarkNodeAsRemovable"] =
|
|
228
|
+
MethodMetadata{1, REANIMATED_SPEC_PREFIX(unmarkNodeAsRemovable)};
|
|
229
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
230
|
+
}
|
|
231
|
+
} // namespace reanimated
|