react-native-macos 0.66.74 → 0.66.77

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: 66,
15
- patch: 74,
15
+ patch: 77,
16
16
  prerelease: null,
17
17
  };
@@ -798,7 +798,7 @@ class VirtualizedList extends React.PureComponent<Props, State> {
798
798
  (this.props.initialScrollIndex || 0) +
799
799
  initialNumToRenderOrDefault(this.props.initialNumToRender),
800
800
  ) - 1,
801
- selectedRowIndex: this.props.initialSelectedIndex || -1, // TODO(macOS GH#774)
801
+ selectedRowIndex: this.props.initialSelectedIndex ?? -1, // TODO(macOS GH#774)
802
802
  };
803
803
 
804
804
  if (this._isNestedWithSameOrientation()) {
@@ -1352,12 +1352,12 @@ class VirtualizedList extends React.PureComponent<Props, State> {
1352
1352
  return (
1353
1353
  // $FlowFixMe[prop-missing] Invalid prop usage
1354
1354
  <ScrollView
1355
- {...props}
1356
1355
  // [TODO(macOS GH#774)
1357
1356
  {...(props.enableSelectionOnKeyPress && keyboardNavigationProps)}
1358
1357
  onPreferredScrollerStyleDidChange={
1359
1358
  preferredScrollerStyleDidChangeHandler
1360
1359
  } // TODO(macOS GH#774)]
1360
+ {...props}
1361
1361
  refreshControl={
1362
1362
  props.refreshControl == null ? (
1363
1363
  <RefreshControl
@@ -1375,12 +1375,12 @@ class VirtualizedList extends React.PureComponent<Props, State> {
1375
1375
  return (
1376
1376
  // $FlowFixMe Invalid prop usage
1377
1377
  <ScrollView
1378
- {...props}
1379
1378
  // [TODO(macOS GH#774)
1380
1379
  {...(props.enableSelectionOnKeyPress && keyboardNavigationProps)}
1381
1380
  onPreferredScrollerStyleDidChange={
1382
1381
  preferredScrollerStyleDidChangeHandler
1383
1382
  } // TODO(macOS GH#774)]
1383
+ {...props}
1384
1384
  />
1385
1385
  );
1386
1386
  }
@@ -23,7 +23,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
23
23
  __rnVersion = @{
24
24
  RCTVersionMajor: @(0),
25
25
  RCTVersionMinor: @(66),
26
- RCTVersionPatch: @(74),
26
+ RCTVersionPatch: @(77),
27
27
  RCTVersionPrerelease: [NSNull null],
28
28
  };
29
29
  });
@@ -148,6 +148,12 @@ extern const UIAccessibilityTraits SwitchAccessibilityTrait;
148
148
  @property (nonatomic, copy) RCTDirectEventBlock onKeyUp;
149
149
  @property (nonatomic, copy) NSArray<NSString*> *validKeysDown;
150
150
  @property (nonatomic, copy) NSArray<NSString*> *validKeysUp;
151
+
152
+ // Shadow Properties
153
+ @property (nonatomic, strong) NSColor *shadowColor;
154
+ @property (nonatomic, assign) CGFloat shadowOpacity;
155
+ @property (nonatomic, assign) CGFloat shadowRadius;
156
+ @property (nonatomic, assign) CGSize shadowOffset;
151
157
  #endif // ]TODO(macOS GH#774)
152
158
 
153
159
  /**
@@ -164,6 +164,7 @@ static NSString *RCTRecursiveAccessibilityLabel(RCTUIView *view) // TODO(macOS I
164
164
  _hitTestEdgeInsets = UIEdgeInsetsZero;
165
165
  #if TARGET_OS_OSX // TODO(macOS GH#774)
166
166
  _transform3D = CATransform3DIdentity;
167
+ _shadowColor = nil;
167
168
  #endif // TODO(macOS GH#774)
168
169
 
169
170
  _backgroundColor = super.backgroundColor;
@@ -726,20 +727,49 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : unused)
726
727
  #endif // TODO(macOS GH#774)
727
728
 
728
729
  #if TARGET_OS_OSX // [TODO(macOS GH#774)
729
- // Workaround AppKit issue with directly manipulating the view layer's shadow.
730
- - (NSShadow*)shadow
730
+ - (void)setShadowColor:(NSColor *)shadowColor
731
731
  {
732
- CALayer *layer = self.layer;
733
- NSShadow *shadow = nil;
732
+ if (_shadowColor != shadowColor)
733
+ {
734
+ _shadowColor = shadowColor;
735
+ [self didUpdateShadow];
736
+ }
737
+ }
734
738
 
735
- if (layer.shadowColor != nil && layer.shadowOpacity > 0) {
736
- shadow = [NSShadow new];
739
+ - (void)setShadowOffset:(CGSize)shadowOffset
740
+ {
741
+ if (!CGSizeEqualToSize(_shadowOffset, shadowOffset))
742
+ {
743
+ _shadowOffset = shadowOffset;
744
+ [self didUpdateShadow];
745
+ }
746
+ }
737
747
 
738
- shadow.shadowColor = [[NSColor colorWithCGColor:layer.shadowColor] colorWithAlphaComponent:layer.shadowOpacity];
739
- shadow.shadowOffset = layer.shadowOffset;
740
- shadow.shadowBlurRadius = layer.shadowRadius;
741
- }
742
- return shadow;
748
+ - (void)setShadowOpacity:(CGFloat)shadowOpacity
749
+ {
750
+ if (_shadowOpacity != shadowOpacity)
751
+ {
752
+ _shadowOpacity = shadowOpacity;
753
+ [self didUpdateShadow];
754
+ }
755
+ }
756
+
757
+ - (void)setShadowRadius:(CGFloat)shadowRadius
758
+ {
759
+ if (_shadowRadius != shadowRadius)
760
+ {
761
+ _shadowRadius = shadowRadius;
762
+ [self didUpdateShadow];
763
+ }
764
+ }
765
+
766
+ -(void)didUpdateShadow
767
+ {
768
+ NSShadow *shadow = [NSShadow new];
769
+ shadow.shadowColor = [[self shadowColor] colorWithAlphaComponent:[self shadowOpacity]];
770
+ shadow.shadowOffset = [self shadowOffset];
771
+ shadow.shadowBlurRadius = [self shadowRadius];
772
+ [self setShadow:shadow];
743
773
  }
744
774
 
745
775
  - (void)viewDidMoveToWindow
@@ -192,10 +192,19 @@ RCT_REMAP_VIEW_PROPERTY(opacity, alpha, CGFloat)
192
192
  #else // [TODO(macOS GH#774)
193
193
  RCT_REMAP_VIEW_PROPERTY(opacity, alphaValue, CGFloat)
194
194
  #endif // ]TODO(macOS GH#774)
195
+
196
+ #if !TARGET_OS_OSX // TODO(macOS GH#774)
195
197
  RCT_REMAP_VIEW_PROPERTY(shadowColor, layer.shadowColor, CGColor)
196
198
  RCT_REMAP_VIEW_PROPERTY(shadowOffset, layer.shadowOffset, CGSize)
197
199
  RCT_REMAP_VIEW_PROPERTY(shadowOpacity, layer.shadowOpacity, float)
198
200
  RCT_REMAP_VIEW_PROPERTY(shadowRadius, layer.shadowRadius, CGFloat)
201
+ #else // [TODO(macOS GH#774)
202
+ RCT_EXPORT_VIEW_PROPERTY(shadowColor, NSColor)
203
+ RCT_EXPORT_VIEW_PROPERTY(shadowOffset, CGSize)
204
+ RCT_EXPORT_VIEW_PROPERTY(shadowOpacity, CGFloat)
205
+ RCT_EXPORT_VIEW_PROPERTY(shadowRadius, CGFloat)
206
+ #endif // ]TODO(macOS GH#774)
207
+
199
208
  RCT_REMAP_VIEW_PROPERTY(needsOffscreenAlphaCompositing, layer.allowsGroupOpacity, BOOL)
200
209
  RCT_CUSTOM_VIEW_PROPERTY(overflow, YGOverflow, RCTView)
201
210
  {
@@ -1,4 +1,4 @@
1
- VERSION_NAME=0.66.74
1
+ VERSION_NAME=0.66.77
2
2
  GROUP=com.facebook.react
3
3
 
4
4
  POM_NAME=ReactNative
@@ -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", 66,
20
- "patch", 74,
20
+ "patch", 77,
21
21
  "prerelease", null);
22
22
  }
@@ -17,7 +17,7 @@ namespace facebook::react {
17
17
  constexpr struct {
18
18
  int32_t Major = 0;
19
19
  int32_t Minor = 66;
20
- int32_t Patch = 74;
20
+ int32_t Patch = 77;
21
21
  std::string_view Prerelease = "";
22
22
  } ReactNativeVersion;
23
23
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-macos",
3
- "version": "0.66.74",
3
+ "version": "0.66.77",
4
4
  "bin": "./cli.js",
5
5
  "description": "React Native for macOS",
6
6
  "license": "MIT",
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "react": "17.0.2",
14
- "react-native": "0.66.74"
14
+ "react-native": "0.66.77"
15
15
  },
16
16
  "devDependencies": {
17
17
  "@babel/core": "^7.12.9",