react-native-tvos 0.79.0-0rc2 → 0.79.1-1

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 (35) hide show
  1. package/Libraries/AppDelegate/RCTJSRuntimeConfiguratorProtocol.h +4 -3
  2. package/Libraries/AppDelegate/RCTRootViewFactory.mm +1 -0
  3. package/Libraries/Components/TV/TVEventControl.js +13 -7
  4. package/Libraries/Core/ReactNativeVersion.js +2 -2
  5. package/Libraries/Network/RCTDataRequestHandler.mm +5 -10
  6. package/Libraries/Network/RCTFileRequestHandler.mm +6 -11
  7. package/Libraries/Utilities/BackHandler.ios.js +1 -1
  8. package/README.md +2 -2
  9. package/React/Base/RCTVersion.m +2 -2
  10. package/React/CoreModules/RCTTVNavigationEventEmitter.mm +40 -0
  11. package/React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec-generated.mm +42 -0
  12. package/React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec.h +6 -0
  13. package/React/FBReactNativeSpec/FBReactNativeSpecJSI-generated.cpp +42 -0
  14. package/React/FBReactNativeSpec/FBReactNativeSpecJSI.h +54 -0
  15. package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +22 -13
  16. package/React/Modules/RCTEventEmitter.m +1 -1
  17. package/ReactAndroid/gradle.properties +1 -1
  18. package/ReactAndroid/publish.gradle +1 -1
  19. package/ReactAndroid/src/main/java/com/facebook/react/devsupport/ReleaseDevSupportManager.kt +2 -1
  20. package/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java +13 -8
  21. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +2 -2
  22. package/ReactCommon/cxxreact/ReactNativeVersion.h +2 -2
  23. package/ReactCommon/hermes/React-hermes.podspec +2 -1
  24. package/ReactCommon/jsitooling/React-jsitooling.podspec +5 -2
  25. package/ReactCommon/jsitooling/react/runtime/JSRuntimeFactory.h +4 -0
  26. package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.mm +24 -13
  27. package/ReactCommon/react/renderer/css/React-renderercss.podspec +3 -1
  28. package/package.json +8 -8
  29. package/scripts/codegen/generate-artifacts-executor.js +8 -8
  30. package/sdks/hermesc/osx-bin/hermes +0 -0
  31. package/sdks/hermesc/osx-bin/hermesc +0 -0
  32. package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
  33. package/src/private/specs_DEPRECATED/modules/NativeTVNavigationEventEmitter.js +6 -0
  34. package/React/Modules/RCTTVMenuBridge.h +0 -16
  35. package/React/Modules/RCTTVMenuBridge.m +0 -49
@@ -5,13 +5,14 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- #import <UIKit/UIKit.h>
9
- #import <react/runtime/JSRuntimeFactoryCAPI.h>
10
-
11
8
  #pragma once
12
9
 
13
10
  NS_ASSUME_NONNULL_BEGIN
14
11
 
12
+ // Forward declarations for umbrella headers.
13
+ // In implementations, import `<react/runtime/JSRuntimeFactoryCAPI.h>` to obtain the actual type.
14
+ typedef void *JSRuntimeFactoryRef;
15
+
15
16
  @protocol RCTJSRuntimeConfiguratorProtocol
16
17
 
17
18
  - (JSRuntimeFactoryRef)createJSRuntimeFactory;
@@ -32,6 +32,7 @@
32
32
  #import <react/renderer/runtimescheduler/RuntimeScheduler.h>
33
33
  #import <react/renderer/runtimescheduler/RuntimeSchedulerCallInvoker.h>
34
34
  #import <react/runtime/JSRuntimeFactory.h>
35
+ #import <react/runtime/JSRuntimeFactoryCAPI.h>
35
36
 
36
37
  @implementation RCTRootViewFactoryConfiguration
37
38
 
@@ -7,25 +7,31 @@
7
7
 
8
8
  'use strict';
9
9
 
10
- const TVMenuBridge = require('../../BatchedBridge/NativeModules').TVMenuBridge;
10
+ import NativeTVNavigationEventEmitter from '../../../src/private/specs_DEPRECATED/modules/NativeTVNavigationEventEmitter';
11
11
 
12
12
  module.exports = {
13
13
  enableTVMenuKey: () => {
14
- TVMenuBridge && TVMenuBridge.enableTVMenuKey();
14
+ NativeTVNavigationEventEmitter &&
15
+ NativeTVNavigationEventEmitter.enableTVMenuKey();
15
16
  },
16
17
  disableTVMenuKey: () => {
17
- TVMenuBridge && TVMenuBridge.disableTVMenuKey();
18
+ NativeTVNavigationEventEmitter &&
19
+ NativeTVNavigationEventEmitter.disableTVMenuKey();
18
20
  },
19
21
  enableTVPanGesture: () => {
20
- TVMenuBridge && TVMenuBridge.enableTVPanGesture();
22
+ NativeTVNavigationEventEmitter &&
23
+ NativeTVNavigationEventEmitter.enableTVPanGesture();
21
24
  },
22
25
  disableTVPanGesture: () => {
23
- TVMenuBridge && TVMenuBridge.disableTVPanGesture();
26
+ NativeTVNavigationEventEmitter &&
27
+ NativeTVNavigationEventEmitter.disableTVPanGesture();
24
28
  },
25
29
  enableGestureHandlersCancelTouches: () => {
26
- TVMenuBridge && TVMenuBridge.enableGestureHandlersCancelTouches();
30
+ NativeTVNavigationEventEmitter &&
31
+ NativeTVNavigationEventEmitter.enableGestureHandlersCancelTouches();
27
32
  },
28
33
  disableGestureHandlersCancelTouches: () => {
29
- TVMenuBridge && TVMenuBridge.disableGestureHandlersCancelTouches();
34
+ NativeTVNavigationEventEmitter &&
35
+ NativeTVNavigationEventEmitter.disableGestureHandlersCancelTouches();
30
36
  },
31
37
  };
@@ -16,8 +16,8 @@ const version: $ReadOnly<{
16
16
  }> = {
17
17
  major: 0,
18
18
  minor: 79,
19
- patch: 0,
20
- prerelease: '0rc2',
19
+ patch: 1,
20
+ prerelease: '1',
21
21
  };
22
22
 
23
23
  module.exports = {version};
@@ -49,13 +49,8 @@ RCT_EXPORT_MODULE()
49
49
  _queue.maxConcurrentOperationCount = 2;
50
50
  }
51
51
 
