react-native-tvos 0.74.2-0 → 0.74.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 (106) hide show
  1. package/Libraries/AppDelegate/RCTAppDelegate.mm +4 -1
  2. package/Libraries/AppDelegate/RCTRootViewFactory.h +8 -0
  3. package/Libraries/AppDelegate/RCTRootViewFactory.mm +11 -3
  4. package/Libraries/AppDelegate/React-RCTAppDelegate.podspec +2 -2
  5. package/Libraries/Blob/React-RCTBlob.podspec +1 -1
  6. package/Libraries/Components/Pressable/Pressable.js +2 -2
  7. package/Libraries/Core/ReactNativeVersion.js +1 -1
  8. package/Libraries/Image/RCTImageLoader.mm +2 -6
  9. package/Libraries/Image/React-RCTImage.podspec +1 -1
  10. package/Libraries/LinkingIOS/React-RCTLinking.podspec +1 -1
  11. package/Libraries/NativeAnimation/React-RCTAnimation.podspec +1 -1
  12. package/Libraries/Network/RCTNetworkTask.mm +4 -3
  13. package/Libraries/Network/React-RCTNetwork.podspec +1 -1
  14. package/Libraries/PushNotificationIOS/React-RCTPushNotification.podspec +1 -1
  15. package/Libraries/Settings/React-RCTSettings.podspec +1 -1
  16. package/Libraries/Text/React-RCTText.podspec +1 -1
  17. package/Libraries/Text/TextInput/Multiline/RCTUITextView.mm +6 -0
  18. package/Libraries/Text/TextInput/RCTBackedTextInputViewProtocol.h +1 -0
  19. package/Libraries/Text/TextInput/RCTBaseTextInputView.mm +0 -13
  20. package/Libraries/Text/TextInput/Singleline/RCTUITextField.mm +5 -0
  21. package/Libraries/TypeSafety/RCTTypeSafety.podspec +1 -1
  22. package/Libraries/Vibration/React-RCTVibration.podspec +1 -1
  23. package/README.md +2 -0
  24. package/React/Base/RCTVersion.m +1 -1
  25. package/React/CoreModules/React-CoreModules.podspec +1 -1
  26. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +10 -5
  27. package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +4 -0
  28. package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +3 -2
  29. package/React/React-RCTFabric.podspec +1 -1
  30. package/React/Views/RCTComponentData.m +11 -3
  31. package/React/Views/ScrollView/RCTScrollView.m +4 -4
  32. package/React-Core.podspec +1 -1
  33. package/ReactAndroid/api/ReactAndroid.api +0 -9
  34. package/ReactAndroid/gradle.properties +1 -1
  35. package/ReactAndroid/publish.gradle +56 -39
  36. package/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java +2 -4
  37. package/ReactAndroid/src/main/java/com/facebook/react/common/build/ReactBuildConfig.java +23 -0
  38. package/ReactAndroid/src/main/java/com/facebook/react/modules/core/JavaTimerManager.java +5 -2
  39. package/ReactAndroid/src/main/java/com/facebook/react/modules/core/ReactAndroidHWInputDeviceHelper.java +20 -0
  40. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
  41. package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.java +3 -1
  42. package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactSurfaceView.java +5 -0
  43. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactAccessibilityDelegate.java +9 -0
  44. package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputKeyPressEvent.java +1 -1
  45. package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java +0 -5
  46. package/ReactApple/Libraries/RCTFoundation/RCTDeprecation/RCTDeprecation.podspec +1 -1
  47. package/ReactCommon/React-Fabric.podspec +1 -1
  48. package/ReactCommon/React-FabricImage.podspec +1 -1
  49. package/ReactCommon/React-Mapbuffer.podspec +1 -1
  50. package/ReactCommon/React-nativeconfig.podspec +1 -1
  51. package/ReactCommon/React-rncore.podspec +1 -1
  52. package/ReactCommon/ReactCommon.podspec +1 -1
  53. package/ReactCommon/cxxreact/React-cxxreact.podspec +1 -1
  54. package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
  55. package/ReactCommon/hermes/React-hermes.podspec +1 -1
  56. package/ReactCommon/hermes/executor/React-jsitracing.podspec +1 -1
  57. package/ReactCommon/jsc/JSCRuntime.cpp +30 -2
  58. package/ReactCommon/jserrorhandler/React-jserrorhandler.podspec +1 -1
  59. package/ReactCommon/jsi/jsi/decorator.h +7 -0
  60. package/ReactCommon/jsi/jsi/jsi.h +7 -0
  61. package/ReactCommon/jsiexecutor/React-jsiexecutor.podspec +1 -1
  62. package/ReactCommon/jsinspector-modern/React-jsinspector.podspec +1 -1
  63. package/ReactCommon/react/debug/React-debug.podspec +1 -1
  64. package/ReactCommon/react/featureflags/React-featureflags.podspec +1 -1
  65. package/ReactCommon/react/nativemodule/core/platform/android/ReactCommon/JavaTurboModule.cpp +53 -10
  66. package/ReactCommon/react/nativemodule/core/platform/ios/React-NativeModulesApple.podspec +1 -1
  67. package/ReactCommon/react/nativemodule/samples/ReactCommon-Samples.podspec +1 -1
  68. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropComponentDescriptor.mm +4 -3
  69. package/ReactCommon/react/renderer/debug/React-rendererdebug.podspec +1 -1
  70. package/ReactCommon/react/renderer/graphics/React-graphics.podspec +1 -1
  71. package/ReactCommon/react/renderer/imagemanager/platform/ios/React-ImageManager.podspec +1 -1
  72. package/ReactCommon/react/renderer/runtimescheduler/React-runtimescheduler.podspec +1 -1
  73. package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.cpp +0 -1
  74. package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler_Legacy.cpp +3 -3
  75. package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler_Modern.cpp +28 -28
  76. package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler_Modern.h +3 -3
  77. package/ReactCommon/react/renderer/runtimescheduler/Task.cpp +9 -7
  78. package/ReactCommon/react/renderer/runtimescheduler/tests/RuntimeSchedulerTest.cpp +46 -0
  79. package/ReactCommon/react/runtime/React-RuntimeCore.podspec +1 -1
  80. package/ReactCommon/react/runtime/React-RuntimeHermes.podspec +1 -1
  81. package/ReactCommon/react/runtime/platform/ios/React-RuntimeApple.podspec +1 -1
  82. package/ReactCommon/react/utils/React-utils.podspec +1 -1
  83. package/ReactCommon/reactperflogger/React-perflogger.podspec +1 -1
  84. package/package.json +13 -13
  85. package/scripts/cocoapods/helpers.rb +4 -0
  86. package/scripts/cocoapods/new_architecture.rb +10 -23
  87. package/scripts/cocoapods/privacy_manifest_utils.rb +11 -5
  88. package/scripts/cocoapods/utils.rb +12 -1
  89. package/scripts/codegen/generate-artifacts-executor.js +1 -1
  90. package/scripts/react_native_pods.rb +4 -0
  91. package/scripts/react_native_pods_utils/script_phases.sh +1 -1
  92. package/sdks/.hermesversion +1 -1
  93. package/sdks/hermes-engine/hermes-engine.podspec +2 -1
  94. package/sdks/hermes-engine/utils/build-apple-framework.sh +11 -14
  95. package/sdks/hermes-engine/utils/build-hermes-xcode.sh +11 -5
  96. package/sdks/hermes-engine/utils/build-ios-framework.sh +17 -8
  97. package/sdks/hermes-engine/utils/create-dummy-hermes-xcframework.sh +1 -1
  98. package/sdks/hermesc/osx-bin/hermes +0 -0
  99. package/sdks/hermesc/osx-bin/hermesc +0 -0
  100. package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
  101. package/template/package.json +6 -6
  102. package/third-party-podspecs/RCT-Folly.podspec +1 -1
  103. package/third-party-podspecs/fmt.podspec +1 -1
  104. package/types/public/ReactNativeTVTypes.d.ts +4 -0
  105. package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputEvent.java +0 -70
  106. package/ReactCommon/react/renderer/runtimescheduler/ErrorUtils.h +0 -34
