@react-native-ohos/react-native-reanimated 3.18.2 → 3.18.3

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.
Files changed (99) hide show
  1. package/LICENSE +21 -21
  2. package/README.OpenSource +10 -10
  3. package/README.md +406 -10
  4. package/harmony/reanimated/BuildProfile.ets +1 -1
  5. package/harmony/reanimated/build-profile.json5 +11 -11
  6. package/harmony/reanimated/oh-package-lock.json5 +29 -0
  7. package/harmony/reanimated/oh-package.json5 +11 -11
  8. package/harmony/reanimated/src/main/cpp/CMakeLists.txt +2 -0
  9. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/AnimatedSensor/AnimatedSensorModule.cpp +86 -86
  10. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/AnimatedSensor/AnimatedSensorModule.h +47 -47
  11. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/PropsRegistry.cpp +68 -68
  12. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/PropsRegistry.h +73 -68
  13. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ReanimatedCommitHook.cpp +101 -101
  14. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ReanimatedCommitHook.h +51 -51
  15. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ReanimatedCommitShadowNode.h +49 -49
  16. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ReanimatedMountHook.cpp +96 -96
  17. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ReanimatedMountHook.h +33 -33
  18. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ShadowTreeCloner.cpp +95 -95
  19. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ShadowTreeCloner.h +29 -29
  20. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationType.h +9 -9
  21. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsManager.cpp +232 -232
  22. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsManager.h +90 -90
  23. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy.cpp +870 -870
  24. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy.h +147 -147
  25. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsUtils.cpp +91 -91
  26. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsUtils.h +176 -176
  27. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxy.cpp +971 -971
  28. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxy.h +252 -254
  29. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxySpec.cpp +231 -231
  30. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxySpec.h +109 -109
  31. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/RuntimeDecorators/RNRuntimeDecorator.cpp +56 -56
  32. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/RuntimeDecorators/RNRuntimeDecorator.h +20 -20
  33. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/RuntimeDecorators/UIRuntimeDecorator.cpp +70 -70
  34. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/RuntimeDecorators/UIRuntimeDecorator.h +35 -35
  35. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/CollectionUtils.h +14 -14
  36. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/FeaturesConfig.cpp +5 -5
  37. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/FeaturesConfig.h +19 -19
  38. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/PlatformDepMethodsHolder.h +98 -98
  39. package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/ReanimatedSystraceSection.h +135 -135
  40. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/NativeModules/WorkletsModuleProxy.cpp +47 -47
  41. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/NativeModules/WorkletsModuleProxy.h +59 -59
  42. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/NativeModules/WorkletsModuleProxySpec.cpp +27 -27
  43. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/NativeModules/WorkletsModuleProxySpec.h +25 -25
  44. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Registries/EventHandlerRegistry.cpp +94 -94
  45. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Registries/EventHandlerRegistry.h +49 -49
  46. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Registries/WorkletRuntimeRegistry.cpp +8 -8
  47. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Registries/WorkletRuntimeRegistry.h +39 -39
  48. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/SharedItems/Shareables.cpp +326 -326
  49. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/SharedItems/Shareables.h +345 -345
  50. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/AsyncQueue.cpp +52 -52
  51. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/AsyncQueue.h +35 -35
  52. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/Defs.h +10 -10
  53. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/JSISerializer.cpp +342 -342
  54. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/JSISerializer.h +47 -47
  55. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/JSLogger.cpp +16 -16
  56. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/JSLogger.h +20 -20
  57. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/JSScheduler.cpp +20 -20
  58. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/JSScheduler.h +29 -29
  59. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/PlatformLogger.h +16 -16
  60. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/ReanimatedJSIUtils.cpp +26 -26
  61. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/ReanimatedJSIUtils.h +199 -199
  62. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/ReanimatedVersion.cpp +95 -95
  63. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/ReanimatedVersion.h +19 -19
  64. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/SingleInstanceChecker.h +72 -72
  65. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/ThreadSafeQueue.h +49 -49
  66. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/UIScheduler.cpp +20 -20
  67. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/UIScheduler.h +22 -22
  68. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/WorkletEventHandler.cpp +29 -29
  69. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/WorkletEventHandler.h +41 -41
  70. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/RNRuntimeWorkletDecorator.cpp +16 -16
  71. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/RNRuntimeWorkletDecorator.h +19 -19
  72. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/ReanimatedHermesRuntime.cpp +112 -112
  73. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/ReanimatedHermesRuntime.h +127 -127
  74. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/ReanimatedRuntime.cpp +53 -53
  75. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/ReanimatedRuntime.h +22 -22
  76. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/RuntimeInitialization.md +191 -191
  77. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/WorkletRuntime.cpp +173 -173
  78. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/WorkletRuntime.h +90 -90
  79. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/WorkletRuntimeCollector.h +36 -36
  80. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/WorkletRuntimeDecorator.cpp +189 -189
  81. package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/WorkletRuntimeDecorator.h +22 -22
  82. package/harmony/reanimated/src/main/cpp/ReanimatedModule.cpp +29 -19
  83. package/harmony/reanimated/src/main/cpp/ReanimatedSensor.cpp +248 -0
  84. package/harmony/reanimated/src/main/cpp/ReanimatedSensor.h +36 -0
  85. package/harmony/reanimated/src/main/cpp/ReanimatedSensorContainer.cpp +36 -0
  86. package/harmony/reanimated/src/main/cpp/ReanimatedSensorContainer.h +23 -0
  87. package/harmony/reanimated/src/main/cpp/WorkletsModule.cpp +60 -60
  88. package/harmony/reanimated/src/main/cpp/patches/AnimatedSensor/AnimatedSensorModule.cpp +89 -89
  89. package/harmony/reanimated/src/main/cpp/patches/NativeModules/ReanimatedModuleProxy.cpp +53 -4
  90. package/harmony/reanimated/src/main/ets/ReanimatedModule.ts +115 -15
  91. package/harmony/reanimated/src/main/module.json5 +12 -12
  92. package/harmony/reanimated/src/main/resources/base/element/color.json +7 -7
  93. package/harmony/reanimated/src/main/resources/base/element/string.json +15 -15
  94. package/harmony/reanimated/src/main/resources/base/profile/main_pages.json +5 -5
  95. package/harmony/reanimated/src/main/resources/en_US/element/string.json +15 -15
  96. package/harmony/reanimated/src/main/resources/zh_CN/element/string.json +15 -15
  97. package/harmony/reanimated/ts.ts +6 -6
  98. package/harmony/reanimated.har +0 -0
  99. package/package.json +51 -50
