react-native-macos 0.68.40 → 0.68.43
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/Gemfile.lock +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
|
@@ -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
|
/**
|
package/React/Views/RCTView.m
CHANGED
|
@@ -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
|
-
|
|
720
|
-
- (NSShadow*)shadow
|
|
720
|
+
- (void)setShadowColor:(NSColor *)shadowColor
|
|
721
721
|
{
|
|
722
|
-
|
|
723
|
-
|
|
722
|
+
if (_shadowColor != shadowColor)
|
|
723
|
+
{
|
|
724
|
+
_shadowColor = shadowColor;
|
|
725
|
+
[self didUpdateShadow];
|
|
726
|
+
}
|
|
727
|
+
}
|
|
724
728
|
|
|
725
|
-
|
|
726
|
-
|
|
729
|
+
- (void)setShadowOffset:(CGSize)shadowOffset
|
|
730
|
+
{
|
|
731
|
+
if (!CGSizeEqualToSize(_shadowOffset, shadowOffset))
|
|
732
|
+
{
|
|
733
|
+
_shadowOffset = shadowOffset;
|
|
734
|
+
[self didUpdateShadow];
|
|
735
|
+
}
|
|
736
|
+
}
|
|
727
737
|
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
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
|
|
@@ -749,6 +779,9 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : unused)
|
|
|
749
779
|
name:NSViewBoundsDidChangeNotification
|
|
750
780
|
object:[[self enclosingScrollView] contentView]];
|
|
751
781
|
}
|
|
782
|
+
|
|
783
|
+
[self reactViewDidMoveToWindow]; // TODO(macOS GH#1412)
|
|
784
|
+
|
|
752
785
|
[super viewDidMoveToWindow];
|
|
753
786
|
}
|
|
754
787
|
|
|
@@ -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
|
{
|
|
@@ -267,18 +267,17 @@
|
|
|
267
267
|
}
|
|
268
268
|
#endif // TODO(macOS GH#774)
|
|
269
269
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
*/
|
|
273
|
-
- (BOOL)reactIsFocusNeeded
|
|
270
|
+
// [TODO(macOS GH#1412)
|
|
271
|
+
- (void)reactViewDidMoveToWindow
|
|
274
272
|
{
|
|
275
|
-
|
|
273
|
+
[self reactFocusIfNeeded];
|
|
276
274
|
}
|
|
275
|
+
// TODO(macOS GH#1412)]
|
|
277
276
|
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
277
|
+
/**
|
|
278
|
+
* Focus manipulation.
|
|
279
|
+
*/
|
|
280
|
+
static __weak RCTPlatformView *_pendingFocusView; // TODO(macOS GH#1412)
|
|
282
281
|
|
|
283
282
|
- (void)reactFocus
|
|
284
283
|
{
|
|
@@ -287,19 +286,23 @@
|
|
|
287
286
|
#else
|
|
288
287
|
if (![self becomeFirstResponder]) {
|
|
289
288
|
#endif //// TODO(macOS GH#774)]
|
|
290
|
-
|
|
291
|
-
|
|
289
|
+
// [TODO(macOS GH#1412)
|
|
290
|
+
_pendingFocusView = self;
|
|
291
|
+
} else {
|
|
292
|
+
_pendingFocusView = nil;
|
|
293
|
+
}
|
|
294
|
+
// TODO(macOS GH#1412)]
|
|
292
295
|
}
|
|
293
296
|
|
|
294
297
|
- (void)reactFocusIfNeeded
|
|
295
298
|
{
|
|
296
|
-
if (self
|
|
299
|
+
if ([self isEqual:_pendingFocusView]) { // TODO(macOS GH#1412)
|
|
297
300
|
#if TARGET_OS_OSX // [TODO(macOS GH#774)
|
|
298
301
|
if ([[self window] makeFirstResponder:self]) {
|
|
299
302
|
#else
|
|
300
303
|
if ([self becomeFirstResponder]) {
|
|
301
304
|
#endif // TODO(macOS GH#774)]
|
|
302
|
-
|
|
305
|
+
_pendingFocusView = nil; // TODO(macOS GH#1412)
|
|
303
306
|
}
|
|
304
307
|
}
|
|
305
308
|
}
|
|
@@ -313,6 +316,12 @@
|
|
|
313
316
|
#else
|
|
314
317
|
[self resignFirstResponder];
|
|
315
318
|
#endif // TODO(macOS GH#774)]
|
|
319
|
+
|
|
320
|
+
// [TODO(macOS GH#1412)
|
|
321
|
+
if ([self isEqual:_pendingFocusView]) {
|
|
322
|
+
_pendingFocusView = nil;
|
|
323
|
+
}
|
|
324
|
+
// TODO(macOS GH#1412)]
|
|
316
325
|
}
|
|
317
326
|
|
|
318
327
|
#pragma mark - Layout
|
package/package.json
CHANGED
package/template/Gemfile.lock
CHANGED