react-native-macos 0.66.76 → 0.66.79

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: 76,
15
+ patch: 79,
16
16
  prerelease: null,
17
17
  };
@@ -23,7 +23,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
23
23
  __rnVersion = @{
24
24
  RCTVersionMajor: @(0),
25
25
  RCTVersionMinor: @(66),
26
- RCTVersionPatch: @(76),
26
+ RCTVersionPatch: @(79),
27
27
  RCTVersionPrerelease: [NSNull null],
28
28
  };
29
29
  });
@@ -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;
@@ -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
@@ -759,6 +789,9 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : unused)
759
789
  name:NSViewBoundsDidChangeNotification
760
790
  object:[[self enclosingScrollView] contentView]];
761
791
  }
792
+
793
+ [self reactViewDidMoveToWindow]; // TODO(macOS GH#1412)
794
+
762
795
  [super viewDidMoveToWindow];
763
796
  }
764
797
 
@@ -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
  {
@@ -91,6 +91,8 @@
91
91
  - (void)reactAddControllerToClosestParent:(UIViewController *)controller;
92
92
  #endif // TODO(macOS GH#774)
93
93
 
94
+ - (void)reactViewDidMoveToWindow; // TODO(macOS GH#1412)
95
+
94
96
  /**
95
97
  * Focus manipulation.
96
98
  */
@@ -270,18 +270,17 @@
270
270
  }
271
271
  #endif // TODO(macOS GH#774)
272
272
 
273
- /**
274
- * Focus manipulation.
275
- */
276
- - (BOOL)reactIsFocusNeeded
273
+ // [TODO(macOS GH#1412)
274
+ - (void)reactViewDidMoveToWindow
277
275
  {
278
- return [(NSNumber *)objc_getAssociatedObject(self, @selector(reactIsFocusNeeded)) boolValue];
276
+ [self reactFocusIfNeeded];
279
277
  }
278
+ // TODO(macOS GH#1412)]
280
279
 
281
- - (void)setReactIsFocusNeeded:(BOOL)isFocusNeeded
282
- {
283
- objc_setAssociatedObject(self, @selector(reactIsFocusNeeded), @(isFocusNeeded), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
284
- }
280
+ /**
281
+ * Focus manipulation.
282
+ */
283
+ static __weak RCTPlatformView *_pendingFocusView; // TODO(macOS GH#1412)
285
284
 
286
285
  - (void)reactFocus
287
286
  {
@@ -290,19 +289,23 @@
290
289
  #else
291
290
  if (![self becomeFirstResponder]) {
292
291
  #endif //// TODO(macOS GH#774)]
293
- self.reactIsFocusNeeded = YES;
294
- }
292
+ // [TODO(macOS GH#1412)
293
+ _pendingFocusView = self;
294
+ } else {
295
+ _pendingFocusView = nil;
296
+ }
297
+ // TODO(macOS GH#1412)]
295
298
  }
296
299
 
297
300
  - (void)reactFocusIfNeeded
298
301
  {
299
- if (self.reactIsFocusNeeded) {
302
+ if ([self isEqual:_pendingFocusView]) { // TODO(macOS GH#1412)
300
303
  #if TARGET_OS_OSX // [TODO(macOS GH#774)
301
304
  if ([[self window] makeFirstResponder:self]) {
302
305
  #else
303
306
  if ([self becomeFirstResponder]) {
304
307
  #endif // TODO(macOS GH#774)]
305
- self.reactIsFocusNeeded = NO;
308
+ _pendingFocusView = nil; // TODO(macOS GH#1412)
306
309
  }
307
310
  }
308
311
  }
@@ -316,6 +319,12 @@
316
319
  #else
317
320
  [self resignFirstResponder];
318
321
  #endif // TODO(macOS GH#774)]
322
+
323
+ // [TODO(macOS GH#1412)
324
+ if ([self isEqual:_pendingFocusView]) {
325
+ _pendingFocusView = nil;
326
+ }
327
+ // TODO(macOS GH#1412)]
319
328
  }
320
329
 
321
330
  #pragma mark - Layout
@@ -1,4 +1,4 @@
1
- VERSION_NAME=0.66.76
1
+ VERSION_NAME=0.66.79
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", 76,
20
+ "patch", 79,
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 = 76;
20
+ int32_t Patch = 79;
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.76",
3
+ "version": "0.66.79",
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.76"
14
+ "react-native": "0.66.79"
15
15
  },
16
16
  "devDependencies": {
17
17
  "@babel/core": "^7.12.9",