react-native-macos 0.74.26 → 0.74.28
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/Components/TextInput/TextInput.d.ts +16 -0
- package/Libraries/Components/TextInput/TextInput.flow.js +2 -0
- package/Libraries/Components/TextInput/TextInput.js +4 -0
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Network/RCTDataRequestHandler.mm +7 -10
- package/Libraries/Network/RCTFileRequestHandler.mm +8 -11
- package/React/Base/RCTVersion.m +1 -1
- 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
|
@@ -1048,6 +1048,22 @@ interface TextInputState {
|
|
|
1048
1048
|
* noop if it wasn't focused
|
|
1049
1049
|
*/
|
|
1050
1050
|
blurTextInput(textField?: React.ElementRef<HostComponent<unknown>>): void;
|
|
1051
|
+
|
|
1052
|
+
// [macOS
|
|
1053
|
+
/**
|
|
1054
|
+
* @param textField ref of the text field that was focused
|
|
1055
|
+
* Call on custom implementations of TextInput to notify the control was focused
|
|
1056
|
+
* noop if it was already focused
|
|
1057
|
+
*/
|
|
1058
|
+
onTextInputFocus(textField?: React.ElementRef<HostComponent<unknown>>): void;
|
|
1059
|
+
|
|
1060
|
+
/**
|
|
1061
|
+
* @param textField ref of the text field that was blurred
|
|
1062
|
+
* Call on custom implementations of TextInput to notify the control was blurred
|
|
1063
|
+
* noop if it wasn't focused
|
|
1064
|
+
*/
|
|
1065
|
+
onTextInputBlur(textField?: React.ElementRef<HostComponent<unknown>>): void;
|
|
1066
|
+
// macOS]
|
|
1051
1067
|
}
|
|
1052
1068
|
|
|
1053
1069
|
/**
|
|
@@ -1223,6 +1223,8 @@ export type TextInputComponentStatics = $ReadOnly<{|
|
|
|
1223
1223
|
currentlyFocusedField: () => ?number,
|
|
1224
1224
|
focusTextInput: (textField: ?ComponentRef) => void,
|
|
1225
1225
|
blurTextInput: (textField: ?ComponentRef) => void,
|
|
1226
|
+
onTextInputFocus: (textField: ?ComponentRef) => void, // [macOS]
|
|
1227
|
+
onTextInputBlur: (textField: ?ComponentRef) => void, // [macOS]
|
|
1226
1228
|
|}>,
|
|
1227
1229
|
|}>;
|
|
1228
1230
|
|
|
@@ -1934,6 +1934,8 @@ ExportedForwardRef.State = {
|
|
|
1934
1934
|
currentlyFocusedField: TextInputState.currentlyFocusedField,
|
|
1935
1935
|
focusTextInput: TextInputState.focusTextInput,
|
|
1936
1936
|
blurTextInput: TextInputState.blurTextInput,
|
|
1937
|
+
onTextInputFocus: TextInputState.focusInput, // [macOS]
|
|
1938
|
+
onTextInputBlur: TextInputState.blurInput, // [macOS]
|
|
1937
1939
|
};
|
|
1938
1940
|
|
|
1939
1941
|
export type TextInputComponentStatics = $ReadOnly<{|
|
|
@@ -1942,6 +1944,8 @@ export type TextInputComponentStatics = $ReadOnly<{|
|
|
|
1942
1944
|
currentlyFocusedField: typeof TextInputState.currentlyFocusedField,
|
|
1943
1945
|
focusTextInput: typeof TextInputState.focusTextInput,
|
|
1944
1946
|
blurTextInput: typeof TextInputState.blurTextInput,
|
|
1947
|
+
onTextInputFocus: typeof TextInputState.focusInput, // [macOS]
|
|
1948
|
+
onTextInputBlur: typeof TextInputState.blurInput, // [macOS]
|
|
1945
1949
|
|}>,
|
|
1946
1950
|
|}>;
|
|
1947
1951
|
|
|
@@ -38,15 +38,13 @@ RCT_EXPORT_MODULE()
|
|
|
38
38
|
_queue.maxConcurrentOperationCount = 2;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
NSBlockOperation *strongOp = weakOp;
|
|
41
|
+
NSBlockOperation *op = [NSBlockOperation new];
|
|
42
|
+
__weak NSBlockOperation *weakOp = op;
|
|
43
|
+
[op addExecutionBlock:^{
|
|
44
|
+
NSBlockOperation *strongOp = weakOp; // Strong reference to avoid deallocation during execution
|
|
45
45
|
if (strongOp == nil || [strongOp isCancelled]) {
|
|
46
46
|
return;
|
|
47
47
|
}
|
|
48
|
-
// macOS]
|
|
49
|
-
|
|
50
48
|
// Get mime type
|
|
51
49
|
NSRange firstSemicolon = [request.URL.resourceSpecifier rangeOfString:@";"];
|
|
52
50
|
NSString *mimeType =
|
|
@@ -58,18 +56,17 @@ RCT_EXPORT_MODULE()
|
|
|
58
56
|
expectedContentLength:-1
|
|
59
57
|
textEncodingName:nil];
|
|
60
58
|
|
|
61
|
-
[delegate URLRequest:strongOp didReceiveResponse:response];
|
|
59
|
+
[delegate URLRequest:strongOp didReceiveResponse:response];
|
|
62
60
|
|
|
63
61
|
// Load data
|
|
64
62
|
NSError *error;
|
|
65
63
|
NSData *data = [NSData dataWithContentsOfURL:request.URL options:NSDataReadingMappedIfSafe error:&error];
|
|
66
64
|
if (data) {
|
|
67
|
-
[delegate URLRequest:strongOp didReceiveData:data];
|
|
65
|
+
[delegate URLRequest:strongOp didReceiveData:data];
|
|
68
66
|
}
|
|
69
|
-
[delegate URLRequest:strongOp didCompleteWithError:error];
|
|
67
|
+
[delegate URLRequest:strongOp didCompleteWithError:error];
|
|
70
68
|
}];
|
|
71
69
|
|
|
72
|
-
weakOp = op;
|
|
73
70
|
[_queue addOperation:op];
|
|
74
71
|
return op;
|
|
75
72
|
}
|
|
@@ -46,21 +46,19 @@ RCT_EXPORT_MODULE()
|
|
|
46
46
|
_fileQueue.maxConcurrentOperationCount = 4;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
NSBlockOperation *strongOp = weakOp;
|
|
49
|
+
NSBlockOperation *op = [NSBlockOperation new];
|
|
50
|
+
__weak NSBlockOperation *weakOp = op;
|
|
51
|
+
[op addExecutionBlock:^{
|
|
52
|
+
NSBlockOperation *strongOp = weakOp; // Strong reference to avoid deallocation during execution
|
|
53
53
|
if (strongOp == nil || [strongOp isCancelled]) {
|
|
54
54
|
return;
|
|
55
55
|
}
|
|
56
|
-
// macOS]
|
|
57
|
-
|
|
58
56
|
// Get content length
|
|
59
57
|
NSError *error = nil;
|
|
60
58
|
NSFileManager *fileManager = [NSFileManager new];
|
|
61
59
|
NSDictionary<NSString *, id> *fileAttributes = [fileManager attributesOfItemAtPath:request.URL.path error:&error];
|
|
62
60
|
if (!fileAttributes) {
|
|
63
|
-
[delegate URLRequest:strongOp didCompleteWithError:error];
|
|
61
|
+
[delegate URLRequest:strongOp didCompleteWithError:error];
|
|
64
62
|
return;
|
|
65
63
|
}
|
|
66
64
|
|
|
@@ -77,17 +75,16 @@ RCT_EXPORT_MODULE()
|
|
|
77
75
|
expectedContentLength:[fileAttributes[NSFileSize] ?: @-1 integerValue]
|
|
78
76
|
textEncodingName:nil];
|
|
79
77
|
|
|
80
|
-
[delegate URLRequest:strongOp didReceiveResponse:response];
|
|
78
|
+
[delegate URLRequest:strongOp didReceiveResponse:response];
|
|
81
79
|
|
|
82
80
|
// Load data
|
|
83
81
|
NSData *data = [NSData dataWithContentsOfURL:request.URL options:NSDataReadingMappedIfSafe error:&error];
|
|
84
82
|
if (data) {
|
|
85
|
-
[delegate URLRequest:strongOp didReceiveData:data];
|
|
83
|
+
[delegate URLRequest:strongOp didReceiveData:data];
|
|
86
84
|
}
|
|
87
|
-
[delegate URLRequest:strongOp didCompleteWithError:error];
|
|
85
|
+
[delegate URLRequest:strongOp didCompleteWithError:error];
|
|
88
86
|
}];
|
|
89
87
|
|
|
90
|
-
weakOp = op;
|
|
91
88
|
[_fileQueue addOperation:op];
|
|
92
89
|
return op;
|
|
93
90
|
}
|
package/React/Base/RCTVersion.m
CHANGED