react-native-macos 0.0.0-90501d6f2 → 0.0.0-9afecd51b

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 (61) hide show
  1. package/Libraries/AddressSanitizerCrash/RCTAddressSanitizerCrash.js +25 -0
  2. package/Libraries/Animated/nodes/AnimatedValue.js +0 -1
  3. package/Libraries/Components/Button.js +1 -1
  4. package/Libraries/Components/CheckBox/CheckBox.macos.js +8 -4
  5. package/Libraries/Components/Keyboard/Keyboard.js +2 -2
  6. package/Libraries/Components/Touchable/TouchableBounce.js +11 -22
  7. package/Libraries/Components/Touchable/TouchableHighlight.js +19 -30
  8. package/Libraries/Components/Touchable/TouchableOpacity.js +14 -29
  9. package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +8 -18
  10. package/Libraries/Components/View/ReactNativeViewAttributes.js +8 -7
  11. package/Libraries/Components/View/ReactNativeViewViewConfigMacOS.js +1 -2
  12. package/Libraries/Components/View/View.js +8 -10
  13. package/Libraries/Components/View/ViewAccessibility.js +0 -1
  14. package/Libraries/Components/View/ViewPropTypes.js +1 -7
  15. package/Libraries/Core/ReactNativeVersion.js +5 -1
  16. package/Libraries/LogBox/Data/LogBoxData.js +18 -18
  17. package/Libraries/StyleSheet/PlatformColorValueTypes.macos.js +16 -1
  18. package/Libraries/StyleSheet/PlatformColorValueTypesMacOS.js +2 -0
  19. package/Libraries/StyleSheet/PlatformColorValueTypesMacOS.macos.js +8 -1
  20. package/Libraries/Text/Text/RCTTextView.m +7 -1
  21. package/Libraries/Types/RootTagTypes.js~merged +23 -0
  22. package/README.md +14 -39
  23. package/React/Base/RCTBridgeModule.h +1 -1
  24. package/React/Base/RCTConvert.m +22 -5
  25. package/React/Base/RCTVersion.m +5 -1
  26. package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingView.mm +1 -1
  27. package/React/CoreModules/RCTAddressSanitizerCrashManager.h +12 -0
  28. package/React/CoreModules/RCTAddressSanitizerCrashManager.mm +18 -0
  29. package/React/CoreModules/RCTAlertController.m +8 -4
  30. package/React/CoreModules/RCTAppearance.mm +5 -1
  31. package/React/CoreModules/RCTDevLoadingView.mm +14 -9
  32. package/React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec-generated.mm +2126 -0
  33. package/React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec.h +2682 -0
  34. package/React/Modules/RCTEventEmitter.h +2 -2
  35. package/React/Views/RCTView.h +2 -2
  36. package/React/Views/RCTView.m +2 -2
  37. package/React/Views/RCTViewManager.m +0 -7
  38. package/React-Core.podspec +0 -11
  39. package/ReactAndroid/gradle.properties +1 -1
  40. package/ReactAndroid/src/main/java/com/facebook/react/ReactActivity.java +7 -0
  41. package/ReactAndroid/src/main/java/com/facebook/react/ReactActivityDelegate.java +7 -0
  42. package/ReactAndroid/src/main/java/com/facebook/react/devsupport/interfaces/BundleLoadCallback.java +3 -1
  43. package/ReactAndroid/src/main/java/com/facebook/react/modules/appearance/AppearanceModule.java +10 -1
  44. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +5 -1
  45. package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java +8 -8
  46. package/ReactAndroid/src/main/jni/third-party/libevent/event-config.h +339 -339
  47. package/ReactCommon/cxxreact/ReactNativeVersion.h +5 -1
  48. package/jest/preprocessor.js +7 -75
  49. package/local-cli/cli.js +0 -0
  50. package/package.json +8 -10
  51. package/scripts/react-native-xcode.sh +1 -1
  52. package/scripts/react_native_pods.rb +1 -1
  53. package/template/package.json +3 -1
  54. package/CHANGELOG.json +0 -500
  55. package/CHANGELOG.md +0 -240
  56. package/Libraries/.npmignore +0 -1
  57. package/React/Base/macOS/RCTDynamicColor.h +0 -28
  58. package/React/Base/macOS/RCTDynamicColor.m +0 -217
  59. package/ReactAndroid/.npmignore +0 -5
  60. package/ReactAndroid/src/main/jni/first-party/fbjni/.gitignore +0 -2
  61. package/ReactCommon/hermes/inspector/tools/msggen/.gitignore +0 -3
