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.
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Lists/VirtualizedList.js +3 -3
- package/React/Base/RCTVersion.m +1 -1
- package/React/Views/RCTView.h +6 -0
- package/React/Views/RCTView.m +41 -11
- package/React/Views/RCTViewManager.m +9 -0
- 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
|
@@ -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
|
|
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
|
}
|
package/React/Base/RCTVersion.m
CHANGED
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
|
|
@@ -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
|
{
|
package/package.json
CHANGED