react-native-tvos 0.79.3-0 → 0.79.5-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/Libraries/AppDelegate/RCTReactNativeFactory.mm +0 -4
  2. package/Libraries/Core/ReactNativeVersion.js +1 -1
  3. package/React/Base/RCTTVRemoteSelectHandler.h +4 -0
  4. package/React/Base/RCTTVRemoteSelectHandler.m +18 -6
  5. package/React/Base/RCTVersion.m +1 -1
  6. package/React/CoreModules/RCTDeviceInfo.mm +51 -19
  7. package/React/FBReactNativeSpec/FBReactNativeSpecJSI-generated.cpp +0 -6
  8. package/React/FBReactNativeSpec/FBReactNativeSpecJSI.h +0 -9
  9. package/ReactAndroid/gradle.properties +1 -1
  10. package/ReactAndroid/publish.gradle +5 -3
  11. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt +1 -7
  12. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt +1 -11
  13. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt +1 -3
  14. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt +1 -3
  15. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt +1 -12
  16. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsOverrides_RNOSS_Stable_Android.kt +0 -2
  17. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt +1 -3
  18. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
  19. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java +1 -1
  20. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java +8 -0
  21. package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.java +20 -36
  22. package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java +1 -1
  23. package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp +1 -15
  24. package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h +1 -4
  25. package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
  26. package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp +1 -5
  27. package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h +1 -6
  28. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp +8 -26
  29. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h +2 -4
  30. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h +1 -5
  31. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h +1 -10
  32. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h +1 -2
  33. package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp +1 -6
  34. package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h +1 -3
  35. package/index.js.flow +115 -0
  36. package/package.json +9 -8
  37. package/scripts/cocoapods/utils.rb +8 -3
  38. package/scripts/codegen/generate-artifacts-executor.js +2 -0
  39. package/sdks/hermesc/osx-bin/hermes +0 -0
  40. package/sdks/hermesc/osx-bin/hermesc +0 -0
  41. package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
  42. package/sdks/hermesc/win64-bin/msvcp140.dll +0 -0
  43. package/sdks/hermesc/win64-bin/vcruntime140.dll +0 -0
  44. package/sdks/hermesc/win64-bin/vcruntime140_1.dll +0 -0
  45. package/src/private/featureflags/ReactNativeFeatureFlags.js +1 -6
  46. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +1 -2
@@ -314,10 +314,6 @@ class RCTAppDelegateBridgelessFeatureFlags : public ReactNativeFeatureFlagsDefau
314
314
  {
315
315
  return true;
316
316
  }
317
- bool updateRuntimeShadowNodeReferencesOnCommit() override
318
- {
319
- return true;
320
- }
321
317
  bool useShadowNodeStateOnClone() override
322
318
  {
323
319
  return true;
@@ -16,7 +16,7 @@ const version: $ReadOnly<{
16
16
  }> = {
17
17
  major: 0,
18
18
  minor: 79,
19
- patch: 3,
19
+ patch: 5,
20
20
  prerelease: '0',
21
21
  };
22
22
 
@@ -24,4 +24,8 @@ NS_ASSUME_NONNULL_BEGIN
24
24
 
25
25
  @end
26
26
 
27
+ @interface RCTTVRemoteSelectGestureRecognizer: UILongPressGestureRecognizer
28
+
29
+ @end
30
+
27
31
  NS_ASSUME_NONNULL_END
@@ -1,16 +1,17 @@
1
1
  #import "RCTTVRemoteSelectHandler.h"
2
+ #import "RCTTVRemoteHandler.h"
2
3
 
3
4
  @interface RCTTVRemoteSelectHandler()
4
5
 
5
- @property (nonatomic, strong) UILongPressGestureRecognizer * pressRecognizer;
6
- @property (nonatomic, strong) UILongPressGestureRecognizer * longPressRecognizer;
6
+ @property (nonatomic, strong) RCTTVRemoteSelectGestureRecognizer * pressRecognizer;
7
+ @property (nonatomic, strong) RCTTVRemoteSelectGestureRecognizer * longPressRecognizer;
7
8
 
8
9
  @property (nonatomic, weak) UIView<RCTTVRemoteSelectHandlerDelegate> *view;
9
10
 
10
11
  @end
11
12
 
12
13
  @implementation RCTTVRemoteSelectHandler {
13
- NSMutableDictionary<NSString *, UIGestureRecognizer *> *_tvRemoteGestureRecognizers;
14
+ NSMutableDictionary<NSString *, RCTTVRemoteSelectGestureRecognizer *> *_tvRemoteGestureRecognizers;
14
15
  }
15
16
 
16
17
  #pragma mark -
@@ -36,14 +37,21 @@
36
37
 
37
38
  // Press recognizer should allow long press recognizer to work (but not the reverse)
38
39
  - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {
39
- return gestureRecognizer == self.pressRecognizer && otherGestureRecognizer == self.longPressRecognizer;
40
+ // We need to allow other external select gesture recognizers to run, but not
41
+ // the select recognizers for pressable subviews of the root view.
42
+
43
+ if (gestureRecognizer == self.pressRecognizer && otherGestureRecognizer == self.longPressRecognizer) {
44
+ return true;
45
+ } else {
46
+ return ![otherGestureRecognizer isKindOfClass:[RCTTVRemoteSelectGestureRecognizer class]];
47
+ }
40
48
  }
41
49
 
42
50
  #pragma mark -
43
51
  #pragma mark Private methods
44
52
 
45
53
  - (void)attachToView {
46
- UILongPressGestureRecognizer *pressRecognizer = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handlePress:)];
54
+ RCTTVRemoteSelectGestureRecognizer *pressRecognizer = [[RCTTVRemoteSelectGestureRecognizer alloc] initWithTarget:self action:@selector(handlePress:)];
47
55
  pressRecognizer.allowedPressTypes = @[ @(UIPressTypeSelect) ];
