react-native-tvos 0.79.0-0 → 0.79.1-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 (25) hide show
  1. package/Libraries/Components/TV/TVEventControl.js +13 -7
  2. package/Libraries/Core/ReactNativeVersion.js +1 -1
  3. package/Libraries/Utilities/BackHandler.ios.js +1 -1
  4. package/README.md +2 -2
  5. package/React/Base/RCTVersion.m +1 -1
  6. package/React/CoreModules/RCTTVNavigationEventEmitter.mm +38 -0
  7. package/React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec-generated.mm +42 -0
  8. package/React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec.h +6 -0
  9. package/React/FBReactNativeSpec/FBReactNativeSpecJSI-generated.cpp +42 -0
  10. package/React/FBReactNativeSpec/FBReactNativeSpecJSI.h +54 -0
  11. package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +22 -13
  12. package/React/Modules/RCTEventEmitter.m +1 -1
  13. package/ReactAndroid/gradle.properties +1 -1
  14. package/ReactAndroid/publish.gradle +1 -1
  15. package/ReactAndroid/src/main/java/com/facebook/react/devsupport/ReleaseDevSupportManager.kt +2 -1
  16. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
  17. package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
  18. package/package.json +8 -8
  19. package/scripts/codegen/generate-artifacts-executor.js +8 -8
  20. package/sdks/hermesc/osx-bin/hermes +0 -0
  21. package/sdks/hermesc/osx-bin/hermesc +0 -0
  22. package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
  23. package/src/private/specs_DEPRECATED/modules/NativeTVNavigationEventEmitter.js +6 -0
  24. package/React/Modules/RCTTVMenuBridge.h +0 -16
  25. package/React/Modules/RCTTVMenuBridge.m +0 -49
@@ -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,7 +16,7 @@ const version: $ReadOnly<{
16
16
  }> = {
17
17
  major: 0,
18
18
  minor: 79,
19
- patch: 0,
19
+ patch: 1,
20
20
  prerelease: '0',
21
21
  };
22
22
 
@@ -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,7 +23,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
23
23
  __rnVersion = @{
24
24
  RCTVersionMajor: @(0),
25
25
  RCTVersionMinor: @(79),
26
- RCTVersionPatch: @(0),
26
+ RCTVersionPatch: @(1),
27
27
  RCTVersionPrerelease: @"0",
28
28
  };
29
29
  });
@@ -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,43 @@ 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
+ RCT_EXPORT_METHOD(enableTVMenuKey)
63
+ {
64
+ [RCTTVRemoteHandler setUseMenuKey:YES];
65
+ [[NSNotificationCenter defaultCenter] postNotificationName:RCTTVEnableMenuKeyNotification object:nil];
66
+ }
67
+
68
+ RCT_EXPORT_METHOD(disableTVMenuKey)
69
+ {
70
+ [RCTTVRemoteHandler setUseMenuKey:NO];
71
+ [[NSNotificationCenter defaultCenter] postNotificationName:RCTTVDisableMenuKeyNotification object:nil];
72
+ }
73
+
74
+ RCT_EXPORT_METHOD(enableTVPanGesture)
75
+ {
76
+ [RCTTVRemoteHandler setUsePanGesture:YES];
77
+ [[NSNotificationCenter defaultCenter] postNotificationName:RCTTVEnablePanGestureNotification object:nil];
78
+ }
79
+
80
+ RCT_EXPORT_METHOD(disableTVPanGesture)
81
+ {
82
+ [RCTTVRemoteHandler setUsePanGesture:NO];
83
+ [[NSNotificationCenter defaultCenter] postNotificationName:RCTTVDisablePanGestureNotification object:nil];
84
+ }
85
+
86
+ RCT_EXPORT_METHOD(enableGestureHandlersCancelTouches) {
87
+ [RCTTVRemoteHandler setGestureHandlersCancelTouches:YES];
88
+ [[NSNotificationCenter defaultCenter] postNotificationName:RCTTVEnableGestureHandlersCancelTouchesNotification object:nil];
89
+ }
90
+
91
+ RCT_EXPORT_METHOD(disableGestureHandlersCancelTouches) {
92
+ [RCTTVRemoteHandler setGestureHandlersCancelTouches:NO];
93
+ [[NSNotificationCenter defaultCenter] postNotificationName:RCTTVDisableGestureHandlersCancelTouchesNotification object:nil];
94
+ }
95
+
58
96
  @end
59
97
 
60
98
  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-0
1
+ VERSION_NAME=0.79.1-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 {
@@ -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
 
@@ -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,
20
+ "patch", 1,
21
21
  "prerelease", "0");
22
22
  }
@@ -17,7 +17,7 @@ namespace facebook::react {
17
17
  constexpr struct {
18
18
  int32_t Major = 0;
19
19
  int32_t Minor = 79;
20
- int32_t Patch = 0;
20
+ int32_t Patch = 1;
21
21
  std::string_view Prerelease = "0";
22
22
  } ReactNativeVersion;
23
23
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-tvos",
3
- "version": "0.79.0-0",
3
+ "version": "0.79.1-0",
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",
116
- "@react-native/codegen": "0.79.0",
117
- "@react-native/community-cli-plugin": "0.79.0",
118
- "@react-native/gradle-plugin": "0.79.0",
119
- "@react-native/js-polyfills": "0.79.0",
120
- "@react-native/normalize-colors": "0.79.0",
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-0"
149
+ "@react-native-tvos/virtualized-lists": "0.79.1-0"
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