react-native-tvos 0.73.1-3 → 0.73.2-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.
@@ -12,6 +12,6 @@
12
12
  exports.version = {
13
13
  major: 0,
14
14
  minor: 73,
15
- patch: 1,
16
- prerelease: '3',
15
+ patch: 2,
16
+ prerelease: '0',
17
17
  };
@@ -34,6 +34,11 @@ let rejectionTrackingOptions: $NonMaybeType<Parameters<enable>[0]> = {
34
34
  ? rejection
35
35
  : JSON.stringify((rejection: $FlowFixMe));
36
36
  }
37
+ // It could although this object is not a standard error, it still has stack information to unwind
38
+ // $FlowFixMe ignore types just check if stack is there
39
+ if (rejection.stack && typeof rejection.stack === 'string') {
40
+ stack = rejection.stack;
41
+ }
37
42
  }
38
43
 
39
44
  const warning = `Possible unhandled promise rejection (id: ${id}):\n${
package/README.md CHANGED
@@ -74,21 +74,22 @@ See [this document](https://docs.expo.dev/bare/using-expo-cli/) for more details
74
74
 
75
75
  ## _(New)_ Using the Expo SDK with TV apps
76
76
 
77
- Starting with the Expo SDK 50 preview, and react-native-tvos 0.73.x, it will be possible to create Expo apps, and build them for TV via a new config plugin.
77
+ See the [Building Expo apps for TV](https://docs.expo.dev/guides/building-for-tv/) guide from Expo for details, including supported Expo modules and limitations.
78
78
 
79
- This functionality will be new in Expo SDK 50, and will be considered an experimental feature for now.
79
+ Expo SDK 50 or greater, and react-native-tvos 0.73.x or later, are required.
80
80
 
81
- The fastest way to generate a new project is described in the [TV Example](https://github.com/expo/examples/tree/master/with-tv) in the Expo examples repo.
81
+ ## _(New)_ How to support TV specific file extensions
82
82
 
83
- Besides most of the core Expo modules, these also work on TV:
83
+ 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)
84
84
 
85
- - expo-av
86
- - expo-image
87
- - expo-localization
88
- - expo-updates
85
+ When this is enabled, Metro will resolve files in the following order of preference (and similarly for the other supported file extensions):
89
86
 
90
- TV does NOT support dev client (dev menu, dev launcher) at this time.
91
- TV does NOT support Expo Router at this time.
87
+ - `file.ios.tv.tsx` or `file.android.tv.tsx`
88
+ - `file.tv.tsx`
89
+ - `file.ios.tsx` or `file.android.tsx`
90
+ - `file.tsx`
91
+
92
+ This config is not enabled by default, since it will impact bundling performance, but is available for developers who need this capability.
92
93
 
93
94
  ## Code changes
94
95
 
@@ -23,8 +23,8 @@ NSDictionary* RCTGetReactNativeVersion(void)
23
23
  __rnVersion = @{
24
24
  RCTVersionMajor: @(0),
25
25
  RCTVersionMinor: @(73),
26
- RCTVersionPatch: @(1),
27
- RCTVersionPrerelease: @"3",
26
+ RCTVersionPatch: @(2),
27
+ RCTVersionPrerelease: @"0",
28
28
  };
29
29
  });
30
30
  return __rnVersion;
@@ -51,7 +51,8 @@ using namespace facebook::react;
51
51
  BOOL _removeClippedSubviews;
52
52
  NSMutableArray<UIView *> *_reactSubviews;
53
53
  BOOL _motionEffectsAdded;
54
- UITapGestureRecognizer *_selectRecognizer;
54
+ UITapGestureRecognizer *_selectRecognizer;
55
+ UILongPressGestureRecognizer * _longSelectRecognizer;
55
56
  NSSet<NSString *> *_Nullable _propKeysManagedByAnimated_DO_NOT_USE_THIS_IS_BROKEN;
56
57
  ParallaxProperties _tvParallaxProperties;
57
58
  BOOL _hasTVPreferredFocus;
@@ -249,6 +250,11 @@ using namespace facebook::react;
249
250
  [self sendNotificationWithEventType:@"select"];
250
251
  }
251
252
 
253
+ - (void)sendLongSelectNotification:(UIGestureRecognizer *)recognizer
254
+ {
255
+ [self sendNotificationWithEventType:@"longSelect"];
256
+ }
257
+
252
258
  - (void)sendNotificationWithEventType:(NSString * __nonnull)eventType
253
259
  {
254
260
  [[NSNotificationCenter defaultCenter] postNotificationName:@"RCTTVNavigationEventNotification"
@@ -292,6 +298,13 @@ using namespace facebook::react;
292
298
  }
293
299
  }
294
300
 
301
+ - (void)handleLongSelect:(UIGestureRecognizer *)r
302
+ {
303
+ if (r.state == UIGestureRecognizerStateBegan) {
304
+ [self sendLongSelectNotification:r];
305
+ }
306
+ }
307
+
295
308
  - (void)addParallaxMotionEffects
296
309
  {
297
310
  if(!_tvParallaxProperties.enabled) {
@@ -887,11 +900,21 @@ using namespace facebook::react;
887
900
  action:@selector(handleSelect:)];
888
901
  recognizer.allowedPressTypes = @[ @(UIPressTypeSelect) ];
889
902
  _selectRecognizer = recognizer;
903
+
904
+ UILongPressGestureRecognizer *longRecognizer = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleLongSelect:)];
905
+ recognizer.allowedPressTypes = @[ @(UIPressTypeSelect) ];
906
+ [self addGestureRecognizer:longRecognizer];
907
+ _longSelectRecognizer = longRecognizer;
908
+
890
909
  [self addGestureRecognizer:_selectRecognizer];
910
+ [self addGestureRecognizer:_longSelectRecognizer];
891
911
  } else {
892
912
  if (_selectRecognizer) {
893
913
  [self removeGestureRecognizer:_selectRecognizer];
894
914
  }
915
+ if (_longSelectRecognizer) {
916
+ [self removeGestureRecognizer:_longSelectRecognizer];
917
+ }
895
918
  }
896
919
  }
897
920
  // `tvParallaxProperties