48
56
  pressRecognizer.minimumPressDuration = 0.0;
49
57
  pressRecognizer.delegate = self; // Press recognizer allows other recognizers to run
@@ -51,7 +59,7 @@
51
59
  [self.view addGestureRecognizer:pressRecognizer];
52
60
  self.pressRecognizer = pressRecognizer;
53
61
 
54
- UILongPressGestureRecognizer *longPressRecognizer = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleLongPress:)];
62
+ RCTTVRemoteSelectGestureRecognizer *longPressRecognizer = [[RCTTVRemoteSelectGestureRecognizer alloc] initWithTarget:self action:@selector(handleLongPress:)];
55
63
  longPressRecognizer.allowedPressTypes = @[ @(UIPressTypeSelect) ];
56
64
  longPressRecognizer.minimumPressDuration = 0.5;
57
65
  longPressRecognizer.delegate = self;
@@ -119,3 +127,7 @@
119
127
  }
120
128
 
121
129
  @end
130
+
131
+ @implementation RCTTVRemoteSelectGestureRecognizer
132
+
133
+ @end
@@ -23,7 +23,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
23
23
  __rnVersion = @{
24
24
  RCTVersionMajor: @(0),
25
25
  RCTVersionMinor: @(79),
26
- RCTVersionPatch: @(3),
26
+ RCTVersionPatch: @(5),
27
27
  RCTVersionPrerelease: @"0",
28
28
  };
29
29
  });
@@ -14,9 +14,7 @@
14
14
  #import <React/RCTEventDispatcherProtocol.h>
15
15
  #import <React/RCTInitializing.h>
16
16
  #import <React/RCTInvalidating.h>
17
- #import <React/RCTKeyWindowValuesProxy.h>
18
17
  #import <React/RCTUtils.h>
19
- #import <React/RCTWindowSafeAreaProxy.h>
20
18
  #import <atomic>
21
19
 
22
20
  #import "CoreModulesPlugins.h"
@@ -33,8 +31,13 @@ using namespace facebook::react;
33
31
  NSDictionary *_currentInterfaceDimensions;
34
32
  BOOL _isFullscreen;
35
33
  std::atomic<BOOL> _invalidated;
34
+ NSDictionary *_constants;
35
+
36
+ __weak UIWindow *_applicationWindow;
36
37
  }
37
38
 
39
+ static NSString *const kFrameKeyPath = @"frame";
40
+
38
41
  @synthesize moduleRegistry = _moduleRegistry;
39
42
 
40
43
  RCT_EXPORT_MODULE()
@@ -42,14 +45,28 @@ RCT_EXPORT_MODULE()
42
45
  - (instancetype)init
43
46
  {
44
47
  if (self = [super init]) {
45
- [[RCTKeyWindowValuesProxy sharedInstance] startObservingWindowSizeIfNecessary];
48
+ _applicationWindow = RCTKeyWindow();
49
+ [_applicationWindow addObserver:self forKeyPath:kFrameKeyPath options:NSKeyValueObservingOptionNew context:nil];
46
50
  }
47
51
  return self;
48
52
  }