@@ -65,7 +65,6 @@
65
65
  [RCTComponentViewFactory currentComponentViewFactory].thirdPartyFabricComponentsProvider = self;
66
66
  }
67
67
  [self _logWarnIfCreateRootViewWithBridgeIsOverridden];
68
- [self customizeRootView:(RCTRootView *)rootView];
69
68
 
70
69
  self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
71
70
  UIViewController *rootViewController = [self createRootViewController];
@@ -271,6 +270,10 @@
271
270
  return [weakSelf createBridgeWithDelegate:delegate launchOptions:launchOptions];
272
271
  };
273
272
 
273
+ configuration.customizeRootView = ^(UIView *_Nonnull rootView) {
274
+ [weakSelf customizeRootView:(RCTRootView *)rootView];
275
+ };
276
+
274
277
  return [[RCTRootViewFactory alloc] initWithConfiguration:configuration andTurboModuleManagerDelegate:self];
275
278
  }
276
279
 
@@ -23,6 +23,7 @@ typedef UIView *_Nonnull (
23
23
  ^RCTCreateRootViewWithBridgeBlock)(RCTBridge *bridge, NSString *moduleName, NSDictionary *initProps);
24
24
  typedef RCTBridge *_Nonnull (
25
25
  ^RCTCreateBridgeWithDelegateBlock)(id<RCTBridgeDelegate> delegate, NSDictionary *launchOptions);
