react-native-macos 0.0.0-5ad4444cf → 0.0.0-5cd43232a

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 (88) hide show
  1. package/Libraries/AddressSanitizerCrash/RCTAddressSanitizerCrash.js +25 -0
  2. package/Libraries/Animated/nodes/AnimatedValue.js +0 -1
  3. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +22 -12
  4. package/Libraries/Components/Button.js +1 -1
  5. package/Libraries/Components/CheckBox/CheckBox.macos.js +8 -4
  6. package/Libraries/Components/Keyboard/Keyboard.js +2 -2
  7. package/Libraries/Components/Touchable/TouchableBounce.js +11 -22
  8. package/Libraries/Components/Touchable/TouchableHighlight.js +19 -30
  9. package/Libraries/Components/Touchable/TouchableOpacity.js +14 -29
  10. package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +8 -18
  11. package/Libraries/Components/View/ReactNativeViewAttributes.js +8 -7
  12. package/Libraries/Components/View/ReactNativeViewViewConfigMacOS.js +1 -2
  13. package/Libraries/Components/View/View.js +8 -10
  14. package/Libraries/Components/View/ViewAccessibility.js +0 -1
  15. package/Libraries/Components/View/ViewPropTypes.js +1 -7
  16. package/Libraries/Core/ReactNativeVersion.js +5 -1
  17. package/Libraries/Image/RCTImageView.mm +2 -8
  18. package/Libraries/LogBox/Data/LogBoxData.js +18 -18
  19. package/Libraries/StyleSheet/PlatformColorValueTypes.macos.js +16 -1
  20. package/Libraries/StyleSheet/PlatformColorValueTypesMacOS.js +2 -0
  21. package/Libraries/StyleSheet/PlatformColorValueTypesMacOS.macos.js +8 -1
  22. package/Libraries/Text/RawText/RCTRawTextShadowView.m +2 -0
  23. package/Libraries/Text/Text/RCTTextView.m +8 -4
  24. package/Libraries/Text/TextInput/Multiline/RCTUITextView.m +10 -8
  25. package/Libraries/Text/TextInput/RCTBackedTextInputDelegate.h +2 -0
  26. package/Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.m +15 -3
  27. package/Libraries/Text/TextInput/RCTBaseTextInputView.m +9 -0
  28. package/Libraries/Types/RootTagTypes.js~merged +23 -0
  29. package/README.md +19 -43
  30. package/React/Base/RCTBridgeModule.h +1 -1
  31. package/React/Base/RCTConvert.m +23 -6
  32. package/React/Base/RCTImageSource.m +2 -0
  33. package/React/Base/RCTJSStackFrame.m +2 -0
  34. package/React/Base/RCTJavaScriptLoader.mm +2 -0
  35. package/React/Base/RCTKeyCommands.m +2 -0
  36. package/React/Base/RCTModuleData.mm +2 -0
  37. package/React/Base/RCTModuleMethod.mm +2 -0
  38. package/React/Base/RCTTouchEvent.m +2 -0
  39. package/React/Base/RCTVersion.m +5 -1
  40. package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingView.mm +1 -1
  41. package/React/Base/macOS/RCTPlatformDisplayLink.m +4 -1
  42. package/React/CoreModules/RCTAddressSanitizerCrashManager.h +12 -0
  43. package/React/CoreModules/RCTAddressSanitizerCrashManager.mm +18 -0
  44. package/React/CoreModules/RCTAlertController.m +8 -4
  45. package/React/CoreModules/RCTAppearance.mm +22 -23
  46. package/React/CoreModules/RCTDevLoadingView.mm +14 -9
  47. package/React/CxxModule/RCTCxxMethod.mm +2 -0
  48. package/React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec-generated.mm +2126 -0
  49. package/React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec.h +2682 -0
  50. package/React/Modules/RCTEventEmitter.h +2 -2
  51. package/React/Modules/RCTLayoutAnimation.m +2 -0
  52. package/React/Modules/RCTLayoutAnimationGroup.m +2 -0
  53. package/React/Views/RCTShadowView.m +3 -1
  54. package/React/Views/RCTSwitch.h +1 -1
  55. package/React/Views/RCTSwitch.m +0 -15
  56. package/React/Views/RCTView.h +5 -2
  57. package/React/Views/RCTView.m +22 -10
  58. package/React/Views/RCTViewManager.m +9 -15
  59. package/React/Views/SafeAreaView/RCTSafeAreaView.m +2 -0
  60. package/React-Core.podspec +0 -11
  61. package/ReactAndroid/gradle.properties +1 -1
  62. package/ReactAndroid/src/main/java/com/facebook/react/ReactActivity.java +7 -0
  63. package/ReactAndroid/src/main/java/com/facebook/react/ReactActivityDelegate.java +7 -0
  64. package/ReactAndroid/src/main/java/com/facebook/react/devsupport/interfaces/BundleLoadCallback.java +3 -1
  65. package/ReactAndroid/src/main/java/com/facebook/react/modules/appearance/AppearanceModule.java +10 -1
  66. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +5 -1
  67. package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java +0 -8
  68. package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java +8 -8
  69. package/ReactAndroid/src/main/jni/third-party/libevent/event-config.h +339 -339
  70. package/ReactCommon/cxxreact/ReactNativeVersion.h +5 -1
  71. package/jest/preprocessor.js +7 -75
  72. package/local-cli/cli.js +0 -0
  73. package/local-cli/generator-macos/templates/macos/Podfile +2 -7
  74. package/package.json +18 -23
  75. package/scripts/react-native-xcode.sh +1 -1
  76. package/scripts/react_native_pods.rb +1 -1
  77. package/template/package.json +4 -2
  78. package/third-party-podspecs/RCT-Folly.podspec +1 -1
  79. package/CHANGELOG.json +0 -500
  80. package/CHANGELOG.md +0 -240
  81. package/Libraries/.npmignore +0 -1
  82. package/React/Base/macOS/RCTDynamicColor.h +0 -28
  83. package/React/Base/macOS/RCTDynamicColor.m +0 -219
  84. package/ReactAndroid/.npmignore +0 -5
  85. package/ReactAndroid/src/main/jni/first-party/fbjni/.gitignore +0 -2
  86. package/ReactCommon/hermes/inspector/tools/msggen/.gitignore +0 -3
  87. package/scripts/fixmacscripts.sh +0 -9
  88. package/scripts/postInstall.js +0 -6