@@ -22,6 +22,7 @@
22
22
  @implementation RCTTVView {
23
23
  __weak RCTBridge *_bridge;
24
24
  UITapGestureRecognizer *_selectRecognizer;
25
+ UILongPressGestureRecognizer * _longSelectRecognizer;
25
26
  BOOL motionEffectsAdded;
26
27
  NSArray* focusDestinations;
27
28
  id<UIFocusItem> previouslyFocusedItem;
@@ -79,11 +80,21 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : unused)
79
80
  action:@selector(handleSelect:)];
80
81
  recognizer.allowedPressTypes = @[ @(UIPressTypeSelect) ];
81
82
  _selectRecognizer = recognizer;
83
+
84
+ UILongPressGestureRecognizer *longRecognizer = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleLongSelect:)];
85
+ recognizer.allowedPressTypes = @[ @(UIPressTypeSelect) ];
86
+ [self addGestureRecognizer:longRecognizer];
87
+ _longSelectRecognizer = longRecognizer;
88
+
82
89
  [self addGestureRecognizer:_selectRecognizer];
90
+ [self addGestureRecognizer:_longSelectRecognizer];
83
91
  } else {
84
92
  if (_selectRecognizer) {
85
93
  [self removeGestureRecognizer:_selectRecognizer];
86
94
  }
95
+ if (_longSelectRecognizer) {
96
+ [self removeGestureRecognizer:_longSelectRecognizer];
97
+ }
87
98
  }
88
99
  }
89
100
 
@@ -120,6 +131,13 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : unused)
120
131
  }
121
132
  }
122
133
 