26
+ typedef void (^RCTCustomizeRootViewBlock)(UIView *rootView);
26
27
  typedef NSURL *_Nullable (^RCTSourceURLForBridgeBlock)(RCTBridge *bridge);
27
28
  typedef NSURL *_Nullable (^RCTBundleURLBlock)(void);
28
29
  typedef NSArray<id<RCTBridgeModule>> *_Nonnull (^RCTExtraModulesForBridgeBlock)(RCTBridge *bridge);
@@ -91,6 +92,13 @@ typedef BOOL (^RCTBridgeDidNotFindModuleBlock)(RCTBridge *bridge, NSString *modu
91
92
  */
92
93
  @property (nonatomic, nullable) RCTCreateBridgeWithDelegateBlock createBridgeWithDelegate;
93
94
 
95
+ /**
96
+ * Block that allows to customize the rootView that is passed to React Native.
97
+ *
98
+ * @parameter: rootView - The root view to customize.
99
+ */
100
+ @property (nonatomic, nullable) RCTCustomizeRootViewBlock customizeRootView;
101
+
94
102
  @end
95
103
 
96
104
  #pragma mark - RCTRootViewFactory
@@ -145,17 +145,25 @@ static NSDictionary *updateInitialProps(NSDictionary *initialProps, BOOL isFabri
145
145
  initWithSurface:surface
146
146
  sizeMeasureMode:RCTSurfaceSizeMeasureModeWidthExact | RCTSurfaceSizeMeasureModeHeightExact];
147
147
 
148
+ if (self->_configuration.customizeRootView != nil) {
149
+ self->_configuration.customizeRootView(surfaceHostingProxyRootView);
150
+ }
148
151
  return surfaceHostingProxyRootView;
149
152
  }
150
153
 
151
154
  [self createBridgeIfNeeded:launchOptions];
152
155
  [self createBridgeAdapterIfNeeded];
153
156
 
157
+ UIView *rootView;
154
158
  if (self->_configuration.createRootViewWithBridge != nil) {
155
- return self->_configuration.createRootViewWithBridge(self.bridge, moduleName, initProps);
159
+ rootView = self->_configuration.createRootViewWithBridge(self.bridge, moduleName, initProps);
160
+ } else {
161
+ rootView = [self createRootViewWithBridge:self.bridge moduleName:moduleName initProps:initProps];
156
162
  }
157
-
158
- return [self createRootViewWithBridge:self.bridge moduleName:moduleName initProps:initProps];
163
+ if (self->_configuration.customizeRootView != nil) {
164
+ self->_configuration.customizeRootView(rootView);
165
+ }
166
+ return rootView;
159
167
  }
160
168
 
161
169
  - (RCTBridge *)createBridgeWithDelegate:(id<RCTBridgeDelegate>)delegate launchOptions:(NSDictionary *)launchOptions
@@ -26,7 +26,7 @@ use_hermes = ENV['USE_HERMES'] == nil || ENV['USE_HERMES'] == '1'
26
26
  new_arch_enabled_flag = (is_new_arch_enabled ? " -DRCT_NEW_ARCH_ENABLED" : "")
27
27
  is_fabric_enabled = true #is_new_arch_enabled || ENV["RCT_FABRIC_ENABLED"]
28
28
  hermes_flag = (use_hermes ? " -DUSE_HERMES" : "")
29
- other_cflags = "$(inherited)" + folly_compiler_flags + new_arch_enabled_flag + hermes_flag
29
+ other_cflags = "$(inherited) " + folly_compiler_flags + new_arch_enabled_flag + hermes_flag
30
30
 
31
31
  header_search_paths = [
32
32
  "$(PODS_TARGET_SRCROOT)/../../ReactCommon",
@@ -61,7 +61,7 @@ Pod::Spec.new do |s|
61
61
  s.pod_target_xcconfig = {
62
62
  "HEADER_SEARCH_PATHS" => header_search_paths,
63
63
  "OTHER_CPLUSPLUSFLAGS" => other_cflags,
64
- "CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
64
+ "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
65
65
  "DEFINES_MODULE" => "YES"
66
66
  }
67
67
  s.user_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/Headers/Private/React-Core\""}
@@ -43,7 +43,7 @@ Pod::Spec.new do |s|
43
43
  s.header_dir = "RCTBlob"
44
44
  s.pod_target_xcconfig = {
45
45
  "USE_HEADERMAP" => "YES",
46
- "CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
46
+ "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
47
47
  "HEADER_SEARCH_PATHS" => header_search_paths.join(' ')
48
48
  }
49
49
 
@@ -393,12 +393,12 @@ function Pressable(props: Props, forwardedRef): React.Node {
393
393
  }
394
394
  }
395
395
  // $FlowFixMe[prop-missing]
