react-native-reanimated 3.1.0 → 3.2.0-nightly-20230516-398e620f5
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/android/build.gradle +58 -41
- package/android/src/main/java/com/swmansion/reanimated/keyboardObserver/ReanimatedKeyboardEventListener.java +1 -1
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/AnimationsManager.java +3 -3
- package/android/src/main/java/com/swmansion/reanimated/sensor/ReanimatedSensorListener.java +3 -1
- package/ios/LayoutReanimation/REAAnimationsManager.m +2 -1
- package/ios/REANodesManager.mm +81 -35
- package/lib/commonjs/createAnimatedComponent.js +0 -2
- package/lib/commonjs/createAnimatedComponent.js.map +1 -1
- package/lib/commonjs/reanimated2/NativeReanimated/NativeReanimated.js +1 -2
- package/lib/commonjs/reanimated2/NativeReanimated/NativeReanimated.js.map +1 -1
- package/lib/commonjs/reanimated2/Sensor.js +69 -0
- package/lib/commonjs/reanimated2/Sensor.js.map +1 -0
- package/lib/commonjs/reanimated2/SensorContainer.js +53 -0
- package/lib/commonjs/reanimated2/SensorContainer.js.map +1 -0
- package/lib/commonjs/reanimated2/animation/util.js +25 -0
- package/lib/commonjs/reanimated2/animation/util.js.map +1 -1
- package/lib/commonjs/reanimated2/commonTypes.js.map +1 -1
- package/lib/commonjs/reanimated2/core.js +19 -4
- package/lib/commonjs/reanimated2/core.js.map +1 -1
- package/lib/commonjs/reanimated2/frameCallback/FrameCallbackRegistryJS.js +0 -6
- package/lib/commonjs/reanimated2/frameCallback/FrameCallbackRegistryJS.js.map +1 -1
- package/lib/commonjs/reanimated2/globals.d.js.map +1 -1
- package/lib/commonjs/reanimated2/hook/useAnimatedRef.js +1 -1
- package/lib/commonjs/reanimated2/hook/useAnimatedRef.js.map +1 -1
- package/lib/commonjs/reanimated2/hook/useAnimatedSensor.js +14 -34
- package/lib/commonjs/reanimated2/hook/useAnimatedSensor.js.map +1 -1
- package/lib/commonjs/reanimated2/jestUtils.js +4 -4
- package/lib/commonjs/reanimated2/jestUtils.js.map +1 -1
- package/lib/commonjs/reanimated2/js-reanimated/index.js +30 -1
- package/lib/commonjs/reanimated2/js-reanimated/index.js.map +1 -1
- package/lib/commonjs/reanimated2/js-reanimated/react-native-web.d.js +2 -0
- package/lib/commonjs/reanimated2/js-reanimated/react-native-web.d.js.map +1 -0
- package/lib/commonjs/reanimated2/mappers.js +4 -5
- package/lib/commonjs/reanimated2/mappers.js.map +1 -1
- package/lib/commonjs/reanimated2/mutables.js +0 -4
- package/lib/commonjs/reanimated2/mutables.js.map +1 -1
- package/lib/commonjs/reanimated2/platform-specific/checkCppVersion.js +2 -3
- package/lib/commonjs/reanimated2/platform-specific/checkCppVersion.js.map +1 -1
- package/lib/commonjs/reanimated2/platform-specific/jsVersion.js +1 -1
- package/lib/commonjs/reanimated2/platform-specific/jsVersion.js.map +1 -1
- package/lib/commonjs/reanimated2/shareables.js +2 -12
- package/lib/commonjs/reanimated2/shareables.js.map +1 -1
- package/lib/commonjs/reanimated2/threads.js +2 -3
- package/lib/commonjs/reanimated2/threads.js.map +1 -1
- package/lib/module/createAnimatedComponent.js +0 -2
- package/lib/module/createAnimatedComponent.js.map +1 -1
- package/lib/module/reanimated2/NativeReanimated/NativeReanimated.js +1 -2
- package/lib/module/reanimated2/NativeReanimated/NativeReanimated.js.map +1 -1
- package/lib/module/reanimated2/Sensor.js +61 -0
- package/lib/module/reanimated2/Sensor.js.map +1 -0
- package/lib/module/reanimated2/SensorContainer.js +45 -0
- package/lib/module/reanimated2/SensorContainer.js.map +1 -0
- package/lib/module/reanimated2/animation/util.js +25 -0
- package/lib/module/reanimated2/animation/util.js.map +1 -1
- package/lib/module/reanimated2/commonTypes.js.map +1 -1
- package/lib/module/reanimated2/core.js +17 -4
- package/lib/module/reanimated2/core.js.map +1 -1
- package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryJS.js +0 -6
- package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryJS.js.map +1 -1
- package/lib/module/reanimated2/globals.d.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedRef.js +1 -1
- package/lib/module/reanimated2/hook/useAnimatedRef.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedSensor.js +15 -34
- package/lib/module/reanimated2/hook/useAnimatedSensor.js.map +1 -1
- package/lib/module/reanimated2/jestUtils.js +4 -4
- package/lib/module/reanimated2/jestUtils.js.map +1 -1
- package/lib/module/reanimated2/js-reanimated/index.js +30 -1
- package/lib/module/reanimated2/js-reanimated/index.js.map +1 -1
- package/lib/module/reanimated2/js-reanimated/react-native-web.d.js +2 -0
- package/lib/module/reanimated2/js-reanimated/react-native-web.d.js.map +1 -0
- package/lib/module/reanimated2/mappers.js +4 -5
- package/lib/module/reanimated2/mappers.js.map +1 -1
- package/lib/module/reanimated2/mutables.js +0 -4
- package/lib/module/reanimated2/mutables.js.map +1 -1
- package/lib/module/reanimated2/platform-specific/checkCppVersion.js +2 -3
- package/lib/module/reanimated2/platform-specific/checkCppVersion.js.map +1 -1
- package/lib/module/reanimated2/platform-specific/jsVersion.js +1 -1
- package/lib/module/reanimated2/platform-specific/jsVersion.js.map +1 -1
- package/lib/module/reanimated2/shareables.js +2 -12
- package/lib/module/reanimated2/shareables.js.map +1 -1
- package/lib/module/reanimated2/threads.js +2 -3
- package/lib/module/reanimated2/threads.js.map +1 -1
- package/package.json +11 -7
- package/plugin/build/plugin.js +2 -2
- package/plugin/build/plugin.js.map +2 -2
- package/react-native-reanimated.d.ts +6 -1
- package/src/createAnimatedComponent.tsx +0 -1
- package/src/reanimated2/NativeReanimated/NativeReanimated.ts +1 -2
- package/src/reanimated2/Sensor.ts +81 -0
- package/src/reanimated2/SensorContainer.ts +71 -0
- package/src/reanimated2/animation/util.ts +44 -0
- package/src/reanimated2/commonTypes.ts +18 -1
- package/src/reanimated2/core.ts +27 -8
- package/src/reanimated2/frameCallback/FrameCallbackRegistryJS.ts +0 -3
- package/src/reanimated2/globals.d.ts +2 -0
- package/src/reanimated2/hook/useAnimatedRef.ts +11 -3
- package/src/reanimated2/hook/useAnimatedSensor.ts +30 -66
- package/src/reanimated2/jestUtils.ts +13 -7
- package/src/reanimated2/js-reanimated/index.ts +35 -2
- package/src/reanimated2/js-reanimated/react-native-web.d.ts +2 -0
- package/src/reanimated2/mappers.ts +4 -3
- package/src/reanimated2/mutables.ts +0 -2
- package/src/reanimated2/platform-specific/checkCppVersion.ts +2 -3
- package/src/reanimated2/platform-specific/jsVersion.ts +1 -1
- package/src/reanimated2/shareables.ts +2 -14
- package/src/reanimated2/threads.ts +2 -3
- package/plugin/.eslintrc.js +0 -7
- package/plugin/README.md +0 -241
- package/plugin/package.json +0 -23
- package/plugin/src/buildWorkletString.ts +0 -213
- package/plugin/src/commonObjects.ts +0 -60
- package/plugin/src/injectVersion.ts +0 -37
- package/plugin/src/makeWorklet.ts +0 -375
- package/plugin/src/plugin.ts +0 -49
- package/plugin/src/processForCalleesWorklets.ts +0 -106
- package/plugin/src/processIfGestureHandlerEventCallbackFunctionNode.ts +0 -156
- package/plugin/src/processIfWorkletFunction.ts +0 -55
- package/plugin/src/processIfWorkletNode.ts +0 -44
- package/plugin/src/processInlineStylesWarning.ts +0 -129
- package/plugin/src/processWorkletObjectMethod.ts +0 -31
- package/plugin/src/types.ts +0 -15
- package/plugin/src/utils.ts +0 -6
- package/plugin/tsconfig.json +0 -15
- package/plugin/yarn.lock +0 -2193
package/android/build.gradle
CHANGED
|
@@ -2,6 +2,9 @@ import com.android.Version
|
|
|
2
2
|
import org.apache.tools.ant.filters.ReplaceTokens
|
|
3
3
|
import org.apache.tools.ant.taskdefs.condition.Os
|
|
4
4
|
import groovy.json.JsonSlurper
|
|
5
|
+
|
|
6
|
+
import javax.inject.Inject
|
|
7
|
+
import java.nio.file.Files
|
|
5
8
|
import java.nio.file.Paths
|
|
6
9
|
|
|
7
10
|
/**
|
|
@@ -141,41 +144,6 @@ def shouldAssertNoMultipleInstances() {
|
|
|
141
144
|
}
|
|
142
145
|
}
|
|
143
146
|
|
|
144
|
-
def findReanimatedInstancesForPath(String path) {
|
|
145
|
-
return fileTree(path) {
|
|
146
|
-
include "**/react-native-reanimated/package.json"
|
|
147
|
-
exclude "**/.yarn/**"
|
|
148
|
-
exclude {{ file, attr -> attr.isSymbolicLink() }}
|
|
149
|
-
}.files
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
def checkNoMultipleInstances() {
|
|
153
|
-
// Assert there are no multiple installations of Reanimated
|
|
154
|
-
Set<File> files
|
|
155
|
-
if (projectDir.path.contains(rootDir.parent)) {
|
|
156
|
-
// standard app
|
|
157
|
-
files = findReanimatedInstancesForPath(rootDir.parent + "/node_modules")
|
|
158
|
-
} else {
|
|
159
|
-
// monorepo
|
|
160
|
-
files = findReanimatedInstancesForPath(rootDir.parent + "/node_modules")
|
|
161
|
-
files.addAll(
|
|
162
|
-
findReanimatedInstancesForPath(file(projectDir.parent).parent)
|
|
163
|
-
)
|
|
164
|
-
}
|
|
165
|
-
if (files.size() > 1) {
|
|
166
|
-
String parsedLocation = files.stream().map({
|
|
167
|
-
File file -> "- " + file.toString().replace("/package.json", "")
|
|
168
|
-
}).collect().join("\n")
|
|
169
|
-
String exceptionMessage = "\n[react-native-reanimated] Multiple versions of Reanimated " +
|
|
170
|
-
"were detected. Only one instance of react-native-reanimated can be installed in a " +
|
|
171
|
-
"project. You need to resolve the conflict manually. Check out the documentation: " +
|
|
172
|
-
"https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/" +
|
|
173
|
-
"troubleshooting#multiple-versions-of-reanimated-were-detected \n\nConflict " +
|
|
174
|
-
"between: \n" + parsedLocation + "\n";
|
|
175
|
-
throw new GradleException(exceptionMessage)
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
|
|
179
147
|
def getReanimatedVersion() {
|
|
180
148
|
def inputFile = file(projectDir.path + '/../package.json')
|
|
181
149
|
def json = new JsonSlurper().parseText(inputFile.text)
|
|
@@ -584,15 +552,64 @@ android {
|
|
|
584
552
|
}
|
|
585
553
|
}
|
|
586
554
|
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
555
|
+
abstract class NoMultipleInstancesAssertionTask extends DefaultTask {
|
|
556
|
+
@Inject abstract ObjectFactory getObjectFactory()
|
|
557
|
+
|
|
558
|
+
@Input abstract Property<File> getProjectDirFile()
|
|
559
|
+
@Input abstract Property<File> getRootDirFile()
|
|
560
|
+
@Input abstract Property<Boolean> getShouldCheck()
|
|
561
|
+
|
|
562
|
+
def findReanimatedInstancesForPath(String path) {
|
|
563
|
+
return objectFactory.fileTree().from(path)
|
|
564
|
+
.include("**/react-native-reanimated/package.json")
|
|
565
|
+
.exclude("**/.yarn/**")
|
|
566
|
+
.exclude({ Files.isSymbolicLink(it.getFile().toPath()) })
|
|
567
|
+
.findAll()
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
@TaskAction
|
|
571
|
+
def check() {
|
|
572
|
+
if (shouldCheck.get()) {
|
|
573
|
+
// Assert there are no multiple installations of Reanimated
|
|
574
|
+
Set<File> files
|
|
575
|
+
|
|
576
|
+
if (projectDirFile.get().parent.contains(rootDirFile.get().parent)) {
|
|
577
|
+
// standard app
|
|
578
|
+
files = findReanimatedInstancesForPath(rootDirFile.get().parent + "/node_modules")
|
|
579
|
+
} else {
|
|
580
|
+
// monorepo
|
|
581
|
+
files = findReanimatedInstancesForPath(rootDirFile.get().parent + "/node_modules")
|
|
582
|
+
files.addAll(
|
|
583
|
+
findReanimatedInstancesForPath(projectDirFile.get().parentFile.parent)
|
|
584
|
+
)
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
if (files.size() > 1) {
|
|
588
|
+
String parsedLocation = files.stream().map({
|
|
589
|
+
File file -> "- " + file.toString().replace("/package.json", "")
|
|
590
|
+
}).collect().join("\n")
|
|
591
|
+
String exceptionMessage = "\n[react-native-reanimated] Multiple versions of Reanimated " +
|
|
592
|
+
"were detected. Only one instance of react-native-reanimated can be installed in a " +
|
|
593
|
+
"project. You need to resolve the conflict manually. Check out the documentation: " +
|
|
594
|
+
"https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/" +
|
|
595
|
+
"troubleshooting#multiple-versions-of-reanimated-were-detected \n\nConflict " +
|
|
596
|
+
"between: \n" + parsedLocation + "\n"
|
|
597
|
+
throw new GradleException(exceptionMessage)
|
|
598
|
+
}
|
|
599
|
+
}
|
|
591
600
|
}
|
|
592
601
|
}
|
|
593
602
|
|
|
603
|
+
tasks.register('assertNoMultipleInstances', NoMultipleInstancesAssertionTask) {
|
|
604
|
+
shouldCheck = shouldAssertNoMultipleInstances()
|
|
605
|
+
rootDirFile = rootDir
|
|
606
|
+
projectDirFile = projectDir
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
def NEW_ARCH_ENABLED = isNewArchitectureEnabled()
|
|
610
|
+
|
|
594
611
|
def assertNoReanimated2WithNewArchitecture = task assertNoReanimated2WithNewArchitectureTask {
|
|
595
|
-
onlyIf {
|
|
612
|
+
onlyIf { NEW_ARCH_ENABLED && REANIMATED_MAJOR_VERSION == 2 }
|
|
596
613
|
doFirst {
|
|
597
614
|
throw new GradleException(
|
|
598
615
|
"\n[react-native-reanimated] Reanimated 2.x does not support Fabric. " +
|
|
@@ -603,7 +620,7 @@ def assertNoReanimated2WithNewArchitecture = task assertNoReanimated2WithNewArch
|
|
|
603
620
|
}
|
|
604
621
|
|
|
605
622
|
def assertLatestReactNativeWithNewArchitecture = task assertLatestReactNativeWithNewArchitectureTask {
|
|
606
|
-
onlyIf {
|
|
623
|
+
onlyIf { NEW_ARCH_ENABLED && REANIMATED_MAJOR_VERSION == 3 && REACT_NATIVE_MINOR_VERSION < 72 }
|
|
607
624
|
doFirst {
|
|
608
625
|
throw new GradleException(
|
|
609
626
|
"\n[react-native-reanimated] Reanimated " + REANIMATED_VERSION + " supports the New Architecture " +
|
|
@@ -145,7 +145,7 @@ public class ReanimatedKeyboardEventListener {
|
|
|
145
145
|
|
|
146
146
|
private void bringBackWindowInsets() {
|
|
147
147
|
WindowCompat.setDecorFitsSystemWindows(
|
|
148
|
-
reactContext.get().getCurrentActivity().getWindow(),
|
|
148
|
+
reactContext.get().getCurrentActivity().getWindow(), !isStatusBarTranslucent);
|
|
149
149
|
ViewCompat.setOnApplyWindowInsetsListener(getRootView(), null);
|
|
150
150
|
ViewCompat.setWindowInsetsAnimationCallback(getRootView(), null);
|
|
151
151
|
View content =
|
package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/AnimationsManager.java
CHANGED
|
@@ -84,7 +84,7 @@ public class AnimationsManager implements ViewHierarchyObserver {
|
|
|
84
84
|
Integer tag = view.getId();
|
|
85
85
|
mCallbacks.put(tag, callback);
|
|
86
86
|
|
|
87
|
-
if (!removeOrAnimateExitRecursive(view,
|
|
87
|
+
if (!removeOrAnimateExitRecursive(view, true)) {
|
|
88
88
|
removeView(view, parent);
|
|
89
89
|
}
|
|
90
90
|
}
|
|
@@ -473,7 +473,7 @@ public class AnimationsManager implements ViewHierarchyObserver {
|
|
|
473
473
|
return mNativeMethodsHolder != null && mNativeMethodsHolder.isLayoutAnimationEnabled();
|
|
474
474
|
}
|
|
475
475
|
|
|
476
|
-
private boolean removeOrAnimateExitRecursive(View view,
|
|
476
|
+
private boolean removeOrAnimateExitRecursive(View view, boolean shouldRemove) {
|
|
477
477
|
int tag = view.getId();
|
|
478
478
|
ViewManager viewManager = resolveViewManager(tag);
|
|
479
479
|
|
|
@@ -501,7 +501,7 @@ public class AnimationsManager implements ViewHierarchyObserver {
|
|
|
501
501
|
ViewGroup viewGroup = (ViewGroup) view;
|
|
502
502
|
for (int i = viewGroup.getChildCount() - 1; i >= 0; i--) {
|
|
503
503
|
View child = viewGroup.getChildAt(i);
|
|
504
|
-
if (removeOrAnimateExitRecursive(child,
|
|
504
|
+
if (removeOrAnimateExitRecursive(child, shouldRemove)) {
|
|
505
505
|
hasAnimatedChildren = true;
|
|
506
506
|
} else if (shouldRemove) {
|
|
507
507
|
toBeRemoved.add(child);
|
|
@@ -69,7 +69,9 @@ public class ReanimatedSensorListener implements SensorEventListener {
|
|
|
69
69
|
};
|
|
70
70
|
setter.sensorSetter(data, orientationDegrees);
|
|
71
71
|
} else {
|
|
72
|
-
|
|
72
|
+
// Set the opposite values to be consistent with iOS
|
|
73
|
+
float[] data = new float[] {-event.values[0], -event.values[1], -event.values[2]};
|
|
74
|
+
setter.sensorSetter(data, orientationDegrees);
|
|
73
75
|
}
|
|
74
76
|
}
|
|
75
77
|
|
|
@@ -396,7 +396,8 @@ BOOL REANodeFind(id<RCTComponent> view, int (^block)(id<RCTComponent>))
|
|
|
396
396
|
return NO;
|
|
397
397
|
}
|
|
398
398
|
|
|
399
|
-
BOOL hasExitAnimation =
|
|
399
|
+
BOOL hasExitAnimation =
|
|
400
|
+
[self hasAnimationForTag:view.reactTag type:EXITING] || [_exitingViews objectForKey:view.reactTag];
|
|
400
401
|
BOOL hasAnimatedChildren = NO;
|
|
401
402
|
shouldRemoveSubviewsWithoutAnimations = shouldRemoveSubviewsWithoutAnimations && !hasExitAnimation;
|
|
402
403
|
NSMutableArray *toBeRemoved = [[NSMutableArray alloc] init];
|
package/ios/REANodesManager.mm
CHANGED
|
@@ -12,6 +12,10 @@
|
|
|
12
12
|
#import <stdatomic.h>
|
|
13
13
|
#endif
|
|
14
14
|
|
|
15
|
+
#if __has_include(<RNScreens/RNSScreenStackHeaderConfig.h>)
|
|
16
|
+
#import <RNScreens/RNSScreenStackHeaderConfig.h>
|
|
17
|
+
#endif
|
|
18
|
+
|
|
15
19
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
16
20
|
using namespace facebook::react;
|
|
17
21
|
#endif
|
|
@@ -85,19 +89,77 @@ using namespace facebook::react;
|
|
|
85
89
|
|
|
86
90
|
@end
|
|
87
91
|
|
|
88
|
-
|
|
92
|
+
#ifndef RCT_NEW_ARCH_ENABLED
|
|
89
93
|
|
|
94
|
+
@interface REASyncUpdateObserver : NSObject <RCTUIManagerObserver>
|
|
90
95
|
@end
|
|
91
96
|
|
|
97
|
+
@implementation REASyncUpdateObserver {
|
|
98
|
+
volatile void (^_mounting)(void);
|
|
99
|
+
volatile BOOL _waitTimedOut;
|
|
100
|
+
dispatch_semaphore_t _semaphore;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
- (instancetype)init
|
|
104
|
+
{
|
|
105
|
+
self = [super init];
|
|
106
|
+
if (self) {
|
|
107
|
+
_mounting = nil;
|
|
108
|
+
_waitTimedOut = NO;
|
|
109
|
+
_semaphore = dispatch_semaphore_create(0);
|
|
110
|
+
}
|
|
111
|
+
return self;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
- (void)dealloc
|
|
115
|
+
{
|
|
116
|
+
RCTAssert(_mounting == nil, @"Mouting block was set but never executed. This may lead to UI inconsistencies");
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
- (void)unblockUIThread
|
|
120
|
+
{
|
|
121
|
+
RCTAssertUIManagerQueue();
|
|
122
|
+
dispatch_semaphore_signal(_semaphore);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
- (void)waitAndMountWithTimeout:(NSTimeInterval)timeout
|
|
126
|
+
{
|
|
127
|
+
RCTAssertMainQueue();
|
|
128
|
+
long result = dispatch_semaphore_wait(_semaphore, dispatch_time(DISPATCH_TIME_NOW, timeout * NSEC_PER_SEC));
|
|
129
|
+
if (result != 0) {
|
|
130
|
+
@synchronized(self) {
|
|
131
|
+
_waitTimedOut = YES;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
if (_mounting) {
|
|
135
|
+
_mounting();
|
|
136
|
+
_mounting = nil;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
- (BOOL)uiManager:(RCTUIManager *)manager performMountingWithBlock:(RCTUIManagerMountingBlock)block
|
|
141
|
+
{
|
|
142
|
+
RCTAssertUIManagerQueue();
|
|
143
|
+
@synchronized(self) {
|
|
144
|
+
if (_waitTimedOut) {
|
|
145
|
+
return NO;
|
|
146
|
+
} else {
|
|
147
|
+
_mounting = block;
|
|
148
|
+
return YES;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
@end
|
|
154
|
+
|
|
155
|
+
#endif
|
|
156
|
+
|
|
92
157
|
@implementation REANodesManager {
|
|
93
158
|
CADisplayLink *_displayLink;
|
|
94
159
|
BOOL _wantRunUpdates;
|
|
95
160
|
NSMutableArray<REAOnAnimationCallback> *_onAnimationCallbacks;
|
|
96
161
|
BOOL _tryRunBatchUpdatesSynchronously;
|
|
97
162
|
REAEventHandler _eventHandler;
|
|
98
|
-
volatile void (^_mounting)(void);
|
|
99
|
-
NSObject *_syncLayoutUpdatesWaitLock;
|
|
100
|
-
volatile BOOL _syncLayoutUpdatesWaitTimedOut;
|
|
101
163
|
NSMutableDictionary<NSNumber *, ComponentUpdate *> *_componentUpdateBuffer;
|
|
102
164
|
NSMutableDictionary<NSNumber *, UIView *> *_viewRegistry;
|
|
103
165
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
@@ -125,7 +187,6 @@ using namespace facebook::react;
|
|
|
125
187
|
_operationsInBatch = [NSMutableDictionary new];
|
|
126
188
|
_componentUpdateBuffer = [NSMutableDictionary new];
|
|
127
189
|
_viewRegistry = [_uiManager valueForKey:@"_viewRegistry"];
|
|
128
|
-
_syncLayoutUpdatesWaitLock = [NSObject new];
|
|
129
190
|
}
|
|
130
191
|
|
|
131
192
|
_displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(onAnimationFrame:)];
|
|
@@ -241,19 +302,6 @@ using namespace facebook::react;
|
|
|
241
302
|
}
|
|
242
303
|
}
|
|
243
304
|
|
|
244
|
-
- (BOOL)uiManager:(RCTUIManager *)manager performMountingWithBlock:(RCTUIManagerMountingBlock)block
|
|
245
|
-
{
|
|
246
|
-
RCTAssert(_mounting == nil, @"Mouting block is expected to not be set");
|
|
247
|
-
@synchronized(_syncLayoutUpdatesWaitLock) {
|
|
248
|
-
if (_syncLayoutUpdatesWaitTimedOut) {
|
|
249
|
-
return NO;
|
|
250
|
-
} else {
|
|
251
|
-
_mounting = block;
|
|
252
|
-
return YES;
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
|
|
257
305
|
- (void)performOperations
|
|
258
306
|
{
|
|
259
307
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
@@ -268,8 +316,7 @@ using namespace facebook::react;
|
|
|
268
316
|
_tryRunBatchUpdatesSynchronously = NO;
|
|
269
317
|
|
|
270
318
|
__weak __typeof__(self) weakSelf = self;
|
|
271
|
-
|
|
272
|
-
_syncLayoutUpdatesWaitTimedOut = NO;
|
|
319
|
+
REASyncUpdateObserver *syncUpdateObserver = [REASyncUpdateObserver new];
|
|
273
320
|
RCTExecuteOnUIManagerQueue(^{
|
|
274
321
|
__typeof__(self) strongSelf = weakSelf;
|
|
275
322
|
if (strongSelf == nil) {
|
|
@@ -278,7 +325,7 @@ using namespace facebook::react;
|
|
|
278
325
|
BOOL canUpdateSynchronously = trySynchronously && ![strongSelf.uiManager hasEnqueuedUICommands];
|
|
279
326
|
|
|
280
327
|
if (!canUpdateSynchronously) {
|
|
281
|
-
|
|
328
|
+
[syncUpdateObserver unblockUIThread];
|
|
282
329
|
}
|
|
283
330
|
|
|
284
331
|
for (int i = 0; i < copiedOperationsQueue.count; i++) {
|
|
@@ -286,8 +333,8 @@ using namespace facebook::react;
|
|
|
286
333
|
}
|
|
287
334
|
|
|
288
335
|
if (canUpdateSynchronously) {
|
|
289
|
-
[strongSelf.uiManager runSyncUIUpdatesWithObserver:
|
|
290
|
-
|
|
336
|
+
[strongSelf.uiManager runSyncUIUpdatesWithObserver:syncUpdateObserver];
|
|
337
|
+
[syncUpdateObserver unblockUIThread];
|
|
291
338
|
}
|
|
292
339
|
// In case canUpdateSynchronously=true we still have to send uiManagerWillPerformMounting event
|
|
293
340
|
// to observers because some components (e.g. TextInput) update their UIViews only on that event.
|
|
@@ -298,17 +345,7 @@ using namespace facebook::react;
|
|
|
298
345
|
// from CADisplayLink but it is easier to hardcode it for the time being.
|
|
299
346
|
// The reason why we use frame duration here is that if takes longer than one frame to complete layout tasks
|
|
300
347
|
// there is no point of synchronizing layout with the UI interaction as we get that one frame delay anyways.
|
|
301
|
-
|
|
302
|
-
if (result != 0) {
|
|
303
|
-
@synchronized(_syncLayoutUpdatesWaitLock) {
|
|
304
|
-
_syncLayoutUpdatesWaitTimedOut = YES;
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
if (_mounting) {
|
|
310
|
-
_mounting();
|
|
311
|
-
_mounting = nil;
|
|
348
|
+
[syncUpdateObserver waitAndMountWithTimeout:0.016];
|
|
312
349
|
}
|
|
313
350
|
}
|
|
314
351
|
_wantRunUpdates = NO;
|
|
@@ -368,7 +405,16 @@ using namespace facebook::react;
|
|
|
368
405
|
|
|
369
406
|
- (BOOL)isNativeViewMounted:(NSNumber *)viewTag
|
|
370
407
|
{
|
|
371
|
-
|
|
408
|
+
UIView *view = _viewRegistry[viewTag];
|
|
409
|
+
if (view.superview != nil) {
|
|
410
|
+
return YES;
|
|
411
|
+
}
|
|
412
|
+
#if __has_include(<RNScreens/RNSScreenStackHeaderConfig.h>)
|
|
413
|
+
if ([view isKindOfClass:[RNSScreenStackHeaderConfig class]]) {
|
|
414
|
+
return ((RNSScreenStackHeaderConfig *)view).screenView != nil;
|
|
415
|
+
}
|
|
416
|
+
#endif
|
|
417
|
+
return NO;
|
|
372
418
|
}
|
|
373
419
|
|
|
374
420
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_WorkletEventHandler","_setAndForwardRef","_invariant","_ConfigHelper","_RNRenderer","_core","_PlatformChecker","_animation","_layoutReanimation","_ViewDescriptorsSet","_fabricUtils","_UpdateProps","_NativeReanimated","_reanimated","obj","__esModule","default","_extends","Object","assign","bind","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","_defineProperty","value","_toPropertyKey","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","TypeError","Number","dummyListener","maybeBuild","layoutAnimationOrBuilder","isAnimationBuilder","build","flattenArray","array","Array","isArray","resultArr","_flattenArray","arr","forEach","item","push","onlyAnimatedStyles","styles","filter","style","viewDescriptors","isSameAnimatedStyle","style1","style2","viewsRef","isSameAnimatedProps","has","x","isInlineStyleTransform","transform","some","t","hasInlineStyles","keys","styleValue","isSharedValue","extractSharedValuesMapFromProps","props","inlineProps","entries","inlinePropsHasChanged","styles1","styles2","getInlinePropsUpdate","update","map","createAnimatedComponent","Component","options","invariant","isReactComponent","name","AnimatedComponent","React","constructor","setAndForwardRef","getForwardedRef","forwardedRef","setLocalRef","ref","tag","findNodeHandle","layout","entering","exiting","sharedTransitionTag","shouldBeUseWeb","enableLayoutAnimations","configureLayoutAnimations","LayoutAnimationType","LAYOUT","ENTERING","EXITING","sharedElementTransition","sharedTransitionStyle","DefaultSharedTransition","SHARED_ELEMENT_TRANSITION","_component","isJest","animatedStyle","componentWillUnmount","_detachNativeEvents","_detachStyles","_detachInlineProps","componentDidMount","_attachNativeEvents","_attachAnimatedStyles","_attachInlineProps","_getEventViewRef","_this$_component","getScrollableNode","node","viewTag","setNativeProps","prop","current","WorkletEventHandler","registerForEvents","unregisterFromEvents","Platform","OS","_styles","remove","_viewTag","_this$props$animatedP","animatedProps","global","_IS_FABRIC","runOnUI","_removeShadowNodeFromRegistry","_reattachNativeEvents","prevProps","reattachNeeded","_updateFromNative","_this$_component2","_this$_component2$set","_getViewInfo","viewName","shadowNodeWrapper","viewConfig","_hostInstance$viewCon","hostInstance","RNRenderer","findHostInstance_DEPRECATED","Error","_nativeTag","uiViewClassName","getShadowNodeWrapperFromRef","_this$props$animatedP2","_this$props$animatedP3","prevStyles","prevAnimatedProps","_animatedProps","hasReanimated2Props","adaptViewConfig","hasOneSameStyle","prevStyle","isPresent","add","initial","newInlineProps","hasChanged","_inlineProps","_inlinePropsViewDescriptors","makeViewDescriptorsSet","sharableViewDescriptors","maybeViewRef","NativeReanimatedModule","native","items","Set","updaterFunction","updateProps","_inlinePropsMapperId","stopMapper","startMapper","values","componentDidUpdate","_filterNonAnimatedProps","inputProps","styleProp","processedStyle","_isFirstRender","initialStyle","initialUpdaterRun","updater","newStyle","StyleSheet","flatten","animatedProp","_animatedProp$initial","_animatedProp$viewsRe","eventNames","eventName","listeners","isChromeDebugger","render","platformProps","select","web","collapsable","createElement","_setComponentRef","displayName","forwardRef"],"sources":["createAnimatedComponent.tsx"],"sourcesContent":["import React, { Component, ComponentType, MutableRefObject, Ref } from 'react';\nimport { findNodeHandle, Platform, StyleSheet } from 'react-native';\nimport WorkletEventHandler from './reanimated2/WorkletEventHandler';\nimport setAndForwardRef from './setAndForwardRef';\nimport './reanimated2/layoutReanimation/animationsManager';\nimport invariant from 'invariant';\nimport { adaptViewConfig } from './ConfigHelper';\nimport { RNRenderer } from './reanimated2/platform-specific/RNRenderer';\nimport {\n configureLayoutAnimations,\n enableLayoutAnimations,\n runOnUI,\n startMapper,\n stopMapper,\n} from './reanimated2/core';\nimport {\n isJest,\n isChromeDebugger,\n shouldBeUseWeb,\n} from './reanimated2/PlatformChecker';\nimport { initialUpdaterRun } from './reanimated2/animation';\nimport {\n BaseAnimationBuilder,\n DefaultSharedTransition,\n EntryExitAnimationFunction,\n ILayoutAnimationBuilder,\n LayoutAnimationFunction,\n LayoutAnimationType,\n} from './reanimated2/layoutReanimation';\nimport {\n SharedValue,\n StyleProps,\n ShadowNodeWrapper,\n} from './reanimated2/commonTypes';\nimport {\n makeViewDescriptorsSet,\n ViewDescriptorsSet,\n ViewRefSet,\n} from './reanimated2/ViewDescriptorsSet';\nimport { getShadowNodeWrapperFromRef } from './reanimated2/fabricUtils';\nimport updateProps from './reanimated2/UpdateProps';\nimport NativeReanimatedModule from './reanimated2/NativeReanimated';\nimport { isSharedValue } from './reanimated2';\n\nfunction dummyListener() {\n // empty listener we use to assign to listener properties for which animated\n // event is used.\n}\n\nfunction maybeBuild(\n layoutAnimationOrBuilder:\n | ILayoutAnimationBuilder\n | LayoutAnimationFunction\n | Keyframe\n): LayoutAnimationFunction | Keyframe {\n const isAnimationBuilder = (\n value: ILayoutAnimationBuilder | LayoutAnimationFunction | Keyframe\n ): value is ILayoutAnimationBuilder =>\n 'build' in layoutAnimationOrBuilder &&\n typeof layoutAnimationOrBuilder.build === 'function';\n\n if (isAnimationBuilder(layoutAnimationOrBuilder)) {\n return layoutAnimationOrBuilder.build();\n } else {\n return layoutAnimationOrBuilder;\n }\n}\n\ntype NestedArray<T> = T | NestedArray<T>[];\nfunction flattenArray<T>(array: NestedArray<T>): T[] {\n if (!Array.isArray(array)) {\n return [array];\n }\n const resultArr: T[] = [];\n\n const _flattenArray = (arr: NestedArray<T>[]): void => {\n arr.forEach((item) => {\n if (Array.isArray(item)) {\n _flattenArray(item);\n } else {\n resultArr.push(item);\n }\n });\n };\n _flattenArray(array);\n return resultArr;\n}\n\nfunction onlyAnimatedStyles(styles: StyleProps[]) {\n return styles.filter((style) => style?.viewDescriptors);\n}\n\nfunction isSameAnimatedStyle(\n style1?: StyleProps,\n style2?: StyleProps\n): boolean {\n // We cannot use equality check to compare useAnimatedStyle outputs directly.\n // Instead, we can compare its viewsRefs.\n return style1?.viewsRef === style2?.viewsRef;\n}\n\nconst isSameAnimatedProps = isSameAnimatedStyle;\n\nconst has = <K extends string>(\n key: K,\n x: unknown\n): x is { [key in K]: unknown } => {\n if (typeof x === 'function' || typeof x === 'object') {\n if (x === null || x === undefined) {\n return false;\n } else {\n return key in x;\n }\n }\n return false;\n};\n\nfunction isInlineStyleTransform(transform: any): boolean {\n if (!transform) {\n return false;\n }\n return transform.some((t: Record<string, any>) => hasInlineStyles(t));\n}\n\nfunction hasInlineStyles(style: StyleProps): boolean {\n if (!style) {\n return false;\n }\n return Object.keys(style).some((key) => {\n const styleValue = style[key];\n return (\n isSharedValue(styleValue) ||\n (key === 'transform' && isInlineStyleTransform(styleValue))\n );\n });\n}\n\nfunction extractSharedValuesMapFromProps(\n props: AnimatedComponentProps<InitialComponentProps>\n): Record<string, any> {\n const inlineProps: Record<string, any> = {};\n\n for (const key in props) {\n const value = props[key];\n if (key === 'style') {\n const styles = flattenArray<StyleProps>(props.style ?? []);\n styles.forEach((style) => {\n if (!style) {\n return;\n }\n for (const [key, styleValue] of Object.entries(style)) {\n if (isSharedValue(styleValue)) {\n inlineProps[key] = styleValue;\n } else if (\n key === 'transform' &&\n isInlineStyleTransform(styleValue)\n ) {\n inlineProps[key] = styleValue;\n }\n }\n });\n } else if (isSharedValue(value)) {\n inlineProps[key] = value;\n }\n }\n\n return inlineProps;\n}\n\nfunction inlinePropsHasChanged(styles1: StyleProps, styles2: StyleProps) {\n if (Object.keys(styles1).length !== Object.keys(styles2).length) {\n return true;\n }\n\n for (const key of Object.keys(styles1)) {\n if (styles1[key] !== styles2[key]) return true;\n }\n\n return false;\n}\n\nfunction getInlinePropsUpdate(inlineProps: Record<string, any>) {\n 'worklet';\n const update: Record<string, any> = {};\n for (const [key, styleValue] of Object.entries(inlineProps)) {\n if (key === 'transform') {\n update[key] = styleValue.map((transform: Record<string, any>) => {\n return getInlinePropsUpdate(transform);\n });\n } else if (isSharedValue(styleValue)) {\n update[key] = styleValue.value;\n } else {\n update[key] = styleValue;\n }\n }\n return update;\n}\n\ninterface AnimatedProps extends Record<string, unknown> {\n viewDescriptors?: ViewDescriptorsSet;\n viewsRef?: ViewRefSet<unknown>;\n initial?: SharedValue<StyleProps>;\n}\n\nexport type AnimatedComponentProps<P extends Record<string, unknown>> = P & {\n forwardedRef?: Ref<Component>;\n style?: NestedArray<StyleProps>;\n animatedProps?: Partial<AnimatedComponentProps<AnimatedProps>>;\n animatedStyle?: StyleProps;\n layout?:\n | BaseAnimationBuilder\n | ILayoutAnimationBuilder\n | typeof BaseAnimationBuilder;\n entering?:\n | BaseAnimationBuilder\n | typeof BaseAnimationBuilder\n | EntryExitAnimationFunction\n | Keyframe;\n exiting?:\n | BaseAnimationBuilder\n | typeof BaseAnimationBuilder\n | EntryExitAnimationFunction\n | Keyframe;\n sharedTransitionTag?: string;\n sharedTransitionStyle?: ILayoutAnimationBuilder;\n};\n\ntype Options<P> = {\n setNativeProps: (ref: ComponentRef, props: P) => void;\n};\n\ninterface ComponentRef extends Component {\n setNativeProps?: (props: Record<string, unknown>) => void;\n getScrollableNode?: () => ComponentRef;\n}\n\nexport interface InitialComponentProps extends Record<string, unknown> {\n ref?: Ref<Component>;\n collapsable?: boolean;\n}\n\nexport default function createAnimatedComponent(\n Component: ComponentType<InitialComponentProps>,\n options?: Options<InitialComponentProps>\n): ComponentType<AnimatedComponentProps<InitialComponentProps>> {\n invariant(\n typeof Component !== 'function' ||\n (Component.prototype && Component.prototype.isReactComponent),\n `Looks like you're passing a function component \\`${Component.name}\\` to \\`createAnimatedComponent\\` function which supports only class components. Please wrap your function component with \\`React.forwardRef()\\` or use a class component instead.`\n );\n\n class AnimatedComponent extends React.Component<\n AnimatedComponentProps<InitialComponentProps>\n > {\n _styles: StyleProps[] | null = null;\n _animatedProps?: Partial<AnimatedComponentProps<AnimatedProps>>;\n _viewTag = -1;\n _isFirstRender = true;\n animatedStyle: { value: StyleProps } = { value: {} };\n initialStyle = {};\n _component: ComponentRef | null = null;\n _inlinePropsViewDescriptors: ViewDescriptorsSet | null = null;\n _inlinePropsMapperId: number | null = null;\n _inlineProps: StyleProps = {};\n static displayName: string;\n\n constructor(props: AnimatedComponentProps<InitialComponentProps>) {\n super(props);\n if (isJest()) {\n this.animatedStyle = { value: {} };\n }\n }\n\n componentWillUnmount() {\n this._detachNativeEvents();\n this._detachStyles();\n this._detachInlineProps();\n }\n\n componentDidMount() {\n this._attachNativeEvents();\n this._attachAnimatedStyles();\n this._attachInlineProps();\n }\n\n _getEventViewRef() {\n // Make sure to get the scrollable node for components that implement\n // `ScrollResponder.Mixin`.\n return this._component?.getScrollableNode\n ? this._component.getScrollableNode()\n : this._component;\n }\n\n _attachNativeEvents() {\n const node = this._getEventViewRef();\n const viewTag = findNodeHandle(options?.setNativeProps ? this : node);\n\n for (const key in this.props) {\n const prop = this.props[key];\n if (\n has('current', prop) &&\n prop.current instanceof WorkletEventHandler\n ) {\n prop.current.registerForEvents(viewTag as number, key);\n }\n }\n }\n\n _detachNativeEvents() {\n for (const key in this.props) {\n const prop = this.props[key];\n if (\n has('current', prop) &&\n prop.current instanceof WorkletEventHandler\n ) {\n prop.current.unregisterFromEvents();\n }\n }\n }\n\n _detachStyles() {\n if (Platform.OS === 'web' && this._styles !== null) {\n for (const style of this._styles) {\n if (style?.viewsRef) {\n style.viewsRef.remove(this);\n }\n }\n } else if (this._viewTag !== -1 && this._styles !== null) {\n for (const style of this._styles) {\n style.viewDescriptors.remove(this._viewTag);\n }\n if (this.props.animatedProps?.viewDescriptors) {\n this.props.animatedProps.viewDescriptors.remove(this._viewTag);\n }\n if (global._IS_FABRIC) {\n const viewTag = this._viewTag;\n runOnUI(() => {\n 'worklet';\n _removeShadowNodeFromRegistry!(viewTag);\n })();\n }\n }\n }\n\n _reattachNativeEvents(\n prevProps: AnimatedComponentProps<InitialComponentProps>\n ) {\n let viewTag: number | undefined;\n\n for (const key in this.props) {\n const prop = this.props[key];\n if (\n has('current', prop) &&\n prop.current instanceof WorkletEventHandler\n ) {\n if (viewTag === undefined) {\n viewTag = prop.current.viewTag;\n }\n }\n }\n for (const key in prevProps) {\n const prop = this.props[key];\n if (\n has('current', prop) &&\n prop.current instanceof WorkletEventHandler &&\n prop.current.reattachNeeded\n ) {\n prop.current.unregisterFromEvents();\n }\n }\n\n for (const key in this.props) {\n const prop = this.props[key];\n if (\n has('current', prop) &&\n prop.current instanceof WorkletEventHandler &&\n prop.current.reattachNeeded\n ) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n prop.current.registerForEvents(viewTag!, key);\n prop.current.reattachNeeded = false;\n }\n }\n }\n\n _updateFromNative(props: StyleProps) {\n if (options?.setNativeProps) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n options.setNativeProps(this._component!, props);\n } else {\n // eslint-disable-next-line no-unused-expressions\n this._component?.setNativeProps?.(props);\n }\n }\n\n _getViewInfo() {\n let viewTag: number | null;\n let viewName: string | null;\n let shadowNodeWrapper: ShadowNodeWrapper | null = null;\n let viewConfig;\n if (Platform.OS === 'web') {\n viewTag = findNodeHandle(this);\n viewName = null;\n shadowNodeWrapper = null;\n viewConfig = null;\n } else {\n // hostInstance can be null for a component that doesn't render anything (render function returns null). Example: svg Stop: https://github.com/react-native-svg/react-native-svg/blob/develop/src/elements/Stop.tsx\n const hostInstance = RNRenderer.findHostInstance_DEPRECATED(this);\n if (!hostInstance) {\n throw new Error(\n 'Cannot find host instance for this component. Maybe it renders nothing?'\n );\n }\n // we can access view tag in the same way it's accessed here https://github.com/facebook/react/blob/e3f4eb7272d4ca0ee49f27577156b57eeb07cf73/packages/react-native-renderer/src/ReactFabric.js#L146\n viewTag = hostInstance?._nativeTag;\n /**\n * RN uses viewConfig for components for storing different properties of the component(example: https://github.com/facebook/react-native/blob/master/Libraries/Components/ScrollView/ScrollViewViewConfig.js#L16).\n * The name we're looking for is in the field named uiViewClassName.\n */\n viewName = hostInstance?.viewConfig?.uiViewClassName;\n\n viewConfig = hostInstance?.viewConfig;\n\n if (global._IS_FABRIC) {\n shadowNodeWrapper = getShadowNodeWrapperFromRef(this);\n }\n }\n return { viewTag, viewName, shadowNodeWrapper, viewConfig };\n }\n\n _attachAnimatedStyles() {\n const styles = this.props.style\n ? onlyAnimatedStyles(flattenArray<StyleProps>(this.props.style))\n : [];\n const prevStyles = this._styles;\n this._styles = styles;\n\n const prevAnimatedProps = this._animatedProps;\n this._animatedProps = this.props.animatedProps;\n\n const { viewTag, viewName, shadowNodeWrapper, viewConfig } =\n this._getViewInfo();\n\n // update UI props whitelist for this view\n const hasReanimated2Props =\n this.props.animatedProps?.viewDescriptors || styles.length;\n if (hasReanimated2Props && viewConfig) {\n adaptViewConfig(viewConfig);\n }\n\n this._viewTag = viewTag as number;\n\n // remove old styles\n if (prevStyles) {\n // in most of the cases, views have only a single animated style and it remains unchanged\n const hasOneSameStyle =\n styles.length === 1 &&\n prevStyles.length === 1 &&\n isSameAnimatedStyle(styles[0], prevStyles[0]);\n\n if (!hasOneSameStyle) {\n // otherwise, remove each style that is not present in new styles\n for (const prevStyle of prevStyles) {\n const isPresent = styles.some((style) =>\n isSameAnimatedStyle(style, prevStyle)\n );\n if (!isPresent) {\n prevStyle.viewDescriptors.remove(viewTag);\n }\n }\n }\n }\n\n styles.forEach((style) => {\n style.viewDescriptors.add({\n tag: viewTag,\n name: viewName,\n shadowNodeWrapper,\n });\n if (isJest()) {\n /**\n * We need to connect Jest's TestObject instance whose contains just props object\n * with the updateProps() function where we update the properties of the component.\n * We can't update props object directly because TestObject contains a copy of props - look at render function:\n * const props = this._filterNonAnimatedProps(this.props);\n */\n this.animatedStyle.value = {\n ...this.animatedStyle.value,\n ...style.initial.value,\n };\n style.animatedStyle.current = this.animatedStyle;\n }\n });\n\n // detach old animatedProps\n if (\n prevAnimatedProps &&\n !isSameAnimatedProps(prevAnimatedProps, this.props.animatedProps)\n ) {\n prevAnimatedProps.viewDescriptors!.remove(viewTag as number);\n }\n\n // attach animatedProps property\n if (this.props.animatedProps?.viewDescriptors) {\n this.props.animatedProps.viewDescriptors.add({\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n tag: viewTag!,\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n name: viewName!,\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n shadowNodeWrapper: shadowNodeWrapper!,\n });\n }\n }\n\n _attachInlineProps() {\n const newInlineProps: Record<string, any> =\n extractSharedValuesMapFromProps(this.props);\n const hasChanged = inlinePropsHasChanged(\n newInlineProps,\n this._inlineProps\n );\n\n if (hasChanged) {\n if (!this._inlinePropsViewDescriptors) {\n this._inlinePropsViewDescriptors = makeViewDescriptorsSet();\n\n const { viewTag, viewName, shadowNodeWrapper, viewConfig } =\n this._getViewInfo();\n\n if (Object.keys(newInlineProps).length && viewConfig) {\n adaptViewConfig(viewConfig);\n }\n\n this._inlinePropsViewDescriptors.add({\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n tag: viewTag!,\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n name: viewName!,\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n shadowNodeWrapper: shadowNodeWrapper!,\n });\n }\n const sharableViewDescriptors =\n this._inlinePropsViewDescriptors.sharableViewDescriptors;\n\n const maybeViewRef = NativeReanimatedModule.native\n ? undefined\n : ({ items: new Set([this]) } as ViewRefSet<any>); // see makeViewsRefSet\n\n const updaterFunction = () => {\n 'worklet';\n const update = getInlinePropsUpdate(newInlineProps);\n updateProps(sharableViewDescriptors, update, maybeViewRef);\n };\n this._inlineProps = newInlineProps;\n if (this._inlinePropsMapperId) {\n stopMapper(this._inlinePropsMapperId);\n }\n this._inlinePropsMapperId = null;\n if (Object.keys(newInlineProps).length) {\n this._inlinePropsMapperId = startMapper(\n updaterFunction,\n Object.values(newInlineProps)\n );\n }\n }\n }\n\n _detachInlineProps() {\n if (this._inlinePropsMapperId) {\n stopMapper(this._inlinePropsMapperId);\n }\n }\n\n componentDidUpdate(\n prevProps: AnimatedComponentProps<InitialComponentProps>\n ) {\n this._reattachNativeEvents(prevProps);\n this._attachAnimatedStyles();\n this._attachInlineProps();\n }\n\n _setComponentRef = setAndForwardRef<Component>({\n getForwardedRef: () =>\n this.props.forwardedRef as MutableRefObject<\n Component<Record<string, unknown>, Record<string, unknown>, unknown>\n >,\n setLocalRef: (ref) => {\n // TODO update config\n const tag = findNodeHandle(ref);\n const { layout, entering, exiting, sharedTransitionTag } = this.props;\n if (\n (layout || entering || exiting || sharedTransitionTag) &&\n tag != null\n ) {\n if (!shouldBeUseWeb()) {\n enableLayoutAnimations(true, false);\n }\n if (layout) {\n configureLayoutAnimations(\n tag,\n LayoutAnimationType.LAYOUT,\n maybeBuild(layout)\n );\n }\n if (entering) {\n configureLayoutAnimations(\n tag,\n LayoutAnimationType.ENTERING,\n maybeBuild(entering)\n );\n }\n if (exiting) {\n configureLayoutAnimations(\n tag,\n LayoutAnimationType.EXITING,\n maybeBuild(exiting)\n );\n }\n if (sharedTransitionTag) {\n const sharedElementTransition =\n this.props.sharedTransitionStyle ?? DefaultSharedTransition;\n configureLayoutAnimations(\n tag,\n LayoutAnimationType.SHARED_ELEMENT_TRANSITION,\n maybeBuild(sharedElementTransition),\n sharedTransitionTag\n );\n }\n }\n\n if (ref !== this._component) {\n this._component = ref;\n }\n },\n });\n\n _filterNonAnimatedProps(\n inputProps: AnimatedComponentProps<InitialComponentProps>\n ): Record<string, unknown> {\n const props: Record<string, unknown> = {};\n for (const key in inputProps) {\n const value = inputProps[key];\n if (key === 'style') {\n const styleProp = inputProps.style;\n const styles = flattenArray<StyleProps>(styleProp ?? []);\n const processedStyle: StyleProps = styles.map((style) => {\n if (style && style.viewDescriptors) {\n // this is how we recognize styles returned by useAnimatedStyle\n style.viewsRef.add(this);\n if (this._isFirstRender) {\n this.initialStyle = {\n ...style.initial.value,\n ...initialUpdaterRun<StyleProps>(style.initial.updater),\n };\n }\n return this.initialStyle;\n } else if (hasInlineStyles(style)) {\n if (this._isFirstRender) {\n return getInlinePropsUpdate(style);\n }\n const newStyle: StyleProps = {};\n for (const [key, styleValue] of Object.entries(style)) {\n if (\n !isSharedValue(styleValue) &&\n !(key === 'transform' && isInlineStyleTransform(styleValue))\n ) {\n newStyle[key] = styleValue;\n }\n }\n return newStyle;\n } else {\n return style;\n }\n });\n props[key] = StyleSheet.flatten(processedStyle);\n } else if (key === 'animatedProps') {\n const animatedProp = inputProps.animatedProps as Partial<\n AnimatedComponentProps<AnimatedProps>\n >;\n if (animatedProp.initial !== undefined) {\n Object.keys(animatedProp.initial.value).forEach((key) => {\n props[key] = animatedProp.initial?.value[key];\n animatedProp.viewsRef?.add(this);\n });\n }\n } else if (\n has('current', value) &&\n value.current instanceof WorkletEventHandler\n ) {\n if (value.current.eventNames.length > 0) {\n value.current.eventNames.forEach((eventName) => {\n props[eventName] = has('listeners', value.current)\n ? (value.current.listeners as Record<string, unknown>)[\n eventName\n ]\n : dummyListener;\n });\n } else {\n props[key] = dummyListener;\n }\n } else if (isSharedValue(value)) {\n if (this._isFirstRender) {\n props[key] = (value as SharedValue<any>).value;\n }\n } else if (\n key !== 'onGestureHandlerStateChange' ||\n !isChromeDebugger()\n ) {\n props[key] = value;\n }\n }\n return props;\n }\n\n render() {\n const props = this._filterNonAnimatedProps(this.props);\n if (isJest()) {\n props.animatedStyle = this.animatedStyle;\n }\n\n if (this._isFirstRender) {\n this._isFirstRender = false;\n }\n\n const platformProps = Platform.select({\n web: {},\n default: { collapsable: false },\n });\n return (\n <Component {...props} ref={this._setComponentRef} {...platformProps} />\n );\n }\n }\n\n AnimatedComponent.displayName = `AnimatedComponent(${\n Component.displayName || Component.name || 'Component'\n })`;\n\n return React.forwardRef<Component>((props, ref) => {\n return (\n <AnimatedComponent\n {...props}\n {...(ref === null ? null : { forwardedRef: ref })}\n />\n );\n });\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,oBAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,iBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACAA,OAAA;AACA,IAAAI,UAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,KAAA,GAAAP,OAAA;AAOA,IAAAQ,gBAAA,GAAAR,OAAA;AAKA,IAAAS,UAAA,GAAAT,OAAA;AACA,IAAAU,kBAAA,GAAAV,OAAA;AAaA,IAAAW,mBAAA,GAAAX,OAAA;AA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AsN,aAAA,CAACtI,SAAS,EAAA/E,QAAA,KAAKqE,KAAK;QAAEsB,GAAG,EAAE,IAAI,CAAC2H;MAAiB,GAAKL,aAAa,EAAI;IAE3E;EACF;EAACnM,eAAA,CAneKsE,iBAAiB;EAqevBA,iBAAiB,CAACmI,WAAW,GAAI,qBAC/BxI,SAAS,CAACwI,WAAW,IAAIxI,SAAS,CAACI,IAAI,IAAI,WAC5C,GAAE;EAEH,oBAAOE,cAAK,CAACmI,UAAU,CAAY,CAACnJ,KAAK,EAAEsB,GAAG,KAAK;IACjD,oBACEhH,MAAA,CAAAoB,OAAA,CAAAsN,aAAA,CAACjI,iBAAiB,EAAApF,QAAA,KACZqE,KAAK,EACJsB,GAAG,KAAK,IAAI,GAAG,IAAI,GAAG;MAAEF,YAAY,EAAEE;IAAI,CAAC,EAChD;EAEN,CAAC,CAAC;AACJ"}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_WorkletEventHandler","_setAndForwardRef","_invariant","_ConfigHelper","_RNRenderer","_core","_PlatformChecker","_animation","_layoutReanimation","_ViewDescriptorsSet","_fabricUtils","_UpdateProps","_NativeReanimated","_reanimated","obj","__esModule","default","_extends","Object","assign","bind","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","_defineProperty","value","_toPropertyKey","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","TypeError","Number","dummyListener","maybeBuild","layoutAnimationOrBuilder","isAnimationBuilder","build","flattenArray","array","Array","isArray","resultArr","_flattenArray","arr","forEach","item","push","onlyAnimatedStyles","styles","filter","style","viewDescriptors","isSameAnimatedStyle","style1","style2","viewsRef","isSameAnimatedProps","has","x","isInlineStyleTransform","transform","some","t","hasInlineStyles","keys","styleValue","isSharedValue","extractSharedValuesMapFromProps","props","inlineProps","entries","inlinePropsHasChanged","styles1","styles2","getInlinePropsUpdate","update","map","createAnimatedComponent","Component","options","invariant","isReactComponent","name","AnimatedComponent","React","constructor","setAndForwardRef","getForwardedRef","forwardedRef","setLocalRef","ref","tag","findNodeHandle","layout","entering","exiting","sharedTransitionTag","shouldBeUseWeb","enableLayoutAnimations","configureLayoutAnimations","LayoutAnimationType","LAYOUT","ENTERING","EXITING","sharedElementTransition","sharedTransitionStyle","DefaultSharedTransition","SHARED_ELEMENT_TRANSITION","_component","isJest","animatedStyle","componentWillUnmount","_detachNativeEvents","_detachStyles","_detachInlineProps","componentDidMount","_attachNativeEvents","_attachAnimatedStyles","_attachInlineProps","_getEventViewRef","_this$_component","getScrollableNode","node","viewTag","setNativeProps","prop","current","WorkletEventHandler","registerForEvents","unregisterFromEvents","Platform","OS","_styles","remove","_viewTag","_this$props$animatedP","animatedProps","global","_IS_FABRIC","runOnUI","_removeShadowNodeFromRegistry","_reattachNativeEvents","prevProps","reattachNeeded","_updateFromNative","_this$_component2","_this$_component2$set","_getViewInfo","viewName","shadowNodeWrapper","viewConfig","_hostInstance$viewCon","hostInstance","RNRenderer","findHostInstance_DEPRECATED","Error","_nativeTag","uiViewClassName","getShadowNodeWrapperFromRef","_this$props$animatedP2","_this$props$animatedP3","prevStyles","prevAnimatedProps","_animatedProps","hasReanimated2Props","adaptViewConfig","hasOneSameStyle","prevStyle","isPresent","add","initial","newInlineProps","hasChanged","_inlineProps","_inlinePropsViewDescriptors","makeViewDescriptorsSet","sharableViewDescriptors","maybeViewRef","NativeReanimatedModule","native","items","Set","updaterFunction","updateProps","_inlinePropsMapperId","stopMapper","startMapper","values","componentDidUpdate","_filterNonAnimatedProps","inputProps","styleProp","processedStyle","_isFirstRender","initialStyle","initialUpdaterRun","updater","newStyle","StyleSheet","flatten","animatedProp","_animatedProp$initial","_animatedProp$viewsRe","eventNames","eventName","listeners","isChromeDebugger","render","platformProps","select","web","collapsable","createElement","_setComponentRef","displayName","forwardRef"],"sources":["createAnimatedComponent.tsx"],"sourcesContent":["import React, { Component, ComponentType, MutableRefObject, Ref } from 'react';\nimport { findNodeHandle, Platform, StyleSheet } from 'react-native';\nimport WorkletEventHandler from './reanimated2/WorkletEventHandler';\nimport setAndForwardRef from './setAndForwardRef';\nimport './reanimated2/layoutReanimation/animationsManager';\nimport invariant from 'invariant';\nimport { adaptViewConfig } from './ConfigHelper';\nimport { RNRenderer } from './reanimated2/platform-specific/RNRenderer';\nimport {\n configureLayoutAnimations,\n enableLayoutAnimations,\n runOnUI,\n startMapper,\n stopMapper,\n} from './reanimated2/core';\nimport {\n isJest,\n isChromeDebugger,\n shouldBeUseWeb,\n} from './reanimated2/PlatformChecker';\nimport { initialUpdaterRun } from './reanimated2/animation';\nimport {\n BaseAnimationBuilder,\n DefaultSharedTransition,\n EntryExitAnimationFunction,\n ILayoutAnimationBuilder,\n LayoutAnimationFunction,\n LayoutAnimationType,\n} from './reanimated2/layoutReanimation';\nimport {\n SharedValue,\n StyleProps,\n ShadowNodeWrapper,\n} from './reanimated2/commonTypes';\nimport {\n makeViewDescriptorsSet,\n ViewDescriptorsSet,\n ViewRefSet,\n} from './reanimated2/ViewDescriptorsSet';\nimport { getShadowNodeWrapperFromRef } from './reanimated2/fabricUtils';\nimport updateProps from './reanimated2/UpdateProps';\nimport NativeReanimatedModule from './reanimated2/NativeReanimated';\nimport { isSharedValue } from './reanimated2';\n\nfunction dummyListener() {\n // empty listener we use to assign to listener properties for which animated\n // event is used.\n}\n\nfunction maybeBuild(\n layoutAnimationOrBuilder:\n | ILayoutAnimationBuilder\n | LayoutAnimationFunction\n | Keyframe\n): LayoutAnimationFunction | Keyframe {\n const isAnimationBuilder = (\n value: ILayoutAnimationBuilder | LayoutAnimationFunction | Keyframe\n ): value is ILayoutAnimationBuilder =>\n 'build' in layoutAnimationOrBuilder &&\n typeof layoutAnimationOrBuilder.build === 'function';\n\n if (isAnimationBuilder(layoutAnimationOrBuilder)) {\n return layoutAnimationOrBuilder.build();\n } else {\n return layoutAnimationOrBuilder;\n }\n}\n\ntype NestedArray<T> = T | NestedArray<T>[];\nfunction flattenArray<T>(array: NestedArray<T>): T[] {\n if (!Array.isArray(array)) {\n return [array];\n }\n const resultArr: T[] = [];\n\n const _flattenArray = (arr: NestedArray<T>[]): void => {\n arr.forEach((item) => {\n if (Array.isArray(item)) {\n _flattenArray(item);\n } else {\n resultArr.push(item);\n }\n });\n };\n _flattenArray(array);\n return resultArr;\n}\n\nfunction onlyAnimatedStyles(styles: StyleProps[]) {\n return styles.filter((style) => style?.viewDescriptors);\n}\n\nfunction isSameAnimatedStyle(\n style1?: StyleProps,\n style2?: StyleProps\n): boolean {\n // We cannot use equality check to compare useAnimatedStyle outputs directly.\n // Instead, we can compare its viewsRefs.\n return style1?.viewsRef === style2?.viewsRef;\n}\n\nconst isSameAnimatedProps = isSameAnimatedStyle;\n\nconst has = <K extends string>(\n key: K,\n x: unknown\n): x is { [key in K]: unknown } => {\n if (typeof x === 'function' || typeof x === 'object') {\n if (x === null || x === undefined) {\n return false;\n } else {\n return key in x;\n }\n }\n return false;\n};\n\nfunction isInlineStyleTransform(transform: any): boolean {\n if (!transform) {\n return false;\n }\n return transform.some((t: Record<string, any>) => hasInlineStyles(t));\n}\n\nfunction hasInlineStyles(style: StyleProps): boolean {\n if (!style) {\n return false;\n }\n return Object.keys(style).some((key) => {\n const styleValue = style[key];\n return (\n isSharedValue(styleValue) ||\n (key === 'transform' && isInlineStyleTransform(styleValue))\n );\n });\n}\n\nfunction extractSharedValuesMapFromProps(\n props: AnimatedComponentProps<InitialComponentProps>\n): Record<string, any> {\n const inlineProps: Record<string, any> = {};\n\n for (const key in props) {\n const value = props[key];\n if (key === 'style') {\n const styles = flattenArray<StyleProps>(props.style ?? []);\n styles.forEach((style) => {\n if (!style) {\n return;\n }\n for (const [key, styleValue] of Object.entries(style)) {\n if (isSharedValue(styleValue)) {\n inlineProps[key] = styleValue;\n } else if (\n key === 'transform' &&\n isInlineStyleTransform(styleValue)\n ) {\n inlineProps[key] = styleValue;\n }\n }\n });\n } else if (isSharedValue(value)) {\n inlineProps[key] = value;\n }\n }\n\n return inlineProps;\n}\n\nfunction inlinePropsHasChanged(styles1: StyleProps, styles2: StyleProps) {\n if (Object.keys(styles1).length !== Object.keys(styles2).length) {\n return true;\n }\n\n for (const key of Object.keys(styles1)) {\n if (styles1[key] !== styles2[key]) return true;\n }\n\n return false;\n}\n\nfunction getInlinePropsUpdate(inlineProps: Record<string, any>) {\n 'worklet';\n const update: Record<string, any> = {};\n for (const [key, styleValue] of Object.entries(inlineProps)) {\n if (key === 'transform') {\n update[key] = styleValue.map((transform: Record<string, any>) => {\n return getInlinePropsUpdate(transform);\n });\n } else if (isSharedValue(styleValue)) {\n update[key] = styleValue.value;\n } else {\n update[key] = styleValue;\n }\n }\n return update;\n}\n\ninterface AnimatedProps extends Record<string, unknown> {\n viewDescriptors?: ViewDescriptorsSet;\n viewsRef?: ViewRefSet<unknown>;\n initial?: SharedValue<StyleProps>;\n}\n\nexport type AnimatedComponentProps<P extends Record<string, unknown>> = P & {\n forwardedRef?: Ref<Component>;\n style?: NestedArray<StyleProps>;\n animatedProps?: Partial<AnimatedComponentProps<AnimatedProps>>;\n animatedStyle?: StyleProps;\n layout?:\n | BaseAnimationBuilder\n | ILayoutAnimationBuilder\n | typeof BaseAnimationBuilder;\n entering?:\n | BaseAnimationBuilder\n | typeof BaseAnimationBuilder\n | EntryExitAnimationFunction\n | Keyframe;\n exiting?:\n | BaseAnimationBuilder\n | typeof BaseAnimationBuilder\n | EntryExitAnimationFunction\n | Keyframe;\n sharedTransitionTag?: string;\n sharedTransitionStyle?: ILayoutAnimationBuilder;\n};\n\ntype Options<P> = {\n setNativeProps: (ref: ComponentRef, props: P) => void;\n};\n\ninterface ComponentRef extends Component {\n setNativeProps?: (props: Record<string, unknown>) => void;\n getScrollableNode?: () => ComponentRef;\n}\n\nexport interface InitialComponentProps extends Record<string, unknown> {\n ref?: Ref<Component>;\n collapsable?: boolean;\n}\n\nexport default function createAnimatedComponent(\n Component: ComponentType<InitialComponentProps>,\n options?: Options<InitialComponentProps>\n): ComponentType<AnimatedComponentProps<InitialComponentProps>> {\n invariant(\n typeof Component !== 'function' ||\n (Component.prototype && Component.prototype.isReactComponent),\n `Looks like you're passing a function component \\`${Component.name}\\` to \\`createAnimatedComponent\\` function which supports only class components. Please wrap your function component with \\`React.forwardRef()\\` or use a class component instead.`\n );\n\n class AnimatedComponent extends React.Component<\n AnimatedComponentProps<InitialComponentProps>\n > {\n _styles: StyleProps[] | null = null;\n _animatedProps?: Partial<AnimatedComponentProps<AnimatedProps>>;\n _viewTag = -1;\n _isFirstRender = true;\n animatedStyle: { value: StyleProps } = { value: {} };\n initialStyle = {};\n _component: ComponentRef | null = null;\n _inlinePropsViewDescriptors: ViewDescriptorsSet | null = null;\n _inlinePropsMapperId: number | null = null;\n _inlineProps: StyleProps = {};\n static displayName: string;\n\n constructor(props: AnimatedComponentProps<InitialComponentProps>) {\n super(props);\n if (isJest()) {\n this.animatedStyle = { value: {} };\n }\n }\n\n componentWillUnmount() {\n this._detachNativeEvents();\n this._detachStyles();\n this._detachInlineProps();\n }\n\n componentDidMount() {\n this._attachNativeEvents();\n this._attachAnimatedStyles();\n this._attachInlineProps();\n }\n\n _getEventViewRef() {\n // Make sure to get the scrollable node for components that implement\n // `ScrollResponder.Mixin`.\n return this._component?.getScrollableNode\n ? this._component.getScrollableNode()\n : this._component;\n }\n\n _attachNativeEvents() {\n const node = this._getEventViewRef();\n const viewTag = findNodeHandle(options?.setNativeProps ? this : node);\n\n for (const key in this.props) {\n const prop = this.props[key];\n if (\n has('current', prop) &&\n prop.current instanceof WorkletEventHandler\n ) {\n prop.current.registerForEvents(viewTag as number, key);\n }\n }\n }\n\n _detachNativeEvents() {\n for (const key in this.props) {\n const prop = this.props[key];\n if (\n has('current', prop) &&\n prop.current instanceof WorkletEventHandler\n ) {\n prop.current.unregisterFromEvents();\n }\n }\n }\n\n _detachStyles() {\n if (Platform.OS === 'web' && this._styles !== null) {\n for (const style of this._styles) {\n if (style?.viewsRef) {\n style.viewsRef.remove(this);\n }\n }\n } else if (this._viewTag !== -1 && this._styles !== null) {\n for (const style of this._styles) {\n style.viewDescriptors.remove(this._viewTag);\n }\n if (this.props.animatedProps?.viewDescriptors) {\n this.props.animatedProps.viewDescriptors.remove(this._viewTag);\n }\n if (global._IS_FABRIC) {\n const viewTag = this._viewTag;\n runOnUI(() => {\n _removeShadowNodeFromRegistry!(viewTag);\n })();\n }\n }\n }\n\n _reattachNativeEvents(\n prevProps: AnimatedComponentProps<InitialComponentProps>\n ) {\n let viewTag: number | undefined;\n\n for (const key in this.props) {\n const prop = this.props[key];\n if (\n has('current', prop) &&\n prop.current instanceof WorkletEventHandler\n ) {\n if (viewTag === undefined) {\n viewTag = prop.current.viewTag;\n }\n }\n }\n for (const key in prevProps) {\n const prop = this.props[key];\n if (\n has('current', prop) &&\n prop.current instanceof WorkletEventHandler &&\n prop.current.reattachNeeded\n ) {\n prop.current.unregisterFromEvents();\n }\n }\n\n for (const key in this.props) {\n const prop = this.props[key];\n if (\n has('current', prop) &&\n prop.current instanceof WorkletEventHandler &&\n prop.current.reattachNeeded\n ) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n prop.current.registerForEvents(viewTag!, key);\n prop.current.reattachNeeded = false;\n }\n }\n }\n\n _updateFromNative(props: StyleProps) {\n if (options?.setNativeProps) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n options.setNativeProps(this._component!, props);\n } else {\n // eslint-disable-next-line no-unused-expressions\n this._component?.setNativeProps?.(props);\n }\n }\n\n _getViewInfo() {\n let viewTag: number | null;\n let viewName: string | null;\n let shadowNodeWrapper: ShadowNodeWrapper | null = null;\n let viewConfig;\n if (Platform.OS === 'web') {\n viewTag = findNodeHandle(this);\n viewName = null;\n shadowNodeWrapper = null;\n viewConfig = null;\n } else {\n // hostInstance can be null for a component that doesn't render anything (render function returns null). Example: svg Stop: https://github.com/react-native-svg/react-native-svg/blob/develop/src/elements/Stop.tsx\n const hostInstance = RNRenderer.findHostInstance_DEPRECATED(this);\n if (!hostInstance) {\n throw new Error(\n 'Cannot find host instance for this component. Maybe it renders nothing?'\n );\n }\n // we can access view tag in the same way it's accessed here https://github.com/facebook/react/blob/e3f4eb7272d4ca0ee49f27577156b57eeb07cf73/packages/react-native-renderer/src/ReactFabric.js#L146\n viewTag = hostInstance?._nativeTag;\n /**\n * RN uses viewConfig for components for storing different properties of the component(example: https://github.com/facebook/react-native/blob/master/Libraries/Components/ScrollView/ScrollViewViewConfig.js#L16).\n * The name we're looking for is in the field named uiViewClassName.\n */\n viewName = hostInstance?.viewConfig?.uiViewClassName;\n\n viewConfig = hostInstance?.viewConfig;\n\n if (global._IS_FABRIC) {\n shadowNodeWrapper = getShadowNodeWrapperFromRef(this);\n }\n }\n return { viewTag, viewName, shadowNodeWrapper, viewConfig };\n }\n\n _attachAnimatedStyles() {\n const styles = this.props.style\n ? onlyAnimatedStyles(flattenArray<StyleProps>(this.props.style))\n : [];\n const prevStyles = this._styles;\n this._styles = styles;\n\n const prevAnimatedProps = this._animatedProps;\n this._animatedProps = this.props.animatedProps;\n\n const { viewTag, viewName, shadowNodeWrapper, viewConfig } =\n this._getViewInfo();\n\n // update UI props whitelist for this view\n const hasReanimated2Props =\n this.props.animatedProps?.viewDescriptors || styles.length;\n if (hasReanimated2Props && viewConfig) {\n adaptViewConfig(viewConfig);\n }\n\n this._viewTag = viewTag as number;\n\n // remove old styles\n if (prevStyles) {\n // in most of the cases, views have only a single animated style and it remains unchanged\n const hasOneSameStyle =\n styles.length === 1 &&\n prevStyles.length === 1 &&\n isSameAnimatedStyle(styles[0], prevStyles[0]);\n\n if (!hasOneSameStyle) {\n // otherwise, remove each style that is not present in new styles\n for (const prevStyle of prevStyles) {\n const isPresent = styles.some((style) =>\n isSameAnimatedStyle(style, prevStyle)\n );\n if (!isPresent) {\n prevStyle.viewDescriptors.remove(viewTag);\n }\n }\n }\n }\n\n styles.forEach((style) => {\n style.viewDescriptors.add({\n tag: viewTag,\n name: viewName,\n shadowNodeWrapper,\n });\n if (isJest()) {\n /**\n * We need to connect Jest's TestObject instance whose contains just props object\n * with the updateProps() function where we update the properties of the component.\n * We can't update props object directly because TestObject contains a copy of props - look at render function:\n * const props = this._filterNonAnimatedProps(this.props);\n */\n this.animatedStyle.value = {\n ...this.animatedStyle.value,\n ...style.initial.value,\n };\n style.animatedStyle.current = this.animatedStyle;\n }\n });\n\n // detach old animatedProps\n if (\n prevAnimatedProps &&\n !isSameAnimatedProps(prevAnimatedProps, this.props.animatedProps)\n ) {\n prevAnimatedProps.viewDescriptors!.remove(viewTag as number);\n }\n\n // attach animatedProps property\n if (this.props.animatedProps?.viewDescriptors) {\n this.props.animatedProps.viewDescriptors.add({\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n tag: viewTag!,\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n name: viewName!,\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n shadowNodeWrapper: shadowNodeWrapper!,\n });\n }\n }\n\n _attachInlineProps() {\n const newInlineProps: Record<string, any> =\n extractSharedValuesMapFromProps(this.props);\n const hasChanged = inlinePropsHasChanged(\n newInlineProps,\n this._inlineProps\n );\n\n if (hasChanged) {\n if (!this._inlinePropsViewDescriptors) {\n this._inlinePropsViewDescriptors = makeViewDescriptorsSet();\n\n const { viewTag, viewName, shadowNodeWrapper, viewConfig } =\n this._getViewInfo();\n\n if (Object.keys(newInlineProps).length && viewConfig) {\n adaptViewConfig(viewConfig);\n }\n\n this._inlinePropsViewDescriptors.add({\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n tag: viewTag!,\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n name: viewName!,\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n shadowNodeWrapper: shadowNodeWrapper!,\n });\n }\n const sharableViewDescriptors =\n this._inlinePropsViewDescriptors.sharableViewDescriptors;\n\n const maybeViewRef = NativeReanimatedModule.native\n ? undefined\n : ({ items: new Set([this]) } as ViewRefSet<any>); // see makeViewsRefSet\n\n const updaterFunction = () => {\n 'worklet';\n const update = getInlinePropsUpdate(newInlineProps);\n updateProps(sharableViewDescriptors, update, maybeViewRef);\n };\n this._inlineProps = newInlineProps;\n if (this._inlinePropsMapperId) {\n stopMapper(this._inlinePropsMapperId);\n }\n this._inlinePropsMapperId = null;\n if (Object.keys(newInlineProps).length) {\n this._inlinePropsMapperId = startMapper(\n updaterFunction,\n Object.values(newInlineProps)\n );\n }\n }\n }\n\n _detachInlineProps() {\n if (this._inlinePropsMapperId) {\n stopMapper(this._inlinePropsMapperId);\n }\n }\n\n componentDidUpdate(\n prevProps: AnimatedComponentProps<InitialComponentProps>\n ) {\n this._reattachNativeEvents(prevProps);\n this._attachAnimatedStyles();\n this._attachInlineProps();\n }\n\n _setComponentRef = setAndForwardRef<Component>({\n getForwardedRef: () =>\n this.props.forwardedRef as MutableRefObject<\n Component<Record<string, unknown>, Record<string, unknown>, unknown>\n >,\n setLocalRef: (ref) => {\n // TODO update config\n const tag = findNodeHandle(ref);\n const { layout, entering, exiting, sharedTransitionTag } = this.props;\n if (\n (layout || entering || exiting || sharedTransitionTag) &&\n tag != null\n ) {\n if (!shouldBeUseWeb()) {\n enableLayoutAnimations(true, false);\n }\n if (layout) {\n configureLayoutAnimations(\n tag,\n LayoutAnimationType.LAYOUT,\n maybeBuild(layout)\n );\n }\n if (entering) {\n configureLayoutAnimations(\n tag,\n LayoutAnimationType.ENTERING,\n maybeBuild(entering)\n );\n }\n if (exiting) {\n configureLayoutAnimations(\n tag,\n LayoutAnimationType.EXITING,\n maybeBuild(exiting)\n );\n }\n if (sharedTransitionTag) {\n const sharedElementTransition =\n this.props.sharedTransitionStyle ?? DefaultSharedTransition;\n configureLayoutAnimations(\n tag,\n LayoutAnimationType.SHARED_ELEMENT_TRANSITION,\n maybeBuild(sharedElementTransition),\n sharedTransitionTag\n );\n }\n }\n\n if (ref !== this._component) {\n this._component = ref;\n }\n },\n });\n\n _filterNonAnimatedProps(\n inputProps: AnimatedComponentProps<InitialComponentProps>\n ): Record<string, unknown> {\n const props: Record<string, unknown> = {};\n for (const key in inputProps) {\n const value = inputProps[key];\n if (key === 'style') {\n const styleProp = inputProps.style;\n const styles = flattenArray<StyleProps>(styleProp ?? []);\n const processedStyle: StyleProps = styles.map((style) => {\n if (style && style.viewDescriptors) {\n // this is how we recognize styles returned by useAnimatedStyle\n style.viewsRef.add(this);\n if (this._isFirstRender) {\n this.initialStyle = {\n ...style.initial.value,\n ...initialUpdaterRun<StyleProps>(style.initial.updater),\n };\n }\n return this.initialStyle;\n } else if (hasInlineStyles(style)) {\n if (this._isFirstRender) {\n return getInlinePropsUpdate(style);\n }\n const newStyle: StyleProps = {};\n for (const [key, styleValue] of Object.entries(style)) {\n if (\n !isSharedValue(styleValue) &&\n !(key === 'transform' && isInlineStyleTransform(styleValue))\n ) {\n newStyle[key] = styleValue;\n }\n }\n return newStyle;\n } else {\n return style;\n }\n });\n props[key] = StyleSheet.flatten(processedStyle);\n } else if (key === 'animatedProps') {\n const animatedProp = inputProps.animatedProps as Partial<\n AnimatedComponentProps<AnimatedProps>\n >;\n if (animatedProp.initial !== undefined) {\n Object.keys(animatedProp.initial.value).forEach((key) => {\n props[key] = animatedProp.initial?.value[key];\n animatedProp.viewsRef?.add(this);\n });\n }\n } else if (\n has('current', value) &&\n value.current instanceof WorkletEventHandler\n ) {\n if (value.current.eventNames.length > 0) {\n value.current.eventNames.forEach((eventName) => {\n props[eventName] = has('listeners', value.current)\n ? (value.current.listeners as Record<string, unknown>)[\n eventName\n ]\n : dummyListener;\n });\n } else {\n props[key] = dummyListener;\n }\n } else if (isSharedValue(value)) {\n if (this._isFirstRender) {\n props[key] = (value as SharedValue<any>).value;\n }\n } else if (\n key !== 'onGestureHandlerStateChange' ||\n !isChromeDebugger()\n ) {\n props[key] = value;\n }\n }\n return props;\n }\n\n render() {\n const props = this._filterNonAnimatedProps(this.props);\n if (isJest()) {\n props.animatedStyle = this.animatedStyle;\n }\n\n if (this._isFirstRender) {\n this._isFirstRender = false;\n }\n\n const platformProps = Platform.select({\n web: {},\n default: { collapsable: false },\n });\n return (\n <Component {...props} ref={this._setComponentRef} {...platformProps} />\n );\n }\n }\n\n AnimatedComponent.displayName = `AnimatedComponent(${\n Component.displayName || Component.name || 'Component'\n })`;\n\n return React.forwardRef<Component>((props, ref) => {\n return (\n <AnimatedComponent\n {...props}\n {...(ref === null ? null : { forwardedRef: ref })}\n />\n );\n });\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,oBAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,iBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACAA,OAAA;AACA,IAAAI,UAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,KAAA,GAAAP,OAAA;AAOA,IAAAQ,gBAAA,GAAAR,OAAA;AAKA,IAAAS,UAAA,GAAAT,OAAA;AACA,IAAAU,kBAAA,GAAAV,OAAA;AAaA,IAAAW,mBAAA,GAAAX,OAAA;AAKA,IAAAY,YAAA,GAAAZ,OAAA;AACA,IAAAa,YAAA,GAAAd,sBAAA,CAAAC,OAAA;AACA,IAAAc,iBAAA,GAAAf,sBAAA,CAAAC,OAAA;AACA,IAAAe,WAAA,GAAAf,OAAA;AAA8C,SAAAD,uBAAAiB,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,SAAA,IAAAA,QAAA,GAAAC,MAAA,CAAAC,MAAA,GAAAD,MAAA,CAAAC,MAAA,CAAAC,IAAA,eAAAC,MAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAF,CAAA,UAAAG,MAAA,GAAAF,SAAA,CAAAD,CAAA,YAAAI,GAAA,I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EAChD;EAEN,CAAC,CAAC;AACJ"}
|
|
@@ -24,11 +24,10 @@ class NativeReanimated {
|
|
|
24
24
|
this.native = native;
|
|
25
25
|
if (native) {
|
|
26
26
|
if (this.InnerNativeModule === undefined) {
|
|
27
|
-
|
|
27
|
+
throw new Error(`[Reanimated] The native part of Reanimated doesn't seem to be initialized. This could be caused by\n\
|
|
28
28
|
- not rebuilding the app after installing or upgrading Reanimated\n\
|
|
29
29
|
- trying to run Reanimated on an unsupported platform\n\
|
|
30
30
|
- running in a brownfield app without manually initializing the native library`);
|
|
31
|
-
return;
|
|
32
31
|
}
|
|
33
32
|
(0, _checkCppVersion.checkCppVersion)();
|
|
34
33
|
}
|