52
- __weak NSBlockOperation *weakOp;
53
- NSBlockOperation *op = [NSBlockOperation blockOperationWithBlock:^{
54
- NSBlockOperation *strongOp = weakOp; // Strong reference to avoid deallocation during execution
55
- if (strongOp == nil || [strongOp isCancelled]) {
56
- return;
57
- }
58
-
52
+ __weak __block NSBlockOperation *weakOp;
53
+ __block NSBlockOperation *op = [NSBlockOperation blockOperationWithBlock:^{
59
54
  // Get mime type
60
55
  NSRange firstSemicolon = [request.URL.resourceSpecifier rangeOfString:@";"];
61
56
  NSString *mimeType =
@@ -67,15 +62,15 @@ RCT_EXPORT_MODULE()
67
62
  expectedContentLength:-1
68
63
  textEncodingName:nil];
69
64
 
70
- [delegate URLRequest:strongOp didReceiveResponse:response];
65
+ [delegate URLRequest:weakOp didReceiveResponse:response];
71
66
 
72
67
  // Load data
73
68
  NSError *error;
74
69
  NSData *data = [NSData dataWithContentsOfURL:request.URL options:NSDataReadingMappedIfSafe error:&error];
75
70
  if (data) {
76
- [delegate URLRequest:strongOp didReceiveData:data];
71
+ [delegate URLRequest:weakOp didReceiveData:data];
77
72
  }
78
- [delegate URLRequest:strongOp didCompleteWithError:error];
73
+ [delegate URLRequest:weakOp didCompleteWithError:error];
79
74
  }];
80
75
 
81
76
  weakOp = op;
@@ -53,19 +53,14 @@ RCT_EXPORT_MODULE()
53
53
  _fileQueue.maxConcurrentOperationCount = 4;
54
54
  }
55
55
 
