react-native-macos 0.68.38 → 0.68.41
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
|
@@ -800,7 +800,7 @@ class VirtualizedList extends React.PureComponent<Props, State> {
|
|
|
800
800
|
(this.props.initialScrollIndex || 0) +
|
|
801
801
|
initialNumToRenderOrDefault(this.props.initialNumToRender),
|
|
802
802
|
) - 1,
|
|
803
|
-
selectedRowIndex: this.props.initialSelectedIndex
|
|
803
|
+
selectedRowIndex: this.props.initialSelectedIndex ?? -1, // TODO(macOS GH#774)
|
|
804
804
|
};
|
|
805
805
|
|
|
806
806
|
if (this._isNestedWithSameOrientation()) {
|
|
@@ -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
|
}
|
package/React/Base/RCTVersion.m
CHANGED
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
|
|
@@ -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