134
+ - (void)handleLongSelect:(UIGestureRecognizer *)r
135
+ {
136
+ if (r.state == UIGestureRecognizerStateBegan) {
137
+ [self sendLongSelectNotification:r];
138
+ }
139
+ }
140
+
123
141
  - (BOOL)isUserInteractionEnabled
124
142
  {
125
143
  return YES;
@@ -414,6 +432,11 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : unused)
414
432
  [self sendNotificationWithEventType:@"select"];
415
433
  }
416
434
 
435
+ - (void)sendLongSelectNotification:(UIGestureRecognizer *)recognizer
436
+ {
437
+ [self sendNotificationWithEventType:@"longSelect"];
438
+ }
439
+
417
440
  - (void)sendNotificationWithEventType:(NSString * __nonnull)eventType
418
441
  {
419
442
  [[NSNotificationCenter defaultCenter] postNotificationName:@"RCTTVNavigationEventNotification"
@@ -614,6 +614,10 @@ static inline void RCTApplyTransformationAccordingLayoutDirection(
614
614
 
615
615
  - (void)scrollToOffset:(CGPoint)offset animated:(BOOL)animated
616
616
  {
617
+ if ([self reactLayoutDirection] == UIUserInterfaceLayoutDirectionRightToLeft) {
618
+ offset.x = _scrollView.contentSize.width - _scrollView.frame.size.width - offset.x;
619
+ }
620
+
617
621
  if (!CGPointEqualToPoint(_scrollView.contentOffset, offset)) {
618
622
  CGRect maxRect = CGRectMake(
619
623
  fmin(-_scrollView.contentInset.left, 0),
@@ -263,7 +263,7 @@ task createNativeDepsDirectories {
263
263
  }
264
264
 
265
265
  task downloadBoost(dependsOn: createNativeDepsDirectories, type: Download) {
266
- src("https://boostorg.jfrog.io/artifactory/main/release/${BOOST_VERSION.replace("_", ".")}/source/boost_${BOOST_VERSION}.tar.gz")
266
+ src("https://archives.boost.io/release/${BOOST_VERSION.replace("_", ".")}/source/boost_${BOOST_VERSION}.tar.gz")
267
267
  onlyIfModified(true)
268
268
  overwrite(false)
269
269
  retries(5)
@@ -1,4 +1,4 @@
1
- VERSION_NAME=0.73.1-3
1
+ VERSION_NAME=0.73.2-0
2
2
 
3
3
  # react.internal.publishingGroup=com.facebook.react
4
4
  # For TV use this group
@@ -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", 73,
20
- "patch", 1,
21
- "prerelease", "3");
20
+ "patch", 2,
21
+ "prerelease", "0");
22
22
  }
@@ -10,6 +10,8 @@ package com.facebook.react.views.textinput;
10
10
  import static com.facebook.react.uimanager.UIManagerHelper.getReactContext;
11
11
 
12
12
  import android.app.UiModeManager;
13
+ import android.content.ClipData;
14
+ import android.content.ClipboardManager;
13
15
  import android.content.Context;
14
16
  import android.content.res.Configuration;
15
17
  import android.graphics.Color;
@@ -212,7 +214,9 @@ public class ReactEditText extends AppCompatEditText {
212
214
  public void onDestroyActionMode(ActionMode mode) {}
213
215
  };
214
216
  setCustomSelectionActionModeCallback(customActionModeCallback);
215
- setCustomInsertionActionModeCallback(customActionModeCallback);
217
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
218
+ setCustomInsertionActionModeCallback(customActionModeCallback);
219
+ }
216
220
  }
217
221
 
218
222
  @Override
@@ -329,7 +333,26 @@ public class ReactEditText extends AppCompatEditText {
329
333
  @Override
330
334
  public boolean onTextContextMenuItem(int id) {
331
335
  if (id == android.R.id.paste) {
332
- id = android.R.id.pasteAsPlainText;
336
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
337
+ id = android.R.id.pasteAsPlainText;
338
+ } else {
339
+ ClipboardManager clipboard =
340
+ (ClipboardManager) getContext().getSystemService(Context.CLIPBOARD_SERVICE);
341
+ ClipData previousClipData = clipboard.getPrimaryClip();
342
+ if (previousClipData != null) {
343
+ for (int i = 0; i < previousClipData.getItemCount(); i++) {
344
+ final CharSequence text = previousClipData.getItemAt(i).coerceToText(getContext());
345
+ final CharSequence paste = (text instanceof Spanned) ? text.toString() : text;
346
+ if (paste != null) {
347
+ ClipData clipData = ClipData.newPlainText(null, text);
348
+ clipboard.setPrimaryClip(clipData);
349
+ }
350
+ }
351
+ boolean actionPerformed = super.onTextContextMenuItem(id);
352
+ clipboard.setPrimaryClip(previousClipData);
353
+ return actionPerformed;
354
+ }
355
+ }
333
356
  }
334
357
  return super.onTextContextMenuItem(id);
335
358
  }
@@ -715,8 +738,10 @@ public class ReactEditText extends AppCompatEditText {
715
738
  }
716
739
  mDisableTextDiffing = false;
717
740
 
718
- if (getBreakStrategy() != reactTextUpdate.getTextBreakStrategy()) {
719
- setBreakStrategy(reactTextUpdate.getTextBreakStrategy());
741
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
742
+ if (getBreakStrategy() != reactTextUpdate.getTextBreakStrategy()) {
743
+ setBreakStrategy(reactTextUpdate.getTextBreakStrategy());
744
+ }
720
745
  }
721
746
 
722
747
  // Update cached spans (in Fabric only).
@@ -17,8 +17,8 @@ namespace facebook::react {
17
17
  constexpr struct {
18
18
  int32_t Major = 0;
19
19
  int32_t Minor = 73;
20
- int32_t Patch = 1;
21
- std::string_view Prerelease = "3";
20
+ int32_t Patch = 2;
21
+ std::string_view Prerelease = "0";
22
22
  } ReactNativeVersion;
23
23
 
24
24
  } // namespace facebook::react
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-tvos",
3
- "version": "0.73.1-3",
3
+ "version": "0.73.2-0",
4
4
  "description": "A framework for building native apps using React",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -94,11 +94,11 @@
94
94
  },
95
95
  "dependencies": {
96
96
  "@jest/create-cache-key-function": "^29.6.3",
97
- "@react-native-community/cli": "12.3.0",
98
- "@react-native-community/cli-platform-android": "12.3.0",
99
- "@react-native-community/cli-platform-ios": "12.3.0",
97
+ "@react-native-community/cli": "12.3.2",
98
+ "@react-native-community/cli-platform-android": "12.3.2",
99
+ "@react-native-community/cli-platform-ios": "12.3.2",
100
100
  "@react-native/assets-registry": "0.73.1",
101
- "@react-native/community-cli-plugin": "0.73.11",
101
+ "@react-native/community-cli-plugin": "0.73.12",
102
102
  "@react-native/codegen": "0.73.2",
103
103
  "@react-native/gradle-plugin": "0.73.4",
104
104
  "@react-native/js-polyfills": "0.73.1",
@@ -115,8 +115,8 @@
115
115
  "jest-environment-node": "^29.6.3",
116
116
  "jsc-android": "^250231.0.0",
117
117
  "memoize-one": "^5.0.0",
118
- "metro-runtime": "^0.80.0",
119
- "metro-source-map": "^0.80.0",
118
+ "metro-runtime": "^0.80.3",
119
+ "metro-source-map": "^0.80.3",
120
120
  "mkdirp": "^0.5.1",
121
121
  "nullthrows": "^1.1.1",
122
122
  "pretty-format": "^26.5.2",
@@ -150,6 +150,6 @@
150
150
  ]
151
151
  },