@@ -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
 
@@ -190,6 +190,7 @@ static NSString *CAMediaTimingFunctionNameFromRCTAnimationType(RCTAnimationType
190
190
  _animationType == animation.animationType;
191
191
  }
192
192
 
193
+ #if DEBUG // TODO(macOS GH#774) description is a debug-only feature
193
194
  - (NSString *)description
194
195
  {
195
196
  return [NSString
@@ -204,5 +205,6 @@ static NSString *CAMediaTimingFunctionNameFromRCTAnimationType(RCTAnimationType
204
205
  _initialVelocity,
205
206
  (long)_animationType];
206
207
  }
208
+ #endif // TODO(macOS GH#774)
207
209
 
208
210
  @end
@@ -64,6 +64,7 @@
64
64
  [_deletingLayoutAnimation isEqual:deletingLayoutAnimation]);
65
65
  }
66
66
 
67
+ #if DEBUG // TODO(macOS GH#774) description is a debug-only feature
67
68
  - (NSString *)description
68
69
  {
69
70
  return
@@ -75,5 +76,6 @@
75
76
  [_updatingLayoutAnimation description],
76
77
  [_deletingLayoutAnimation description]];
77
78
  }
79
+ #endif // TODO(macOS GH#774)
78
80
 
79
81
  @end