@@ -1,72 +1,72 @@
1
- #pragma once
2
-
3
- #ifndef NDEBUG
4
-
5
- #include <cxxabi.h>
6
-
7
- #include <atomic>
8
- #include <cassert>
9
- #include <iostream>
10
- #include <string>
11
-
12
- #ifdef ANDROID
13
- #include <android/log.h>
14
- #endif // ANDROID
15
-
16
- namespace worklets {
17
-
18
- // This is a class that counts how many instances of a different class there
19
- // are. It is meant only to be used with classes that should only have one
20
- // instance.
21
-
22
- template <class T>
23
- class SingleInstanceChecker {
24
- public:
25
- SingleInstanceChecker();
26
- ~SingleInstanceChecker();
27
-
28
- private:
29
- void assertWithMessage(bool condition, std::string message) {
30
- if (!condition) {
31
- #ifdef ANDROID
32
- __android_log_print(
33
- ANDROID_LOG_WARN, "Reanimated", "%s", message.c_str());
34
- #else
35
- std::cerr << "[Reanimated] " << message << std::endl;
36
- #endif
37
-
38
- #ifdef IS_REANIMATED_EXAMPLE_APP
39
- assert(false);
40
- #endif
41
- }
42
- }
43
-
44
- // A static field will exist separately for every class template.
45
- // This has to be inline for automatic initialization.
46
- inline static std::atomic<int> instanceCount_;
47
- };
48
-
49
- template <class T>
50
- SingleInstanceChecker<T>::SingleInstanceChecker() {
51
- int status = 0;
52
- std::string className =
53
- __cxxabiv1::__cxa_demangle(typeid(T).name(), nullptr, nullptr, &status);
54
-
55
- // React Native can spawn up to two instances of a Native Module at the same
56
- // time. This happens during a reload when a new instance of React Native is
57
- // created while simultaneously the old one is torn down.
58
- instanceCount_++;
59
- assertWithMessage(
60
- instanceCount_ <= 2,
61
- "[Reanimated] More than two instances of " + className +
62
- " present. This may indicate a memory leak due to a retain cycle.");
63
- }
64
-
65
- template <class T>
66
- SingleInstanceChecker<T>::~SingleInstanceChecker() {
67
- instanceCount_--;
68
- }
69
-
70
- } // namespace worklets
71
-
72
- #endif // NDEBUG
1
+ #pragma once
2
+
3
+ #ifndef NDEBUG
4
+
5
+ #include <cxxabi.h>
6
+
7
+ #include <atomic>
8
+ #include <cassert>
9
+ #include <iostream>
10
+ #include <string>
11
+
12
+ #ifdef ANDROID
13
+ #include <android/log.h>
14
+ #endif // ANDROID
15
+
16
+ namespace worklets {
17
+
18
+ // This is a class that counts how many instances of a different class there
19
+ // are. It is meant only to be used with classes that should only have one
20
+ // instance.
21
+
22
+ template <class T>
23
+ class SingleInstanceChecker {
24
+ public:
25
+ SingleInstanceChecker();
26
+ ~SingleInstanceChecker();
27
+
28
+ private:
29
+ void assertWithMessage(bool condition, std::string message) {
30
+ if (!condition) {
31
+ #ifdef ANDROID
32
+ __android_log_print(
33
+ ANDROID_LOG_WARN, "Reanimated", "%s", message.c_str());
34
+ #else
35
+ std::cerr << "[Reanimated] " << message << std::endl;
36
+ #endif
37
+
38
+ #ifdef IS_REANIMATED_EXAMPLE_APP
39
+ assert(false);
40
+ #endif
41
+ }
42
+ }
43
+
44
+ // A static field will exist separately for every class template.
45
+ // This has to be inline for automatic initialization.
46
+ inline static std::atomic<int> instanceCount_;
47
+ };
48
+
49
+ template <class T>
50
+ SingleInstanceChecker<T>::SingleInstanceChecker() {
51
+ int status = 0;
52
+ std::string className =
53
+ __cxxabiv1::__cxa_demangle(typeid(T).name(), nullptr, nullptr, &status);
54
+
55
+ // React Native can spawn up to two instances of a Native Module at the same
56
+ // time. This happens during a reload when a new instance of React Native is
57
+ // created while simultaneously the old one is torn down.
58
+ instanceCount_++;
59
+ assertWithMessage(
60
+ instanceCount_ <= 2,
61
+ "[Reanimated] More than two instances of " + className +
62
+ " present. This may indicate a memory leak due to a retain cycle.");
63
+ }
64
+
65
+ template <class T>
66
+ SingleInstanceChecker<T>::~SingleInstanceChecker() {
67
+ instanceCount_--;
68
+ }
69
+
70
+ } // namespace worklets
71
+
72
+ #endif // NDEBUG
@@ -1,49 +1,49 @@
1
- #pragma once
2
-
3
- #include <condition_variable>
4
- #include <mutex>
5
- #include <queue>
6
- #include <utility>
7
-
8
- namespace worklets {
9
-
10
- //
11
- // Copyright (c) 2013 Juan Palacios juan.palacios.puyana@gmail.com
12
- // Subject to the BSD 2-Clause License
13
- // - see < https://opensource.org/license/bsd-2-clause/ >
14
- //
15
- template <typename T>
16
- class ThreadSafeQueue {
17
- public:
18
- T pop() {
19
- std::unique_lock<std::mutex> mlock(mutex_);
20
- while (queue_.empty()) {
21
- cond_.wait(mlock);
22
- }
23
- const auto item = queue_.front();
24
- queue_.pop();
25
- return item;
26
- }
27
-
28
- void push(T &&item) {
29
- std::unique_lock<std::mutex> mlock(mutex_);
30
- queue_.push(std::move(item));
31
- mlock.unlock();
32
- cond_.notify_one();
33
- }
34
-
35
- bool empty() const {
36
- std::unique_lock<std::mutex> mlock(mutex_);
37
- const auto res = queue_.empty();
38
- mlock.unlock();
39
- cond_.notify_one();
40
- return res;
41
- }
42
-
43
- private:
44
- std::queue<T> queue_;
45
- mutable std::mutex mutex_;
46
- mutable std::condition_variable cond_;
47
- };
48
-
49
- } // namespace worklets
1
+ #pragma once
2
+
3
+ #include <condition_variable>
4
+ #include <mutex>
5
+ #include <queue>
6
+ #include <utility>
7
+
8
+ namespace worklets {
9
+
10
+ //
11
+ // Copyright (c) 2013 Juan Palacios juan.palacios.puyana@gmail.com
12
+ // Subject to the BSD 2-Clause License
13
+ // - see < https://opensource.org/license/bsd-2-clause/ >
14
+ //
15
+ template <typename T>
16
+ class ThreadSafeQueue {
17
+ public:
18
+ T pop() {
19
+ std::unique_lock<std::mutex> mlock(mutex_);
20
+ while (queue_.empty()) {
21
+ cond_.wait(mlock);
22
+ }
23
+ const auto item = queue_.front();
24
+ queue_.pop();
25
+ return item;
26
+ }
27
+
28
+ void push(T &&item) {
29
+ std::unique_lock<std::mutex> mlock(mutex_);
30
+ queue_.push(std::move(item));
31
+ mlock.unlock();
32
+ cond_.notify_one();
33
+ }
34
+
35
+ bool empty() const {
36
+ std::unique_lock<std::mutex> mlock(mutex_);
37
+ const auto res = queue_.empty();
38
+ mlock.unlock();
39
+ cond_.notify_one();
40
+ return res;
41
+ }
42
+
43
+ private:
44
+ std::queue<T> queue_;
45
+ mutable std::mutex mutex_;
46
+ mutable std::condition_variable cond_;
47
+ };
48
+
49
+ } // namespace worklets
@@ -1,20 +1,20 @@
1
- #include <worklets/Tools/UIScheduler.h>
2
- #include <worklets/WorkletRuntime/ReanimatedRuntime.h>
3
-
4
- #include <utility>
5
-
6
- namespace worklets {
7
-
8
- void UIScheduler::scheduleOnUI(std::function<void()> job) {
9
- uiJobs_.push(std::move(job));
10
- }
11
-
12
- void UIScheduler::triggerUI() {
13
- scheduledOnUI_ = false;
14
- while (!uiJobs_.empty()) {
15
- const auto job = uiJobs_.pop();
16
- job();
17
- }
18
- }
19
-
20
- } // namespace worklets
1
+ #include <worklets/Tools/UIScheduler.h>
2
+ #include <worklets/WorkletRuntime/ReanimatedRuntime.h>
3
+
4
+ #include <utility>
5
+
6
+ namespace worklets {
7
+
8
+ void UIScheduler::scheduleOnUI(std::function<void()> job) {
9
+ uiJobs_.push(std::move(job));
10
+ }
11
+
12
+ void UIScheduler::triggerUI() {
13
+ scheduledOnUI_ = false;
14
+ while (!uiJobs_.empty()) {
15
+ const auto job = uiJobs_.pop();
16
+ job();
17
+ }
18
+ }
19
+
20
+ } // namespace worklets
@@ -1,22 +1,22 @@
1
- #pragma once
2
-
3
- #include <worklets/Tools/ThreadSafeQueue.h>
4
-
5
- #include <ReactCommon/CallInvoker.h>
6
-
7
- #include <atomic>
8
-
9
- namespace worklets {
10
-
11
- class UIScheduler {
12
- public:
13
- virtual void scheduleOnUI(std::function<void()> job);
14
- virtual void triggerUI();
15
- virtual ~UIScheduler() = default;
16
-
17
- protected:
18
- std::atomic<bool> scheduledOnUI_{false};
19
- ThreadSafeQueue<std::function<void()>> uiJobs_;
20
- };
21
-
22
- } // namespace worklets
1
+ #pragma once
2
+
3
+ #include <worklets/Tools/ThreadSafeQueue.h>
4
+
5
+ #include <ReactCommon/CallInvoker.h>
6
+
7
+ #include <atomic>
8
+
9
+ namespace worklets {
10
+
11
+ class UIScheduler {
12
+ public:
13
+ virtual void scheduleOnUI(std::function<void()> job);
14
+ virtual void triggerUI();
15
+ virtual ~UIScheduler() = default;
16
+
17
+ protected:
18
+ std::atomic<bool> scheduledOnUI_{false};
19
+ ThreadSafeQueue<std::function<void()>> uiJobs_;
20
+ };
21
+
22
+ } // namespace worklets
@@ -1,29 +1,29 @@
1
- #include <worklets/Tools/WorkletEventHandler.h>
2
-
3
- namespace worklets {
4
-
5
- void WorkletEventHandler::process(
6
- const std::shared_ptr<WorkletRuntime> &workletRuntime,
7
- const double eventTimestamp,
8
- const jsi::Value &eventValue) const {
9
- workletRuntime->runGuarded(
10
- handlerFunction_, jsi::Value(eventTimestamp), eventValue);
11
- }
12
-
13
- uint64_t WorkletEventHandler::getHandlerId() const {
14
- return handlerId_;
15
- }
16
-
17
- const std::string &WorkletEventHandler::getEventName() const {
18
- return eventName_;
19
- }
20
-
21
- uint64_t WorkletEventHandler::getEmitterReactTag() const {
22
- return emitterReactTag_;
23
- }
24
-
25
- bool WorkletEventHandler::shouldIgnoreEmitterReactTag() const {
26
- return emitterReactTag_ == -1;
27
- }
28
-
29
- } // namespace worklets
1
+ #include <worklets/Tools/WorkletEventHandler.h>
2
+
3
+ namespace worklets {
4
+
5
+ void WorkletEventHandler::process(
6
+ const std::shared_ptr<WorkletRuntime> &workletRuntime,
7
+ const double eventTimestamp,
8
+ const jsi::Value &eventValue) const {
9
+ workletRuntime->runGuarded(
10
+ handlerFunction_, jsi::Value(eventTimestamp), eventValue);
11
+ }
12
+
13
+ uint64_t WorkletEventHandler::getHandlerId() const {
14
+ return handlerId_;
15
+ }
16
+
17
+ const std::string &WorkletEventHandler::getEventName() const {
18
+ return eventName_;
19
+ }
20
+
21
+ uint64_t WorkletEventHandler::getEmitterReactTag() const {
22
+ return emitterReactTag_;
23
+ }
24
+
25
+ bool WorkletEventHandler::shouldIgnoreEmitterReactTag() const {
26
+ return emitterReactTag_ == -1;
27
+ }
28
+
29
+ } // namespace worklets
@@ -1,41 +1,41 @@
1
- #pragma once
2
-
3
- #include <worklets/SharedItems/Shareables.h>
4
- #include <worklets/WorkletRuntime/WorkletRuntime.h>
5
-
6
- #include <jsi/jsi.h>
7
-
8
- #include <memory>
9
- #include <string>
10
-
11
- using namespace facebook;
12
-
13
- namespace worklets {
14
-
15
- class WorkletEventHandler {
16
- const uint64_t handlerId_;
17
- const uint64_t emitterReactTag_;
18
- const std::string eventName_;
19
- const std::shared_ptr<ShareableWorklet> handlerFunction_;
20
-
21
- public:
22
- WorkletEventHandler(
23
- const uint64_t handlerId,
24
- const std::string &eventName,
25
- const uint64_t emitterReactTag,
26
- const std::shared_ptr<ShareableWorklet> &handlerFunction)
27
- : handlerId_(handlerId),
28
- emitterReactTag_(emitterReactTag),
29
- eventName_(eventName),
30
- handlerFunction_(handlerFunction) {}
31
- void process(
32
- const std::shared_ptr<WorkletRuntime> &workletRuntime,
33
- double eventTimestamp,
34
- const jsi::Value &eventValue) const;
35
- uint64_t getHandlerId() const;
36
- const std::string &getEventName() const;
37
- uint64_t getEmitterReactTag() const;
38
- bool shouldIgnoreEmitterReactTag() const;
39
- };
40
-
41
- } // namespace worklets
1
+ #pragma once
2
+
3
+ #include <worklets/SharedItems/Shareables.h>
4
+ #include <worklets/WorkletRuntime/WorkletRuntime.h>
5
+
6
+ #include <jsi/jsi.h>
7
+
8
+ #include <memory>
9
+ #include <string>
10
+
11
+ using namespace facebook;
12
+
13
+ namespace worklets {
14
+
15
+ class WorkletEventHandler {
16
+ const uint64_t handlerId_;
17
+ const uint64_t emitterReactTag_;
18
+ const std::string eventName_;
19
+ const std::shared_ptr<ShareableWorklet> handlerFunction_;
20
+
21
+ public:
22
+ WorkletEventHandler(
23
+ const uint64_t handlerId,
24
+ const std::string &eventName,
25
+ const uint64_t emitterReactTag,
26
+ const std::shared_ptr<ShareableWorklet> &handlerFunction)
27
+ : handlerId_(handlerId),
28
+ emitterReactTag_(emitterReactTag),
29
+ eventName_(eventName),
30
+ handlerFunction_(handlerFunction) {}
31
+ void process(
32
+ const std::shared_ptr<WorkletRuntime> &workletRuntime,
33
+ double eventTimestamp,
34
+ const jsi::Value &eventValue) const;
35
+ uint64_t getHandlerId() const;
36
+ const std::string &getEventName() const;
37
+ uint64_t getEmitterReactTag() const;
38
+ bool shouldIgnoreEmitterReactTag() const;
39
+ };
40
+
41
+ } // namespace worklets
@@ -1,16 +1,16 @@
1
- #include <worklets/WorkletRuntime/RNRuntimeWorkletDecorator.h>
2
-
3
- namespace worklets {
4
-
5
- void RNRuntimeWorkletDecorator::decorate(
6
- jsi::Runtime &rnRuntime,
7
- const std::shared_ptr<WorkletsModuleProxy> &workletsModuleProxy) {
8
- rnRuntime.global().setProperty(rnRuntime, "_WORKLET", false);
9
-
10
- rnRuntime.global().setProperty(
11
- rnRuntime,
12
- "__workletsModuleProxy",
13
- jsi::Object::createFromHostObject(rnRuntime, workletsModuleProxy));
14
- }
15
-
16
- } // namespace worklets
1
+ #include <worklets/WorkletRuntime/RNRuntimeWorkletDecorator.h>
2
+
3
+ namespace worklets {
4
+
5
+ void RNRuntimeWorkletDecorator::decorate(
6
+ jsi::Runtime &rnRuntime,
7
+ const std::shared_ptr<WorkletsModuleProxy> &workletsModuleProxy) {
8
+ rnRuntime.global().setProperty(rnRuntime, "_WORKLET", false);
9
+
10
+ rnRuntime.global().setProperty(
11
+ rnRuntime,
12
+ "__workletsModuleProxy",
13
+ jsi::Object::createFromHostObject(rnRuntime, workletsModuleProxy));
14
+ }
15
+
16
+ } // namespace worklets
@@ -1,19 +1,19 @@
1
- #pragma once
2
-
3
- #include <jsi/jsi.h>
4
- #include <worklets/NativeModules/WorkletsModuleProxy.h>
5
- #include <memory>
6
-
7
- using namespace facebook;
8
-
9
- namespace worklets {
10
-
11
- class RNRuntimeWorkletDecorator {
12
- // TODO: Rename to `RNRuntimeWorkletsDecorator` or something more suitable.
13
- public:
14
- static void decorate(
15
- jsi::Runtime &rnRuntime,
16
- const std::shared_ptr<WorkletsModuleProxy> &workletsModuleProxy);
17
- };
18
-
19
- } // namespace worklets
1
+ #pragma once
2
+
3
+ #include <jsi/jsi.h>
4
+ #include <worklets/NativeModules/WorkletsModuleProxy.h>
5
+ #include <memory>
6
+
7
+ using namespace facebook;
8
+
9
+ namespace worklets {
10
+
11
+ class RNRuntimeWorkletDecorator {
12
+ // TODO: Rename to `RNRuntimeWorkletsDecorator` or something more suitable.
13
+ public:
14
+ static void decorate(
15
+ jsi::Runtime &rnRuntime,
16
+ const std::shared_ptr<WorkletsModuleProxy> &workletsModuleProxy);
17
+ };
18
+
19
+ } // namespace worklets