49
53
 
54
+ - (void)observeValueForKeyPath:(NSString *)keyPath
55
+ ofObject:(id)object
56
+ change:(NSDictionary *)change
57
+ context:(void *)context
58
+ {
59
+ #if !TARGET_OS_TV
60
+ if ([keyPath isEqualToString:kFrameKeyPath]) {
61
+ [self interfaceFrameDidChange];
62
+ [[NSNotificationCenter defaultCenter] postNotificationName:RCTWindowFrameDidChangeNotification object:self];
63
+ }
64
+ #endif
65
+ }
66
+
50
67
  + (BOOL)requiresMainQueueSetup
51
68
  {
52
- return NO;
69
+ return YES;
53
70
  }
54
71
 
55
72
  - (dispatch_queue_t)methodQueue
@@ -85,7 +102,7 @@ RCT_EXPORT_MODULE()
85
102
 
86
103
  #if TARGET_OS_IOS
87
104
 
88
- _currentInterfaceOrientation = [RCTKeyWindowValuesProxy sharedInstance].currentInterfaceOrientation;
105
+ _currentInterfaceOrientation = RCTKeyWindow().windowScene.interfaceOrientation;
89
106
 
90
107
  [[NSNotificationCenter defaultCenter] addObserver:self
91
108
  selector:@selector(interfaceFrameDidChange)
@@ -102,6 +119,15 @@ RCT_EXPORT_MODULE()
102
119
  selector:@selector(invalidate)
103
120
  name:RCTBridgeWillInvalidateModulesNotification
104
121
  object:nil];
122
+
123
+ _constants = @{
124
+ @"Dimensions" : [self _exportedDimensions],
125
+ // Note:
126
+ // This prop is deprecated and will be removed in a future release.
127
+ // Please use this only for a quick and temporary solution.
128
+ // Use <SafeAreaView> instead.
129
+ @"isIPhoneX_deprecated" : @(RCTIsIPhoneNotched()),
130
+ };
105
131
  }
106
132
 
107
133
  - (void)invalidate
@@ -124,6 +150,8 @@ RCT_EXPORT_MODULE()
124
150
 
125
151
  [[NSNotificationCenter defaultCenter] removeObserver:self name:RCTBridgeWillInvalidateModulesNotification object:nil];
126
152
 
153
+ [_applicationWindow removeObserver:self forKeyPath:kFrameKeyPath];
154
+
127
155
  #if TARGET_OS_IOS
128
156
  [[NSNotificationCenter defaultCenter] removeObserver:self name:UIDeviceOrientationDidChangeNotification object:nil];
129
157
  #endif
@@ -136,8 +164,13 @@ static BOOL RCTIsIPhoneNotched()
136
164
  #if TARGET_OS_IOS
137
165
  static dispatch_once_t onceToken;
138
166
  dispatch_once(&onceToken, ^{
167
+ RCTAssertMainQueue();
168
+
139
169
  // 20pt is the top safeArea value in non-notched devices
140
- isIPhoneNotched = [RCTWindowSafeAreaProxy sharedInstance].currentSafeAreaInsets.top > 20;
170
+ UIWindow *keyWindow = RCTKeyWindow();
171
+ if (keyWindow) {
172
+ isIPhoneNotched = keyWindow.safeAreaInsets.top > 20;
173
+ }
141
174
  });
142
175
  #endif
143
176
 
@@ -146,11 +179,13 @@ static BOOL RCTIsIPhoneNotched()
146
179
 
147
180
  static NSDictionary *RCTExportedDimensions(CGFloat fontScale)