396
- if (focused && evt.eventType === 'select') {
396
+ if (evt.eventType === 'select') {
397
397
  // $FlowFixMe[incompatible-exact]
398
398
  onPress && onPress(evt);
399
399
  }
400
400
  // $FlowFixMe[prop-missing]
401
- if (focused && evt.eventType === 'longSelect') {
401
+ if (evt.eventType === 'longSelect') {
402
402
  // $FlowFixMe[incompatible-exact]
403
403
  onLongPress && onLongPress(evt);
404
404
  }
@@ -16,7 +16,7 @@ const version: $ReadOnly<{
16
16
  }> = {
17
17
  major: 0,
18
18
  minor: 74,
19
- patch: 2,
19
+ patch: 5,
20
20
  prerelease: '0',
21
21
  };
22
22
 
@@ -44,11 +44,7 @@ static NSInteger RCTImageBytesForImage(UIImage *image)
44
44
  return image.images ? image.images.count * singleImageBytes : singleImageBytes;
45
45
  }
46
46
 
47
- static uint64_t getNextImageRequestCount(void)
48
- {
49
- static uint64_t requestCounter = 0;
50
- return requestCounter++;
51
- }
47
+ static auto currentRequestCount = std::atomic<uint64_t>(0);
52
48
 
53
49
  static NSError *addResponseHeadersToError(NSError *originalError, NSHTTPURLResponse *response)
54
50
  {
@@ -522,7 +518,7 @@ static UIImage *RCTResizeImageIfNeeded(UIImage *image, CGSize size, CGFloat scal
522
518
  auto cancelled = std::make_shared<std::atomic<int>>(0);
523
519
  __block dispatch_block_t cancelLoad = nil;
524
520
  __block NSLock *cancelLoadLock = [NSLock new];
525
- NSString *requestId = [NSString stringWithFormat:@"%@-%llu", [[NSUUID UUID] UUIDString], getNextImageRequestCount()];
521
+ NSString *requestId = [NSString stringWithFormat:@"%@-%llu", [[NSUUID UUID] UUIDString], currentRequestCount++];
526
522
 
527
523
  void (^completionHandler)(NSError *, id, id, NSURLResponse *) =
528
524
  ^(NSError *error, id imageOrData, id imageMetadata, NSURLResponse *response) {
@@ -42,7 +42,7 @@ Pod::Spec.new do |s|
42
42
  s.header_dir = "RCTImage"
43
43
  s.pod_target_xcconfig = {
44
44
  "USE_HEADERMAP" => "YES",
45
- "CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
45
+ "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
46
46
  "HEADER_SEARCH_PATHS" => header_search_paths.join(' ')
47
47
  }
48
48
  s.framework = ["Accelerate", "UIKit"]
@@ -41,7 +41,7 @@ Pod::Spec.new do |s|
41
41
  s.header_dir = "RCTLinking"
42
42
  s.pod_target_xcconfig = {
43
43
  "USE_HEADERMAP" => "YES",
44
- "CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
44
+ "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
45
45
  "HEADER_SEARCH_PATHS" => header_search_paths.join(' ')
46
46
  }
47
47
 
@@ -40,7 +40,7 @@ Pod::Spec.new do |s|
40
40
  s.header_dir = "RCTAnimation"
41
41
  s.pod_target_xcconfig = {
42
42
  "USE_HEADERMAP" => "YES",
43
- "CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
43
+ "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
44
44
  "HEADER_SEARCH_PATHS" => header_search_paths.join(" ")
45
45
  }
46
46
 
@@ -5,6 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
+ #import <atomic>
8
9
  #import <mutex>
9
10
 
10
11
  #import <React/RCTLog.h>
@@ -20,6 +21,8 @@
20
21
  RCTNetworkTask *_selfReference;
21
22
  }
22
23
 
24
+ static auto currentRequestId = std::atomic<NSUInteger>(0);
25
+
23
26
  - (instancetype)initWithRequest:(NSURLRequest *)request
24
27
  handler:(id<RCTURLRequestHandler>)handler
25
28
  callbackQueue:(dispatch_queue_t)callbackQueue
@@ -28,10 +31,8 @@
28
31
  RCTAssertParam(handler);
29
32
  RCTAssertParam(callbackQueue);
30
33
 
31
- static NSUInteger requestID = 0;
32
-
33
34
  if ((self = [super init])) {
34
- _requestID = @(requestID++);
35
+ _requestID = @(currentRequestId++);
35
36
  _request = request;
36
37
  _handler = handler;
37
38
  _callbackQueue = callbackQueue;
@@ -40,7 +40,7 @@ Pod::Spec.new do |s|
40
40
  s.header_dir = "RCTNetwork"
41
41
  s.pod_target_xcconfig = {
42
42
  "USE_HEADERMAP" => "YES",
43
- "CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
43
+ "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
44
44
  "HEADER_SEARCH_PATHS" => header_search_paths.join(' ')
45
45
  }
46
46
  s.frameworks = "MobileCoreServices"
@@ -41,7 +41,7 @@ Pod::Spec.new do |s|
41
41
  s.header_dir = "RCTPushNotification"
42
42
  s.pod_target_xcconfig = {
43
43
  "USE_HEADERMAP" => "YES",
44
- "CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
44
+ "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
45
45
  "HEADER_SEARCH_PATHS" => header_search_paths.join(' ')
46
46
  }
47
47
  s.framework = "UserNotifications"
@@ -41,7 +41,7 @@ Pod::Spec.new do |s|
41
41
  s.header_dir = "RCTSettings"
42
42
  s.pod_target_xcconfig = {
43
43
  "USE_HEADERMAP" => "YES",
44
- "CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
44
+ "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
45
45
  "HEADER_SEARCH_PATHS" => header_search_paths.join(' ')
46
46
  }
47
47
 
@@ -30,7 +30,7 @@ Pod::Spec.new do |s|
30
30
  s.preserve_paths = "package.json", "LICENSE", "LICENSE-docs"
31
31
  s.header_dir = "RCTText"
32
32
  s.framework = ["MobileCoreServices"]
33
- s.pod_target_xcconfig = { "CLANG_CXX_LANGUAGE_STANDARD" => "c++20" }
33
+ s.pod_target_xcconfig = { "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard() }
34
34
 
35
35
  s.dependency "Yoga"
36
36
  s.dependency "React-Core/RCTTextHeaders", version
@@ -165,6 +165,12 @@ static UIColor *defaultPlaceholderColor(void)
165
165
  [super setSelectedTextRange:selectedTextRange];
166
166
  }
167
167
 
168
+ // After restoring the previous cursor position, we manually trigger the scroll to the new cursor position (PR 38679).
169
+ - (void)scrollRangeToVisible:(NSRange)range
170
+ {
171
+ [super scrollRangeToVisible:range];
172
+ }
173
+
168
174
  - (void)paste:(id)sender
169
175
  {
170
176
  _textWasPasted = YES;
@@ -43,6 +43,7 @@ NS_ASSUME_NONNULL_BEGIN
43
43
  // If the change was a result of user actions (like typing or touches), we MUST notify the delegate.
44
44
  - (void)setSelectedTextRange:(nullable UITextRange *)selectedTextRange NS_UNAVAILABLE;
45
45
  - (void)setSelectedTextRange:(nullable UITextRange *)selectedTextRange notifyDelegate:(BOOL)notifyDelegate;
46
+ - (void)scrollRangeToVisible:(NSRange)selectedTextRange;
46
47
 
47
48
  // This protocol disallows direct access to `text` property because
48
49
  // unwise usage of it can break the `attributeText` behavior.
@@ -497,8 +497,6 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithFrame : (CGRect)frame)
497
497
  }
498
498
  }
499
499
 
500
- NSString *previousText = [backedTextInputView.attributedText.string copy] ?: @"";
501
-
502
500
  if (range.location + range.length > backedTextInputView.attributedText.string.length) {
503
501
  _predictedText = backedTextInputView.attributedText.string;
504
502
  } else if (text != nil) {
@@ -506,17 +504,6 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithFrame : (CGRect)frame)
506
504
  withString:text];
507
505
  }