@@ -52,7 +52,7 @@ typedef NS_ENUM(unsigned int, meta_prop_t) {
52
52
  #if !TARGET_OS_OSX // [TODO(macOS GH#774)
53
53
  float pixelsInPoint = RCTScreenScale();
54
54
  #else
55
- float pixelsInPoint = 0; // TODO(ISS#1656079): Turn off pixel rounding for macOS until we can get screen resolution passed here
55
+ float pixelsInPoint = 1; // TODO(ISS#1656079): Use 1x alignment for macOS until we can use backing resolution
56
56
  #endif // ]TODO(macOS GH#774)
57
57
  YGConfigSetPointScaleFactor(yogaConfig, pixelsInPoint);
58
58
  YGConfigSetUseLegacyStretchBehaviour(yogaConfig, true);
@@ -393,6 +393,7 @@ static void RCTProcessMetaPropsBorder(const YGValue metaProps[META_PROP_COUNT],
393
393
  return self.reactTag;
394
394
  }
395
395
 
396
+ #if DEBUG // TODO(macOS GH#774) description is a debug-only feature
396
397
  - (NSString *)description
397
398
  {
398
399
  NSString *description = super.description;
@@ -403,6 +404,7 @@ static void RCTProcessMetaPropsBorder(const YGValue metaProps[META_PROP_COUNT],
403
404
  NSStringFromCGRect(self.layoutMetrics.frame)];
404
405
  return description;
405
406
  }
407
+ #endif // TODO(macOS GH#774)
406
408
 
407
409
  - (void)addRecursiveDescriptionToString:(NSMutableString *)string atLevel:(NSUInteger)level
408
410
  {
@@ -12,7 +12,7 @@
12
12
  #if !TARGET_OS_OSX // TODO(macOS GH#774)
13
13
  @interface RCTSwitch : UISwitch
14
14
  #else // [TODO(macOS GH#774)
15
- @interface RCTSwitch : NSButton
15
+ @interface RCTSwitch : NSSwitch
16
16
  #endif // ]TODO(macOS GH#774)
17
17
 
18
18
  #if !TARGET_OS_OSX // TODO(macOS GH#774)
@@ -7,25 +7,10 @@
7
7
 
8
8
  #import "RCTSwitch.h"
9
9
 
10
- #if TARGET_OS_OSX // [TODO(macOS GH#774)
11
- #import <QuartzCore/QuartzCore.h>
12
- #endif // ]TODO(macOS GH#774)
13
-
14
10
  #import "UIView+React.h"
15
11
 
16
12
  @implementation RCTSwitch
17
13
 
18
- #if TARGET_OS_OSX // [TODO(macOS GH#774)
19
- - (instancetype)initWithFrame:(CGRect)frame
20
- {
21
- if ((self = [super initWithFrame:frame])) {
22
- self.buttonType = NSButtonTypeSwitch;
23
- self.title = @""; // default is "Button"
24
- }
25
- return self;
26
- }
27
- #endif
28
-
29
14
  #if !TARGET_OS_OSX // TODO(macOS GH#774)
30
15
  - (void)setOn:(BOOL)on animated:(BOOL)animated
31
16
  {
@@ -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;
@@ -128,6 +128,9 @@ extern const UIAccessibilityTraits SwitchAccessibilityTrait;
128
128
  /**
129
129
  * macOS Properties
130
130
  */
131
+
132
+ @property (nonatomic, assign) CATransform3D transform3D;
133
+
131
134
  @property (nonatomic, copy) RCTDirectEventBlock onDoubleClick;
132
135
  @property (nonatomic, copy) RCTDirectEventBlock onClick;
133
136
  @property (nonatomic, copy) RCTDirectEventBlock onMouseEnter;
@@ -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;
@@ -162,6 +162,9 @@ static NSString *RCTRecursiveAccessibilityLabel(RCTUIView *view) // TODO(macOS I
162
162
  _borderBottomEndRadius = -1;
163
163
  _borderStyle = RCTBorderStyleSolid;
164
164
  _hitTestEdgeInsets = UIEdgeInsetsZero;
165
+ #if TARGET_OS_OSX // TODO(macOS GH#774)
166
+ _transform3D = CATransform3DIdentity;
167
+ #endif // TODO(macOS GH#774)
165
168
 
166
169
  _backgroundColor = super.backgroundColor;
167
170
  }
@@ -708,17 +711,13 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : unused)
708
711
  }