@@ -14,8 +14,8 @@
14
14
  @interface RCTEventEmitter : NSObject <RCTBridgeModule, RCTInvalidating>
15
15
 
16
16
  @property (nonatomic, weak) RCTBridge * _Nullable bridge; // TODO(macOS GH#774)
17
- @property (nonatomic, weak) RCTModuleRegistry *moduleRegistry;
18
- @property (nonatomic, weak) RCTViewRegistry *viewRegistry_DEPRECATED;
17
+ @property (nonatomic, weak) RCTModuleRegistry * _Nullable moduleRegistry; // TODO(macOS GH#774)
18
+ @property (nonatomic, weak) RCTViewRegistry * _Nullable viewRegistry_DEPRECATED; // TODO(macOS GH#774)
19
19
 
20
20
  - (instancetype _Nullable)initWithDisabledObservation; // TODO(macOS GH#774)
21
21
 
@@ -9,7 +9,7 @@
9
9
 
10
10
  #import <React/RCTBorderStyle.h>
11
11
  #import <React/RCTComponent.h>
12
- #import <React/RCTEventDispatcher.h> // TODO(OSS Candidate ISS#2710739)
12
+ #import <React/RCTEventDispatcherProtocol.h> // TODO(OSS Candidate ISS#2710739)
13
13
  #import <React/RCTPointerEvents.h>
14
14
 
15
15
  #if !TARGET_OS_OSX // TODO(macOS GH#774)
@@ -23,7 +23,7 @@ extern const UIAccessibilityTraits SwitchAccessibilityTrait;
23
23
  @interface RCTView : RCTUIView // TODO(macOS ISS#3536887)
24
24
 
25
25
  // [TODO(OSS Candidate ISS#2710739)
