react-native-macos 0.81.6 → 0.81.8
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/Blob/RCTBlobManager.h +0 -0
- package/Libraries/Blob/RCTBlobManager.mm +0 -0
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +0 -0
- package/Libraries/Components/View/ReactNativeViewAttributes.js +1 -0
- package/Libraries/Components/View/ViewPropTypes.js +2 -0
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/NativeComponent/BaseViewConfig.ios.js +8 -0
- package/Libraries/Pressability/Pressability.js +38 -4
- package/Libraries/StyleSheet/normalizeColor.js +0 -0
- package/Libraries/Text/TextInput/Multiline/RCTUITextView.mm +13 -4
- package/Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.mm +1 -1
- package/Libraries/Text/TextInput/RCTBaseTextInputView.mm +5 -2
- package/Libraries/Text/TextInput/Singleline/RCTUITextField.h +0 -4
- package/Libraries/Text/TextInput/Singleline/RCTUITextField.mm +3 -20
- package/Libraries/Text/TextInput/Singleline/macOS/RCTUISecureTextField.h +5 -3
- package/Libraries/Text/TextInput/Singleline/macOS/RCTUISecureTextField.mm +83 -0
- package/React/Base/RCTJavaScriptLoader.h +0 -0
- package/React/Base/RCTJavaScriptLoader.mm +0 -0
- package/React/Base/RCTVersion.m +1 -1
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +27 -21
- package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +192 -4
- package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputNativeCommands.h +20 -0
- package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +61 -2
- package/React/Fabric/RCTSurfacePointerHandler.mm +6 -2
- package/React/Views/RCTComponentData.mm +1 -1
- package/React/Views/RCTView.h +1 -0
- package/React/Views/RCTViewManager.m +1 -0
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.kt +1 -1
- package/ReactCommon/cxxreact/ReactNativeVersion.h +2 -2
- package/ReactCommon/react/renderer/components/switch/iosswitch/react/renderer/components/switch/IOSSwitchShadowNode.mm +5 -0
- package/ReactCommon/react/renderer/components/switch/iosswitch/react/renderer/components/switch/MacOSSwitchShadowNode.mm +5 -0
- package/ReactCommon/react/renderer/components/view/TouchEventEmitter.cpp +4 -0
- package/ReactCommon/react/renderer/components/view/TouchEventEmitter.h +1 -0
- package/ReactCommon/react/renderer/components/view/platform/macos/react/renderer/components/view/HostPlatformViewEventEmitter.cpp +16 -0
- package/ReactCommon/react/renderer/components/view/platform/macos/react/renderer/components/view/HostPlatformViewEventEmitter.h +2 -0
- package/ReactCommon/react/renderer/components/view/platform/macos/react/renderer/components/view/HostPlatformViewEvents.h +6 -0
- package/ReactCommon/react/renderer/components/view/platform/macos/react/renderer/components/view/HostPlatformViewProps.cpp +2 -0
- package/ReactCommon/react/renderer/components/view/platform/macos/react/renderer/components/view/MouseEvent.h +8 -0
- package/ReactCommon/react/renderer/components/view/primitives.h +2 -0
- package/ReactCommon/react/renderer/components/view/propsConversions.h +4 -0
- package/ReactCommon/react/renderer/graphics/platform/ios/react/renderer/graphics/HostPlatformColor.h +2 -0
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.mm +11 -0
- package/gradle/libs.versions.toml +1 -1
- package/local-cli/cli.js +0 -0
- package/package.json +27 -6
- package/react-native.config.js +0 -1
- package/scripts/compose-source-maps.js +0 -0
- package/scripts/featureflags/index.js +47 -0
- package/scripts/find-node-for-xcode.sh +0 -0
- package/scripts/ios-prebuild/cli.js +136 -0
- package/sdks/hermes-engine/utils/build-apple-framework.sh +2 -1
- package/sdks/hermes-engine/utils/build-ios-framework.sh +8 -3
- package/sdks/hermes-engine/utils/create-dummy-hermes-xcframework.sh +0 -0
- package/third-party-podspecs/RCT-Folly.podspec +1 -1
- package/third-party-podspecs/fmt.podspec +2 -2
- package/Libraries/Text/TextInput/Singleline/macOS/RCTUISecureTextField.m +0 -14
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -135,6 +135,8 @@ type MouseEventProps = $ReadOnly<{
|
|
|
135
135
|
|
|
136
136
|
// Experimental/Work in Progress Pointer Event Callbacks (not yet ready for use)
|
|
137
137
|
type PointerEventProps = $ReadOnly<{
|
|
138
|
+
onAuxClick?: ?(event: PointerEvent) => void,
|
|
139
|
+
onAuxClickCapture?: ?(event: PointerEvent) => void,
|
|
138
140
|
onClick?: ?(event: PointerEvent) => void,
|
|
139
141
|
onClickCapture?: ?(event: PointerEvent) => void,
|
|
140
142
|
onPointerEnter?: ?(event: PointerEvent) => void,
|
|
@@ -89,6 +89,12 @@ const bubblingEventTypes = {
|
|
|
89
89
|
},
|
|
90
90
|
|
|
91
91
|
// Experimental/Work in Progress Pointer Events (not yet ready for use)
|
|
92
|
+
topAuxClick: {
|
|
93
|
+
phasedRegistrationNames: {
|
|
94
|
+
captured: 'onAuxClickCapture',
|
|
95
|
+
bubbled: 'onAuxClick',
|
|
96
|
+
},
|
|
97
|
+
},
|
|
92
98
|
topClick: {
|
|
93
99
|
phasedRegistrationNames: {
|
|
94
100
|
captured: 'onClickCapture',
|
|
@@ -394,6 +400,8 @@ const validAttributesForEventProps = ConditionallyIgnoredEventHandlers({
|
|
|
394
400
|
onTouchCancel: true,
|
|
395
401
|
|
|
396
402
|
// Pointer events
|
|
403
|
+
onAuxClick: true,
|
|
404
|
+
onAuxClickCapture: true,
|
|
397
405
|
onClick: true,
|
|
398
406
|
onClickCapture: true,
|
|
399
407
|
onPointerUp: true,
|
|
@@ -410,6 +410,16 @@ export default class Pressability {
|
|
|
410
410
|
_touchActivateTime: ?number;
|
|
411
411
|
_touchState: TouchState = 'NOT_RESPONDER';
|
|
412
412
|
|
|
413
|
+
// [macOS
|
|
414
|
+
/**
|
|
415
|
+
* Returns true if the button from a press event is the default (primary/left)
|
|
416
|
+
* button. A button value of 0 or undefined is considered the default button.
|
|
417
|
+
*/
|
|
418
|
+
_isDefaultPressButton(button: ?number): boolean {
|
|
419
|
+
return !button;
|
|
420
|
+
}
|
|
421
|
+
// macOS]
|
|
422
|
+
|
|
413
423
|
constructor(config: PressabilityConfig) {
|
|
414
424
|
this.configure(config);
|
|
415
425
|
}
|
|
@@ -554,6 +564,13 @@ export default class Pressability {
|
|
|
554
564
|
return;
|
|
555
565
|
}
|
|
556
566
|
|
|
567
|
+
// [macOS Only fire onPress for primary (left) mouse button clicks.
|
|
568
|
+
// Non-primary buttons (right, middle) should not trigger onPress.
|
|
569
|
+
if (!this._isDefaultPressButton(event?.nativeEvent?.button)) {
|
|
570
|
+
return;
|
|
571
|
+
}
|
|
572
|
+
// macOS]
|
|
573
|
+
|
|
557
574
|
// for non-pointer click events (e.g. accessibility clicks), we should only dispatch when we're the "real" target
|
|
558
575
|
// in particular, we shouldn't respond to clicks from nested pressables
|
|
559
576
|
if (event?.currentTarget !== event?.target) {
|
|
@@ -791,7 +808,12 @@ export default class Pressability {
|
|
|
791
808
|
|
|
792
809
|
if (isPressInSignal(prevState) && signal === 'LONG_PRESS_DETECTED') {
|
|
793
810
|
const {onLongPress} = this._config;
|
|
794
|
-
if (
|
|
811
|
+
if (
|
|
812
|
+
onLongPress != null &&
|
|
813
|
+
this._isDefaultPressButton(
|
|
814
|
+
getTouchFromPressEvent(event).button,
|
|
815
|
+
) /* [macOS] */
|
|
816
|
+
) {
|
|
795
817
|
onLongPress(event);
|
|
796
818
|
}
|
|
797
819
|
}
|
|
@@ -799,7 +821,14 @@ export default class Pressability {
|
|
|
799
821
|
const isPrevActive = isActiveSignal(prevState);
|
|
800
822
|
const isNextActive = isActiveSignal(nextState);
|
|
801
823
|
|
|
802
|
-
|
|
824
|
+
// [macOS Don't activate press visual feedback for non-primary mouse buttons
|
|
825
|
+
// (e.g. right-click, middle-click). They should fire onAuxClick, not onPress.
|
|
826
|
+
const isPrimaryButton = this._isDefaultPressButton(
|
|
827
|
+
getTouchFromPressEvent(event).button,
|
|
828
|
+
);
|
|
829
|
+
// macOS]
|
|
830
|
+
|
|
831
|
+
if (!isPrevActive && isNextActive && isPrimaryButton /* [macOS] */) {
|
|
803
832
|
this._activate(event);
|
|
804
833
|
} else if (isPrevActive && !isNextActive) {
|
|
805
834
|
this._deactivate(event);
|
|
@@ -807,12 +836,17 @@ export default class Pressability {
|
|
|
807
836
|
|
|
808
837
|
if (isPressInSignal(prevState) && signal === 'RESPONDER_RELEASE') {
|
|
809
838
|
// If we never activated (due to delays), activate and deactivate now.
|
|
810
|
-
if (!isNextActive && !isPrevActive) {
|
|
839
|
+
if (!isNextActive && !isPrevActive && isPrimaryButton /* [macOS] */) {
|
|
811
840
|
this._activate(event);
|
|
812
841
|
this._deactivate(event);
|
|
813
842
|
}
|
|
814
843
|
const {onLongPress, onPress, android_disableSound} = this._config;
|
|
815
|
-
if (
|
|
844
|
+
if (
|
|
845
|
+
onPress != null &&
|
|
846
|
+
this._isDefaultPressButton(
|
|
847
|
+
getTouchFromPressEvent(event).button,
|
|
848
|
+
) /* [macOS] */
|
|
849
|
+
) {
|
|
816
850
|
const isPressCanceledByLongPress =
|
|
817
851
|
onLongPress != null && prevState === 'RESPONDER_ACTIVE_LONG_PRESS_IN';
|
|
818
852
|
if (!isPressCanceledByLongPress) {
|
|
File without changes
|
|
@@ -328,10 +328,19 @@ static RCTUIColor *defaultPlaceholderColor(void) // [macOS]
|
|
|
328
328
|
#if !TARGET_OS_OSX // [macOS]
|
|
329
329
|
[super setAttributedText:attributedText];
|
|
330
330
|
#else // [macOS
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
331
|
+
if (self.ghostTextChanging) {
|
|
332
|
+
// Ghost text changes should not be on the undo stack. Disable undo
|
|
333
|
+
// registration around the text storage mutation so Cmd+Z skips over
|
|
334
|
+
// ghost text insertions/removals.
|
|
335
|
+
[self.undoManager disableUndoRegistration];
|
|
336
|
+
[self.textStorage setAttributedString:attributedText ?: [NSAttributedString new]];
|
|
337
|
+
[self.undoManager enableUndoRegistration];
|
|
338
|
+
} else {
|
|
339
|
+
// Break undo coalescing when the text is changed by JS (e.g. autocomplete).
|
|
340
|
+
[self breakUndoCoalescing];
|
|
341
|
+
// Avoid Exception thrown while executing UI block: *** -[NSBigMutableString replaceCharactersInRange:withString:]: nil argument
|
|
342
|
+
[self.textStorage setAttributedString:attributedText ?: [NSAttributedString new]];
|
|
343
|
+
}
|
|
335
344
|
#endif // macOS]
|
|
336
345
|
[self textDidChange];
|
|
337
346
|
}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
#import <React/RCTBackedTextInputDelegateAdapter.h>
|
|
9
9
|
#import "RCTBackedTextInputViewProtocol.h" // [macOS
|
|
10
10
|
#import "RCTBackedTextInputDelegate.h"
|
|
11
|
-
#import
|
|
11
|
+
#import <React/RCTTextUIKit.h> // macOS]
|
|
12
12
|
|
|
13
13
|
#pragma mark - RCTBackedTextFieldDelegateAdapter (for UITextField)
|
|
14
14
|
|
|
@@ -21,8 +21,11 @@
|
|
|
21
21
|
#import <React/RCTTextAttributes.h>
|
|
22
22
|
#import <React/RCTTextSelection.h>
|
|
23
23
|
#import <React/RCTUITextView.h> // [macOS]
|
|
24
|
-
#import
|
|
24
|
+
#import <React/RCTTextUIKit.h> // [macOS]
|
|
25
25
|
#import <React/RCTHandledKey.h> // [macOS]
|
|
26
|
+
#if TARGET_OS_OSX // [macOS
|
|
27
|
+
#import <React/RCTUISecureTextField.h>
|
|
28
|
+
#endif // macOS]
|
|
26
29
|
|
|
27
30
|
/** Native iOS text field bottom keyboard offset amount */
|
|
28
31
|
static const CGFloat kSingleLineKeyboardBottomOffset = 15.0;
|
|
@@ -194,7 +197,7 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : (NSCoder *)decoder)
|
|
|
194
197
|
BOOL shouldFallbackToBareTextComparison =
|
|
195
198
|
// There are multiple Korean input sources (2-Set, 3-Set, etc). Check substring instead instead
|
|
196
199
|
[[[self.backedTextInputView inputContext] selectedKeyboardInputSource] containsString:@"com.apple.inputmethod.Korean"] ||
|
|
197
|
-
[self.backedTextInputView hasMarkedText] || [self.backedTextInputView isKindOfClass:[
|
|
200
|
+
[self.backedTextInputView hasMarkedText] || [self.backedTextInputView isKindOfClass:[RCTUISecureTextField class]] ||
|
|
198
201
|
#endif // macOS]
|
|
199
202
|
fontHasBeenUpdatedBySystem;
|
|
200
203
|
|
|
@@ -20,11 +20,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
20
20
|
#if !TARGET_OS_OSX // [macOS]
|
|
21
21
|
@interface RCTUITextField : UITextField <RCTBackedTextInputViewProtocol>
|
|
22
22
|
#else // [macOS
|
|
23
|
-
#if RCT_SUBCLASS_SECURETEXTFIELD
|
|
24
|
-
@interface RCTUISecureTextField : NSSecureTextField <RCTBackedTextInputViewProtocol>
|
|
25
|
-
#else
|
|
26
23
|
@interface RCTUITextField : NSTextField <RCTBackedTextInputViewProtocol>
|
|
27
|
-
#endif // RCT_SUBCLASS_SECURETEXTFIELD
|
|
28
24
|
#endif // macOS]
|
|
29
25
|
|
|
30
26
|
|
|
@@ -17,12 +17,7 @@
|
|
|
17
17
|
|
|
18
18
|
#if TARGET_OS_OSX // [macOS
|
|
19
19
|
|
|
20
|
-
#if RCT_SUBCLASS_SECURETEXTFIELD
|
|
21
|
-
#define RCTUITextFieldCell RCTUISecureTextFieldCell
|
|
22
|
-
@interface RCTUISecureTextFieldCell : NSSecureTextFieldCell
|
|
23
|
-
#else
|
|
24
20
|
@interface RCTUITextFieldCell : NSTextFieldCell
|
|
25
|
-
#endif
|
|
26
21
|
|
|
27
22
|
@property (nonatomic, assign) UIEdgeInsets textContainerInset;
|
|
28
23
|
@property (nonatomic, getter=isAutomaticTextReplacementEnabled) BOOL automaticTextReplacementEnabled;
|
|
@@ -36,11 +31,6 @@
|
|
|
36
31
|
|
|
37
32
|
@implementation RCTUITextFieldCell
|
|
38
33
|
|
|
39
|
-
- (void)setTextContainerInset:(UIEdgeInsets)textContainerInset
|
|
40
|
-
{
|
|
41
|
-
_textContainerInset = textContainerInset;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
34
|
- (NSRect)titleRectForBounds:(NSRect)rect
|
|
45
35
|
{
|
|
46
36
|
return UIEdgeInsetsInsetRect([super titleRectForBounds:rect], self.textContainerInset);
|
|
@@ -58,12 +48,9 @@
|
|
|
58
48
|
|
|
59
49
|
- (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView
|
|
60
50
|
{
|
|
61
|
-
if (self.drawsBackground) {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
[self.backgroundColor set];
|
|
65
|
-
NSRectFill(cellFrame);
|
|
66
|
-
}
|
|
51
|
+
if (self.drawsBackground && self.backgroundColor && self.backgroundColor.alphaComponent > 0) {
|
|
52
|
+
[self.backgroundColor set];
|
|
53
|
+
NSRectFill(cellFrame);
|
|
67
54
|
}
|
|
68
55
|
|
|
69
56
|
[super drawInteriorWithFrame:[self titleRectForBounds:cellFrame] inView:controlView];
|
|
@@ -86,11 +73,7 @@
|
|
|
86
73
|
@end
|
|
87
74
|
#endif // macOS]
|
|
88
75
|
|
|
89
|
-
#ifdef RCT_SUBCLASS_SECURETEXTFIELD
|
|
90
|
-
@implementation RCTUISecureTextField {
|
|
91
|
-
#else
|
|
92
76
|
@implementation RCTUITextField {
|
|
93
|
-
#endif
|
|
94
77
|
RCTBackedTextFieldDelegateAdapter *_textInputDelegateAdapter;
|
|
95
78
|
NSDictionary<NSAttributedStringKey, id> *_defaultTextAttributes;
|
|
96
79
|
#if !TARGET_OS_OSX // [macOS]
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
// [macOS]
|
|
9
|
+
|
|
10
|
+
#if TARGET_OS_OSX
|
|
11
|
+
|
|
12
|
+
#import <React/RCTUISecureTextField.h>
|
|
13
|
+
#import <React/RCTUIKit.h>
|
|
14
|
+
|
|
15
|
+
#pragma mark - RCTUISecureTextFieldCell
|
|
16
|
+
|
|
17
|
+
@interface RCTUISecureTextFieldCell : NSSecureTextFieldCell
|
|
18
|
+
|
|
19
|
+
@property (nonatomic, assign) UIEdgeInsets textContainerInset;
|
|
20
|
+
@property (nonatomic, getter=isAutomaticTextReplacementEnabled) BOOL automaticTextReplacementEnabled;
|
|
21
|
+
@property (nonatomic, getter=isAutomaticSpellingCorrectionEnabled) BOOL automaticSpellingCorrectionEnabled;
|
|
22
|
+
@property (nonatomic, getter=isContinuousSpellCheckingEnabled) BOOL continuousSpellCheckingEnabled;
|
|
23
|
+
@property (nonatomic, getter=isGrammarCheckingEnabled) BOOL grammarCheckingEnabled;
|
|
24
|
+
@property (nonatomic, strong, nullable) RCTPlatformColor *selectionColor;
|
|
25
|
+
@property (nonatomic, strong, nullable) RCTPlatformColor *insertionPointColor;
|
|
26
|
+
|
|
27
|
+
@end
|
|
28
|
+
|
|
29
|
+
@implementation RCTUISecureTextFieldCell
|
|
30
|
+
|
|
31
|
+
- (NSRect)titleRectForBounds:(NSRect)rect
|
|
32
|
+
{
|
|
33
|
+
return UIEdgeInsetsInsetRect([super titleRectForBounds:rect], self.textContainerInset);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
- (void)editWithFrame:(NSRect)rect inView:(NSView *)controlView editor:(NSText *)textObj delegate:(id)delegate event:(NSEvent *)event
|
|
37
|
+
{
|
|
38
|
+
[super editWithFrame:[self titleRectForBounds:rect] inView:controlView editor:textObj delegate:delegate event:event];
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
- (void)selectWithFrame:(NSRect)rect inView:(NSView *)controlView editor:(NSText *)textObj delegate:(id)delegate start:(NSInteger)selStart length:(NSInteger)selLength
|
|
42
|
+
{
|
|
43
|
+
[super selectWithFrame:[self titleRectForBounds:rect] inView:controlView editor:textObj delegate:delegate start:selStart length:selLength];
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
- (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView
|
|
47
|
+
{
|
|
48
|
+
if (self.drawsBackground && self.backgroundColor && self.backgroundColor.alphaComponent > 0) {
|
|
49
|
+
[self.backgroundColor set];
|
|
50
|
+
NSRectFill(cellFrame);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
[super drawInteriorWithFrame:[self titleRectForBounds:cellFrame] inView:controlView];
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
- (NSText *)setUpFieldEditorAttributes:(NSText *)textObj
|
|
57
|
+
{
|
|
58
|
+
NSTextView *fieldEditor = (NSTextView *)[super setUpFieldEditorAttributes:textObj];
|
|
59
|
+
fieldEditor.automaticSpellingCorrectionEnabled = self.isAutomaticSpellingCorrectionEnabled;
|
|
60
|
+
fieldEditor.automaticTextReplacementEnabled = self.isAutomaticTextReplacementEnabled;
|
|
61
|
+
fieldEditor.continuousSpellCheckingEnabled = self.isContinuousSpellCheckingEnabled;
|
|
62
|
+
fieldEditor.grammarCheckingEnabled = self.isGrammarCheckingEnabled;
|
|
63
|
+
NSMutableDictionary *selectTextAttributes = fieldEditor.selectedTextAttributes.mutableCopy;
|
|
64
|
+
selectTextAttributes[NSBackgroundColorAttributeName] = self.selectionColor ?: [NSColor selectedControlColor];
|
|
65
|
+
fieldEditor.selectedTextAttributes = selectTextAttributes;
|
|
66
|
+
fieldEditor.insertionPointColor = self.insertionPointColor ?: [NSColor textColor];
|
|
67
|
+
return fieldEditor;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
@end
|
|
71
|
+
|
|
72
|
+
#pragma mark - RCTUISecureTextField
|
|
73
|
+
|
|
74
|
+
@implementation RCTUISecureTextField
|
|
75
|
+
|
|
76
|
+
+ (Class)cellClass
|
|
77
|
+
{
|
|
78
|
+
return RCTUISecureTextFieldCell.class;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@end
|
|
82
|
+
|
|
83
|
+
#endif // TARGET_OS_OSX
|
|
File without changes
|
|
File without changes
|
package/React/Base/RCTVersion.m
CHANGED
|
@@ -157,7 +157,9 @@ RCTSendScrollEventForNativeAnimations_DEPRECATED(RCTUIScrollView *scrollView, NS
|
|
|
157
157
|
#if !TARGET_OS_OSX // [macOS]
|
|
158
158
|
[_scrollView addSubview:_containerView];
|
|
159
159
|
#else // [macOS
|
|
160
|
-
|
|
160
|
+
// Force overlay scrollbar style to avoid layout issues with legacy scrollbars.
|
|
161
|
+
_scrollView.scrollerStyle = NSScrollerStyleOverlay;
|
|
162
|
+
// Don't set autoresizingMask — AppKit corrupts the documentView frame during tile/resize.
|
|
161
163
|
[_scrollView setDocumentView:_containerView];
|
|
162
164
|
#endif // macOS]
|
|
163
165
|
|
|
@@ -185,26 +187,11 @@ RCTSendScrollEventForNativeAnimations_DEPRECATED(RCTUIScrollView *scrollView, NS
|
|
|
185
187
|
}
|
|
186
188
|
|
|
187
189
|
#if TARGET_OS_OSX // [macOS
|
|
188
|
-
- (void)
|
|
189
|
-
{
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
// it fills the visible area before React's first layout pass. However, AppKit's autoresizing can
|
|
194
|
-
// corrupt the documentView's frame by adding the NSClipView's size delta to the container's
|
|
195
|
-
// dimensions (e.g., during initial tile or window resize), inflating it well beyond the correct
|
|
196
|
-
// content size. This produces massive horizontal and vertical overflow on first render.
|
|
197
|
-
//
|
|
198
|
-
// After React has set the content size via updateState:, we reset the documentView frame here to
|
|
199
|
-
// undo any autoresizing corruption. This runs after AppKit's layout (which triggers autoresizing),
|
|
200
|
-
// so it reliably corrects the frame.
|
|
201
|
-
if (!CGSizeEqualToSize(_contentSize, CGSizeZero)) {
|
|
202
|
-
CGRect containerFrame = _containerView.frame;
|
|
203
|
-
if (!CGSizeEqualToSize(containerFrame.size, _contentSize)) {
|
|
204
|
-
containerFrame.size = _contentSize;
|
|
205
|
-
_containerView.frame = containerFrame;
|
|
206
|
-
}
|
|
207
|
-
}
|
|
190
|
+
- (void)_preferredScrollerStyleDidChange:(NSNotification *)notification
|
|
191
|
+
{
|
|
192
|
+
// Re-force overlay style when system preference changes.
|
|
193
|
+
_scrollView.scrollerStyle = NSScrollerStyleOverlay;
|
|
194
|
+
[_scrollView tile];
|
|
208
195
|
}
|
|
209
196
|
#endif // macOS]
|
|
210
197
|
|
|
@@ -585,6 +572,18 @@ static inline UIViewAnimationOptions animationOptionsWithCurve(UIViewAnimationCu
|
|
|
585
572
|
return nil;
|
|
586
573
|
}
|
|
587
574
|
|
|
575
|
+
#if TARGET_OS_OSX // [macOS
|
|
576
|
+
// Check scrollbars before content subviews — scrollers are NSScrollView children,
|
|
577
|
+
// not documentView children, so full-width content would swallow their clicks.
|
|
578
|
+
if (isPointInside) {
|
|
579
|
+
NSPoint scrollViewPoint = [_scrollView convertPoint:point fromView:self];
|
|
580
|
+
NSView *scrollViewHit = [_scrollView hitTest:scrollViewPoint];
|
|
581
|
+
if ([scrollViewHit isKindOfClass:[NSScroller class]]) {
|
|
582
|
+
return (RCTPlatformView *)scrollViewHit;
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
#endif // macOS]
|
|
586
|
+
|
|
588
587
|
for (RCTPlatformView *subview in [_containerView.subviews reverseObjectEnumerator]) { // [macOS]
|
|
589
588
|
RCTPlatformView *hitView = RCTUIViewHitTestWithEvent(subview, point, self, event); // [macOS]
|
|
590
589
|
if (hitView) {
|
|
@@ -889,12 +888,19 @@ static inline UIViewAnimationOptions animationOptionsWithCurve(UIViewAnimationCu
|
|
|
889
888
|
[defaultCenter removeObserver:self
|
|
890
889
|
name:NSViewBoundsDidChangeNotification
|
|
891
890
|
object:_scrollView.contentView];
|
|
891
|
+
[defaultCenter removeObserver:self
|
|
892
|
+
name:NSPreferredScrollerStyleDidChangeNotification
|
|
893
|
+
object:nil];
|
|
892
894
|
} else {
|
|
893
895
|
// Register for scrollview's clipview bounds change notifications so we can track scrolling
|
|
894
896
|
[defaultCenter addObserver:self
|
|
895
897
|
selector:@selector(scrollViewDocumentViewBoundsDidChange:)
|
|
896
898
|
name:NSViewBoundsDidChangeNotification
|
|
897
899
|
object:_scrollView.contentView]; // NSClipView
|
|
900
|
+
[defaultCenter addObserver:self
|
|
901
|
+
selector:@selector(_preferredScrollerStyleDidChange:)
|
|
902
|
+
name:NSPreferredScrollerStyleDidChangeNotification
|
|
903
|
+
object:nil];
|
|
898
904
|
}
|
|
899
905
|
#endif // macOS]
|
|
900
906
|
|