709
712
  #endif // ]TODO(macOS GH#774)
710
713
 
714
+ #if DEBUG // TODO(macOS GH#774) description is a debug-only feature
711
715
  - (NSString *)description
712
716
  {
713
- NSString *superDescription = super.description;
714
- NSRange semicolonRange = [superDescription rangeOfString:@";"];
715
- if (semicolonRange.location == NSNotFound) { // [TODO(macOS GH#774)
716
- return [[superDescription substringToIndex:superDescription.length - 1] stringByAppendingFormat:@"; reactTag: %@; frame = %@; layer = %@>", self.reactTag, NSStringFromCGRect(self.frame), self.layer];
717
- } else { // ]TODO(macOS GH#774)
718
- NSString *replacement = [NSString stringWithFormat:@"; reactTag: %@;", self.reactTag];
719
- return [superDescription stringByReplacingCharactersInRange:semicolonRange withString:replacement];
720
- } // TODO(macOS GH#774)
717
+ // TODO(macOS GH#774): we shouldn't make assumptions on what super's description is. Just append additional content.
718
+ return [[super description] stringByAppendingFormat:@" reactTag: %@; frame = %@; layer = %@", self.reactTag, NSStringFromCGRect(self.frame), self.layer];
721
719
  }
720
+ #endif // TODO(macOS GH#774)
722
721
 
723
722
  #if TARGET_OS_OSX // [TODO(macOS GH#774)
724
723
  - (void)viewDidMoveToWindow
@@ -1169,6 +1168,19 @@ static CGFloat RCTDefaultIfNegativeTo(CGFloat defaultValue, CGFloat x)
1169
1168
  backgroundColor = _backgroundColor.CGColor;
1170
1169
  #endif
1171
1170
 
1171
+ #if TARGET_OS_OSX // [TODO(macOS GH#1035)
1172
+ CATransform3D transform = [self transform3D];
1173
+ CGPoint anchorPoint = [layer anchorPoint];
1174
+ if (CGPointEqualToPoint(anchorPoint, CGPointZero) && !CATransform3DEqualToTransform(transform, CATransform3DIdentity)) {
1175
+ // https://developer.apple.com/documentation/quartzcore/calayer/1410817-anchorpoint
1176
+ // This compensates for the fact that layer.anchorPoint is {0, 0} instead of {0.5, 0.5} on macOS for some reason.
1177
+ CATransform3D originAdjust = CATransform3DTranslate(CATransform3DIdentity, self.frame.size.width / 2, self.frame.size.height / 2, 0);
1178
+ transform = CATransform3DConcat(CATransform3DConcat(CATransform3DInvert(originAdjust), transform), originAdjust);
1179
+ // Enable edge antialiasing in perspective transforms
1180
+ [layer setAllowsEdgeAntialiasing:!(transform.m34 == 0.0f)];
1181
+ }
1182
+ [layer setTransform:transform];
1183
+ #endif // ]TODO(macOS GH#1035)
1172
1184
  if (useIOSBorderRendering) {
1173
1185
  layer.cornerRadius = cornerRadii.topLeft;
1174
1186
  layer.borderColor = borderColors.left;
@@ -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),
@@ -216,15 +215,16 @@ RCT_CUSTOM_VIEW_PROPERTY(shouldRasterizeIOS, BOOL, RCTView)
216
215
 
217
216
  RCT_CUSTOM_VIEW_PROPERTY(transform, CATransform3D, RCTView)