26
- - (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher;
26
+ - (instancetype)initWithEventDispatcher:(id<RCTEventDispatcherProtocol>)eventDispatcher;
27
27
 
28
28
  - (BOOL)becomeFirstResponder;
29
29
  - (BOOL)resignFirstResponder;
@@ -123,7 +123,7 @@ static NSString *RCTRecursiveAccessibilityLabel(RCTUIView *view) // TODO(macOS I
123
123
 
124
124
  @implementation RCTView {
125
125
  RCTUIColor *_backgroundColor; // TODO(OSS Candidate ISS#2710739)
126
- RCTEventDispatcher *_eventDispatcher; // TODO(OSS Candidate ISS#2710739)
126
+ id<RCTEventDispatcherProtocol> _eventDispatcher; // TODO(OSS Candidate ISS#2710739)
127
127
  #if TARGET_OS_OSX // [TODO(macOS GH#774)
128
128
  NSTrackingArea *_trackingArea;
129
129
  BOOL _hasMouseOver;
@@ -133,7 +133,7 @@ static NSString *RCTRecursiveAccessibilityLabel(RCTUIView *view) // TODO(macOS I
133
133
  }
134
134
 
135
135
  // [TODO(OSS Candidate ISS#2710739)
136
- - (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher
136
+ - (instancetype)initWithEventDispatcher:(id<RCTEventDispatcherProtocol>)eventDispatcher
137
137
  {
138
138
  if ((self = [self initWithFrame:CGRectZero])) {
139
139
  _eventDispatcher = eventDispatcher;
@@ -51,7 +51,6 @@ RCT_MULTI_ENUM_CONVERTER(
51
51
  // a set of RN accessibilityTraits are macOS specific accessiblity roles and map to nothing on iOS:
52
52
  @"disclosure" : @(UIAccessibilityTraitNone),
53
53
  @"group" : @(UIAccessibilityTraitNone),
54
- @"list" : @(UIAccessibilityTraitNone),
55
54
  // ]TODO(macOS GH#774)
56
55
  @"alert" : @(UIAccessibilityTraitNone),
57
56
  @"checkbox" : @(UIAccessibilityTraitNone),
@@ -386,12 +385,6 @@ RCT_CUSTOM_VIEW_PROPERTY(acceptsFirstMouse, BOOL, RCTView)
386
385
  view.acceptsFirstMouse = json ? [RCTConvert BOOL:json] : defaultView.acceptsFirstMouse;
387
386
  }
388
387
  }
389
- RCT_CUSTOM_VIEW_PROPERTY(acceptsKeyboardFocus, BOOL, RCTView)
390
- {
391
- if ([view respondsToSelector:@selector(setFocusable:)]) {
392
- view.focusable = json ? [RCTConvert BOOL:json] : defaultView.focusable;
393
- }
394
- }
395
388
  RCT_CUSTOM_VIEW_PROPERTY(focusable, BOOL, RCTView)
396
389
  {
397
390
  if ([view respondsToSelector:@selector(setFocusable:)]) {
@@ -77,17 +77,6 @@ Pod::Spec.new do |s|
77
77
  ss.private_header_files = "React/Cxx*/*.h"
78
78
  end
79
79
 
80
- s.subspec "Hermes" do |ss|
81
- ss.platforms = { :osx => "10.15", :ios => "11.0" }
82
- ss.source_files = "ReactCommon/hermes/executor/*.{cpp,h}",
83
- "ReactCommon/hermes/inspector/*.{cpp,h}",
84
- "ReactCommon/hermes/inspector/chrome/*.{cpp,h}",
85
- "ReactCommon/hermes/inspector/detail/*.{cpp,h}"
86
- ss.pod_target_xcconfig = { "GCC_PREPROCESSOR_DEFINITIONS" => "HERMES_ENABLE_DEBUGGER=1" }
87
- ss.dependency "RCT-Folly/Futures"
88
- ss.dependency "hermes-engine"
89
- end
90
-
91
80
  s.subspec "DevSupport" do |ss|
92
81
  ss.source_files = "React/DevSupport/*.{h,mm,m}",
93
82
  "React/Inspector/*.{h,mm,m}"
@@ -1,4 +1,4 @@
1
- VERSION_NAME=0.0.0-90501d6f2
1
+ VERSION_NAME=0.0.0-9afecd51b
2
2
  GROUP=com.facebook.react
3
3
 
4
4
  POM_NAME=ReactNative
@@ -8,6 +8,7 @@
8
8
  package com.facebook.react;
9
9
 
10
10
  import android.content.Intent;
11
+ import android.content.res.Configuration;
11
12
  import android.os.Bundle;
12
13
  import android.view.KeyEvent;
13
14
  import androidx.annotation.Nullable;
@@ -121,6 +122,12 @@ public abstract class ReactActivity extends AppCompatActivity
121
122
  mDelegate.onWindowFocusChanged(hasFocus);
122
123
  }
123
124
 
125
+ @Override
126
+ public void onConfigurationChanged(Configuration newConfig) {
127
+ super.onConfigurationChanged(newConfig);
128
+ mDelegate.onConfigurationChanged(newConfig);
129
+ }
130
+
124
131
  protected final ReactNativeHost getReactNativeHost() {
125
132
  return mDelegate.getReactNativeHost();
126
133
  }
@@ -11,6 +11,7 @@ import android.annotation.TargetApi;
11
11
  import android.app.Activity;
12
12
  import android.content.Context;
13
13
  import android.content.Intent;
14
+ import android.content.res.Configuration;
14
15
  import android.os.Build;
15
16
  import android.os.Bundle;
16
17
  import android.view.KeyEvent;
@@ -154,6 +155,12 @@ public class ReactActivityDelegate {
154
155
  }
155
156
  }
156
157
 
158
+ public void onConfigurationChanged(Configuration newConfig) {
159
+ if (getReactNativeHost().hasInstance()) {
160
+ getReactInstanceManager().onConfigurationChanged(getContext(), newConfig);
161
+ }
162
+ }
163
+
157
164
  @TargetApi(Build.VERSION_CODES.M)
158
165
  public void requestPermissions(
159
166
  String[] permissions, int requestCode, PermissionListener listener) {
@@ -5,8 +5,10 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
+ // TODO(macOS GH#774)
9
+
8
10
  package com.facebook.react.devsupport.interfaces;
9
11
 
10
12
  public interface BundleLoadCallback {
11
13
  void onSuccess();
12
- }
14
+ }
@@ -7,6 +7,7 @@
7
7
 
8
8
  package com.facebook.react.modules.appearance;
9
9
 
10
+ import android.app.Activity;
10
11
  import android.content.Context;
11
12
  import android.content.res.Configuration;
12
13
  import androidx.annotation.Nullable;
@@ -74,7 +75,15 @@ public class AppearanceModule extends NativeAppearanceSpec {
74
75
 
75
76
  @Override
76
77
  public String getColorScheme() {
77
- mColorScheme = colorSchemeForCurrentConfiguration(getReactApplicationContext());
78
+ // Attempt to use the Activity context first in order to get the most up to date
79
+ // scheme. This covers the scenario when AppCompatDelegate.setDefaultNightMode()
80
+ // is called directly (which can occur in Brownfield apps for example).
81
+ Activity activity = getCurrentActivity();
82
+
83
+ mColorScheme =
84
+ colorSchemeForCurrentConfiguration(
85
+ activity != null ? activity : getReactApplicationContext());
86
+
78
87
  return mColorScheme;
79
88
  }
80
89
 
@@ -13,10 +13,14 @@ import com.facebook.react.common.MapBuilder;
13
13
 
14
14
  import java.util.Map;
15
15
 
16
+ // [TODO(macOS GH#944)
17
+ // Note: Be careful not to override these version numbers
18
+ // when we merge upstream stable branches into main
19
+ // TODO(macOS GH#944)]
16
20
  public class ReactNativeVersion {
17
21
  public static final Map<String, Object> VERSION = MapBuilder.<String, Object>of(
18
22
  "major", 0,
19
23
  "minor", 0,
20
24
  "patch", 0,
21
- "prerelease", "90501d6f2");
25
+ "prerelease", "9afecd51b");
22
26
  }
@@ -1098,8 +1098,8 @@ public class ReactViewBackgroundDrawable extends Drawable {
1098
1098
  int width = Math.round(borderWidth.left);
1099
1099
  updatePathEffect(width);
1100
1100
  mPaint.setStrokeWidth(width);
1101
- mPathForSingleBorder.moveTo(left, top - borderWidth.top / 2);
1102
- mPathForSingleBorder.lineTo(left, bottom + borderWidth.bottom / 2);
1101
+ mPathForSingleBorder.moveTo(left + width / 2, top);
1102
+ mPathForSingleBorder.lineTo(left + width / 2, bottom);
1103
1103
  canvas.drawPath(mPathForSingleBorder, mPaint);
1104
1104
  }
1105
1105
  if (borderTop > 0) {
@@ -1107,8 +1107,8 @@ public class ReactViewBackgroundDrawable extends Drawable {
1107
1107
  int width = Math.round(borderWidth.top);
1108
1108
  updatePathEffect(width);
1109
1109
  mPaint.setStrokeWidth(width);
1110
- mPathForSingleBorder.moveTo(left, top);
1111
- mPathForSingleBorder.lineTo(right, top);
1110
+ mPathForSingleBorder.moveTo(left, top + width / 2);
1111
+ mPathForSingleBorder.lineTo(right, top + width / 2);
1112
1112
  canvas.drawPath(mPathForSingleBorder, mPaint);
1113
1113
  }
1114
1114
  if (borderRight > 0) {
@@ -1116,8 +1116,8 @@ public class ReactViewBackgroundDrawable extends Drawable {
1116
1116
  int width = Math.round(borderWidth.right);
1117
1117
  updatePathEffect(width);
1118
1118
  mPaint.setStrokeWidth(width);
1119
- mPathForSingleBorder.moveTo(right, top - borderWidth.top / 2);
1120
- mPathForSingleBorder.lineTo(right, bottom + borderWidth.bottom / 2);
1119
+ mPathForSingleBorder.moveTo(right - width / 2, top);
1120
+ mPathForSingleBorder.lineTo(right - width / 2, bottom);
1121
1121
  canvas.drawPath(mPathForSingleBorder, mPaint);
1122
1122
  }
1123
1123
  if (borderBottom > 0) {
@@ -1125,8 +1125,8 @@ public class ReactViewBackgroundDrawable extends Drawable {
1125
1125
  int width = Math.round(borderWidth.bottom);
1126
1126
  updatePathEffect(width);
1127
1127
  mPaint.setStrokeWidth(width);
1128
- mPathForSingleBorder.moveTo(left, bottom);
1129
- mPathForSingleBorder.lineTo(right, bottom);
1128
+ mPathForSingleBorder.moveTo(left, bottom - width / 2);
1129
+ mPathForSingleBorder.lineTo(right, bottom - width / 2);
1130
1130
  canvas.drawPath(mPathForSingleBorder, mPaint);
1131
1131
  }
1132
1132
  }