508
506
 
509
- if (_onTextInput) {
510
- _onTextInput(@{
511
- // We copy the string here because if it's a mutable string it may get released before we stop using it on a
512
- // different thread, causing a crash.
513
- @"text" : [text copy],
514
- @"previousText" : previousText,
515
- @"range" : @{@"start" : @(range.location), @"end" : @(range.location + range.length)},
516
- @"eventCount" : @(_nativeEventCount),
517
- });
518
- }
519
-
520
507
  return text; // Accepting the change.
521
508
  }
522
509
 
@@ -201,6 +201,11 @@
201
201
  [super setSelectedTextRange:selectedTextRange];
202
202
  }
203
203
 
204
+ - (void)scrollRangeToVisible:(NSRange)range
205
+ {
206
+ // Singleline TextInput does not require scrolling after calling setSelectedTextRange (PR 38679).
207
+ }
208
+
204
209
  - (void)paste:(id)sender
205
210
  {
206
211
  _textWasPasted = YES;
@@ -29,7 +29,7 @@ Pod::Spec.new do |s|
29
29
  s.header_dir = "RCTTypeSafety"
30
30
  s.pod_target_xcconfig = {
31
31
  "USE_HEADERMAP" => "YES",
32
- "CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
32
+ "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
33
33
  "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/Libraries/TypeSafety\""
34
34
  }
35
35
 
@@ -41,7 +41,7 @@ Pod::Spec.new do |s|
41
41
  s.header_dir = "RCTVibration"
42
42
  s.pod_target_xcconfig = {
43
43
  "USE_HEADERMAP" => "YES",
44
- "CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
44
+ "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
45
45
  "HEADER_SEARCH_PATHS" => header_search_paths.join(' ')
46
46
  }
47
47
  s.frameworks = "AudioToolbox"
package/README.md CHANGED
@@ -222,6 +222,8 @@ class Game2048 extends React.Component {
222
222
  - `enableTVPanGesture`/`disableTVPanGesture`: Methods to enable and disable detection of finger touches that pan across the touch surface of the Siri remote. See `TVEventHandlerExample` in the `RNTester` app for a demo.
223
223
  - `enableGestureHandlersCancelTouches`/`disableGestureHandlersCancelTouches`: Methods to turn on and turn off cancellation of touches by the gesture handlers in `RCTTVRemoteHandler` (see #366). Cancellation of touches is turned on (enabled) by default in 0.69 and earlier releases.
224
224
 
225
+ - Accessibility: We have an additional `accessibilityFocus` [accessibility action](https://reactnative.dev/docs/accessibility#accessibility-actions) on Android that you can use for detecting focus changes on every *accessible* element (like a regular `Text`) when `TalkBack` is enabled.
226
+
225
227
  - _TVFocusGuideView_: This component provides support for Apple's `UIFocusGuide` API and is implemented in the same way for Android TV, to help ensure that focusable controls can be navigated to, even if they are not directly in line with other controls. An example is provided in `RNTester` that shows two different ways of using this component.
226
228
 
227
229
  | Prop | Value | Description |
@@ -23,7 +23,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
23
23
  __rnVersion = @{
24
24
  RCTVersionMajor: @(0),
25
25
  RCTVersionMinor: @(74),
26
- RCTVersionPatch: @(2),
26
+ RCTVersionPatch: @(5),
27
27
  RCTVersionPrerelease: @"0",
28
28
  };
29
29
  });
@@ -44,7 +44,7 @@ Pod::Spec.new do |s|
44
44
  s.header_dir = "CoreModules"
45
45
  s.pod_target_xcconfig = {
46
46
  "USE_HEADERMAP" => "YES",
47
- "CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
47
+ "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
48
48
  "HEADER_SEARCH_PATHS" => header_search_paths.join(" ")
49
49
  }
50
50
  s.framework = "UIKit"
@@ -131,8 +131,8 @@ static void RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrol
131
131
  {
132
132
  if (self = [super initWithFrame:frame]) {
133
133
  _props = ScrollViewShadowNode::defaultSharedProps();
134
-
135
134
  _scrollView = [[RCTEnhancedScrollView alloc] initWithFrame:self.bounds];
135
+ _scrollView.clipsToBounds = _props->getClipsContentToBounds();
136
136
  _scrollView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
137
137
  _scrollView.delaysContentTouches = NO;
138
138
  ((RCTEnhancedScrollView *)_scrollView).overridingDelegate = self;
@@ -270,6 +270,11 @@ static void RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrol
270
270
  }
271
271
  }
272
272
 
273
+ // Overflow prop
274
+ if (oldScrollViewProps.getClipsContentToBounds() != newScrollViewProps.getClipsContentToBounds()) {
275
+ _scrollView.clipsToBounds = newScrollViewProps.getClipsContentToBounds();
276
+ }
277
+
273
278
  MAP_SCROLL_VIEW_PROP(zoomScale);
274
279
 
275
280
  if (oldScrollViewProps.contentInset != newScrollViewProps.contentInset) {
@@ -1008,28 +1013,28 @@ static void RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrol
1008
1013
  - (void)swipedUp
1009
1014
  {
1010
1015
  CGFloat newOffset = self.scrollView.contentOffset.y - [self swipeVerticalInterval];
1011
- NSLog(@"Swiped up to %f", newOffset);
1016
+ // NSLog(@"Swiped up to %f", newOffset);
1012
1017
  [self swipeVerticalScrollToOffset:newOffset];
1013
1018
  }
1014
1019
 
1015
1020
  - (void)swipedDown
1016
1021
  {
1017
1022
  CGFloat newOffset = self.scrollView.contentOffset.y + [self swipeVerticalInterval];
1018
- NSLog(@"Swiped down to %f", newOffset);
1023
+ // NSLog(@"Swiped down to %f", newOffset);
1019
1024
  [self swipeVerticalScrollToOffset:newOffset];
1020
1025
  }
1021
1026
 
1022
1027
  - (void)swipedLeft
1023
1028
  {
1024
1029
  CGFloat newOffset = self.scrollView.contentOffset.x - [self swipeHorizontalInterval];
1025
- NSLog(@"Swiped left to %f", newOffset);
1030
+ // NSLog(@"Swiped left to %f", newOffset);
1026
1031
  [self swipeHorizontalScrollToOffset:newOffset];
1027
1032
  }
1028
1033
 
1029
1034
  - (void)swipedRight
1030
1035
  {
1031
1036
  CGFloat newOffset = self.scrollView.contentOffset.x + [self swipeHorizontalInterval];
1032
- NSLog(@"Swiped right to %f", newOffset);
1037
+ // NSLog(@"Swiped right to %f", newOffset);
1033
1038
  [self swipeHorizontalScrollToOffset:newOffset];
1034
1039
  }
1035
1040
 
@@ -597,6 +597,9 @@ using namespace facebook::react;
597
597
  UITextRange *selectedRange = _backedTextInputView.selectedTextRange;
598
598
  NSInteger oldTextLength = _backedTextInputView.attributedText.string.length;
599
599
  _backedTextInputView.attributedText = attributedString;
600
+ // Updating the UITextView attributedText, for example changing the lineHeight, the color or adding
601
+ // a new paragraph with \n, causes the cursor to move to the end of the Text and scroll.
602
+ // This is fixed by restoring the cursor position and scrolling to that position (iOS issue 652653).
600
603
  if (selectedRange.empty) {
601
604
  // Maintaining a cursor position relative to the end of the old text.
602
605
  NSInteger offsetStart = [_backedTextInputView offsetFromPosition:_backedTextInputView.beginningOfDocument
@@ -607,6 +610,7 @@ using namespace facebook::react;
607
610
  offset:newOffset];
608
611
  [_backedTextInputView setSelectedTextRange:[_backedTextInputView textRangeFromPosition:position toPosition:position]
609
612
  notifyDelegate:YES];
613
+ [_backedTextInputView scrollRangeToVisible:NSMakeRange(offsetStart, 0)];
610
614
  }
611
615
  [self _restoreTextSelection];
612
616
  _lastStringStateWasUpdatedWith = attributedString;
@@ -1278,8 +1278,9 @@ static RCTBorderStyle RCTBorderStyleFromBorderStyle(BorderStyle borderStyle)
1278
1278
  // iOS draws borders in front of the content whereas CSS draws them behind
1279
1279
  // the content. For this reason, only use iOS border drawing when clipping
1280
1280
  // or when the border is hidden.
1281
- borderMetrics.borderWidths.left == 0 ||
1282
- colorComponentsFromColor(borderMetrics.borderColors.left).alpha == 0 || self.clipsToBounds);
1281
+ borderMetrics.borderWidths.left == 0 || self.clipsToBounds ||
1282
+ (colorComponentsFromColor(borderMetrics.borderColors.left).alpha == 0 &&
1283
+ (*borderMetrics.borderColors.left).getUIColor() != nullptr));
1283
1284
 
1284
1285
  CGColorRef backgroundColor = [_backgroundColor resolvedColorWithTraitCollection:self.traitCollection].CGColor;
1285
1286
 
@@ -64,7 +64,7 @@ Pod::Spec.new do |s|
64
64
  s.pod_target_xcconfig = {
65
65
  "HEADER_SEARCH_PATHS" => header_search_paths,
66
66
  "OTHER_CFLAGS" => "$(inherited) " + folly_compiler_flags + new_arch_flags,
67
- "CLANG_CXX_LANGUAGE_STANDARD" => "c++20"
67
+ "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard()
68
68
  }.merge!(ENV['USE_FRAMEWORKS'] != nil ? {
69
69
  "PUBLIC_HEADERS_FOLDER_PATH" => "#{module_name}.framework/Headers/#{header_dir}"
70
70
  }: {})
@@ -61,12 +61,20 @@ static SEL selectorForType(NSString *type)
61
61
  return self;
62
62
  }