152
152
  "devDependencies": {
153
- "react-native-core": "npm:react-native@0.73.1"
153
+ "react-native-core": "npm:react-native@0.73.2"
154
154
  }
155
155
  }
@@ -299,7 +299,7 @@ def react_native_post_install(
299
299
  end
300
300
 
301
301
  fabric_enabled = ENV['RCT_FABRIC_ENABLED'] == '1'
302
- hermes_enabled = ReactNativePodsUtils.has_pod(installer, "React-hermes")
302
+ hermes_enabled = ENV['USE_HERMES'] == '1'
303
303
 
304
304
  if hermes_enabled
305
305
  ReactNativePodsUtils.set_gcc_preprocessor_definition_for_React_hermes(installer)
Binary file
Binary file
Binary file
@@ -6,6 +6,27 @@ const {getDefaultConfig, mergeConfig} = require('@react-native/metro-config');
6
6
  *
7
7
  * @type {import('metro-config').MetroConfig}
8
8
  */
9
- const config = {};
9
+ const defaultConfig = getDefaultConfig(__dirname);
10
10
 
11
- module.exports = mergeConfig(getDefaultConfig(__dirname), config);
11
+ const config = {
12
+ // When enabled, the optional code below will allow Metro to resolve
13
+ // and bundle source files with TV-specific extensions
14
+ // (e.g., *.ios.tv.tsx, *.android.tv.tsx, *.tv.tsx)
15
+ //
16
+ // Metro will still resolve source files with standard extensions
17
+ // as usual if TV-specific files are not found for a module.
18
+ //
19
+ // This code is not enabled by default, since it will impact bundling performance,
20
+ // but is available for developers who need this capability.
21
+ //
22
+ // resolver: process.env.BUILDING_FOR_TV
23
+ // ? {
24
+ // sourceExts: [].concat(
25
+ // defaultConfig.resolver.sourceExts.map(e => `tv.${e}`),
26
+ // defaultConfig.resolver.sourceExts,
27
+ // ),
28
+ // }
29
+ // : undefined,
30
+ };
31
+
32
+ module.exports = mergeConfig(defaultConfig, config);
@@ -11,17 +11,17 @@
11
11
  "test": "jest"
12
12
  },
