react-native-macos 0.68.39 → 0.68.42

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.
@@ -16,6 +16,6 @@
16
16
  exports.version = {
17
17
  major: 0,
18
18
  minor: 68,
19
- patch: 39,
19
+ patch: 42,
20
20
  prerelease: null,
21
21
  };
@@ -1351,12 +1351,12 @@ class VirtualizedList extends React.PureComponent<Props, State> {
1351
1351
  return (
1352
1352
  // $FlowFixMe[prop-missing] Invalid prop usage
1353
1353
  <ScrollView
1354
- {...props}
1355
1354
  // [TODO(macOS GH#774)
1356
1355
  {...(props.enableSelectionOnKeyPress && keyboardNavigationProps)}
1357
1356
  onPreferredScrollerStyleDidChange={
1358
1357
  preferredScrollerStyleDidChangeHandler
1359
1358
  } // TODO(macOS GH#774)]
1359
+ {...props}
1360
1360
  refreshControl={
1361
1361
  props.refreshControl == null ? (
1362
1362
  <RefreshControl
@@ -1374,12 +1374,12 @@ class VirtualizedList extends React.PureComponent<Props, State> {
1374
1374
  return (
1375
1375
  // $FlowFixMe Invalid prop usage
1376
1376
  <ScrollView
1377
- {...props}
1378
1377
  // [TODO(macOS GH#774)
1379
1378
  {...(props.enableSelectionOnKeyPress && keyboardNavigationProps)}
1380
1379
  onPreferredScrollerStyleDidChange={
1381
1380
  preferredScrollerStyleDidChangeHandler
1382
1381
  } // TODO(macOS GH#774)]
1382
+ {...props}
1383
1383
  />
1384
1384
  );
1385
1385
  }
@@ -27,7 +27,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
27
27
  __rnVersion = @{
28
28
  RCTVersionMajor: @(0),
29
29
  RCTVersionMinor: @(68),
30
- RCTVersionPatch: @(39),
30
+ RCTVersionPatch: @(42),
31
31
  RCTVersionPrerelease: [NSNull null],
32
32
  };
33
33
  });
@@ -8,7 +8,8 @@
8
8
  #import "RCTActivityIndicatorView.h"
9
9
 
10
10
  #if TARGET_OS_OSX // [TODO(macOS GH#774)
11
- #import <QuartzCore/QuartzCore.h>
11
+ #import <CoreImage/CIFilter.h>
12
+ #import <CoreImage/CIVector.h>
12
13
 
13
14
  @interface RCTActivityIndicatorView ()
14
15
  @property (nonatomic, readwrite, getter=isAnimating) BOOL animating;
@@ -139,6 +139,12 @@ extern const UIAccessibilityTraits SwitchAccessibilityTrait;
139
139
  @property (nonatomic, copy) RCTDirectEventBlock onKeyUp;
140
140
  @property (nonatomic, copy) NSArray<NSString*> *validKeysDown;
141
141
  @property (nonatomic, copy) NSArray<NSString*> *validKeysUp;
142
+
143
+ // Shadow Properties
144
+ @property (nonatomic, strong) NSColor *shadowColor;
145
+ @property (nonatomic, assign) CGFloat shadowOpacity;
146
+ @property (nonatomic, assign) CGFloat shadowRadius;
147
+ @property (nonatomic, assign) CGSize shadowOffset;
142
148
  #endif // ]TODO(macOS GH#774)
143
149
 
144
150
  /**
@@ -165,6 +165,7 @@ static NSString *RCTRecursiveAccessibilityLabel(RCTUIView *view) // TODO(macOS I
165
165
  _hitTestEdgeInsets = UIEdgeInsetsZero;
166
166
  #if TARGET_OS_OSX // TODO(macOS GH#774)
167
167
  _transform3D = CATransform3DIdentity;
168
+ _shadowColor = nil;
168
169
  #endif // TODO(macOS GH#774)
169
170
 
170
171
  _backgroundColor = super.backgroundColor;
@@ -716,20 +717,49 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : unused)
716
717
  #endif // TODO(macOS GH#774)
717
718
 
718
719
  #if TARGET_OS_OSX // [TODO(macOS GH#774)
719
- // Workaround AppKit issue with directly manipulating the view layer's shadow.
720
- - (NSShadow*)shadow
720
+ - (void)setShadowColor:(NSColor *)shadowColor
721
721
  {
722
- CALayer *layer = self.layer;
723
- NSShadow *shadow = nil;
722
+ if (_shadowColor != shadowColor)
723
+ {
724
+ _shadowColor = shadowColor;
725
+ [self didUpdateShadow];
726
+ }
727
+ }
724
728
 
725
- if (layer.shadowColor != nil && layer.shadowOpacity > 0) {
726
- shadow = [NSShadow new];
729
+ - (void)setShadowOffset:(CGSize)shadowOffset
730
+ {
731
+ if (!CGSizeEqualToSize(_shadowOffset, shadowOffset))
732
+ {
733
+ _shadowOffset = shadowOffset;
734
+ [self didUpdateShadow];
735
+ }
736
+ }
727
737
 
728
- shadow.shadowColor = [[NSColor colorWithCGColor:layer.shadowColor] colorWithAlphaComponent:layer.shadowOpacity];
729
- shadow.shadowOffset = layer.shadowOffset;
730
- shadow.shadowBlurRadius = layer.shadowRadius;
731
- }
732
- return shadow;
738
+ - (void)setShadowOpacity:(CGFloat)shadowOpacity
739
+ {
740
+ if (_shadowOpacity != shadowOpacity)
741
+ {
742
+ _shadowOpacity = shadowOpacity;
743
+ [self didUpdateShadow];
744
+ }
745
+ }
746
+
747
+ - (void)setShadowRadius:(CGFloat)shadowRadius
748
+ {
749
+ if (_shadowRadius != shadowRadius)
750
+ {
751
+ _shadowRadius = shadowRadius;
752
+ [self didUpdateShadow];
753
+ }
754
+ }
755
+
756
+ -(void)didUpdateShadow
757
+ {
758
+ NSShadow *shadow = [NSShadow new];
759
+ shadow.shadowColor = [[self shadowColor] colorWithAlphaComponent:[self shadowOpacity]];
760
+ shadow.shadowOffset = [self shadowOffset];
761
+ shadow.shadowBlurRadius = [self shadowRadius];
762
+ [self setShadow:shadow];
733
763
  }
734
764
 
735
765
  - (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.68.39
1
+ VERSION_NAME=0.68.42
2
2
  GROUP=com.facebook.react
3
3
 
4
4
  POM_NAME=ReactNative
@@ -21,6 +21,6 @@ public class ReactNativeVersion {
21
21
  public static final Map<String, Object> VERSION = MapBuilder.<String, Object>of(
22
22
  "major", 0,
23
23
  "minor", 68,
24
- "patch", 39,
24
+ "patch", 42,
25
25
  "prerelease", null);
26
26
  }
@@ -21,7 +21,7 @@ namespace facebook::react {
21
21
  constexpr struct {
22
22
  int32_t Major = 0;
23
23
  int32_t Minor = 68;
24
- int32_t Patch = 39;
24
+ int32_t Patch = 42;
25
25
  std::string_view Prerelease = "";
26
26
  } ReactNativeVersion;
27
27
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-macos",
3
- "version": "0.68.39",
3
+ "version": "0.68.42",
4
4
  "bin": "./cli.js",
5
5
  "description": "React Native for macOS",
6
6
  "license": "MIT",
@@ -12,7 +12,7 @@
12
12
  },
13
13
  "dependencies": {
14
14
  "react": "17.0.2",
15
- "react-native-macos": "0.68.39"
15
+ "react-native-macos": "0.68.42"
16
16
  },
17
17
  "devDependencies": {
18
18
  "@babel/core": "^7.12.9",