56
- __weak NSBlockOperation *weakOp;
57
- NSBlockOperation *op = [NSBlockOperation blockOperationWithBlock:^{
58
- NSBlockOperation *strongOp = weakOp; // Strong reference to avoid deallocation during execution
59
- if (strongOp == nil || [strongOp isCancelled]) {
60
- return;
61
- }
62
-
56
+ __weak __block NSBlockOperation *weakOp;
57
+ __block NSBlockOperation *op = [NSBlockOperation blockOperationWithBlock:^{
63
58
  // Get content length
64
59
  NSError *error = nil;
65
60
  NSFileManager *fileManager = [NSFileManager new];
66
61
  NSDictionary<NSString *, id> *fileAttributes = [fileManager attributesOfItemAtPath:request.URL.path error:&error];
67
62
  if (!fileAttributes) {
68
- [delegate URLRequest:strongOp didCompleteWithError:error];
63
+ [delegate URLRequest:weakOp didCompleteWithError:error];
69
64
  return;
70
65
  }
71
66
 
@@ -82,14 +77,14 @@ RCT_EXPORT_MODULE()
82
77
  expectedContentLength:[fileAttributes[NSFileSize] ?: @-1 integerValue]
83
78
  textEncodingName:nil];
84
79
 
85
- [delegate URLRequest:strongOp didReceiveResponse:response];
80
+ [delegate URLRequest:weakOp didReceiveResponse:response];
86
81
 
87
82
  // Load data
88
83
  NSData *data = [NSData dataWithContentsOfURL:request.URL options:NSDataReadingMappedIfSafe error:&error];
89
84
  if (data) {
90
- [delegate URLRequest:strongOp didReceiveData:data];
85
+ [delegate URLRequest:weakOp didReceiveData:data];
91
86
  }
92
- [delegate URLRequest:strongOp didCompleteWithError:error];
87
+ [delegate URLRequest:weakOp didCompleteWithError:error];
93
88
  }];
94
89
 
95
90
  weakOp = op;
@@ -12,7 +12,7 @@
12
12
  // On iOS, this just implements a stub.
13
13
 
14
14
  const TVEventHandler = require('../Components/TV/TVEventHandler');
15
- const Platform = require('./Platform');
15
+ const Platform = require('./Platform').default;
16
16
 
17
17
  type BackPressEventName = 'backPress' | 'hardwareBackPress';
18
18
  type BackPressHandler = () => ?boolean;
package/README.md CHANGED
@@ -148,7 +148,7 @@ npx react-native run:android --device tv_api_31
148
148
 
149
149
  ## How to support TV specific file extensions
150
150
 
151
- The template contains an [example Metro configuration](./packages/react-native/template/metro.config.js) that allows Metro to resolve application source files with TV-specific code, indicated by specific file extensions (e.g. `*.ios.tv.tsx`, `*.android.tv.tsx`, `*.tv.tsx`). The config will work the same way with the other standard source file extensions (`.js`, etc.), as documented in [Metro docs](https://metrobundler.dev/docs/configuration/#sourceexts)
151
+ The template contains an [example Metro configuration](https://github.com/react-native-tvos/react-native-template-typescript-tv/blob/main/template/metro.config.js) that allows Metro to resolve application source files with TV-specific code, indicated by specific file extensions (e.g. `*.ios.tv.tsx`, `*.android.tv.tsx`, `*.tv.tsx`). The config will work the same way with the other standard source file extensions (`.js`, etc.), as documented in [Metro docs](https://metrobundler.dev/docs/configuration/#sourceexts)
152
152
 
153
153
  When this is enabled, Metro will resolve files in the following order of preference (and similarly for the other supported file extensions):
154
154
 
@@ -190,7 +190,7 @@ Code has been added to detect focus changes and use existing methods to style th
190
190
 
191
191
  Because focus and blur events are now fully native core events, they will respond correctly to capturing and bubbling event handlers in `View` components. A demo of this has been added to the TVEventHandlerExample in RNTester.
192
192
 
193
- - _Tailwind styles for Pressable and Touchable controls_: The above events allow RNTV to support the [`focus:` and `active:` pseudo classes for Tailwind styles](https://www.nativewind.dev/v4/core-concepts/states#hover-focus-and-active-).
193
+ - _Tailwind styles for Pressable and Touchable controls_: The above events allow RNTV to support the [`focus:` and `active:` pseudo classes for Tailwind styles](https://www.nativewind.dev/core-concepts/states#hover-focus-and-active-).
194
194
 
195
195
  - _TV remote/keyboard input_: Application code that needs to implement custom handling of TV remote events can create an instance of `TVEventHandler` and listen for these events. For a more convenient API, we provide `useTVEventHandler`.
196
196
 
@@ -23,8 +23,8 @@ NSDictionary* RCTGetReactNativeVersion(void)
23
23
  __rnVersion = @{
24
24
  RCTVersionMajor: @(0),
25
25
  RCTVersionMinor: @(79),
26
- RCTVersionPatch: @(0),
27
- RCTVersionPrerelease: @"0rc2",
26
+ RCTVersionPatch: @(1),
27
+ RCTVersionPrerelease: @"1",
28
28
  };
29
29
  });
30
30
  return __rnVersion;
@@ -8,6 +8,7 @@
8
8
  #import "RCTTVNavigationEventEmitter.h"
9
9
  #if TARGET_OS_TV
10
10
  #import "RCTTVNavigationEventNotificationConstants.h"
11
+ #import <React/RCTTVRemoteHandler.h>
11
12
  #endif
12
13
 
13
14
  #import <FBReactNativeSpec/FBReactNativeSpec.h>
@@ -55,6 +56,45 @@ RCT_EXPORT_MODULE()
55
56
  return std::make_shared<facebook::react::NativeTVNavigationEventEmitterSpecJSI>(params);
56
57
  }
57
58
 
59
+ #pragma mark -
60
+ #pragma mark Methods moved from old RCTTVMenuBridge
61
+
62
+ #if TARGET_OS_TV
63
+ RCT_EXPORT_METHOD(enableTVMenuKey)
64
+ {
65
+ [RCTTVRemoteHandler setUseMenuKey:YES];
66
+ [[NSNotificationCenter defaultCenter] postNotificationName:RCTTVEnableMenuKeyNotification object:nil];
67
+ }
68
+
69
+ RCT_EXPORT_METHOD(disableTVMenuKey)
70
+ {
71
+ [RCTTVRemoteHandler setUseMenuKey:NO];
72
+ [[NSNotificationCenter defaultCenter] postNotificationName:RCTTVDisableMenuKeyNotification object:nil];
73
+ }
74
+
75
+ RCT_EXPORT_METHOD(enableTVPanGesture)
76
+ {
77
+ [RCTTVRemoteHandler setUsePanGesture:YES];
78
+ [[NSNotificationCenter defaultCenter] postNotificationName:RCTTVEnablePanGestureNotification object:nil];
79
+ }
80
+
81
+ RCT_EXPORT_METHOD(disableTVPanGesture)
82
+ {
83
+ [RCTTVRemoteHandler setUsePanGesture:NO];
84
+ [[NSNotificationCenter defaultCenter] postNotificationName:RCTTVDisablePanGestureNotification object:nil];
85
+ }
86
+
87
+ RCT_EXPORT_METHOD(enableGestureHandlersCancelTouches) {
88
+ [RCTTVRemoteHandler setGestureHandlersCancelTouches:YES];
89
+ [[NSNotificationCenter defaultCenter] postNotificationName:RCTTVEnableGestureHandlersCancelTouchesNotification object:nil];
90
+ }
91
+
92
+ RCT_EXPORT_METHOD(disableGestureHandlersCancelTouches) {
93
+ [RCTTVRemoteHandler setGestureHandlersCancelTouches:NO];
94
+ [[NSNotificationCenter defaultCenter] postNotificationName:RCTTVDisableGestureHandlersCancelTouchesNotification object:nil];
95
+ }
96
+ #endif
97
+
58
98
  @end
59
99
 
60
100
  Class RCTTVNavigationEventEmitterCls(void)
@@ -2198,6 +2198,30 @@ namespace facebook::react {
2198
2198
  return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, VoidKind, "removeListeners", @selector(removeListeners:), args, count);
2199
2199
  }
2200
2200
 
2201
+ static facebook::jsi::Value __hostFunction_NativeTVNavigationEventEmitterSpecJSI_enableTVMenuKey(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
2202
+ return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, VoidKind, "enableTVMenuKey", @selector(enableTVMenuKey), args, count);
2203
+ }
2204
+
2205
+ static facebook::jsi::Value __hostFunction_NativeTVNavigationEventEmitterSpecJSI_disableTVMenuKey(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
2206
+ return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, VoidKind, "disableTVMenuKey", @selector(disableTVMenuKey), args, count);
2207
+ }
2208
+
2209
+ static facebook::jsi::Value __hostFunction_NativeTVNavigationEventEmitterSpecJSI_enableTVPanGesture(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
2210
+ return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, VoidKind, "enableTVPanGesture", @selector(enableTVPanGesture), args, count);
2211
+ }
2212
+
2213
+ static facebook::jsi::Value __hostFunction_NativeTVNavigationEventEmitterSpecJSI_disableTVPanGesture(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
2214
+ return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, VoidKind, "disableTVPanGesture", @selector(disableTVPanGesture), args, count);
2215
+ }
2216
+
2217
+ static facebook::jsi::Value __hostFunction_NativeTVNavigationEventEmitterSpecJSI_enableGestureHandlersCancelTouches(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
2218
+ return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, VoidKind, "enableGestureHandlersCancelTouches", @selector(enableGestureHandlersCancelTouches), args, count);
2219
+ }
2220
+
2221
+ static facebook::jsi::Value __hostFunction_NativeTVNavigationEventEmitterSpecJSI_disableGestureHandlersCancelTouches(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
2222
+ return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, VoidKind, "disableGestureHandlersCancelTouches", @selector(disableGestureHandlersCancelTouches), args, count);
2223
+ }
2224
+
2201
2225
  NativeTVNavigationEventEmitterSpecJSI::NativeTVNavigationEventEmitterSpecJSI(const ObjCTurboModule::InitParams &params)
2202
2226
  : ObjCTurboModule(params) {
2203
2227
 
@@ -2206,6 +2230,24 @@ namespace facebook::react {
2206
2230
 
2207
2231
  methodMap_["removeListeners"] = MethodMetadata {1, __hostFunction_NativeTVNavigationEventEmitterSpecJSI_removeListeners};
2208
2232
 
2233
+
2234
+ methodMap_["enableTVMenuKey"] = MethodMetadata {0, __hostFunction_NativeTVNavigationEventEmitterSpecJSI_enableTVMenuKey};
2235
+
2236
+
2237
+ methodMap_["disableTVMenuKey"] = MethodMetadata {0, __hostFunction_NativeTVNavigationEventEmitterSpecJSI_disableTVMenuKey};
2238
+
2239
+
2240
+ methodMap_["enableTVPanGesture"] = MethodMetadata {0, __hostFunction_NativeTVNavigationEventEmitterSpecJSI_enableTVPanGesture};
2241
+
2242
+
2243
+ methodMap_["disableTVPanGesture"] = MethodMetadata {0, __hostFunction_NativeTVNavigationEventEmitterSpecJSI_disableTVPanGesture};
2244
+
2245
+
2246
+ methodMap_["enableGestureHandlersCancelTouches"] = MethodMetadata {0, __hostFunction_NativeTVNavigationEventEmitterSpecJSI_enableGestureHandlersCancelTouches};
2247
+
2248
+
2249
+ methodMap_["disableGestureHandlersCancelTouches"] = MethodMetadata {0, __hostFunction_NativeTVNavigationEventEmitterSpecJSI_disableGestureHandlersCancelTouches};
2250
+
2209
2251
  }
2210
2252
  } // namespace facebook::react