13
13
  "dependencies": {
14
- "expo": "^50.0.0-preview.4",
14
+ "expo": "^50.0.2",
15
15
  "react": "18.2.0",
16
- "react-native": "npm:react-native-tvos@0.73.1-3"
16
+ "react-native": "npm:react-native-tvos@0.73.2-0"
17
17
  },
18
18
  "devDependencies": {
19
19
  "@babel/core": "^7.20.0",
20
20
  "@babel/preset-env": "^7.20.0",
21
21
  "@babel/runtime": "^7.20.0",
22
- "@react-native/babel-preset": "0.73.18",
23
- "@react-native/eslint-config": "0.73.1",
24
- "@react-native/metro-config": "0.73.2",
22
+ "@react-native/babel-preset": "0.73.19",
23
+ "@react-native/eslint-config": "0.73.2",
24
+ "@react-native/metro-config": "0.73.3",
25
25
  "@react-native/typescript-config": "0.73.1",
26
26
  "@types/react": "^18.2.6",
27
27
  "@types/react-test-renderer": "^18.0.0",
@@ -10,7 +10,7 @@ Pod::Spec.new do |spec|
10
10
  spec.homepage = 'http://www.boost.org'
11
11
  spec.summary = 'Boost provides free peer-reviewed portable C++ source libraries.'
12
12
  spec.authors = 'Rene Rivera'
13
- spec.source = { :http => 'https://boostorg.jfrog.io/artifactory/main/release/1.83.0/source/boost_1_83_0.tar.bz2',
13
+ spec.source = { :http => 'https://archives.boost.io/release/1.83.0/source/boost_1_83_0.tar.bz2',
14
14
  :sha256 => '6478edfe2f3305127cffe8caf73ea0176c53769f4bf1585be237eb30798c3b8e' }
15
15
 
16
16
  # Pinning to the same version as React.podspec.