63
63
 
64
+ - (BOOL)isBridgeMode
65
+ {
66
+ // If we are in bridge mode, the bridge is RCTBridge
67
+ // If we are bridgeless, the bridge is RCTBridgeProxy
68
+ return [_bridge isKindOfClass:[RCTBridge class]];
69
+ }
70
+
64
71
  - (RCTViewManager *)manager
65
72
  {
66
- if (!_manager && _bridge) {
73
+ if (!_manager && [self isBridgeMode]) {
67
74
  _manager = [_bridge moduleForClass:_managerClass];
68
75
  } else if (!_manager && !_bridgelessViewManager) {
69
76
  _bridgelessViewManager = [_managerClass new];
77
+ _bridgelessViewManager.bridge = _bridge;
70
78
  [[NSNotificationCenter defaultCenter] postNotificationName:RCTDidInitializeModuleNotification
71
79
  object:nil
72
80
  userInfo:@{@"module" : _bridgelessViewManager}];
@@ -267,8 +275,8 @@ static RCTPropBlock createNSInvocationSetter(NSMethodSignature *typeSignature, S
267
275
  type == NSSelectorFromString(@"RCTDirectEventBlock:") ||
268
276
  type == NSSelectorFromString(@"RCTCapturingEventBlock:")) {
269
277
  // Special case for event handlers
270
- setterBlock =
271
- createEventSetter(name, setter, self.eventInterceptor, _bridge ? _bridge.eventDispatcher : _eventDispatcher);
278
+ setterBlock = createEventSetter(
279
+ name, setter, self.eventInterceptor, [self isBridgeMode] ? _bridge.eventDispatcher : _eventDispatcher);
272
280
  } else {
273
281
  // Ordinary property handlers
274
282
  NSMethodSignature *typeSignature = [[RCTConvert class] methodSignatureForSelector:type];
@@ -1154,7 +1154,7 @@ RCT_SCROLL_EVENT_HANDLER(scrollViewDidScrollToTop, onScrollToTop)
1154
1154
  }
1155
1155
 
1156
1156
  CGFloat newOffset = self.scrollView.contentOffset.y - [self swipeVerticalInterval];
1157
- NSLog(@"Swiped up to %f", newOffset);
1157
+ // NSLog(@"Swiped up to %f", newOffset);
1158
1158
  [self scrollToVerticalOffset:newOffset];
1159
1159
  }
1160
1160
 
@@ -1165,7 +1165,7 @@ RCT_SCROLL_EVENT_HANDLER(scrollViewDidScrollToTop, onScrollToTop)
1165
1165
  }
1166
1166
 
1167
1167
  CGFloat newOffset = self.scrollView.contentOffset.y + [self swipeVerticalInterval];
1168
- NSLog(@"Swiped down to %f", newOffset);
1168
+ // NSLog(@"Swiped down to %f", newOffset);
1169
1169
  [self scrollToVerticalOffset:newOffset];
1170
1170
  }