2211
2253
 
@@ -2022,6 +2022,12 @@ namespace facebook::react {
2022
2022
 
2023
2023
  - (void)addListener:(NSString *)eventName;
2024
2024
  - (void)removeListeners:(double)count;
2025
+ - (void)enableTVMenuKey;
2026
+ - (void)disableTVMenuKey;
2027
+ - (void)enableTVPanGesture;
2028
+ - (void)disableTVPanGesture;
2029
+ - (void)enableGestureHandlersCancelTouches;
2030
+ - (void)disableGestureHandlersCancelTouches;
2025
2031
 
2026
2032
  @end
2027
2033
 
@@ -2414,11 +2414,53 @@ static jsi::Value __hostFunction_NativeTVNavigationEventEmitterCxxSpecJSI_remove
2414
2414
  );
2415
2415
  return jsi::Value::undefined();
2416
2416
  }
2417
+ static jsi::Value __hostFunction_NativeTVNavigationEventEmitterCxxSpecJSI_enableTVMenuKey(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
2418
+ static_cast<NativeTVNavigationEventEmitterCxxSpecJSI *>(&turboModule)->enableTVMenuKey(
2419
+ rt
2420
+ );
2421
+ return jsi::Value::undefined();
2422
+ }
2423
+ static jsi::Value __hostFunction_NativeTVNavigationEventEmitterCxxSpecJSI_disableTVMenuKey(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
2424
+ static_cast<NativeTVNavigationEventEmitterCxxSpecJSI *>(&turboModule)->disableTVMenuKey(
2425
+ rt
2426
+ );
2427
+ return jsi::Value::undefined();
2428
+ }
2429
+ static jsi::Value __hostFunction_NativeTVNavigationEventEmitterCxxSpecJSI_enableTVPanGesture(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
2430
+ static_cast<NativeTVNavigationEventEmitterCxxSpecJSI *>(&turboModule)->enableTVPanGesture(
2431
+ rt
2432
+ );
2433
+ return jsi::Value::undefined();
2434
+ }
2435
+ static jsi::Value __hostFunction_NativeTVNavigationEventEmitterCxxSpecJSI_disableTVPanGesture(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
2436
+ static_cast<NativeTVNavigationEventEmitterCxxSpecJSI *>(&turboModule)->disableTVPanGesture(
2437
+ rt
2438
+ );
2439
+ return jsi::Value::undefined();
2440
+ }
2441
+ static jsi::Value __hostFunction_NativeTVNavigationEventEmitterCxxSpecJSI_enableGestureHandlersCancelTouches(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
2442
+ static_cast<NativeTVNavigationEventEmitterCxxSpecJSI *>(&turboModule)->enableGestureHandlersCancelTouches(
2443
+ rt
2444
+ );
2445
+ return jsi::Value::undefined();
2446
+ }
2447
+ static jsi::Value __hostFunction_NativeTVNavigationEventEmitterCxxSpecJSI_disableGestureHandlersCancelTouches(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
2448
+ static_cast<NativeTVNavigationEventEmitterCxxSpecJSI *>(&turboModule)->disableGestureHandlersCancelTouches(
2449
+ rt
2450
+ );
2451
+ return jsi::Value::undefined();
2452
+ }
2417
2453
 
2418
2454
  NativeTVNavigationEventEmitterCxxSpecJSI::NativeTVNavigationEventEmitterCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker)
2419
2455
  : TurboModule("TVNavigationEventEmitter", jsInvoker) {
2420
2456
  methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeTVNavigationEventEmitterCxxSpecJSI_addListener};
2421
2457
  methodMap_["removeListeners"] = MethodMetadata {1, __hostFunction_NativeTVNavigationEventEmitterCxxSpecJSI_removeListeners};
2458
+ methodMap_["enableTVMenuKey"] = MethodMetadata {0, __hostFunction_NativeTVNavigationEventEmitterCxxSpecJSI_enableTVMenuKey};
2459
+ methodMap_["disableTVMenuKey"] = MethodMetadata {0, __hostFunction_NativeTVNavigationEventEmitterCxxSpecJSI_disableTVMenuKey};
2460
+ methodMap_["enableTVPanGesture"] = MethodMetadata {0, __hostFunction_NativeTVNavigationEventEmitterCxxSpecJSI_enableTVPanGesture};
2461
+ methodMap_["disableTVPanGesture"] = MethodMetadata {0, __hostFunction_NativeTVNavigationEventEmitterCxxSpecJSI_disableTVPanGesture};
2462
+ methodMap_["enableGestureHandlersCancelTouches"] = MethodMetadata {0, __hostFunction_NativeTVNavigationEventEmitterCxxSpecJSI_enableGestureHandlersCancelTouches};
2463
+ methodMap_["disableGestureHandlersCancelTouches"] = MethodMetadata {0, __hostFunction_NativeTVNavigationEventEmitterCxxSpecJSI_disableGestureHandlersCancelTouches};
2422
2464
  }
2423
2465
  static jsi::Value __hostFunction_NativeVibrationCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
2424
2466
  return static_cast<NativeVibrationCxxSpecJSI *>(&turboModule)->getConstants(
@@ -6632,6 +6632,12 @@ protected:
6632
6632
  public:
6633
6633
  virtual void addListener(jsi::Runtime &rt, jsi::String eventName) = 0;
6634
6634
  virtual void removeListeners(jsi::Runtime &rt, double count) = 0;
6635
+ virtual void enableTVMenuKey(jsi::Runtime &rt) = 0;
6636
+ virtual void disableTVMenuKey(jsi::Runtime &rt) = 0;
6637
+ virtual void enableTVPanGesture(jsi::Runtime &rt) = 0;
6638
+ virtual void disableTVPanGesture(jsi::Runtime &rt) = 0;
6639
+ virtual void enableGestureHandlersCancelTouches(jsi::Runtime &rt) = 0;
6640
+ virtual void disableGestureHandlersCancelTouches(jsi::Runtime &rt) = 0;
6635
6641
 
6636
6642
  };
6637
6643
 
@@ -6678,6 +6684,54 @@ private:
6678
6684
  return bridging::callFromJs<void>(
6679
6685
  rt, &T::removeListeners, jsInvoker_, instance_, std::move(count));
6680
6686
  }