218
217
  {
219
- #if !TARGET_OS_OSX // TODO(macOS GH#774)
218
+ #if TARGET_OS_OSX // [TODO(macOS GH#460)
219
+ CATransform3D transform = json ? [RCTConvert CATransform3D:json] : defaultView.layer.transform;
220
+ [view setTransform3D:transform];
221
+ [view setNeedsDisplay];
222
+ #else // ]TODO(macOS GH#460)]
220
223
  view.layer.transform = json ? [RCTConvert CATransform3D:json] : defaultView.layer.transform;
221
- // Enable edge antialiasing in perspective transforms
222
- view.layer.allowsEdgeAntialiasing = !(view.layer.transform.m34 == 0.0f);
223
- #elif TARGET_OS_OSX // [TODO(macOS GH#774)
224
- view.layer.sublayerTransform = json ? [RCTConvert CATransform3D:json] : defaultView.layer.sublayerTransform;
225
- // TODO: Improve this by enabling edge antialiasing only for transforms with rotation or skewing
226
- view.layer.edgeAntialiasingMask = !CATransform3DIsIdentity(view.layer.sublayerTransform) ? kCALayerLeftEdge | kCALayerRightEdge | kCALayerBottomEdge | kCALayerTopEdge : 0;
227
- #endif // ]TODO(macOS GH#774)
224
+ // Enable edge antialiasing in rotation, skew, or perspective transforms
225
+ view.layer.allowsEdgeAntialiasing =
226
+ view.layer.transform.m12 != 0.0f || view.layer.transform.m21 != 0.0f || view.layer.transform.m34 != 0.0f;
227
+ #endif // [TODO(macOS GH#460)]
228
228
  }
229
229
 
230
230
  RCT_CUSTOM_VIEW_PROPERTY(accessibilityRole, UIAccessibilityTraits, RCTView)
@@ -386,12 +386,6 @@ RCT_CUSTOM_VIEW_PROPERTY(acceptsFirstMouse, BOOL, RCTView)
386
386
  view.acceptsFirstMouse = json ? [RCTConvert BOOL:json] : defaultView.acceptsFirstMouse;
387
387
  }
388
388
  }
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
389
  RCT_CUSTOM_VIEW_PROPERTY(focusable, BOOL, RCTView)
396
390
  {
397
391
  if ([view respondsToSelector:@selector(setFocusable:)]) {
@@ -30,6 +30,7 @@
30
30
  RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : (NSCoder *)decoder)
31
31
  RCT_NOT_IMPLEMENTED(-(instancetype)initWithFrame : (CGRect)frame)
32
32
 
33
+ #if DEBUG // TODO(macOS GH#774) description is a debug-only feature
33
34
  - (NSString *)description
34
35
  {
35
36
  NSString *superDescription = [super description];
@@ -44,6 +45,7 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithFrame : (CGRect)frame)
44
45
  NSStringFromUIEdgeInsets([self safeAreaInsetsIfSupportedAndEnabled]),
45
46
  NSStringFromUIEdgeInsets(_currentSafeAreaInsets)];
46
47
  }
48
+ #endif // TODO(macOS GH#774)
47
49
 
48
50
  - (BOOL)isSupportedByOS
49
51
  {
@@ -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" }
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-5ad4444cf
1
+ VERSION_NAME=0.0.0-5cd43232a
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", "5ad4444cf");
25
+ "prerelease", "5cd43232a");
22
26
  }
@@ -828,16 +828,8 @@ public class ReactTextInputManager extends BaseViewManager<ReactEditText, Layout
828
828
  // This will supercede secureTextEntry={false}. If it doesn't, due to the way
829
829
  // the flags work out, the underlying field will end up a URI-type field.
830
830
  flagsToSet = InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD;
831
- <<<<<<< HEAD
832
- } else if ((view.getStagedInputType() & AUTOCAPITALIZE_FLAGS) != 0) {
833
- // This prevents KEYBOARD_TYPE_FLAGS from being unset when the keyboardType is
834
- // default, null, or unsupported, and autocapitalize is on.
835
- // Unsetting these flags breaks the autoCapitalize functionality.
836
- unsettingFlagsBreaksAutocomplete = true;
837
- =======
838
831
  } else if (KEYBOARD_TYPE_URI.equalsIgnoreCase(keyboardType)) {
839
832
  flagsToSet = InputType.TYPE_TEXT_VARIATION_URI;
840
- >>>>>>> v0.66.0
841
833
  }
842
834
 
843
835
  updateStagedInputTypeFlag(view, InputType.TYPE_MASK_CLASS, flagsToSet);
@@ -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
  }