react-native-reanimated 4.7.0 → 4.7.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/Common/cpp/reanimated/CSS/common/values/CSSNumber.cpp +5 -9
- package/Common/cpp/reanimated/CSS/common/values/CSSNumber.h +2 -6
- package/Common/cpp/reanimated/Fabric/ReanimatedCommitHook.cpp +34 -2
- package/Common/cpp/reanimated/Fabric/ReanimatedCommitHook.h +15 -1
- package/Common/cpp/reanimated/Fabric/ReanimatedMountHook.cpp +9 -0
- package/Common/cpp/reanimated/Fabric/ReanimatedMountHook.h +3 -0
- package/Common/cpp/reanimated/Fabric/updates/AnimatedPropsRegistry.cpp +135 -33
- package/Common/cpp/reanimated/Fabric/updates/AnimatedPropsRegistry.h +37 -3
- package/Common/cpp/reanimated/Fabric/updates/SynchronousWritesTracker.cpp +103 -0
- package/Common/cpp/reanimated/Fabric/updates/SynchronousWritesTracker.h +74 -0
- package/Common/cpp/reanimated/Fabric/updates/UpdatesRegistry.cpp +43 -0
- package/Common/cpp/reanimated/Fabric/updates/UpdatesRegistry.h +13 -0
- package/Common/cpp/reanimated/Fabric/updates/UpdatesRegistryManager.cpp +14 -1
- package/Common/cpp/reanimated/Fabric/updates/UpdatesRegistryManager.h +3 -0
- package/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy.cpp +318 -134
- package/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy.h +27 -6
- package/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxyCommon.cpp +32 -17
- package/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxyCommon.h +17 -1
- package/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy_Legacy.cpp +14 -13
- package/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy_Legacy.h +5 -2
- package/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsUtils.h +57 -9
- package/Common/cpp/reanimated/LayoutAnimations/PropsDiffer.h +2 -2
- package/Common/cpp/reanimated/LayoutAnimations/SharedTransitions.cpp +11 -11
- package/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxy.cpp +114 -11
- package/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxy.h +12 -2
- package/Common/cpp/reanimated/Tools/PlatformDepMethodsHolder.h +17 -1
- package/Common/cpp/reanimated/Tools/TextMetrics.h +22 -0
- package/android/src/main/cpp/reanimated/android/NativeProxy.cpp +32 -3
- package/android/src/main/cpp/reanimated/android/NativeProxy.h +3 -0
- package/android/src/main/java/com/swmansion/reanimated/NativeProxy.kt +108 -9
- package/android/src/main/java/com/swmansion/reanimated/NodesManager.kt +2 -4
- package/android/src/main/java/com/swmansion/reanimated/nativeProxy/EventHandler.kt +4 -3
- package/android/src/main/java/com/swmansion/reanimated/sensor/ReanimatedSensor.kt +1 -1
- package/android/src/main/java/com/swmansion/reanimated/sensor/ReanimatedSensorListener.kt +44 -33
- package/apple/reanimated/apple/REAReducedMotion.h +1 -3
- package/apple/reanimated/apple/REASynchronousPropsRewriter.h +18 -0
- package/apple/reanimated/apple/REASynchronousPropsRewriter.mm +37 -0
- package/apple/reanimated/apple/ReanimatedModule.mm +7 -0
- package/apple/reanimated/apple/keyboardObserver/REAKeyboardEventObserver.mm +20 -3
- package/apple/reanimated/apple/native/PlatformDepMethodsHolderImpl.mm +52 -1
- package/jest/resolver.js +4 -1
- package/lib/module/PropsRegistryGarbageCollector.js +43 -25
- package/lib/module/PropsRegistryGarbageCollector.js.map +1 -1
- package/lib/module/ReanimatedModule/NativeReanimated.js +2 -2
- package/lib/module/ReanimatedModule/NativeReanimated.js.map +1 -1
- package/lib/module/animation/timing.js +15 -2
- package/lib/module/animation/timing.js.map +1 -1
- package/lib/module/commonTypes.js.map +1 -1
- package/lib/module/createAnimatedComponent/AnimatedComponent.js +1 -1
- package/lib/module/createAnimatedComponent/AnimatedComponent.js.map +1 -1
- package/lib/module/createAnimatedComponent/AnimatedComponent.native.js +10 -34
- package/lib/module/createAnimatedComponent/AnimatedComponent.native.js.map +1 -1
- package/lib/module/platform-specific/jsVersion.js +1 -1
- package/lib/module/platformFunctions/setNativeProps.native.js +2 -1
- package/lib/module/platformFunctions/setNativeProps.native.js.map +1 -1
- package/lib/module/updateProps/updateProps.native.js +5 -4
- package/lib/module/updateProps/updateProps.native.js.map +1 -1
- package/lib/typescript/PropsRegistryGarbageCollector.d.ts +2 -2
- package/lib/typescript/PropsRegistryGarbageCollector.d.ts.map +1 -1
- package/lib/typescript/ReanimatedModule/reanimatedModuleProxy.d.ts +1 -1
- package/lib/typescript/ReanimatedModule/reanimatedModuleProxy.d.ts.map +1 -1
- package/lib/typescript/animation/timing.d.ts.map +1 -1
- package/lib/typescript/commonTypes.d.ts +3 -1
- package/lib/typescript/commonTypes.d.ts.map +1 -1
- package/lib/typescript/createAnimatedComponent/AnimatedComponent.d.ts +1 -1
- package/lib/typescript/createAnimatedComponent/AnimatedComponent.d.ts.map +1 -1
- package/lib/typescript/createAnimatedComponent/AnimatedComponent.native.d.ts +1 -1
- package/lib/typescript/createAnimatedComponent/AnimatedComponent.native.d.ts.map +1 -1
- package/lib/typescript/createAnimatedComponent/commonTypes.d.ts +1 -1
- package/lib/typescript/createAnimatedComponent/commonTypes.d.ts.map +1 -1
- package/lib/typescript/platform-specific/jsVersion.d.ts +1 -1
- package/lib/typescript/updateProps/updateProps.native.d.ts.map +1 -1
- package/package.json +9 -7
- package/src/PropsRegistryGarbageCollector.ts +46 -25
- package/src/ReanimatedModule/NativeReanimated.ts +2 -2
- package/src/ReanimatedModule/reanimatedModuleProxy.ts +1 -1
- package/src/animation/timing.ts +20 -2
- package/src/commonTypes.ts +3 -1
- package/src/createAnimatedComponent/AnimatedComponent.native.tsx +5 -30
- package/src/createAnimatedComponent/AnimatedComponent.tsx +1 -1
- package/src/createAnimatedComponent/commonTypes.ts +1 -1
- package/src/platform-specific/jsVersion.ts +1 -1
- package/src/platformFunctions/setNativeProps.native.ts +3 -1
- package/src/privateGlobals.d.ts +1 -0
- package/src/updateProps/updateProps.native.ts +10 -3
|
@@ -14,6 +14,7 @@ class EventHandler : RCTModernEventEmitter {
|
|
|
14
14
|
|
|
15
15
|
var mCustomEventNamesResolver: UIManagerModule.CustomEventNamesResolver? = null
|
|
16
16
|
internal var isInDrawPassProvider: (() -> Boolean)? = null
|
|
17
|
+
internal var nativeCallGuard: (() -> Unit) -> Unit = { it() }
|
|
17
18
|
|
|
18
19
|
@DoNotStrip
|
|
19
20
|
private constructor(hybridData: HybridData) {
|
|
@@ -32,7 +33,7 @@ class EventHandler : RCTModernEventEmitter {
|
|
|
32
33
|
category: Int,
|
|
33
34
|
) {
|
|
34
35
|
val resolvedEventName = mCustomEventNamesResolver!!.resolveCustomEventName(eventName) ?: eventName
|
|
35
|
-
receiveEvent(resolvedEventName, targetTag, params, isInDrawPass())
|
|
36
|
+
nativeCallGuard { receiveEvent(resolvedEventName, targetTag, params, isInDrawPass()) }
|
|
36
37
|
}
|
|
37
38
|
|
|
38
39
|
override fun receiveEvent(
|
|
@@ -42,7 +43,7 @@ class EventHandler : RCTModernEventEmitter {
|
|
|
42
43
|
params: WritableMap?,
|
|
43
44
|
) {
|
|
44
45
|
val resolvedEventName = mCustomEventNamesResolver!!.resolveCustomEventName(eventName) ?: eventName
|
|
45
|
-
receiveEvent(resolvedEventName, targetTag, params, isInDrawPass())
|
|
46
|
+
nativeCallGuard { receiveEvent(resolvedEventName, targetTag, params, isInDrawPass()) }
|
|
46
47
|
}
|
|
47
48
|
|
|
48
49
|
override fun receiveEvent(
|
|
@@ -51,7 +52,7 @@ class EventHandler : RCTModernEventEmitter {
|
|
|
51
52
|
params: WritableMap?,
|
|
52
53
|
) {
|
|
53
54
|
val resolvedEventName = mCustomEventNamesResolver!!.resolveCustomEventName(eventName) ?: eventName
|
|
54
|
-
receiveEvent(resolvedEventName, targetTag, params, isInDrawPass())
|
|
55
|
+
nativeCallGuard { receiveEvent(resolvedEventName, targetTag, params, isInDrawPass()) }
|
|
55
56
|
}
|
|
56
57
|
|
|
57
58
|
override fun receiveTouches(
|
|
@@ -26,7 +26,7 @@ internal class ReanimatedSensor(
|
|
|
26
26
|
init {
|
|
27
27
|
val wm = reactContext.get()!!.getSystemService(Context.WINDOW_SERVICE) as WindowManager
|
|
28
28
|
val display = wm.defaultDisplay
|
|
29
|
-
listener = ReanimatedSensorListener(setter, interval.toDouble(), display)
|
|
29
|
+
listener = ReanimatedSensorListener(setter, interval.toDouble(), display, sensorType)
|
|
30
30
|
sensorManager =
|
|
31
31
|
reactContext.get()!!.getSystemService(Context.SENSOR_SERVICE) as SensorManager
|
|
32
32
|
this.interval = if (interval == -1) DEFAULT_INTERVAL else interval
|
|
@@ -4,6 +4,7 @@ import android.hardware.Sensor
|
|
|
4
4
|
import android.hardware.SensorEvent
|
|
5
5
|
import android.hardware.SensorEventListener
|
|
6
6
|
import android.hardware.SensorManager
|
|
7
|
+
import android.util.Log
|
|
7
8
|
import android.view.Display
|
|
8
9
|
import android.view.Surface
|
|
9
10
|
import com.swmansion.reanimated.nativeProxy.SensorSetter
|
|
@@ -12,8 +13,10 @@ class ReanimatedSensorListener(
|
|
|
12
13
|
private val setter: SensorSetter,
|
|
13
14
|
private val interval: Double,
|
|
14
15
|
private val display: Display,
|
|
16
|
+
private val sensorType: ReanimatedSensorType,
|
|
15
17
|
) : SensorEventListener {
|
|
16
18
|
private var lastRead = System.currentTimeMillis().toDouble()
|
|
19
|
+
private var didWarnAboutMislabeledEvent = false
|
|
17
20
|
|
|
18
21
|
private val rotation = FloatArray(9)
|
|
19
22
|
private val orientation = FloatArray(3)
|
|
@@ -24,8 +27,8 @@ class ReanimatedSensorListener(
|
|
|
24
27
|
if (current - lastRead < interval) {
|
|
25
28
|
return
|
|
26
29
|
}
|
|
27
|
-
val sensorType = event.sensor.type
|
|
28
30
|
lastRead = current
|
|
31
|
+
warnOnceAboutMislabeledEvent(event.sensor)
|
|
29
32
|
|
|
30
33
|
val orientationDegrees =
|
|
31
34
|
when (display.rotation) {
|
|
@@ -35,43 +38,51 @@ class ReanimatedSensorListener(
|
|
|
35
38
|
else -> 0
|
|
36
39
|
}
|
|
37
40
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
quaternion[0], // qw
|
|
49
|
-
// make Android consistent with iOS, which is better documented here:
|
|
50
|
-
// https://developer.apple.com/documentation/coremotion/getting_processed_device-motion_data/
|
|
51
|
-
-orientation[0], // yaw
|
|
52
|
-
-orientation[1], // pitch
|
|
53
|
-
orientation[2], // roll
|
|
54
|
-
)
|
|
55
|
-
setter.sensorSetter(data, orientationDegrees)
|
|
41
|
+
val values = event.values
|
|
42
|
+
val data =
|
|
43
|
+
when (sensorType) {
|
|
44
|
+
ReanimatedSensorType.ROTATION_VECTOR -> rotationData(values)
|
|
45
|
+
ReanimatedSensorType.GYROSCOPE,
|
|
46
|
+
ReanimatedSensorType.MAGNETIC_FIELD,
|
|
47
|
+
-> floatArrayOf(values[0], values[1], values[2])
|
|
48
|
+
ReanimatedSensorType.GRAVITY,
|
|
49
|
+
ReanimatedSensorType.ACCELEROMETER,
|
|
50
|
+
-> floatArrayOf(-values[0], -values[1], -values[2])
|
|
56
51
|
}
|
|
57
|
-
|
|
58
|
-
Sensor.TYPE_MAGNETIC_FIELD,
|
|
59
|
-
-> {
|
|
60
|
-
val data = floatArrayOf(event.values[0], event.values[1], event.values[2])
|
|
61
|
-
setter.sensorSetter(data, orientationDegrees)
|
|
62
|
-
}
|
|
63
|
-
Sensor.TYPE_GRAVITY,
|
|
64
|
-
Sensor.TYPE_LINEAR_ACCELERATION,
|
|
65
|
-
-> {
|
|
66
|
-
val data = floatArrayOf(-event.values[0], -event.values[1], -event.values[2])
|
|
67
|
-
setter.sensorSetter(data, orientationDegrees)
|
|
68
|
-
}
|
|
69
|
-
else -> throw IllegalArgumentException("[Reanimated] Unknown sensor type.")
|
|
70
|
-
}
|
|
52
|
+
setter.sensorSetter(data, orientationDegrees)
|
|
71
53
|
}
|
|
72
54
|
|
|
73
55
|
override fun onAccuracyChanged(
|
|
74
56
|
sensor: Sensor,
|
|
75
57
|
accuracy: Int,
|
|
76
58
|
) {}
|
|
59
|
+
|
|
60
|
+
private fun warnOnceAboutMislabeledEvent(eventSensor: Sensor) {
|
|
61
|
+
if (didWarnAboutMislabeledEvent || eventSensor.type == sensorType.getType()) {
|
|
62
|
+
return
|
|
63
|
+
}
|
|
64
|
+
didWarnAboutMislabeledEvent = true
|
|
65
|
+
Log.w(
|
|
66
|
+
"Reanimated",
|
|
67
|
+
"Sensor $sensorType (type ${sensorType.getType()}) receives events from " +
|
|
68
|
+
"\"${eventSensor.name}\" (type ${eventSensor.type}).",
|
|
69
|
+
)
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
private fun rotationData(values: FloatArray): FloatArray {
|
|
73
|
+
SensorManager.getQuaternionFromVector(quaternion, values)
|
|
74
|
+
SensorManager.getRotationMatrixFromVector(rotation, values)
|
|
75
|
+
SensorManager.getOrientation(rotation, orientation)
|
|
76
|
+
return floatArrayOf(
|
|
77
|
+
quaternion[1], // qx
|
|
78
|
+
quaternion[3], // qy -> we set qz to match iOS
|
|
79
|
+
-quaternion[2], // qz -> we set -qy to match iOS
|
|
80
|
+
quaternion[0], // qw
|
|
81
|
+
// make Android consistent with iOS, which is better documented here:
|
|
82
|
+
// https://developer.apple.com/documentation/coremotion/getting_processed_device-motion_data/
|
|
83
|
+
-orientation[0], // yaw
|
|
84
|
+
-orientation[1], // pitch
|
|
85
|
+
orientation[2], // roll
|
|
86
|
+
)
|
|
87
|
+
}
|
|
77
88
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#import <React/RCTSurfacePresenter.h>
|
|
4
|
+
#import <reanimated/NativeModules/ReanimatedModuleProxy.h>
|
|
5
|
+
|
|
6
|
+
#import <memory>
|
|
7
|
+
|
|
8
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
9
|
+
|
|
10
|
+
@interface REASynchronousPropsRewriter : NSObject <RCTSurfacePresenterObserver>
|
|
11
|
+
|
|
12
|
+
- (instancetype)initWithSurfacePresenter:(RCTSurfacePresenter *)surfacePresenter
|
|
13
|
+
reanimatedModuleProxy:
|
|
14
|
+
(const std::shared_ptr<reanimated::ReanimatedModuleProxy> &)reanimatedModuleProxy;
|
|
15
|
+
|
|
16
|
+
@end
|
|
17
|
+
|
|
18
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
#import <reanimated/apple/REASynchronousPropsRewriter.h>
|
|
2
|
+
|
|
3
|
+
#import <React/RCTAssert.h>
|
|
4
|
+
|
|
5
|
+
@implementation REASynchronousPropsRewriter {
|
|
6
|
+
__weak RCTSurfacePresenter *_surfacePresenter;
|
|
7
|
+
std::weak_ptr<reanimated::ReanimatedModuleProxy> _reanimatedModuleProxy;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
- (instancetype)initWithSurfacePresenter:(RCTSurfacePresenter *)surfacePresenter
|
|
11
|
+
reanimatedModuleProxy:
|
|
12
|
+
(const std::shared_ptr<reanimated::ReanimatedModuleProxy> &)reanimatedModuleProxy
|
|
13
|
+
{
|
|
14
|
+
if (self = [super init]) {
|
|
15
|
+
_surfacePresenter = surfacePresenter;
|
|
16
|
+
_reanimatedModuleProxy = reanimatedModuleProxy;
|
|
17
|
+
// `addObserver:` is deprecated, but its replacement has no hook for an external observer.
|
|
18
|
+
// See `REAPseudoSelectorAttachQueue`.
|
|
19
|
+
[surfacePresenter addObserver:self];
|
|
20
|
+
}
|
|
21
|
+
return self;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
- (void)dealloc
|
|
25
|
+
{
|
|
26
|
+
[_surfacePresenter removeObserver:self];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
- (void)didMountComponentsWithRootTag:(NSInteger)rootTag
|
|
30
|
+
{
|
|
31
|
+
RCTAssertMainQueue();
|
|
32
|
+
if (const auto reanimatedModuleProxy = _reanimatedModuleProxy.lock()) {
|
|
33
|
+
reanimatedModuleProxy->rewriteSynchronousProps();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@end
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
#import <reanimated/apple/REAAssertJavaScriptQueue.h>
|
|
11
11
|
#import <reanimated/apple/REAAssertTurboModuleManagerQueue.h>
|
|
12
12
|
#import <reanimated/apple/REANodesManager.h>
|
|
13
|
+
#import <reanimated/apple/REASynchronousPropsRewriter.h>
|
|
13
14
|
#import <reanimated/apple/ReanimatedModule.h>
|
|
14
15
|
#import <reanimated/apple/native/NativeProxy.h>
|
|
15
16
|
#import <reanimated/apple/native/REAJSIUtils.h>
|
|
@@ -25,6 +26,7 @@ using namespace worklets;
|
|
|
25
26
|
@implementation ReanimatedModule {
|
|
26
27
|
__weak RCTSurfacePresenter *_surfacePresenter;
|
|
27
28
|
std::shared_ptr<ReanimatedModuleProxy> _reanimatedModuleProxy;
|
|
29
|
+
REASynchronousPropsRewriter *_synchronousPropsRewriter;
|
|
28
30
|
#ifndef NDEBUG
|
|
29
31
|
reanimated::SingleInstanceChecker<ReanimatedModule> singleInstanceChecker_;
|
|
30
32
|
#endif // NDEBUG
|
|
@@ -41,6 +43,7 @@ RCT_EXPORT_MODULE(ReanimatedModule);
|
|
|
41
43
|
REAAssertTurboModuleManagerQueue();
|
|
42
44
|
|
|
43
45
|
[_nodesManager invalidate];
|
|
46
|
+
_synchronousPropsRewriter = nil;
|
|
44
47
|
_reanimatedModuleProxy.reset();
|
|
45
48
|
[super invalidate];
|
|
46
49
|
}
|
|
@@ -184,6 +187,10 @@ RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(installTurboModule)
|
|
|
184
187
|
const auto &uiManager = scheduler.uiManager;
|
|
185
188
|
react_native_assert(uiManager.get() != nil);
|
|
186
189
|
_reanimatedModuleProxy->initializeFabric(uiManager);
|
|
190
|
+
if (_reanimatedModuleProxy->hasSynchronousWritesTracker()) {
|
|
191
|
+
_synchronousPropsRewriter = [[REASynchronousPropsRewriter alloc] initWithSurfacePresenter:_surfacePresenter
|
|
192
|
+
reanimatedModuleProxy:_reanimatedModuleProxy];
|
|
193
|
+
}
|
|
187
194
|
[self attachReactEventListener:_reanimatedModuleProxy];
|
|
188
195
|
[self registerRCTEventHandler:_reanimatedModuleProxy uiWorkletRuntime:uiWorkletRuntime];
|
|
189
196
|
|
|
@@ -86,6 +86,23 @@ typedef NS_ENUM(NSUInteger, KeyboardState) { // NOLINT(performance-enum-size,cpp
|
|
|
86
86
|
|
|
87
87
|
#else
|
|
88
88
|
|
|
89
|
+
static UIWindow *_Nullable REAFindKeyWindow(void)
|
|
90
|
+
{
|
|
91
|
+
// The window used to be read straight off the app delegate. Apps that adopt the UIScene
|
|
92
|
+
// life cycle own their window in a UISceneDelegate, so their app delegate may not declare
|
|
93
|
+
// `window` at all and messaging it raises NSInvalidArgumentException. Prefer the delegate
|
|
94
|
+
// when it is available so existing apps keep the exact same window, and otherwise fall back
|
|
95
|
+
// to the scene-aware lookup (cf. -[REATouchHoverCoordinator activeKeyWindow]).
|
|
96
|
+
id<UIApplicationDelegate> delegate = RCTSharedApplication().delegate;
|
|
97
|
+
if ([delegate respondsToSelector:@selector(window)]) {
|
|
98
|
+
UIWindow *window = delegate.window;
|
|
99
|
+
if (window != nil) {
|
|
100
|
+
return window;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return RCTKeyWindow();
|
|
104
|
+
}
|
|
105
|
+
|
|
89
106
|
- (void)runListeners:(float)keyboardHeight
|
|
90
107
|
{
|
|
91
108
|
for (NSString *key in _listeners.allKeys) {
|
|
@@ -185,7 +202,7 @@ typedef NS_ENUM(NSUInteger, KeyboardState) { // NOLINT(performance-enum-size,cpp
|
|
|
185
202
|
CGRect beginFrame = [[userInfo objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue];
|
|
186
203
|
CGRect endFrame = [[userInfo objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue];
|
|
187
204
|
NSTimeInterval animationDuration = [[userInfo objectForKey:UIKeyboardAnimationDurationUserInfoKey] doubleValue];
|
|
188
|
-
auto window =
|
|
205
|
+
auto window = REAFindKeyWindow();
|
|
189
206
|
|
|
190
207
|
/*
|
|
191
208
|
The keyboard frame is in the screen's coordinate space and must first be converted
|
|
@@ -238,7 +255,7 @@ typedef NS_ENUM(NSUInteger, KeyboardState) { // NOLINT(performance-enum-size,cpp
|
|
|
238
255
|
RCTExecuteOnMainQueue(^() {
|
|
239
256
|
if (!self->_measuringView) {
|
|
240
257
|
self->_measuringView = [[UIView alloc] initWithFrame:CGRectMake(0, -1, 0, 0)];
|
|
241
|
-
UIWindow *keyWindow =
|
|
258
|
+
UIWindow *keyWindow = REAFindKeyWindow();
|
|
242
259
|
[keyWindow addSubview:self->_measuringView];
|
|
243
260
|
}
|
|
244
261
|
if ([self->_listeners count] == 0) {
|
|
@@ -301,7 +318,7 @@ typedef NS_ENUM(NSUInteger, KeyboardState) { // NOLINT(performance-enum-size,cpp
|
|
|
301
318
|
{
|
|
302
319
|
[[self getDisplayLink] setPaused:YES];
|
|
303
320
|
|
|
304
|
-
auto window =
|
|
321
|
+
auto window = REAFindKeyWindow();
|
|
305
322
|
auto keyboardView = [self getKeyboardView];
|
|
306
323
|
if (keyboardView) {
|
|
307
324
|
CGRect frameIntersection = CGRectIntersection(window.bounds, keyboardView.frame);
|
|
@@ -12,9 +12,11 @@
|
|
|
12
12
|
#import <reanimated/apple/pseudoSelectors/REAPseudoSelectorAttachQueue.h>
|
|
13
13
|
#import <reanimated/apple/sensor/ReanimatedSensorContainer.h>
|
|
14
14
|
|
|
15
|
+
#import <React/RCTAssert.h>
|
|
15
16
|
#import <React/RCTComponentViewProtocol.h>
|
|
16
17
|
#import <React/RCTComponentViewRegistry.h>
|
|
17
18
|
#import <React/RCTMountingManager.h>
|
|
19
|
+
#import <React/RCTViewComponentView.h>
|
|
18
20
|
|
|
19
21
|
#import <memory>
|
|
20
22
|
#import <variant>
|
|
@@ -194,18 +196,61 @@ std::shared_ptr<css::CSSPlatformTransitionBackend> makePlatformTransitionBackend
|
|
|
194
196
|
|
|
195
197
|
ForceScreenSnapshotFunction makeForceScreenSnapshotFunction(REANodesManager *nodesManager)
|
|
196
198
|
{
|
|
197
|
-
auto forceScreenSnapshot = [=](Tag tag) {
|
|
199
|
+
auto forceScreenSnapshot = [=](Tag tag) -> bool {
|
|
198
200
|
RCTSurfacePresenter *surfacePresenter = nodesManager.surfacePresenter;
|
|
199
201
|
RCTComponentViewRegistry *componentViewRegistry = surfacePresenter.mountingManager.componentViewRegistry;
|
|
200
202
|
REAUIView<RCTComponentViewProtocol> *maybeRNSScreenView = [componentViewRegistry findComponentViewWithTag:tag];
|
|
201
203
|
SEL setSnapshotAfterUpdatesSelector = @selector(setSnapshotAfterUpdates:);
|
|
202
204
|
if ([maybeRNSScreenView respondsToSelector:setSnapshotAfterUpdatesSelector]) {
|
|
203
205
|
[static_cast<id<RNScreenViewOptionalProtocol>>(maybeRNSScreenView) setSnapshotAfterUpdates:YES];
|
|
206
|
+
return true;
|
|
204
207
|
}
|
|
208
|
+
return false;
|
|
205
209
|
};
|
|
206
210
|
return forceScreenSnapshot;
|
|
207
211
|
}
|
|
208
212
|
|
|
213
|
+
ReadMountedViewPropsFunction makeReadMountedViewPropsFunction(REANodesManager *nodesManager)
|
|
214
|
+
{
|
|
215
|
+
auto readMountedViewProps = [=](Tag tag) -> Props::Shared {
|
|
216
|
+
RCTAssertMainQueue();
|
|
217
|
+
RCTSurfacePresenter *surfacePresenter = nodesManager.surfacePresenter;
|
|
218
|
+
RCTComponentViewRegistry *componentViewRegistry = surfacePresenter.mountingManager.componentViewRegistry;
|
|
219
|
+
REAUIView<RCTComponentViewProtocol> *componentView = [componentViewRegistry findComponentViewWithTag:tag];
|
|
220
|
+
// The default `props` getter of `UIView` asserts.
|
|
221
|
+
if (![componentView isKindOfClass:[RCTViewComponentView class]]) {
|
|
222
|
+
return nullptr;
|
|
223
|
+
}
|
|
224
|
+
return [componentView props];
|
|
225
|
+
};
|
|
226
|
+
return readMountedViewProps;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
ObtainMountedViewPropsFunction makeObtainMountedViewPropsFunction(REANodesManager *nodesManager)
|
|
230
|
+
{
|
|
231
|
+
return [=](Tag tag) -> std::optional<MountedViewProps> {
|
|
232
|
+
#if TARGET_OS_OSX
|
|
233
|
+
return std::nullopt;
|
|
234
|
+
#else
|
|
235
|
+
RCTComponentViewRegistry *componentViewRegistry =
|
|
236
|
+
nodesManager.surfacePresenter.mountingManager.componentViewRegistry;
|
|
237
|
+
REAUIView *view = [componentViewRegistry findComponentViewWithTag:tag];
|
|
238
|
+
if (view == nil || view.window == nil) {
|
|
239
|
+
return std::nullopt;
|
|
240
|
+
}
|
|
241
|
+
const CGSize size = view.bounds.size;
|
|
242
|
+
const CGPoint anchor = view.layer.anchorPoint;
|
|
243
|
+
return MountedViewProps{
|
|
244
|
+
.x = view.center.x - size.width * anchor.x,
|
|
245
|
+
.y = view.center.y - size.height * anchor.y,
|
|
246
|
+
.width = size.width,
|
|
247
|
+
.height = size.height,
|
|
248
|
+
.opacity = view.alpha,
|
|
249
|
+
};
|
|
250
|
+
#endif
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
|
|
209
254
|
PlatformAttachPseudoSelectorFunction makeAttachPseudoSelectorFunction(REAPseudoSelectorAttachQueue *attachQueue)
|
|
210
255
|
{
|
|
211
256
|
return [attachQueue](Tag tag, PseudoSelector selector, std::function<void(bool)> callback) {
|
|
@@ -228,6 +273,8 @@ PlatformDepMethodsHolder makePlatformDepMethodsHolder(RCTModuleRegistry *moduleR
|
|
|
228
273
|
|
|
229
274
|
auto forceScreenSnapshotFunction = makeForceScreenSnapshotFunction(nodesManager);
|
|
230
275
|
|
|
276
|
+
auto readMountedViewPropsFunction = makeReadMountedViewPropsFunction(nodesManager);
|
|
277
|
+
|
|
231
278
|
auto synchronouslyUpdateUIPropsFunction = makeSynchronouslyUpdateUIPropsFunction(nodesManager);
|
|
232
279
|
|
|
233
280
|
auto getAnimationTimestamp = makeGetAnimationTimestamp();
|
|
@@ -253,11 +300,14 @@ PlatformDepMethodsHolder makePlatformDepMethodsHolder(RCTModuleRegistry *moduleR
|
|
|
253
300
|
auto attachPseudoSelectorFunction = makeAttachPseudoSelectorFunction(attachQueue);
|
|
254
301
|
auto detachPseudoSelectorFunction = makeDetachPseudoSelectorFunction(attachQueue);
|
|
255
302
|
|
|
303
|
+
auto obtainMountedViewPropsFunction = makeObtainMountedViewPropsFunction(nodesManager);
|
|
304
|
+
|
|
256
305
|
auto platformTransitionBackend = makePlatformTransitionBackend(nodesManager);
|
|
257
306
|
|
|
258
307
|
PlatformDepMethodsHolder platformDepMethodsHolder = {
|
|
259
308
|
requestRender,
|
|
260
309
|
forceScreenSnapshotFunction,
|
|
310
|
+
readMountedViewPropsFunction,
|
|
261
311
|
synchronouslyUpdateUIPropsFunction,
|
|
262
312
|
getAnimationTimestamp,
|
|
263
313
|
registerSensorFunction,
|
|
@@ -268,6 +318,7 @@ PlatformDepMethodsHolder makePlatformDepMethodsHolder(RCTModuleRegistry *moduleR
|
|
|
268
318
|
maybeFlushUIUpdatesQueueFunction,
|
|
269
319
|
attachPseudoSelectorFunction,
|
|
270
320
|
detachPseudoSelectorFunction,
|
|
321
|
+
obtainMountedViewPropsFunction,
|
|
271
322
|
platformTransitionBackend,
|
|
272
323
|
};
|
|
273
324
|
return platformDepMethodsHolder;
|
package/jest/resolver.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
const path = require('path');
|
|
1
2
|
const workletsResolver = require('react-native-worklets/jest/resolver');
|
|
2
3
|
|
|
4
|
+
const REANIMATED_DIR = /[\\/]react-native-reanimated[\\/](src|lib)[\\/]/;
|
|
5
|
+
|
|
3
6
|
const WEB_ONLY_IN_JEST = new Set([
|
|
4
7
|
'initializers',
|
|
5
8
|
'mutables',
|
|
@@ -24,7 +27,7 @@ module.exports = (request, options) => {
|
|
|
24
27
|
if (
|
|
25
28
|
request.startsWith('.') &&
|
|
26
29
|
isWebOnly &&
|
|
27
|
-
options.basedir.
|
|
30
|
+
REANIMATED_DIR.test(options.basedir + path.sep)
|
|
28
31
|
) {
|
|
29
32
|
return options.defaultResolver(request, {
|
|
30
33
|
...options,
|
|
@@ -27,17 +27,16 @@ export const PropsRegistryGarbageCollector = {
|
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
29
|
syncPropsBackToReact() {
|
|
30
|
-
const settledUpdates = ReanimatedModule.getSettledUpdates();
|
|
31
|
-
for (const {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
30
|
+
const settledUpdates = ReanimatedModule.getSettledUpdates([...this.viewsMap.keys()]);
|
|
31
|
+
for (const settledUpdate of settledUpdates) {
|
|
32
|
+
const {
|
|
33
|
+
viewTag,
|
|
34
|
+
props,
|
|
35
|
+
style
|
|
36
|
+
} = settledUpdate;
|
|
38
37
|
const component = this.viewsMap.get(viewTag);
|
|
39
|
-
|
|
40
|
-
component?._syncStylePropsBackToReact(
|
|
38
|
+
unprocessSettledUpdate(settledUpdate);
|
|
39
|
+
component?._syncStylePropsBackToReact(props, style);
|
|
41
40
|
}
|
|
42
41
|
},
|
|
43
42
|
registerInterval() {
|
|
@@ -50,26 +49,45 @@ export const PropsRegistryGarbageCollector = {
|
|
|
50
49
|
}
|
|
51
50
|
}
|
|
52
51
|
};
|
|
53
|
-
export function
|
|
52
|
+
export function unprocessSettledUpdate({
|
|
53
|
+
props,
|
|
54
|
+
style,
|
|
55
|
+
keysLastWrittenByAnimatedStyle
|
|
56
|
+
}) {
|
|
54
57
|
unprocessColorsInProps(props);
|
|
55
|
-
|
|
56
|
-
|
|
58
|
+
unprocessColorsInProps(style);
|
|
59
|
+
for (const key of keysLastWrittenByAnimatedStyle) {
|
|
60
|
+
const unprocess = STYLE_BUILDER_VALUE_UNPROCESSORS[key];
|
|
61
|
+
if (!unprocess) {
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
for (const settledValues of [props, style]) {
|
|
65
|
+
if (key in settledValues) {
|
|
66
|
+
settledValues[key] = unprocess(settledValues[key]);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
57
70
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
71
|
+
const STYLE_BUILDER_VALUE_UNPROCESSORS = {
|
|
72
|
+
boxShadow: unprocessBoxShadow,
|
|
73
|
+
backgroundImage: unprocessBackgroundImage,
|
|
74
|
+
// eslint-disable-next-line camelcase
|
|
75
|
+
experimental_backgroundImage: unprocessBackgroundImage
|
|
76
|
+
};
|
|
77
|
+
function unprocessBoxShadow(value) {
|
|
78
|
+
if (!Array.isArray(value)) {
|
|
79
|
+
return value;
|
|
65
80
|
}
|
|
81
|
+
return value.map(boxShadow => ({
|
|
82
|
+
...boxShadow,
|
|
83
|
+
color: unprocessColor(boxShadow.color)
|
|
84
|
+
}));
|
|
66
85
|
}
|
|
67
|
-
function unprocessBackgroundImage(
|
|
68
|
-
if (!Array.isArray(
|
|
69
|
-
return;
|
|
86
|
+
function unprocessBackgroundImage(value) {
|
|
87
|
+
if (!Array.isArray(value)) {
|
|
88
|
+
return value;
|
|
70
89
|
}
|
|
71
|
-
|
|
72
|
-
props.backgroundImage = props.backgroundImage.map(backgroundImage => {
|
|
90
|
+
return value.map(backgroundImage => {
|
|
73
91
|
const colorStops = backgroundImage.colorStops.map(unprocessColorStop);
|
|
74
92
|
if (backgroundImage.type === 'linear-gradient') {
|
|
75
93
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["unprocessColor","unprocessColorsInProps","ReanimatedModule","FLUSH_INTERVAL_MS","PropsRegistryGarbageCollector","viewsMap","Map","intervalId","registerView","viewTag","component","has","set","size","registerInterval","unregisterView","deleted","delete","unregisterInterval","syncPropsBackToReact","settledUpdates","getSettledUpdates","
|
|
1
|
+
{"version":3,"names":["unprocessColor","unprocessColorsInProps","ReanimatedModule","FLUSH_INTERVAL_MS","PropsRegistryGarbageCollector","viewsMap","Map","intervalId","registerView","viewTag","component","has","set","size","registerInterval","unregisterView","deleted","delete","unregisterInterval","syncPropsBackToReact","settledUpdates","getSettledUpdates","keys","settledUpdate","props","style","get","unprocessSettledUpdate","_syncStylePropsBackToReact","setInterval","bind","clearInterval","keysLastWrittenByAnimatedStyle","key","unprocess","STYLE_BUILDER_VALUE_UNPROCESSORS","settledValues","boxShadow","unprocessBoxShadow","backgroundImage","unprocessBackgroundImage","experimental_backgroundImage","value","Array","isArray","map","color","colorStops","unprocessColorStop","type","direction","unprocessDirection","position","positions","undefined"],"sourceRoot":"../../src","sources":["PropsRegistryGarbageCollector.ts"],"mappings":"AAAA,YAAY;;AAQZ,SACEA,cAAc,EACdC,sBAAsB,QACjB,qCAAkC;AAGzC,SAASC,gBAAgB,QAAQ,oBAAoB;AAErD,MAAMC,iBAAiB,GAAG,GAAG;AAE7B,OAAO,MAAMC,6BAA6B,GAAG;EAC3CC,QAAQ,EAAE,IAAIC,GAAG,CAAqC,CAAC;EACvDC,UAAU,EAAE,IAA6B;EAEzCC,YAAYA,CAACC,OAAe,EAAEC,SAAqC,EAAE;IACnE,IAAI,IAAI,CAACL,QAAQ,CAACM,GAAG,CAACF,OAAO,CAAC,EAAE;MAC9B;MACA;MACA;MACA;MACA;MACA;IACF;IACA,IAAI,CAACJ,QAAQ,CAACO,GAAG,CAACH,OAAO,EAAEC,SAAS,CAAC;IACrC,IAAI,IAAI,CAACL,QAAQ,CAACQ,IAAI,KAAK,CAAC,EAAE;MAC5B,IAAI,CAACC,gBAAgB,CAAC,CAAC;IACzB;EACF,C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kBAAkBA,CAAC;EAAEF,IAAI;EAAEP;AAA0B,CAAC,EAAE;EAC/D,OAAOO,IAAI,KAAK,OAAO,GAAG,GAAGP,KAAK,KAAK,GAAGA,KAAK;AACjD;AAEA,SAASM,kBAAkBA,CAAC;EAAEF,KAAK;EAAEM;AAA6B,CAAC,EAAE;EACnE,OAAO;IACLN,KAAK,EAAEA,KAAK,KAAK,IAAI,GAAG,IAAI,GAAG9C,cAAc,CAAC8C,KAAK,CAAC;IACpDO,SAAS,EAAED,QAAQ,KAAK,IAAI,GAAGE,SAAS,GAAG,CAACF,QAAQ;EACtD,CAAC;AACH","ignoreList":[]}
|
|
@@ -108,8 +108,8 @@ See https://docs.swmansion.com/react-native-reanimated/docs/guides/troubleshooti
|
|
|
108
108
|
unregisterCSSTransition(viewTag) {
|
|
109
109
|
this.#reanimatedModuleProxy.unregisterCSSTransition(viewTag);
|
|
110
110
|
}
|
|
111
|
-
getSettledUpdates() {
|
|
112
|
-
return this.#reanimatedModuleProxy.getSettledUpdates();
|
|
111
|
+
getSettledUpdates(registeredViewTags) {
|
|
112
|
+
return this.#reanimatedModuleProxy.getSettledUpdates(registeredViewTags);
|
|
113
113
|
}
|
|
114
114
|
registerPseudoStyles(shadowNodeWrapper, config) {
|
|
115
115
|
this.#reanimatedModuleProxy.registerPseudoStyles(shadowNodeWrapper, config);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getUIRuntimeHolder","getUISchedulerHolder","IS_JEST","getShadowNodeWrapperFromRef","checkCppVersion","jsVersion","assertWorkletsVersion","ReanimatedTurboModule","createNativeReanimatedModule","NativeReanimatedModule","assertSingleReanimatedInstance","global","_REANIMATED_VERSION_JS","undefined","Error","reanimatedModuleProxy","constructor","__DEV__","installTurboModule","__reanimatedModuleProxy","globalThis","RN$Bridgeless","registerSensor","sensorType","interval","iosReferenceFrame","handler","unregisterSensor","sensorId","registerEventHandler","eventHandler","eventName","emitterReactTag","unregisterEventHandler","id","getViewProp","viewTag","propName","component","callback","shadowNodeWrapper","configureLayoutAnimationBatch","layoutAnimationsBatch","setShouldAnimateExitingForTag","shouldAnimate","getStaticFeatureFlag","name","setDynamicFeatureFlag","value","subscribeForKeyboardEvents","isStatusBarTranslucent","isNavigationBarTranslucent","unsubscribeFromKeyboardEvents","listenerId","setViewStyle","style","setCSSEventHandler","markNodeAsRemovable","unmarkNodeAsRemovable","registerCSSKeyframes","animationName","compoundComponentName","keyframesConfig","unregisterCSSKeyframes","applyCSSAnimations","animationUpdates","unregisterCSSAnimations","runCSSTransition","transitionConfig","eventMask","unregisterCSSTransition","getSettledUpdates","registerPseudoStyles","config","unregisterPseudoStyles","__UI_WORKLET_RUNTIME_HOLDER","__UI_SCHEDULER_HOLDER","status"],"sourceRoot":"../../../src","sources":["ReanimatedModule/NativeReanimated.ts"],"mappings":"AAAA,YAAY;;AAGZ,SACEA,kBAAkB,EAClBC,oBAAoB,QACf,uBAAuB;AAE9B,SAASC,OAAO,QAAQ,oBAAW;AAiBnC,SAASC,2BAA2B,QAAQ,gBAAgB;AAC5D,SAASC,eAAe,QAAQ,yCAAsC;AACtE,SAASC,SAAS,QAAQ,mCAAgC;AAC1D,SAASC,qBAAqB,QAAQ,yCAAsC;AAC5E,SAASC,qBAAqB,QAAQ,mBAAU;AAMhD,OAAO,SAASC,4BAA4BA,CAAA,EAAsB;EAChE,OAAO,IAAIC,sBAAsB,CAAC,CAAC;AACrC;AAEA,SAASC,8BAA8BA,CAAA,EAAG;EACxC,IACEC,MAAM,CAACC,sBAAsB,KAAKC,SAAS,IAC3CF,MAAM,CAACC,sBAAsB,KAAKP,SAAS,EAC3C;IACA,MAAM,IAAIS,KAAK,CACb;AACN,iKAAiKH,MAAM,CAACC,sBAAsB,cAAcP,SAAS,GACjN,CAAC;EACH;AACF;AAEA,MAAMI,sBAAsB,CAA8B;EACxD;AACF;AACA;AACA;EACE,CAACM,qBAAqB;EACtBC,WAAWA,CAAA,EAAG;IACZ;IACA,IAAIC,OAAO,EAAE;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iBAAoC,EAAE;IACxD,IAAI,CAAC,CAACzB,qBAAqB,CAAC0C,mBAAmB,CAACjB,iBAAiB,CAAC;EACpE;EAEAkB,qBAAqBA,CAACtB,OAAe,EAAE;IACrC,IAAI,CAAC,CAACrB,qBAAqB,CAAC2C,qBAAqB,CAACtB,OAAO,CAAC;EAC5D;EAEAuB,oBAAoBA,CAClBC,aAAqB,EACrBC,qBAA6B,EAC7BC,eAAsD,EACtD;IACA,IAAI,CAAC,CAAC/C,qBAAqB,CAAC4C,oBAAoB,CAC9CC,aAAa,EACbC,qBAAqB,EACrBC,eACF,CAAC;EACH;EAEAC,sBAAsBA,CAACH,aAAqB,EAAEC,qBAA6B,EAAE;IAC3E,IAAI,CAAC,CAAC9C,qBAAqB,CAACgD,sBAAsB,CAChDH,aAAa,EACbC,qBACF,CAAC;EACH;EAEAG,kBAAkBA,CAChBxB,iBAAoC,EACpCqB,qBAA6B,EAC7BI,gBAAqC,EACrC;IACA,IAAI,CAAC,CAAClD,qBAAqB,CAACiD,kBAAkB,CAC5CxB,iBAAiB,EACjBqB,qBAAqB,EACrBI,gBACF,CAAC;EACH;EAEAC,uBAAuBA,CAAC9B,OAAe,EAAE;IACvC,IAAI,CAAC,CAACrB,qBAAqB,CAACmD,uBAAuB,CAAC9B,OAAO,CAAC;EAC9D;EAEA+B,gBAAgBA,CACd3B,iBAAoC,EACpC4B,gBAAqC,EACrCC,SAAiB,EACX;IACN,IAAI,CAAC,CAACtD,qBAAqB,CAACoD,gBAAgB,CAC1C3B,iBAAiB,EACjB4B,gBAAgB,EAChBC,SACF,CAAC;EACH;EAEAC,uBAAuBA,CAAClC,OAAe,EAAE;IACvC,IAAI,CAAC,CAACrB,qBAAqB,CAACuD,uBAAuB,CAAClC,OAAO,CAAC;EAC9D;EAEAmC,iBAAiBA,
|
|
1
|
+
{"version":3,"names":["getUIRuntimeHolder","getUISchedulerHolder","IS_JEST","getShadowNodeWrapperFromRef","checkCppVersion","jsVersion","assertWorkletsVersion","ReanimatedTurboModule","createNativeReanimatedModule","NativeReanimatedModule","assertSingleReanimatedInstance","global","_REANIMATED_VERSION_JS","undefined","Error","reanimatedModuleProxy","constructor","__DEV__","installTurboModule","__reanimatedModuleProxy","globalThis","RN$Bridgeless","registerSensor","sensorType","interval","iosReferenceFrame","handler","unregisterSensor","sensorId","registerEventHandler","eventHandler","eventName","emitterReactTag","unregisterEventHandler","id","getViewProp","viewTag","propName","component","callback","shadowNodeWrapper","configureLayoutAnimationBatch","layoutAnimationsBatch","setShouldAnimateExitingForTag","shouldAnimate","getStaticFeatureFlag","name","setDynamicFeatureFlag","value","subscribeForKeyboardEvents","isStatusBarTranslucent","isNavigationBarTranslucent","unsubscribeFromKeyboardEvents","listenerId","setViewStyle","style","setCSSEventHandler","markNodeAsRemovable","unmarkNodeAsRemovable","registerCSSKeyframes","animationName","compoundComponentName","keyframesConfig","unregisterCSSKeyframes","applyCSSAnimations","animationUpdates","unregisterCSSAnimations","runCSSTransition","transitionConfig","eventMask","unregisterCSSTransition","getSettledUpdates","registeredViewTags","registerPseudoStyles","config","unregisterPseudoStyles","__UI_WORKLET_RUNTIME_HOLDER","__UI_SCHEDULER_HOLDER","status"],"sourceRoot":"../../../src","sources":["ReanimatedModule/NativeReanimated.ts"],"mappings":"AAAA,YAAY;;AAGZ,SACEA,kBAAkB,EAClBC,oBAAoB,QACf,uBAAuB;AAE9B,SAASC,OAAO,QAAQ,oBAAW;AAiBnC,SAASC,2BAA2B,QAAQ,gBAAgB;AAC5D,SAASC,eAAe,QAAQ,yCAAsC;AACtE,SAASC,SAAS,QAAQ,mCAAgC;AAC1D,SAASC,qBAAqB,QAAQ,yCAAsC;AAC5E,SAASC,qBAAqB,QAAQ,mBAAU;AAMhD,OAAO,SAASC,4BAA4BA,CAAA,EAAsB;EAChE,OAAO,IAAIC,sBAAsB,CAAC,CAAC;AACrC;AAEA,SAASC,8BAA8BA,CAAA,EAAG;EACxC,IACEC,MAAM,CAACC,sBAAsB,KAAKC,SAAS,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BAAgB,EAChBC,SACF,CAAC;EACH;EAEAC,uBAAuBA,CAAClC,OAAe,EAAE;IACvC,IAAI,CAAC,CAACrB,qBAAqB,CAACuD,uBAAuB,CAAClC,OAAO,CAAC;EAC9D;EAEAmC,iBAAiBA,CAACC,kBAA4B,EAAmB;IAC/D,OAAO,IAAI,CAAC,CAACzD,qBAAqB,CAACwD,iBAAiB,CAACC,kBAAkB,CAAC;EAC1E;EAEAC,oBAAoBA,CAClBjC,iBAAoC,EACpCkC,MAA4B,EAC5B;IACA,IAAI,CAAC,CAAC3D,qBAAqB,CAAC0D,oBAAoB,CAACjC,iBAAiB,EAAEkC,MAAM,CAAC;EAC7E;EAEAC,sBAAsBA,CAACvC,OAAe,EAAE;IACtC,IAAI,CAAC,CAACrB,qBAAqB,CAAC4D,sBAAsB,CAACvC,OAAO,CAAC;EAC7D;AACF;AAEA,SAASlB,kBAAkBA,CAAA,EAAG;EAC5B,IAAIE,UAAU,CAACD,uBAAuB,EAAE;IACtC,OAAO,IAAI;EACb;EAEAC,UAAU,CAACwD,2BAA2B,GAAG5E,kBAAkB,CAAC,CAAC;EAC7DoB,UAAU,CAACyD,qBAAqB,GAAG5E,oBAAoB,CAAC,CAAC;EACzD,MAAM6E,MAAM,GAAGvE,qBAAqB,CAAEW,kBAAkB,CAAC,CAAC;EAC1D,OAAOE,UAAU,CAACwD,2BAA2B;EAC7C,OAAOxD,UAAU,CAACyD,qBAAqB;EACvC,OAAOC,MAAM;AACf","ignoreList":[]}
|
|
@@ -56,14 +56,27 @@ export const withTiming = function (toValue, userConfig, callback) {
|
|
|
56
56
|
startTime,
|
|
57
57
|
startValue
|
|
58
58
|
} = animation;
|
|
59
|
-
|
|
59
|
+
let runtime = now - startTime;
|
|
60
|
+
if (runtime < 0) {
|
|
61
|
+
// `startTime` comes from `global.__frameTimestamp ||
|
|
62
|
+
// global._getAnimationTimestamp()` (see `valueSetter`). An animation
|
|
63
|
+
// started outside a frame flush - from a gesture callback, for
|
|
64
|
+
// instance - takes the second branch and reads the clock at that
|
|
65
|
+
// instant, while the frame that first progresses it passes its vsync
|
|
66
|
+
// timestamp, which is earlier. The first tick then sees a small
|
|
67
|
+
// negative runtime. This can potentially cause glitches during
|
|
68
|
+
// animations.
|
|
69
|
+
animation.startTime = now;
|
|
70
|
+
runtime = 0;
|
|
71
|
+
}
|
|
60
72
|
if (runtime >= config.duration) {
|
|
61
73
|
// reset startTime to avoid reusing finished animation config in `start` method
|
|
62
74
|
animation.startTime = 0;
|
|
63
75
|
animation.current = toValue;
|
|
64
76
|
return true;
|
|
65
77
|
}
|
|
66
|
-
const
|
|
78
|
+
const normalizedTime = Math.min(Math.max(runtime / config.duration, 0), 1);
|
|
79
|
+
const progress = animation.easing(normalizedTime);
|
|
67
80
|
animation.current = startValue + (toValue - startValue) * progress;
|
|
68
81
|
return false;
|
|
69
82
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Easing","assertEasingIsWorklet","defineAnimation","getReduceMotionForAnimation","withTiming","toValue","userConfig","callback","__DEV__","easing","config","duration","inOut","quad","Object","keys","forEach","key","timing","animation","now","startTime","startValue","runtime","current","progress","onStart","value","previousAnimation","type","factory","onFrame","reduceMotion"],"sourceRoot":"../../../src","sources":["animation/timing.ts"],"mappings":"AAAA,YAAY;;AAUZ,SAASA,MAAM,QAAQ,cAAW;AAClC,SACEC,qBAAqB,EACrBC,eAAe,EACfC,2BAA2B,QACtB,QAAQ;;AAEf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA2BA;;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,UAAU,GAAG,SAAAA,CACxBC,OAAwB,EACxBC,UAAyB,EACzBC,QAA4B,EACA;EAC5B,SAAS;;EAET,IAAIC,OAAO,IAAIF,UAAU,EAAEG,MAAM,EAAE;IACjCR,qBAAqB,CAACK,UAAU,CAACG,MAAM,CAAC;EAC1C;EAEA,OAAOP,eAAe,CAAkBG,OAAO,EAAE,MAAM;IACrD,SAAS;;IACT,MAAMK,MAAoD,GAAG;MAC3DC,QAAQ,EAAE,GAAG;MACbF,MAAM,EAAET,MAAM,CAACY,KAAK,CAACZ,MAAM,CAACa,IAAI;IAClC,CAAC;IACD,IAAIP,UAAU,EAAE;MACdQ,MAAM,CAACC,IAAI,CAACT,UAAU,CAAC,CAACU,OAAO,CAC5BC,GAAG;MACF;MACEP,MAAM,CAASO,GAAG,CAAC,GAAGX,UAAU,CAACW,GAAG,CAC1C,CAAC;IACH;IAEA,SAASC,MAAMA,CAACC,SAA+B,EAAEC,GAAc,EAAW;MACxE;MACA,MAAM;QAAEf,OAAO;QAAEgB,SAAS;QAAEC;MAAW,CAAC,GAAGH,SAAS;MACpD,
|
|
1
|
+
{"version":3,"names":["Easing","assertEasingIsWorklet","defineAnimation","getReduceMotionForAnimation","withTiming","toValue","userConfig","callback","__DEV__","easing","config","duration","inOut","quad","Object","keys","forEach","key","timing","animation","now","startTime","startValue","runtime","current","normalizedTime","Math","min","max","progress","onStart","value","previousAnimation","type","factory","onFrame","reduceMotion"],"sourceRoot":"../../../src","sources":["animation/timing.ts"],"mappings":"AAAA,YAAY;;AAUZ,SAASA,MAAM,QAAQ,cAAW;AAClC,SACEC,qBAAqB,EACrBC,eAAe,EACfC,2BAA2B,QACtB,QAAQ;;AAEf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA2BA;;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,UAAU,GAAG,SAAAA,CACxBC,OAAwB,EACxBC,UAAyB,EACzBC,QAA4B,EACA;EAC5B,SAAS;;EAET,IAAIC,OAAO,IAAIF,UAAU,EAAEG,MAAM,EAAE;IACjCR,qBAAqB,CAACK,UAAU,CAACG,MAAM,CAAC;EAC1C;EAEA,OAAOP,eAAe,CAAkBG,OAAO,EAAE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