6687
+ void enableTVMenuKey(jsi::Runtime &rt) override {
6688
+ static_assert(
6689
+ bridging::getParameterCount(&T::enableTVMenuKey) == 1,
6690
+ "Expected enableTVMenuKey(...) to have 1 parameters");
6691
+
6692
+ return bridging::callFromJs<void>(
6693
+ rt, &T::enableTVMenuKey, jsInvoker_, instance_);
6694
+ }
6695
+ void disableTVMenuKey(jsi::Runtime &rt) override {
6696
+ static_assert(
6697
+ bridging::getParameterCount(&T::disableTVMenuKey) == 1,
6698
+ "Expected disableTVMenuKey(...) to have 1 parameters");
6699
+
6700
+ return bridging::callFromJs<void>(
6701
+ rt, &T::disableTVMenuKey, jsInvoker_, instance_);
6702
+ }
6703
+ void enableTVPanGesture(jsi::Runtime &rt) override {
6704
+ static_assert(
6705
+ bridging::getParameterCount(&T::enableTVPanGesture) == 1,
6706
+ "Expected enableTVPanGesture(...) to have 1 parameters");
6707
+
6708
+ return bridging::callFromJs<void>(
6709
+ rt, &T::enableTVPanGesture, jsInvoker_, instance_);
6710
+ }
6711
+ void disableTVPanGesture(jsi::Runtime &rt) override {
6712
+ static_assert(
6713
+ bridging::getParameterCount(&T::disableTVPanGesture) == 1,
6714
+ "Expected disableTVPanGesture(...) to have 1 parameters");
6715
+
6716
+ return bridging::callFromJs<void>(
6717
+ rt, &T::disableTVPanGesture, jsInvoker_, instance_);
6718
+ }
6719
+ void enableGestureHandlersCancelTouches(jsi::Runtime &rt) override {
6720
+ static_assert(
6721
+ bridging::getParameterCount(&T::enableGestureHandlersCancelTouches) == 1,
6722
+ "Expected enableGestureHandlersCancelTouches(...) to have 1 parameters");
6723
+
6724
+ return bridging::callFromJs<void>(
6725
+ rt, &T::enableGestureHandlersCancelTouches, jsInvoker_, instance_);
6726
+ }
6727
+ void disableGestureHandlersCancelTouches(jsi::Runtime &rt) override {
6728
+ static_assert(
6729
+ bridging::getParameterCount(&T::disableGestureHandlersCancelTouches) == 1,
6730
+ "Expected disableGestureHandlersCancelTouches(...) to have 1 parameters");
6731
+
6732
+ return bridging::callFromJs<void>(
6733
+ rt, &T::disableGestureHandlersCancelTouches, jsInvoker_, instance_);
6734
+ }
6681
6735
 
6682
6736
  private:
6683
6737
  friend class NativeTVNavigationEventEmitterCxxSpec;
@@ -706,6 +706,11 @@ static NSSet<NSNumber *> *returnKeyTypesSet;
706
706
  }
707
707
 
708
708
  - (void)_restoreTextSelection
709
+ {
710
+ [self _restoreTextSelectionAndIgnoreCaretChange:NO];
711
+ }
712
+
713
+ - (void)_restoreTextSelectionAndIgnoreCaretChange:(BOOL)ignore
709
714
  {
710
715
  const auto &selection = static_cast<const TextInputProps &>(*_props).selection;
711
716
  if (!selection.has_value()) {
@@ -715,6 +720,9 @@ static NSSet<NSNumber *> *returnKeyTypesSet;
715
720
  offset:selection->start];
716
721
  auto end = [_backedTextInputView positionFromPosition:_backedTextInputView.beginningOfDocument offset:selection->end];
717
722
  auto range = [_backedTextInputView textRangeFromPosition:start toPosition:end];
723
+ if (ignore && range.empty) {
724
+ return;
725
+ }
718
726
  [_backedTextInputView setSelectedTextRange:range notifyDelegate:YES];
719
727
  }
720
728
 
@@ -729,19 +737,20 @@ static NSSet<NSNumber *> *returnKeyTypesSet;
729
737
  // Updating the UITextView attributedText, for example changing the lineHeight, the color or adding
730
738
  // a new paragraph with \n, causes the cursor to move to the end of the Text and scroll.
731
739
  // This is fixed by restoring the cursor position and scrolling to that position (iOS issue 652653).
732
- if (selectedRange.empty) {
733
- // Maintaining a cursor position relative to the end of the old text.
734
- NSInteger offsetStart = [_backedTextInputView offsetFromPosition:_backedTextInputView.beginningOfDocument
735
- toPosition:selectedRange.start];
736
- NSInteger offsetFromEnd = oldTextLength - offsetStart;
737
- NSInteger newOffset = attributedString.string.length - offsetFromEnd;
738
- UITextPosition *position = [_backedTextInputView positionFromPosition:_backedTextInputView.beginningOfDocument
739
- offset:newOffset];
740
- [_backedTextInputView setSelectedTextRange:[_backedTextInputView textRangeFromPosition:position toPosition:position]
741
- notifyDelegate:YES];
742
- [_backedTextInputView scrollRangeToVisible:NSMakeRange(offsetStart, 0)];
743
- }
744
- [self _restoreTextSelection];
740
+ // Maintaining a cursor position relative to the end of the old text.
741
+ NSInteger offsetStart = [_backedTextInputView offsetFromPosition:_backedTextInputView.beginningOfDocument
742
+ toPosition:selectedRange.start];
743
+ NSInteger offsetFromEnd = oldTextLength - offsetStart;
744
+ NSInteger newOffset = attributedString.string.length - offsetFromEnd;
745
+ UITextPosition *position = [_backedTextInputView positionFromPosition:_backedTextInputView.beginningOfDocument
746
+ offset:newOffset];
747
+ [_backedTextInputView setSelectedTextRange:[_backedTextInputView textRangeFromPosition:position toPosition:position]
748
+ notifyDelegate:YES];
749
+ [_backedTextInputView scrollRangeToVisible:NSMakeRange(offsetStart, 0)];
750
+
751
+ // A zero-length selection range can cause the caret position to change on iOS,
752
+ // and we have already updated the caret position, so we can safely ignore caret changing in this place.
753
+ [self _restoreTextSelectionAndIgnoreCaretChange:YES];
745
754
  [self _updateTypingAttributes];
746
755
  _lastStringStateWasUpdatedWith = attributedString;
747
756
  }
@@ -67,7 +67,7 @@
67
67
  method:@"emit"
68
68
  withArgs:body ? @[ eventName, body ] : @[ eventName ]];
69
69
  } else {
70
- RCTLogWarn(@"Sending `%@` with no listeners registered.", eventName);
70
+ RCTLogInfo(@"Sending `%@` with no listeners registered.", eventName);
71
71
  }