1171
1171
 
@@ -1176,7 +1176,7 @@ RCT_SCROLL_EVENT_HANDLER(scrollViewDidScrollToTop, onScrollToTop)
1176
1176
  }
1177
1177
 
1178
1178
  CGFloat newOffset = self.scrollView.contentOffset.x - [self swipeHorizontalInterval];
1179
- NSLog(@"Swiped left to %f", newOffset);
1179
+ // NSLog(@"Swiped left to %f", newOffset);
1180
1180
  [self scrollToHorizontalOffset:newOffset];
1181
1181
  }
1182
1182
 
@@ -1187,7 +1187,7 @@ RCT_SCROLL_EVENT_HANDLER(scrollViewDidScrollToTop, onScrollToTop)
1187
1187
  }
1188
1188
 
1189
1189
  CGFloat newOffset = self.scrollView.contentOffset.x + [self swipeHorizontalInterval];
1190
- NSLog(@"Swiped right to %f", newOffset);
1190
+ // NSLog(@"Swiped right to %f", newOffset);
1191
1191
  [self scrollToHorizontalOffset:newOffset];
1192
1192
  }
1193
1193
 
@@ -72,7 +72,7 @@ Pod::Spec.new do |s|
72
72
  "HEADER_SEARCH_PATHS" => header_search_paths,
