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.
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/React/Base/RCTVersion.m +1 -1
- package/React/Views/RCTActivityIndicatorView.m +2 -1
- package/React/Views/RCTView.h +6 -0
- package/React/Views/RCTView.m +44 -11
- package/React/Views/RCTViewManager.m +9 -0
- package/React/Views/UIView+React.h +2 -0
- package/React/Views/UIView+React.m +22 -13
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
- package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
- package/package.json +1 -1
- package/template/package.json +1 -1
package/React/Base/RCTVersion.m
CHANGED
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
#import "RCTActivityIndicatorView.h"
|
|
9
9
|
|
|
10
10
|
#if TARGET_OS_OSX // [TODO(macOS GH#774)
|
|
11
|
-
#import <
|
|
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;
|
package/React/Views/RCTView.h
CHANGED
|
@@ -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
|
/**
|
package/React/Views/RCTView.m
CHANGED
|
@@ -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
|
-
|
|
730
|
-
- (NSShadow*)shadow
|
|
730
|
+
- (void)setShadowColor:(NSColor *)shadowColor
|
|
731
731
|
{
|
|
732
|
-
|
|
733
|
-
|
|
732
|
+
if (_shadowColor != shadowColor)
|
|
733
|
+
{
|
|
734
|
+
_shadowColor = shadowColor;
|
|
735
|
+
[self didUpdateShadow];
|
|
736
|
+
}
|
|
737
|
+
}
|
|
734
738
|
|
|
735
|
-
|
|
736
|
-
|
|
739
|
+
- (void)setShadowOffset:(CGSize)shadowOffset
|
|
740
|
+
{
|
|
741
|
+
if (!CGSizeEqualToSize(_shadowOffset, shadowOffset))
|
|
742
|
+
{
|
|
743
|
+
_shadowOffset = shadowOffset;
|
|
744
|
+
[self didUpdateShadow];
|
|
745
|
+
}
|
|
746
|
+
}
|
|
737
747
|
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
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
|
{
|
|
@@ -270,18 +270,17 @@
|
|
|
270
270
|
}
|
|
271
271
|
#endif // TODO(macOS GH#774)
|
|
272
272
|
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
*/
|
|
276
|
-
- (BOOL)reactIsFocusNeeded
|
|
273
|
+
// [TODO(macOS GH#1412)
|
|
274
|
+
- (void)reactViewDidMoveToWindow
|
|
277
275
|
{
|
|
278
|
-
|
|
276
|
+
[self reactFocusIfNeeded];
|
|
279
277
|
}
|
|
278
|
+
// TODO(macOS GH#1412)]
|
|
280
279
|
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
package/package.json
CHANGED