72
72
  }
73
73
 
@@ -1,4 +1,4 @@
1
- VERSION_NAME=0.79.0-0rc2
1
+ VERSION_NAME=0.79.1-1
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:///Users/expo/workingdir/build/maven_local'
23
+ def mavenTempLocalUrl = 'file:///var/folders/xp/yw_lp59x05d2mp0g0n2f_d240000gn/T/eas-build-workingdir/build/maven_local'
24
24
  // Rewritten when copying this to ReactAndroid/publish.gradle
25
25
 
26
26
  publishing {
@@ -11,6 +11,7 @@ import android.app.Activity
11
11
  import android.util.Pair
12
12
  import android.view.View
13
13
  import com.facebook.react.bridge.DefaultJSExceptionHandler
14
+ import com.facebook.react.bridge.JSExceptionHandler
14
15
  import com.facebook.react.bridge.ReactContext
15
16
  import com.facebook.react.bridge.ReadableArray
16
17
  import com.facebook.react.common.SurfaceDelegate
@@ -34,7 +35,7 @@ import java.io.File
34
35
  */
35
36
  public open class ReleaseDevSupportManager : DevSupportManager {
36
37
 
37
- private val defaultJSExceptionHandler: DefaultJSExceptionHandler = DefaultJSExceptionHandler()
38
+ private val defaultJSExceptionHandler: JSExceptionHandler = DefaultJSExceptionHandler()
38
39
 
39
40
  public override fun showNewJavaError(message: String?, e: Throwable?): Unit = Unit
40
41
 
@@ -173,7 +173,7 @@ public class FabricUIManager
173
173
  private final CopyOnWriteArrayList<UIManagerListener> mListeners = new CopyOnWriteArrayList<>();
174
174
 
175
175
  private boolean mMountNotificationScheduled = false;
176
- private final List<Integer> mMountedSurfaceIds = new ArrayList<>();
176
+ private List<Integer> mSurfaceIdsWithPendingMountNotification = new ArrayList<>();
177
177
 
178
178
  @ThreadConfined(UI)
179
179
  @NonNull
@@ -1254,12 +1254,15 @@ public class FabricUIManager
1254
1254
 
1255
1255
  // Collect surface IDs for all the mount items
1256
1256
  for (MountItem mountItem : mountItems) {
1257
- if (mountItem != null && !mMountedSurfaceIds.contains(mountItem.getSurfaceId())) {
1258
- mMountedSurfaceIds.add(mountItem.getSurfaceId());
1257
+ if (mountItem != null
1258
+ && !mSurfaceIdsWithPendingMountNotification.contains(mountItem.getSurfaceId())) {
1259
+ mSurfaceIdsWithPendingMountNotification.add(mountItem.getSurfaceId());
1259
1260
  }
1260
1261
  }
1261
1262
 
1262
- if (!mMountNotificationScheduled && !mMountedSurfaceIds.isEmpty()) {
1263
+ if (!mMountNotificationScheduled && !mSurfaceIdsWithPendingMountNotification.isEmpty()) {
1264
+ mMountNotificationScheduled = true;
1265
+
1263
1266
  // Notify mount when the effects are visible and prevent mount hooks to
1264
1267
  // delay paint.
1265
1268
  UiThreadUtil.getUiThreadHandler()
@@ -1269,17 +1272,19 @@ public class FabricUIManager
1269
1272
  public void run() {
1270
1273
  mMountNotificationScheduled = false;
1271
1274
 
1275
+ // Create a copy in case mount hooks trigger more mutations
1276
+ final List<Integer> surfaceIdsToReportMount =
1277
+ mSurfaceIdsWithPendingMountNotification;
1278
+ mSurfaceIdsWithPendingMountNotification = new ArrayList<>();
1279
+
1272
1280
  final @Nullable FabricUIManagerBinding binding = mBinding;
1273
1281
  if (binding == null || mDestroyed) {
1274
- mMountedSurfaceIds.clear();
1275
1282
  return;
1276
1283
  }
1277
1284
 
1278
- for (int surfaceId : mMountedSurfaceIds) {
1285
+ for (int surfaceId : surfaceIdsToReportMount) {
1279
1286
  binding.reportMount(surfaceId);
1280
1287
  }
1281
-
1282
- mMountedSurfaceIds.clear();
1283
1288
  }
1284
1289
  });
1285
1290
  }
@@ -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", 0,
21
- "prerelease", "0rc2");
20
+ "patch", 1,
21
+ "prerelease", "1");
22
22
  }
@@ -17,8 +17,8 @@ namespace facebook::react {
17
17
  constexpr struct {
18
18
  int32_t Major = 0;
19
19
  int32_t Minor = 79;
20
- int32_t Patch = 0;
21
- std::string_view Prerelease = "0rc2";
20
+ int32_t Patch = 1;
21
+ std::string_view Prerelease = "1";
22
22
  } ReactNativeVersion;
23
23
 
24
24
  } // namespace facebook::react
@@ -38,7 +38,8 @@ Pod::Spec.new do |s|
38
38
  s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags
39
39
  s.pod_target_xcconfig = {
40
40
  "HEADER_SEARCH_PATHS" => "\"${PODS_ROOT}/hermes-engine/destroot/include\" \"$(PODS_TARGET_SRCROOT)/..\" \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/fmt/include\"",
41
- "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard()
41
+ "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
42
+ "DEFINES_MODULE" => "YES",
42
43
  }
43
44
  s.header_dir = "reacthermes"
44
45
  s.dependency "React-cxxreact", version
@@ -48,8 +48,11 @@ Pod::Spec.new do |s|
48
48
  s.header_mappings_dir = "./"
49
49
  end
50
50
 
51
- s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => header_search_paths.join(" "),
52
- "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard() }
51
+ s.pod_target_xcconfig = {
52
+ "HEADER_SEARCH_PATHS" => header_search_paths.join(" "),
53
+ "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
54
+ "DEFINES_MODULE" => "YES",
55
+ }
53
56
 
54
57
  s.dependency "React-cxxreact", version
55
58
  s.dependency "React-jsi", version
@@ -7,6 +7,8 @@
7
7
 
8
8
  #pragma once
9
9
 
10
+ #ifdef __cplusplus
11
+
10
12
  #include <ReactCommon/RuntimeExecutor.h>
11
13
  #include <cxxreact/MessageQueueThread.h>
12
14
  #include <jsi/jsi.h>
@@ -72,3 +74,5 @@ class JSIRuntimeHolder : public JSRuntime {
72
74
  };
73
75
 
74
76
  } // namespace facebook::react