148
181
  {
182
+ RCTAssertMainQueue();
149
183
  UIScreen *mainScreen = UIScreen.mainScreen;
150
184
  CGSize screenSize = mainScreen.bounds.size;
185
+ UIView *mainWindow = RCTKeyWindow();
151
186
 
152
187
  // We fallback to screen size if a key window is not found.
153
- CGSize windowSize = [RCTKeyWindowValuesProxy sharedInstance].windowSize;
188
+ CGSize windowSize = mainWindow ? mainWindow.bounds.size : screenSize;
154
189
 
155
190
  NSDictionary<NSString *, NSNumber *> *dimsWindow = @{
156
191
  @"width" : @(windowSize.width),
@@ -174,7 +209,10 @@ static NSDictionary *RCTExportedDimensions(CGFloat fontScale)
174
209
  RCTAssert(_moduleRegistry, @"Failed to get exported dimensions: RCTModuleRegistry is nil");
175
210
  RCTAccessibilityManager *accessibilityManager =
176
211
  (RCTAccessibilityManager *)[_moduleRegistry moduleForName:"AccessibilityManager"];
177
- RCTAssert(accessibilityManager, @"Failed to get exported dimensions: AccessibilityManager is nil");
212
+ // TOOD(T225745315): For some reason, accessibilityManager is nil in some cases.
213
+ // We default the fontScale to 1.0 in this case. This should be okay: if we assume
214
+ // that accessibilityManager will eventually become available, js will eventually
215
+ // be updated with the correct fontScale.
178
216
  CGFloat fontScale = accessibilityManager ? accessibilityManager.multiplier : 1.0;
179
217
  return RCTExportedDimensions(fontScale);
180
218
  }
@@ -186,14 +224,7 @@ static NSDictionary *RCTExportedDimensions(CGFloat fontScale)
186
224
 
187
225
  - (NSDictionary<NSString *, id> *)getConstants
188
226
  {
189
- return @{
190
- @"Dimensions" : [self _exportedDimensions],
191
- // Note:
192
- // This prop is deprecated and will be removed in a future release.
193
- // Please use this only for a quick and temporary solution.
194
- // Use <SafeAreaView> instead.
195
- @"isIPhoneX_deprecated" : @(RCTIsIPhoneNotched()),
196
- };
227
+ return _constants;
197
228
  }
198
229
 
199
230
  - (void)didReceiveNewContentSizeMultiplier
@@ -215,10 +246,11 @@ static NSDictionary *RCTExportedDimensions(CGFloat fontScale)
215
246
  - (void)interfaceOrientationDidChange
216
247
  {
217
248
  #if TARGET_OS_IOS && !TARGET_OS_MACCATALYST
218
- UIWindow *keyWindow = RCTKeyWindow();
219
- UIInterfaceOrientation nextOrientation = keyWindow.windowScene.interfaceOrientation;
249
+ UIApplication *application = RCTSharedApplication();
250
+ UIInterfaceOrientation nextOrientation = RCTKeyWindow().windowScene.interfaceOrientation;
220
251
 
221
- BOOL isRunningInFullScreen = CGRectEqualToRect(keyWindow.frame, keyWindow.screen.bounds);
252
+ BOOL isRunningInFullScreen =
253
+ CGRectEqualToRect(application.delegate.window.frame, application.delegate.window.screen.bounds);
222
254
  // We are catching here two situations for multitasking view:
223
255
  // a) The app is in Split View and the container gets resized -> !isRunningInFullScreen
224
256
  // b) The app changes to/from fullscreen example: App runs in slide over mode and goes into fullscreen->
@@ -201,11 +201,6 @@ static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useAlwa
201
201
  rt
202
202
  );
203
203
  }