73
73
  "DEFINES_MODULE" => "YES",
74
74
  "GCC_PREPROCESSOR_DEFINITIONS" => "RCT_METRO_PORT=${RCT_METRO_PORT}",
75
- "CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
75
+ "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
76
76
  "FRAMEWORK_SEARCH_PATHS" => frameworks_search_paths.join(" ")
77
77
  }
78
78
  s.user_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/Headers/Private/React-Core\""}
@@ -7362,15 +7362,6 @@ public class com/facebook/react/views/textinput/ReactTextChangedEvent : com/face
7362
7362
  public fun getEventName ()Ljava/lang/String;
7363
7363
  }
7364
7364
 
7365
- public class com/facebook/react/views/textinput/ReactTextInputEvent : com/facebook/react/uimanager/events/Event {
7366
- public static final field EVENT_NAME Ljava/lang/String;
7367
- public fun <init> (IILjava/lang/String;Ljava/lang/String;II)V
7368
- public fun <init> (ILjava/lang/String;Ljava/lang/String;II)V
7369
- public fun canCoalesce ()Z
7370
- protected fun getEventData ()Lcom/facebook/react/bridge/WritableMap;
7371
- public fun getEventName ()Ljava/lang/String;
7372
- }
7373
-
7374
7365
  public final class com/facebook/react/views/textinput/ReactTextInputLocalData {
7375
7366
  public fun <init> (Landroid/widget/EditText;)V
7376
7367
  public fun apply (Landroid/widget/EditText;)V
@@ -1,4 +1,4 @@
1
- VERSION_NAME=0.74.2-0
1
+ VERSION_NAME=0.74.5-0
2
2
  # react.internal.publishingGroup=com.facebook.react
3
3
  # For TV use this group
4
4
  react.internal.publishingGroup=io.github.react-native-tvos