77
+
78
+ #endif // __cplusplus
@@ -57,7 +57,7 @@ static jsi::Value convertNSNumberToJSINumber(jsi::Runtime &runtime, NSNumber *va
57
57
 
58
58
  static jsi::String convertNSStringToJSIString(jsi::Runtime &runtime, NSString *value)
59
59
  {
60
- return jsi::String::createFromUtf8(runtime, [value UTF8String] ?: "");
60
+ return jsi::String::createFromUtf8(runtime, [value UTF8String] ? [value UTF8String] : "");
61
61
  }
62
62
 
63
63
  static jsi::Object convertNSDictionaryToJSIObject(jsi::Runtime &runtime, NSDictionary *value)
@@ -213,7 +213,11 @@ static jsi::Value createJSRuntimeError(jsi::Runtime &runtime, const std::string
213
213
  /**
214
214
  * Creates JSError with current JS runtime and NSException stack trace.
215
215
  */
216
- static jsi::JSError convertNSExceptionToJSError(jsi::Runtime &runtime, NSException *exception)
216
+ static jsi::JSError convertNSExceptionToJSError(
217
+ jsi::Runtime &runtime,
218
+ NSException *exception,
219
+ const std::string &moduleName,
220
+ const std::string &methodName)
217
221
  {
218
222
  std::string reason = [exception.reason UTF8String];
219
223
 
@@ -224,7 +228,8 @@ static jsi::JSError convertNSExceptionToJSError(jsi::Runtime &runtime, NSExcepti
224
228
  cause.setProperty(
225
229
  runtime, "stackReturnAddresses", convertNSArrayToJSIArray(runtime, exception.callStackReturnAddresses));
226
230
 
227
- jsi::Value error = createJSRuntimeError(runtime, "Exception in HostFunction: " + reason);
231
+ std::string message = moduleName + "." + methodName + " raised an exception: " + reason;
232
+ jsi::Value error = createJSRuntimeError(runtime, message);
228
233
  error.asObject(runtime).setProperty(runtime, "cause", std::move(cause));
229
234
  return {runtime, std::move(error)};
230
235
  }
@@ -356,28 +361,34 @@ id ObjCTurboModule::performMethodInvocation(
356
361
  }
357
362
 
358
363
  if (isSync) {
359
- TurboModulePerfLogger::syncMethodCallExecutionStart(moduleName, methodNameStr.c_str());
364
+ TurboModulePerfLogger::syncMethodCallExecutionStart(moduleName, methodName);
360
365
  } else {
361
- TurboModulePerfLogger::asyncMethodCallExecutionStart(moduleName, methodNameStr.c_str(), asyncCallCounter);
366
+ TurboModulePerfLogger::asyncMethodCallExecutionStart(moduleName, methodName, asyncCallCounter);
362
367
  }
363
368
 
364
369
  @try {
365
370
  [inv invokeWithTarget:strongModule];
366
371
  } @catch (NSException *exception) {
367
- throw convertNSExceptionToJSError(runtime, exception);
372
+ if (isSync) {
373
+ // We can only convert NSException to JSError in sync method calls.
374
+ // See https://github.com/reactwg/react-native-new-architecture/discussions/276#discussioncomment-12567155
375
+ throw convertNSExceptionToJSError(runtime, exception, std::string{moduleName}, methodNameStr);
376
+ } else {
377
+ @throw exception;
378
+ }
368
379
  } @finally {
369
380
  [retainedObjectsForInvocation removeAllObjects];
370
381
  }
371
382
 
372
383
  if (!isSync) {
373
- TurboModulePerfLogger::asyncMethodCallExecutionEnd(moduleName, methodNameStr.c_str(), asyncCallCounter);
384
+ TurboModulePerfLogger::asyncMethodCallExecutionEnd(moduleName, methodName, asyncCallCounter);
374
385
  return;
375
386
  }
376
387
 
377
388
  void *rawResult;
378
389
  [inv getReturnValue:&rawResult];
379
390
  result = (__bridge id)rawResult;
380
- TurboModulePerfLogger::syncMethodCallExecutionEnd(moduleName, methodNameStr.c_str());
391
+ TurboModulePerfLogger::syncMethodCallExecutionEnd(moduleName, methodName);
381
392
  };
382
393
 
383
394
  if (isSync) {
@@ -419,23 +430,23 @@ void ObjCTurboModule::performVoidMethodInvocation(
419
430
  }
420
431
 
421
432
  if (shouldVoidMethodsExecuteSync_) {
422
- TurboModulePerfLogger::syncMethodCallExecutionStart(moduleName, methodNameStr.c_str());
433
+ TurboModulePerfLogger::syncMethodCallExecutionStart(moduleName, methodName);
423
434
  } else {
424
- TurboModulePerfLogger::asyncMethodCallExecutionStart(moduleName, methodNameStr.c_str(), asyncCallCounter);
435
+ TurboModulePerfLogger::asyncMethodCallExecutionStart(moduleName, methodName, asyncCallCounter);
425
436
  }
426
437
 
427
438
  @try {
428
439
  [inv invokeWithTarget:strongModule];
429
440
  } @catch (NSException *exception) {
430
- throw convertNSExceptionToJSError(runtime, exception);
441
+ throw convertNSExceptionToJSError(runtime, exception, std::string{moduleName}, methodNameStr);
431
442
  } @finally {
432
443
  [retainedObjectsForInvocation removeAllObjects];
433
444
  }
434
445
 
435
446
  if (shouldVoidMethodsExecuteSync_) {
436
- TurboModulePerfLogger::syncMethodCallExecutionEnd(moduleName, methodNameStr.c_str());
447
+ TurboModulePerfLogger::syncMethodCallExecutionEnd(moduleName, methodName);
437
448
  } else {
438
- TurboModulePerfLogger::asyncMethodCallExecutionEnd(moduleName, methodNameStr.c_str(), asyncCallCounter);
449
+ TurboModulePerfLogger::asyncMethodCallExecutionEnd(moduleName, methodName, asyncCallCounter);
439
450
  }
440
451
 
441
452
  return;
@@ -36,7 +36,9 @@ Pod::Spec.new do |s|
36
36
  s.exclude_files = "tests"
37
37
  s.pod_target_xcconfig = {
38
38
  "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
39
- "HEADER_SEARCH_PATHS" => header_search_paths.join(' ')}
39
+ "HEADER_SEARCH_PATHS" => header_search_paths.join(' '),
40
+ "DEFINES_MODULE" => "YES",
41
+ }
40
42
 
41
43
  if ENV['USE_FRAMEWORKS']
42
44
  s.module_name = "React_renderercss"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-tvos",
3
- "version": "0.79.0-0rc2",
3
+ "version": "0.79.1-1",
4
4
  "description": "A framework for building native apps using React",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -112,12 +112,12 @@
112
112
  },
113
113
  "dependencies": {
114
114
  "@jest/create-cache-key-function": "^29.7.0",
115
- "@react-native/assets-registry": "0.79.0-rc.2",
116
- "@react-native/codegen": "0.79.0-rc.2",
117
- "@react-native/community-cli-plugin": "0.79.0-rc.2",
118
- "@react-native/gradle-plugin": "0.79.0-rc.2",
119
- "@react-native/js-polyfills": "0.79.0-rc.2",
120
- "@react-native/normalize-colors": "0.79.0-rc.2",
115
+ "@react-native/assets-registry": "0.79.1",
116
+ "@react-native/codegen": "0.79.1",
117
+ "@react-native/community-cli-plugin": "0.79.1",
118
+ "@react-native/gradle-plugin": "0.79.1",
119
+ "@react-native/js-polyfills": "0.79.1",
120
+ "@react-native/normalize-colors": "0.79.1",
121
121
  "abort-controller": "^3.0.0",
122
122
  "anser": "^1.4.9",
123
123
  "ansi-regex": "^5.0.0",
@@ -146,7 +146,7 @@
146
146
  "whatwg-fetch": "^3.0.0",
147
147
  "ws": "^6.2.3",
148
148
  "yargs": "^17.6.2",
149
- "@react-native-tvos/virtualized-lists": "0.79.0-0rc2"
149
+ "@react-native-tvos/virtualized-lists": "0.79.1-1"
150
150
  },
151
151
  "codegenConfig": {
152
152
  "libraries": [
@@ -1082,19 +1082,19 @@ function execute(projectRoot, targetPlatform, baseOutputPath, source) {
1082
1082
  platform,
1083
1083
  );
1084
1084
 
1085
- if (source === 'app') {
1086
- // These components are only required by apps, not by libraries
1085
+ if (source === 'app' && platform !== 'android') {
1086
+ // These components are only required by apps, not by libraries. They are also Apple specific.
1087
1087
  generateRCTThirdPartyComponents(libraries, outputPath);
1088
1088
  generateRCTModuleProviders(projectRoot, pkgJson, libraries, outputPath);
1089
1089
  generateCustomURLHandlers(libraries, outputPath);
1090
1090
  generateAppDependencyProvider(outputPath);
1091
+ generateReactCodegenPodspec(
1092
+ projectRoot,
1093
+ pkgJson,
1094
+ outputPath,
1095
+ baseOutputPath,
1096
+ );
1091
1097
  }
1092
- generateReactCodegenPodspec(
1093
- projectRoot,
1094
- pkgJson,
1095
- outputPath,
1096
- baseOutputPath,
1097
- );
1098
1098
 
1099
1099
  cleanupEmptyFilesAndFolders(outputPath);
1100
1100
  }
Binary file
Binary file
Binary file
@@ -15,6 +15,12 @@ import * as TurboModuleRegistry from '../../../../Libraries/TurboModule/TurboMod
15
15
  export interface Spec extends TurboModule {
16
16
  +addListener: (eventName: string) => void;
17
17
  +removeListeners: (count: number) => void;
18
+ +enableTVMenuKey: () => void;
19
+ +disableTVMenuKey: () => void;
20
+ +enableTVPanGesture: () => void;
21
+ +disableTVPanGesture: () => void;
22
+ +enableGestureHandlersCancelTouches: () => void;
23
+ +disableGestureHandlersCancelTouches: () => void;
18
24
  }
19
25
 
20
26
  export default (TurboModuleRegistry.get<Spec>('TVNavigationEventEmitter'): ?Spec);
@@ -1,16 +0,0 @@
1
- //
2
- // RCTTVMenuBridge.h
3
- //
4
- // Created by Douglas Lowder on 6/4/19.
5
- //
6
-
7
- #import <UIKit/UIKit.h>
8
- #import <React/RCTBridgeModule.h>
9
-
10
- NS_ASSUME_NONNULL_BEGIN
11
-
12
- @interface RCTTVMenuBridge : NSObject <RCTBridgeModule>
13
-
14
- @end
15
-
16
- NS_ASSUME_NONNULL_END
@@ -1,49 +0,0 @@
1
- //
2
- // RCTTVMenuBridge.m
3
- //
4
- // Created by Douglas Lowder on 6/4/19.
5
- //
6
-
7
- #import "RCTTVMenuBridge.h"
8
- #import <React/RCTRootView.h>
9
- #import <React/RCTTVRemoteHandler.h>
10
-
11
- @implementation RCTTVMenuBridge
12
-
13
- RCT_EXPORT_MODULE();
14
-
15
- RCT_EXPORT_METHOD(enableTVMenuKey)
16
- {
17
- [RCTTVRemoteHandler setUseMenuKey:YES];
18
- [[NSNotificationCenter defaultCenter] postNotificationName:RCTTVEnableMenuKeyNotification object:nil];
19
- }
20
-
21
- RCT_EXPORT_METHOD(disableTVMenuKey)
22
- {
23
- [RCTTVRemoteHandler setUseMenuKey:NO];
24
- [[NSNotificationCenter defaultCenter] postNotificationName:RCTTVDisableMenuKeyNotification object:nil];
25
- }
26
-
27
- RCT_EXPORT_METHOD(enableTVPanGesture)
28
- {
29
- [RCTTVRemoteHandler setUsePanGesture:YES];
30
- [[NSNotificationCenter defaultCenter] postNotificationName:RCTTVEnablePanGestureNotification object:nil];
31
- }
32
-
33
- RCT_EXPORT_METHOD(disableTVPanGesture)
34
- {
35
- [RCTTVRemoteHandler setUsePanGesture:NO];
36
- [[NSNotificationCenter defaultCenter] postNotificationName:RCTTVDisablePanGestureNotification object:nil];
37
- }
38
-
39
- RCT_EXPORT_METHOD(enableGestureHandlersCancelTouches) {
40
- [RCTTVRemoteHandler setGestureHandlersCancelTouches:YES];
41
- [[NSNotificationCenter defaultCenter] postNotificationName:RCTTVEnableGestureHandlersCancelTouchesNotification object:nil];
42
- }
43
-
44
- RCT_EXPORT_METHOD(disableGestureHandlersCancelTouches) {
45
- [RCTTVRemoteHandler setGestureHandlersCancelTouches:NO];
46
- [[NSNotificationCenter defaultCenter] postNotificationName:RCTTVDisableGestureHandlersCancelTouchesNotification object:nil];
47
- }
48
-
49
- @end