204
- static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useEditTextStockAndroidFocusBehavior(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
205
- return static_cast<NativeReactNativeFeatureFlagsCxxSpecJSI *>(&turboModule)->useEditTextStockAndroidFocusBehavior(
206
- rt
207
- );
208
- }
209
204
  static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useFabricInterop(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
210
205
  return static_cast<NativeReactNativeFeatureFlagsCxxSpecJSI *>(&turboModule)->useFabricInterop(
211
206
  rt
@@ -282,7 +277,6 @@ NativeReactNativeFeatureFlagsCxxSpecJSI::NativeReactNativeFeatureFlagsCxxSpecJSI
282
277
  methodMap_["traceTurboModulePromiseRejectionsOnAndroid"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_traceTurboModulePromiseRejectionsOnAndroid};
283
278
  methodMap_["updateRuntimeShadowNodeReferencesOnCommit"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_updateRuntimeShadowNodeReferencesOnCommit};
284
279
  methodMap_["useAlwaysAvailableJSErrorHandling"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useAlwaysAvailableJSErrorHandling};
285
- methodMap_["useEditTextStockAndroidFocusBehavior"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useEditTextStockAndroidFocusBehavior};
286
280
  methodMap_["useFabricInterop"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useFabricInterop};
287
281
  methodMap_["useNativeViewConfigsInBridgelessMode"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useNativeViewConfigsInBridgelessMode};
288
282
  methodMap_["useOptimizedEventBatchingOnAndroid"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useOptimizedEventBatchingOnAndroid};
@@ -58,7 +58,6 @@ public:
58
58
  virtual bool traceTurboModulePromiseRejectionsOnAndroid(jsi::Runtime &rt) = 0;
59
59
  virtual bool updateRuntimeShadowNodeReferencesOnCommit(jsi::Runtime &rt) = 0;
60
60
  virtual bool useAlwaysAvailableJSErrorHandling(jsi::Runtime &rt) = 0;
61
- virtual bool useEditTextStockAndroidFocusBehavior(jsi::Runtime &rt) = 0;
62
61
  virtual bool useFabricInterop(jsi::Runtime &rt) = 0;
63
62
  virtual bool useNativeViewConfigsInBridgelessMode(jsi::Runtime &rt) = 0;
64
63
  virtual bool useOptimizedEventBatchingOnAndroid(jsi::Runtime &rt) = 0;
@@ -400,14 +399,6 @@ private:
400
399
  return bridging::callFromJs<bool>(
401
400
  rt, &T::useAlwaysAvailableJSErrorHandling, jsInvoker_, instance_);
402
401
  }
403
- bool useEditTextStockAndroidFocusBehavior(jsi::Runtime &rt) override {
404
- static_assert(
405
- bridging::getParameterCount(&T::useEditTextStockAndroidFocusBehavior) == 1,
406
- "Expected useEditTextStockAndroidFocusBehavior(...) to have 1 parameters");
407
-
408
- return bridging::callFromJs<bool>(
409
- rt, &T::useEditTextStockAndroidFocusBehavior, jsInvoker_, instance_);
410
- }
411
402
  bool useFabricInterop(jsi::Runtime &rt) override {
412
403
  static_assert(
413
404
  bridging::getParameterCount(&T::useFabricInterop) == 1,
@@ -1,4 +1,4 @@
1
- VERSION_NAME=0.79.3-0
1
+ VERSION_NAME=0.79.5-0
2
2
  react.internal.publishingGroup=io.github.react-native-tvos
3
3
 
4
4
  android.useAndroidX=true
@@ -20,7 +20,7 @@ def sonatypeUsername = findProperty('SONATYPE_USERNAME')
20
20
  def sonatypePassword = findProperty('SONATYPE_PASSWORD')
21
21
 
22
22
  def reactAndroidProjectDir = project(':packages:react-native:ReactAndroid').projectDir
23
- def mavenTempLocalUrl = 'file:///var/folders/xp/yw_lp59x05d2mp0g0n2f_d240000gn/T/eas-build-workingdir/build/maven_local'
23
+ def mavenTempLocalUrl = 'file:///Users/expo/workingdir/build/maven_local'
24
24
  // Rewritten when copying this to ReactAndroid/publish.gradle
25
25
 
26
26
  publishing {
@@ -78,7 +78,8 @@ publishing {
78
78
  }
79
79
  maven {
80
80
  name = 'sonatypeRelease'
81
- url = 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/'
81
+ url = 'https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/'
82
+ // url = 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/'
82
83
  credentials(PasswordCredentials) {
83
84
  username = sonatypeUsername
84
85
  password = sonatypePassword
@@ -86,7 +87,8 @@ publishing {
86
87
  }
87
88
  maven {
88
89
  name = 'sonatypeSnapshot'
89
- url = 'https://s01.oss.sonatype.org/content/repositories/snapshots/'
90
+ url = 'https://central.sonatype.com/repository/maven-snapshots/'
91
+ // url = 'https://s01.oss.sonatype.org/content/repositories/snapshots/'
90
92
  credentials(PasswordCredentials) {
91
93
  username = sonatypeUsername
92
94
  password = sonatypePassword
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * @generated SignedSource<<b263bdcbc1258f7d5c56e69732ba9076>>
7
+ * @generated SignedSource<<fa641112b3a8888ba2b24cf8829e9382>>
8
8
  */
9
9
 
10
10
  /**
@@ -250,12 +250,6 @@ public object ReactNativeFeatureFlags {
250
250
  @JvmStatic
251
251
  public fun useAlwaysAvailableJSErrorHandling(): Boolean = accessor.useAlwaysAvailableJSErrorHandling()
252
252
 
253
- /**
254
- * If true, focusing in ReactEditText will mainly use stock Android requestFocus() behavior. If false it will use legacy custom focus behavior.
255
- */
256
- @JvmStatic
257
- public fun useEditTextStockAndroidFocusBehavior(): Boolean = accessor.useEditTextStockAndroidFocusBehavior()
258
-
259
253
  /**
260
254
  * Should this application enable the Fabric Interop Layer for Android? If yes, the application will behave so that it can accept non-Fabric components and render them on Fabric. This toggle is controlling extra logic such as custom event dispatching that are needed for the Fabric Interop Layer to work correctly.
261
255
  */
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * @generated SignedSource<<0496ecf3d1e5d8a2e6d4d594aca806d0>>
7
+ * @generated SignedSource<<9ecb711480b7d6c22bac380c28d035bc>>
8
8
  */
9
9
 
10
10
  /**
@@ -57,7 +57,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
57
57
  private var traceTurboModulePromiseRejectionsOnAndroidCache: Boolean? = null
58
58
  private var updateRuntimeShadowNodeReferencesOnCommitCache: Boolean? = null
59
59
  private var useAlwaysAvailableJSErrorHandlingCache: Boolean? = null
60
- private var useEditTextStockAndroidFocusBehaviorCache: Boolean? = null
61
60
  private var useFabricInteropCache: Boolean? = null
62
61
  private var useNativeViewConfigsInBridgelessModeCache: Boolean? = null
63
62
  private var useOptimizedEventBatchingOnAndroidCache: Boolean? = null
@@ -399,15 +398,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
399
398
  return cached
400
399
  }
401
400
 
402
- override fun useEditTextStockAndroidFocusBehavior(): Boolean {
403
- var cached = useEditTextStockAndroidFocusBehaviorCache
404
- if (cached == null) {
405
- cached = ReactNativeFeatureFlagsCxxInterop.useEditTextStockAndroidFocusBehavior()
406
- useEditTextStockAndroidFocusBehaviorCache = cached
407
- }
408
- return cached
409
- }
410
-
411
401
  override fun useFabricInterop(): Boolean {
412
402
  var cached = useFabricInteropCache
413
403
  if (cached == null) {
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * @generated SignedSource<<c4f3b0cee8b9b4b9cebb589801e1dd15>>
7
+ * @generated SignedSource<<2151e5ec5d04924e742f37b527dc23b9>>
8
8
  */
9
9
 
10
10
  /**
@@ -102,8 +102,6 @@ public object ReactNativeFeatureFlagsCxxInterop {
102
102
 
103
103
  @DoNotStrip @JvmStatic public external fun useAlwaysAvailableJSErrorHandling(): Boolean
104
104
 
105
- @DoNotStrip @JvmStatic public external fun useEditTextStockAndroidFocusBehavior(): Boolean
106
-
107
105
  @DoNotStrip @JvmStatic public external fun useFabricInterop(): Boolean
108
106
 
109
107
  @DoNotStrip @JvmStatic public external fun useNativeViewConfigsInBridgelessMode(): Boolean
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * @generated SignedSource<<a8900217ae0385947b619c8fa0834942>>
7
+ * @generated SignedSource<<56f86a3a0c0bbf453cf45a0db541ef54>>
8
8
  */
9
9
 
10
10
  /**
@@ -97,8 +97,6 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
97
97
 
98
98
  override fun useAlwaysAvailableJSErrorHandling(): Boolean = false
99
99
 
100
- override fun useEditTextStockAndroidFocusBehavior(): Boolean = true
101
-
102
100
  override fun useFabricInterop(): Boolean = false
103
101
 
104
102
  override fun useNativeViewConfigsInBridgelessMode(): Boolean = false
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * @generated SignedSource<<8f5180a0ef154c083ac38d28e650ee11>>
7
+ * @generated SignedSource<<5b016fd6298477856116736e37c37c6f>>
8
8
  */
9
9
 
10
10
  /**
@@ -61,7 +61,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
61
61
  private var traceTurboModulePromiseRejectionsOnAndroidCache: Boolean? = null
62
62
  private var updateRuntimeShadowNodeReferencesOnCommitCache: Boolean? = null
63
63
  private var useAlwaysAvailableJSErrorHandlingCache: Boolean? = null
64
- private var useEditTextStockAndroidFocusBehaviorCache: Boolean? = null
65
64
  private var useFabricInteropCache: Boolean? = null
66
65
  private var useNativeViewConfigsInBridgelessModeCache: Boolean? = null
67
66
  private var useOptimizedEventBatchingOnAndroidCache: Boolean? = null
@@ -440,16 +439,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
440
439
  return cached
441
440
  }
442
441
 
443
- override fun useEditTextStockAndroidFocusBehavior(): Boolean {
444
- var cached = useEditTextStockAndroidFocusBehaviorCache
445
- if (cached == null) {
446
- cached = currentProvider.useEditTextStockAndroidFocusBehavior()
447
- accessedFeatureFlags.add("useEditTextStockAndroidFocusBehavior")
448
- useEditTextStockAndroidFocusBehaviorCache = cached
449
- }
450
- return cached
451
- }
452
-
453
442
  override fun useFabricInterop(): Boolean {
454
443
  var cached = useFabricInteropCache
455
444
  if (cached == null) {
@@ -18,7 +18,5 @@ public class ReactNativeFeatureFlagsOverrides_RNOSS_Stable_Android(
18
18
 
19
19
  override fun useTurboModules(): Boolean = bridgelessEnabled || turboModulesEnabled
20
20
 
21
- override fun updateRuntimeShadowNodeReferencesOnCommit(): Boolean = true
22
-
23
21
  override fun useShadowNodeStateOnClone(): Boolean = true
24
22
  }
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * @generated SignedSource<<33571f99b1f78fbc62cecfca5f8351fa>>
7
+ * @generated SignedSource<<b4d6157922f6182dd588d5ae5b54ead9>>
8
8
  */
9
9
 
10
10
  /**
@@ -97,8 +97,6 @@ public interface ReactNativeFeatureFlagsProvider {
97
97
 
98
98
  @DoNotStrip public fun useAlwaysAvailableJSErrorHandling(): Boolean
99
99
 
100
- @DoNotStrip public fun useEditTextStockAndroidFocusBehavior(): Boolean
101
-
102
100
  @DoNotStrip public fun useFabricInterop(): Boolean
103
101
 
104
102
  @DoNotStrip public fun useNativeViewConfigsInBridgelessMode(): Boolean
@@ -17,6 +17,6 @@ public class ReactNativeVersion {
17
17
  public static final Map<String, Object> VERSION = MapBuilder.<String, Object>of(
18
18
  "major", 0,
19
19
  "minor", 79,
20
- "patch", 3,
20
+ "patch", 5,
21
21
  "prerelease", "0");
22
22
  }
@@ -171,7 +171,7 @@ public class ReactHorizontalScrollView extends HorizontalScrollView
171
171
 
172
172
  @Override
173
173
  protected int computeScrollDeltaToGetChildRectOnScreen(Rect rect) {
174
- if (mScrollEnabled) {
174
+ if (!mScrollEnabled) {
175
175
  return 0;
176
176
  }
177
177
  return super.computeScrollDeltaToGetChildRectOnScreen(rect);
@@ -402,6 +402,14 @@ public class ReactScrollView extends ScrollView
402
402
  }
403
403
  }
404
404
 
405
+ @Override
406
+ protected int computeScrollDeltaToGetChildRectOnScreen(Rect rect) {
407
+ if (!mScrollEnabled) {
408
+ return 0;
409
+ }
410
+ return super.computeScrollDeltaToGetChildRectOnScreen(rect);
411
+ }
412
+
405
413
  @Override
406
414
  protected void onScrollChanged(int x, int y, int oldX, int oldY) {
407
415
  Systrace.beginSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, "ReactScrollView.onScrollChanged");
@@ -41,6 +41,7 @@ import android.view.Menu;
41
41
  import android.view.MenuItem;
42
42
  import android.view.MotionEvent;
43
43
  import android.view.View;
44
+ import android.view.ViewGroup;
44
45
  import android.view.accessibility.AccessibilityNodeInfo;
45
46
  import android.view.inputmethod.EditorInfo;
46
47
  import android.view.inputmethod.InputConnection;
@@ -153,9 +154,6 @@ public class ReactEditText extends AppCompatEditText {
153
154
 
154
155
  public ReactEditText(Context context) {
155
156
  super(context);
156
- if (!ReactNativeFeatureFlags.useEditTextStockAndroidFocusBehavior()) {
157
- setFocusableInTouchMode(false);
158
- }
159
157
 
160
158
  mInputMethodManager =
161
159
  (InputMethodManager)
@@ -198,9 +196,7 @@ public class ReactEditText extends AppCompatEditText {
198
196
  // selection on accessibility click to undo that.
199
197
  setSelection(length);
200
198
  }
201
- return ReactNativeFeatureFlags.useEditTextStockAndroidFocusBehavior()
202
- ? requestFocusProgramatically()
203
- : requestFocusInternal();
199
+ return requestFocusProgramatically();
204
200
  }
205
201
  return super.performAccessibilityAction(host, action, args);
206
202
  }
@@ -369,30 +365,30 @@ public class ReactEditText extends AppCompatEditText {
369
365
  return super.onTextContextMenuItem(id);
370
366
  }
371
367
 
372
- @Override
373
- public void clearFocus() {
374
- boolean useStockFocusBehavior = ReactNativeFeatureFlags.useEditTextStockAndroidFocusBehavior();
375
- if (!useStockFocusBehavior) {
376
- setFocusableInTouchMode(false);
368
+ public void clearFocusAndMaybeRefocus() {
369
+ if (Build.VERSION.SDK_INT > Build.VERSION_CODES.P || !isInTouchMode()) {
370
+ super.clearFocus();
371
+ } else {
372
+ // Avoid refocusing to a new view on old versions of Android by default
373
+ // by preventing `requestFocus()` on the rootView from moving focus to any child.
374
+ // https://cs.android.com/android/_/android/platform/frameworks/base/+/bdc66cb5a0ef513f4306edf9156cc978b08e06e4
375
+ ViewGroup rootViewGroup = (ViewGroup)getRootView();
376
+ int oldDescendantFocusability = rootViewGroup.getDescendantFocusability();
377
+ rootViewGroup.setDescendantFocusability(ViewGroup.FOCUS_BLOCK_DESCENDANTS);
378
+ super.clearFocus();
379
+ rootViewGroup.setDescendantFocusability(oldDescendantFocusability);
377
380
  }
378
- super.clearFocus();
379
381
  isKeyboardOpened = false;
380
382
  hideSoftKeyboard();
381
383
  }
382
384
 
383
- @Override
384
- public boolean requestFocus(int direction, Rect previouslyFocusedRect) {
385
- // This is a no-op so that when the OS calls requestFocus(), nothing will happen. ReactEditText
386
- // is a controlled component, which means its focus is controlled by JS, with two exceptions:
387
- // autofocus when it's attached to the window, and responding to accessibility events. In both
388
- // of these cases, we call requestFocusInternal() directly.
389
- return ReactNativeFeatureFlags.useEditTextStockAndroidFocusBehavior()
390
- ? super.requestFocus(direction, previouslyFocusedRect)
391
- : isFocused();
385
+ /* package */ void clearFocusFromJS() {
386
+ clearFocusAndMaybeRefocus();
392
387
  }
393
388
 
394
389
  private boolean requestFocusInternal() {
395
- setFocusableInTouchMode(true);
390
+ // We must explicitly call this method on the super class; if we call requestFocus() without
391
+ // any arguments, it will call into the overridden requestFocus(int, Rect) above, which no-ops.
396
392
  boolean focused = super.requestFocus(View.FOCUS_DOWN, null);
397
393
  if (getShowSoftInputOnFocus()) {
398
394
  showSoftKeyboard();
@@ -693,15 +689,7 @@ public class ReactEditText extends AppCompatEditText {
693
689
 
694
690
  // VisibleForTesting from {@link TextInputEventsTestCase}.
695
691
  public void requestFocusFromJS() {
696
- if (ReactNativeFeatureFlags.useEditTextStockAndroidFocusBehavior()) {
697
- requestFocusProgramatically();
698
- } else {
699
- requestFocusInternal();
700
- }
701
- }
702
-
703
- /* package */ void clearFocusFromJS() {
704
- clearFocus();
692
+ requestFocusProgramatically();
705
693
  }
706
694
 
707
695
  // VisibleForTesting from {@link TextInputEventsTestCase}.
@@ -1166,11 +1154,7 @@ public class ReactEditText extends AppCompatEditText {
1166
1154
  }
1167
1155
 
1168
1156
  if (mAutoFocus && !mDidAttachToWindow) {
1169
- if (ReactNativeFeatureFlags.useEditTextStockAndroidFocusBehavior()) {
1170
- requestFocusProgramatically();
1171
- } else {
1172
- requestFocusInternal();
1173
- }
1157
+ requestFocusProgramatically();
1174
1158
  }
1175
1159
 
1176
1160
  mDidAttachToWindow = true;
@@ -1164,7 +1164,7 @@ public class ReactTextInputManager extends BaseViewManager<ReactEditText, Layout
1164
1164
  }
1165
1165
 
1166
1166
  if (shouldBlur) {
1167
- editText.clearFocus();
1167
+ editText.clearFocusAndMaybeRefocus();
1168
1168
  }
1169
1169
 
1170
1170
  // Prevent default behavior except when we want it to insert a newline.