react-native-macos 0.76.8 → 0.76.10
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/AppDelegate/RCTAppSetupUtils.mm +1 -1
- package/Libraries/AppDelegate/React-RCTAppDelegate.podspec +1 -0
- package/Libraries/Blob/React-RCTBlob.podspec +3 -1
- 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/Components/TextInput/TextInputState.js +5 -1
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Inspector/NetworkOverlay.js +1 -1
- package/Libraries/Lists/FillRateHelper.js +3 -3
- package/Libraries/Lists/FlatList.d.ts +1 -1
- package/Libraries/Lists/FlatList.js +2 -2
- package/Libraries/Lists/SectionList.d.ts +1 -1
- package/Libraries/Lists/SectionList.js +2 -2
- package/Libraries/Lists/SectionListModern.js +2 -2
- package/Libraries/Lists/ViewabilityHelper.js +3 -3
- package/Libraries/Lists/VirtualizeUtils.js +2 -2
- package/Libraries/Lists/VirtualizedList.js +3 -3
- package/Libraries/Lists/VirtualizedListContext.js +2 -2
- package/Libraries/Lists/VirtualizedSectionList.js +3 -3
- package/Libraries/Modal/Modal.js +1 -1
- package/Libraries/Network/FormData.js +11 -3
- package/Libraries/Network/RCTDataRequestHandler.mm +17 -3
- package/Libraries/Network/RCTFileRequestHandler.mm +17 -3
- package/Libraries/Text/Text.d.ts +1 -0
- package/Libraries/Text/TextInput/Singleline/RCTUITextField.mm +1 -1
- package/Libraries/Utilities/ReactNativeTestTools.js +1 -1
- package/React/Base/RCTVersion.m +1 -1
- package/React/CoreModules/React-CoreModules.podspec +9 -10
- package/React/CxxModule/RCTCxxMethod.mm +10 -2
- package/React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec-generated.mm +2354 -0
- package/React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec.h +2820 -0
- package/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +1 -5
- package/React/Fabric/Surface/RCTFabricSurface.mm +1 -0
- package/React/React-RCTFabric.podspec +1 -0
- package/React/Views/RCTViewKeyboardEvent.m +24 -0
- package/React/third-party.xcconfig +1 -1
- package/React-Core.podspec +2 -1
- package/ReactAndroid/api/ReactAndroid.api +1 -1
- package/ReactAndroid/build.gradle.kts +24 -0
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerBase.java +3 -1
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/HMRClient.java +4 -1
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java +13 -8
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
- package/ReactAndroid/src/main/jni/CMakeLists.txt +1 -0
- package/ReactAndroid/src/main/jni/third-party/fast_float/CMakeLists.txt +13 -0
- package/ReactAndroid/src/main/jni/third-party/folly/CMakeLists.txt +5 -6
- package/ReactCommon/React-Fabric.podspec +2 -1
- package/ReactCommon/React-FabricComponents.podspec +3 -1
- package/ReactCommon/React-FabricImage.podspec +7 -5
- package/ReactCommon/ReactCommon.podspec +9 -8
- package/ReactCommon/cxxreact/CxxNativeModule.cpp +6 -3
- package/ReactCommon/cxxreact/React-cxxreact.podspec +11 -10
- package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
- package/ReactCommon/hermes/React-hermes.podspec +7 -6
- package/ReactCommon/jsi/React-jsi.podspec +4 -3
- package/ReactCommon/jsiexecutor/React-jsiexecutor.podspec +7 -6
- package/ReactCommon/jsinspector-modern/React-jsinspector.podspec +4 -4
- package/ReactCommon/react/nativemodule/core/platform/ios/React-NativeModulesApple.podspec +1 -1
- package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.mm +24 -13
- package/ReactCommon/react/nativemodule/samples/ReactCommon-Samples.podspec +3 -1
- package/ReactCommon/react/renderer/debug/React-rendererdebug.podspec +4 -2
- package/ReactCommon/react/renderer/graphics/React-graphics.podspec +4 -2
- package/ReactCommon/react/renderer/imagemanager/platform/ios/React-ImageManager.podspec +1 -0
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.h +24 -3
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.mm +1 -41
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextLayoutManager.mm +4 -5
- package/ReactCommon/reactperflogger/React-perflogger.podspec +1 -0
- package/cli.js +11 -2
- package/gradle/libs.versions.toml +3 -2
- package/package.json +10 -9
- package/react-native.config.js +24 -23
- package/scripts/cocoapods/codegen_utils.rb +1 -2
- package/scripts/cocoapods/helpers.rb +13 -1
- package/scripts/cocoapods/new_architecture.rb +1 -0
- package/scripts/cocoapods/utils.rb +13 -5
- package/scripts/react_native_pods.rb +14 -0
- package/sdks/hermes-engine/hermes-engine.podspec +3 -4
- package/sdks/hermes-engine/hermes-utils.rb +70 -18
- package/third-party-podspecs/RCT-Folly.podspec +16 -7
- package/third-party-podspecs/fast_float.podspec +29 -0
- package/third-party-podspecs/fmt.podspec +2 -2
- package/types/index.d.ts +1 -1
|
@@ -55,7 +55,7 @@ RCTAppSetupDefaultRootView(RCTBridge *bridge, NSString *moduleName, NSDictionary
|
|
|
55
55
|
id<RCTSurfaceProtocol> surface = [[RCTFabricSurface alloc] initWithBridge:bridge
|
|
56
56
|
moduleName:moduleName
|
|
57
57
|
initialProperties:initialProperties];
|
|
58
|
-
RCTPlatformView *rootView = [[RCTSurfaceHostingProxyRootView alloc] initWithSurface:surface];
|
|
58
|
+
RCTPlatformView *rootView = [[RCTSurfaceHostingProxyRootView alloc] initWithSurface:surface]; // [macOS]
|
|
59
59
|
[surface start];
|
|
60
60
|
return rootView;
|
|
61
61
|
}
|
|
@@ -32,6 +32,7 @@ header_search_paths = [
|
|
|
32
32
|
"$(PODS_ROOT)/Headers/Private/React-Core",
|
|
33
33
|
"$(PODS_ROOT)/boost",
|
|
34
34
|
"$(PODS_ROOT)/DoubleConversion",
|
|
35
|
+
"$(PODS_ROOT)/fast_float/include",
|
|
35
36
|
"$(PODS_ROOT)/fmt/include",
|
|
36
37
|
"$(PODS_ROOT)/RCT-Folly",
|
|
37
38
|
"${PODS_ROOT}/Headers/Public/FlipperKit",
|
|
@@ -24,6 +24,7 @@ header_search_paths = [
|
|
|
24
24
|
"\"$(PODS_ROOT)/RCT-Folly\"",
|
|
25
25
|
"\"$(PODS_ROOT)/boost\"",
|
|
26
26
|
"\"$(PODS_ROOT)/DoubleConversion\"",
|
|
27
|
+
"\"$(PODS_ROOT)/fast_float/include\"",
|
|
27
28
|
"\"$(PODS_ROOT)/fmt/include\"",
|
|
28
29
|
"\"${PODS_ROOT}/Headers/Public/ReactCodegen/react/renderer/components\"",
|
|
29
30
|
]
|
|
@@ -48,7 +49,8 @@ Pod::Spec.new do |s|
|
|
|
48
49
|
}
|
|
49
50
|
|
|
50
51
|
s.dependency "DoubleConversion"
|
|
51
|
-
s.dependency "
|
|
52
|
+
s.dependency "fast_float"
|
|
53
|
+
s.dependency "fmt"
|
|
52
54
|
s.dependency "RCT-Folly", folly_version
|
|
53
55
|
s.dependency "React-jsi"
|
|
54
56
|
s.dependency "React-Core/RCTBlobHeaders"
|
|
@@ -1059,6 +1059,22 @@ interface TextInputState {
|
|
|
1059
1059
|
* noop if it wasn't focused
|
|
1060
1060
|
*/
|
|
1061
1061
|
blurTextInput(textField?: React.ElementRef<HostComponent<unknown>>): void;
|
|
1062
|
+
|
|
1063
|
+
// [macOS
|
|
1064
|
+
/**
|
|
1065
|
+
* @param textField ref of the text field that was focused
|
|
1066
|
+
* Call on custom implementations of TextInput to notify the control was focused
|
|
1067
|
+
* noop if it was already focused
|
|
1068
|
+
*/
|
|
1069
|
+
onTextInputFocus(textField?: React.ElementRef<HostComponent<unknown>>): void;
|
|
1070
|
+
|
|
1071
|
+
/**
|
|
1072
|
+
* @param textField ref of the text field that was blurred
|
|
1073
|
+
* Call on custom implementations of TextInput to notify the control was blurred
|
|
1074
|
+
* noop if it wasn't focused
|
|
1075
|
+
*/
|
|
1076
|
+
onTextInputBlur(textField?: React.ElementRef<HostComponent<unknown>>): void;
|
|
1077
|
+
// macOS]
|
|
1062
1078
|
}
|
|
1063
1079
|
|
|
1064
1080
|
/**
|
|
@@ -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
|
|
|
@@ -2013,6 +2013,8 @@ ExportedForwardRef.State = {
|
|
|
2013
2013
|
currentlyFocusedField: TextInputState.currentlyFocusedField,
|
|
2014
2014
|
focusTextInput: TextInputState.focusTextInput,
|
|
2015
2015
|
blurTextInput: TextInputState.blurTextInput,
|
|
2016
|
+
onTextInputFocus: TextInputState.focusInput, // [macOS]
|
|
2017
|
+
onTextInputBlur: TextInputState.blurInput, // [macOS]
|
|
2016
2018
|
};
|
|
2017
2019
|
|
|
2018
2020
|
export type TextInputComponentStatics = $ReadOnly<{|
|
|
@@ -2021,6 +2023,8 @@ export type TextInputComponentStatics = $ReadOnly<{|
|
|
|
2021
2023
|
currentlyFocusedField: typeof TextInputState.currentlyFocusedField,
|
|
2022
2024
|
focusTextInput: typeof TextInputState.focusTextInput,
|
|
2023
2025
|
blurTextInput: typeof TextInputState.blurTextInput,
|
|
2026
|
+
onTextInputFocus: typeof TextInputState.focusInput, // [macOS]
|
|
2027
|
+
onTextInputBlur: typeof TextInputState.blurInput, // [macOS]
|
|
2024
2028
|
|}>,
|
|
2025
2029
|
|}>;
|
|
2026
2030
|
|
|
@@ -105,7 +105,11 @@ function focusTextInput(textField: ?ComponentRef) {
|
|
|
105
105
|
|
|
106
106
|
if (textField != null) {
|
|
107
107
|
const fieldCanBeFocused =
|
|
108
|
-
currentlyFocusedInputRef
|
|
108
|
+
// [macOS currentlyFocusedInputRef does not account for the fact that any arbritrary view can
|
|
109
|
+
// recieve focus on desktop. https://github.com/facebook/react-native/pull/52472/ fixes this,
|
|
110
|
+
// disable the check for now
|
|
111
|
+
// currentlyFocusedInputRef !== textField &&
|
|
112
|
+
// macOS]
|
|
109
113
|
// $FlowFixMe - `currentProps` is missing in `NativeMethods`
|
|
110
114
|
textField.currentProps?.editable !== false;
|
|
111
115
|
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
|
-
import type {RenderItemProps} from '@react-native-
|
|
13
|
+
import type {RenderItemProps} from '@react-native-macos/virtualized-lists'; // [macOS]
|
|
14
14
|
|
|
15
15
|
const ScrollView = require('../Components/ScrollView/ScrollView');
|
|
16
16
|
const TouchableHighlight = require('../Components/Touchable/TouchableHighlight');
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
|
-
import {typeof FillRateHelper as FillRateHelperType} from '@react-native-
|
|
13
|
+
import {typeof FillRateHelper as FillRateHelperType} from '@react-native-macos/virtualized-lists'; // [macOS]
|
|
14
14
|
|
|
15
15
|
const FillRateHelper: FillRateHelperType =
|
|
16
|
-
require('@react-native-
|
|
16
|
+
require('@react-native-macos/virtualized-lists').FillRateHelper; // [macOS]
|
|
17
17
|
|
|
18
|
-
export type {FillRateInfo} from '@react-native-
|
|
18
|
+
export type {FillRateInfo} from '@react-native-macos/virtualized-lists'; // [macOS]
|
|
19
19
|
module.exports = FillRateHelper;
|
|
@@ -13,7 +13,7 @@ import type {
|
|
|
13
13
|
ViewToken,
|
|
14
14
|
VirtualizedListProps,
|
|
15
15
|
ViewabilityConfig,
|
|
16
|
-
} from '@react-native-
|
|
16
|
+
} from '@react-native-macos/virtualized-lists'; // [macOS]
|
|
17
17
|
import type {ScrollViewComponent} from '../Components/ScrollView/ScrollView';
|
|
18
18
|
import type {StyleProp} from '../StyleSheet/StyleSheet';
|
|
19
19
|
import type {ViewStyle} from '../StyleSheet/StyleSheetTypes';
|
|
@@ -15,14 +15,14 @@ import type {
|
|
|
15
15
|
RenderItemType,
|
|
16
16
|
ViewabilityConfigCallbackPair,
|
|
17
17
|
ViewToken,
|
|
18
|
-
} from '@react-native-
|
|
18
|
+
} from '@react-native-macos/virtualized-lists'; // [macOS]
|
|
19
19
|
|
|
20
20
|
import * as ReactNativeFeatureFlags from '../../src/private/featureflags/ReactNativeFeatureFlags';
|
|
21
21
|
import {type ScrollResponderType} from '../Components/ScrollView/ScrollView';
|
|
22
22
|
import {
|
|
23
23
|
VirtualizedList,
|
|
24
24
|
keyExtractor as defaultKeyExtractor,
|
|
25
|
-
} from '@react-native-
|
|
25
|
+
} from '@react-native-macos/virtualized-lists'; // [macOS]
|
|
26
26
|
import memoizeOne from 'memoize-one';
|
|
27
27
|
|
|
28
28
|
const View = require('../Components/View/View');
|
|
@@ -11,7 +11,7 @@ import type * as React from 'react';
|
|
|
11
11
|
import type {
|
|
12
12
|
ListRenderItemInfo,
|
|
13
13
|
VirtualizedListWithoutRenderItemProps,
|
|
14
|
-
} from '@react-native-
|
|
14
|
+
} from '@react-native-macos/virtualized-lists'; // [macOS]
|
|
15
15
|
import type {
|
|
16
16
|
ScrollView,
|
|
17
17
|
ScrollViewProps,
|
|
@@ -15,10 +15,10 @@ import type {
|
|
|
15
15
|
ScrollToLocationParamsType,
|
|
16
16
|
SectionBase as _SectionBase,
|
|
17
17
|
VirtualizedSectionListProps,
|
|
18
|
-
} from '@react-native-
|
|
18
|
+
} from '@react-native-macos/virtualized-lists'; // [macOS]
|
|
19
19
|
|
|
20
20
|
import Platform from '../Utilities/Platform';
|
|
21
|
-
import {VirtualizedSectionList} from '@react-native-
|
|
21
|
+
import {VirtualizedSectionList} from '@react-native-macos/virtualized-lists'; // [macOS]
|
|
22
22
|
import * as React from 'react';
|
|
23
23
|
|
|
24
24
|
type Item = any;
|
|
@@ -15,11 +15,11 @@ import type {
|
|
|
15
15
|
ScrollToLocationParamsType,
|
|
16
16
|
SectionBase as _SectionBase,
|
|
17
17
|
VirtualizedSectionListProps,
|
|
18
|
-
} from '@react-native-
|
|
18
|
+
} from '@react-native-macos/virtualized-lists'; // [macOS]
|
|
19
19
|
import type {AbstractComponent, ElementRef} from 'react';
|
|
20
20
|
|
|
21
21
|
import Platform from '../Utilities/Platform';
|
|
22
|
-
import {VirtualizedSectionList} from '@react-native-
|
|
22
|
+
import {VirtualizedSectionList} from '@react-native-macos/virtualized-lists'; // [macOS]
|
|
23
23
|
import React, {forwardRef, useImperativeHandle, useRef} from 'react';
|
|
24
24
|
|
|
25
25
|
type Item = any;
|
|
@@ -14,11 +14,11 @@ export type {
|
|
|
14
14
|
ViewToken,
|
|
15
15
|
ViewabilityConfig,
|
|
16
16
|
ViewabilityConfigCallbackPair,
|
|
17
|
-
} from '@react-native-
|
|
17
|
+
} from '@react-native-macos/virtualized-lists'; // [macOS]
|
|
18
18
|
|
|
19
|
-
import {typeof ViewabilityHelper as ViewabilityHelperType} from '@react-native-
|
|
19
|
+
import {typeof ViewabilityHelper as ViewabilityHelperType} from '@react-native-macos/virtualized-lists'; // [macOS]
|
|
20
20
|
|
|
21
21
|
const ViewabilityHelper: ViewabilityHelperType =
|
|
22
|
-
require('@react-native-
|
|
22
|
+
require('@react-native-macos/virtualized-lists').ViewabilityHelper; // [macOS]
|
|
23
23
|
|
|
24
24
|
module.exports = ViewabilityHelper;
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
|
-
import {typeof keyExtractor as KeyExtractorType} from '@react-native-
|
|
13
|
+
import {typeof keyExtractor as KeyExtractorType} from '@react-native-macos/virtualized-lists'; // [macOS]
|
|
14
14
|
|
|
15
15
|
const keyExtractor: KeyExtractorType =
|
|
16
|
-
require('@react-native-
|
|
16
|
+
require('@react-native-macos/virtualized-lists').keyExtractor; // [macOS]
|
|
17
17
|
|
|
18
18
|
module.exports = {keyExtractor};
|
|
@@ -10,14 +10,14 @@
|
|
|
10
10
|
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
|
-
import {typeof VirtualizedList as VirtualizedListType} from '@react-native-
|
|
13
|
+
import {typeof VirtualizedList as VirtualizedListType} from '@react-native-macos/virtualized-lists'; // [macOS]
|
|
14
14
|
|
|
15
15
|
const VirtualizedList: VirtualizedListType =
|
|
16
|
-
require('@react-native-
|
|
16
|
+
require('@react-native-macos/virtualized-lists').VirtualizedList; // [macOS]
|
|
17
17
|
|
|
18
18
|
export type {
|
|
19
19
|
RenderItemProps,
|
|
20
20
|
RenderItemType,
|
|
21
21
|
Separators,
|
|
22
|
-
} from '@react-native-
|
|
22
|
+
} from '@react-native-macos/virtualized-lists'; // [macOS]
|
|
23
23
|
module.exports = VirtualizedList;
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
|
-
import {typeof VirtualizedListContextResetter as VirtualizedListContextResetterType} from '@react-native-
|
|
13
|
+
import {typeof VirtualizedListContextResetter as VirtualizedListContextResetterType} from '@react-native-macos/virtualized-lists'; // [macOS]
|
|
14
14
|
|
|
15
15
|
const VirtualizedListContextResetter: VirtualizedListContextResetterType =
|
|
16
|
-
require('@react-native-
|
|
16
|
+
require('@react-native-macos/virtualized-lists').VirtualizedListContextResetter; // [macOS]
|
|
17
17
|
|
|
18
18
|
module.exports = {VirtualizedListContextResetter};
|
|
@@ -10,13 +10,13 @@
|
|
|
10
10
|
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
|
-
import {typeof VirtualizedSectionList as VirtualizedSectionListType} from '@react-native-
|
|
13
|
+
import {typeof VirtualizedSectionList as VirtualizedSectionListType} from '@react-native-macos/virtualized-lists'; // [macOS]
|
|
14
14
|
|
|
15
15
|
const VirtualizedSectionList: VirtualizedSectionListType =
|
|
16
|
-
require('@react-native-
|
|
16
|
+
require('@react-native-macos/virtualized-lists').VirtualizedSectionList; // [macOS]
|
|
17
17
|
|
|
18
18
|
export type {
|
|
19
19
|
SectionBase,
|
|
20
20
|
ScrollToLocationParamsType,
|
|
21
|
-
} from '@react-native-
|
|
21
|
+
} from '@react-native-macos/virtualized-lists'; // [macOS]
|
|
22
22
|
module.exports = VirtualizedSectionList;
|
package/Libraries/Modal/Modal.js
CHANGED
|
@@ -17,7 +17,7 @@ import {type EventSubscription} from '../vendor/emitter/EventEmitter';
|
|
|
17
17
|
import ModalInjection from './ModalInjection';
|
|
18
18
|
import NativeModalManager from './NativeModalManager';
|
|
19
19
|
import RCTModalHostView from './RCTModalHostViewNativeComponent';
|
|
20
|
-
import {VirtualizedListContextResetter} from '@react-native-
|
|
20
|
+
import {VirtualizedListContextResetter} from '@react-native-macos/virtualized-lists'; // [macOS]
|
|
21
21
|
|
|
22
22
|
const ScrollView = require('../Components/ScrollView/ScrollView');
|
|
23
23
|
const View = require('../Components/View/View');
|
|
@@ -28,6 +28,15 @@ type FormDataPart =
|
|
|
28
28
|
...
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
+
/**
|
|
32
|
+
* Encode a FormData filename compliant with RFC 2183
|
|
33
|
+
*
|
|
34
|
+
* https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition#directives
|
|
35
|
+
*/
|
|
36
|
+
function encodeFilename(filename: string): string {
|
|
37
|
+
return encodeURIComponent(filename.replace(/\//g, '_'));
|
|
38
|
+
}
|
|
39
|
+
|
|
31
40
|
/**
|
|
32
41
|
* Polyfill for XMLHttpRequest2 FormData API, allowing multipart POST requests
|
|
33
42
|
* with mixed data (string, native files) to be submitted via XMLHttpRequest.
|
|
@@ -82,9 +91,8 @@ class FormData {
|
|
|
82
91
|
// content type (cf. web Blob interface.)
|
|
83
92
|
if (typeof value === 'object' && !Array.isArray(value) && value) {
|
|
84
93
|
if (typeof value.name === 'string') {
|
|
85
|
-
headers['content-disposition'] +=
|
|
86
|
-
value.name
|
|
87
|
-
}"; filename*=utf-8''${encodeURI(value.name)}`;
|
|
94
|
+
headers['content-disposition'] +=
|
|
95
|
+
`; filename="${encodeFilename(value.name)}"`;
|
|
88
96
|
}
|
|
89
97
|
if (typeof value.type === 'string') {
|
|
90
98
|
headers['content-type'] = value.type;
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
#import <React/RCTDataRequestHandler.h>
|
|
9
9
|
#import <ReactCommon/RCTTurboModule.h>
|
|
10
10
|
|
|
11
|
+
#import <mutex>
|
|
12
|
+
|
|
11
13
|
#import "RCTNetworkPlugins.h"
|
|
12
14
|
|
|
13
15
|
@interface RCTDataRequestHandler () <RCTTurboModule>
|
|
@@ -15,14 +17,22 @@
|
|
|
15
17
|
|
|
16
18
|
@implementation RCTDataRequestHandler {
|
|
17
19
|
NSOperationQueue *_queue;
|
|
20
|
+
std::mutex _operationHandlerMutexLock;
|
|
18
21
|
}
|
|
19
22
|
|
|
20
23
|
RCT_EXPORT_MODULE()
|
|
21
24
|
|
|
22
25
|
- (void)invalidate
|
|
23
26
|
{
|
|
24
|
-
|
|
25
|
-
_queue
|
|
27
|
+
std::lock_guard<std::mutex> lock(_operationHandlerMutexLock);
|
|
28
|
+
if (_queue) {
|
|
29
|
+
for (NSOperation *operation in _queue.operations) {
|
|
30
|
+
if (!operation.isCancelled && !operation.isFinished) {
|
|
31
|
+
[operation cancel];
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
_queue = nil;
|
|
35
|
+
}
|
|
26
36
|
}
|
|
27
37
|
|
|
28
38
|
- (BOOL)canHandleRequest:(NSURLRequest *)request
|
|
@@ -32,6 +42,7 @@ RCT_EXPORT_MODULE()
|
|
|
32
42
|
|
|
33
43
|
- (NSOperation *)sendRequest:(NSURLRequest *)request withDelegate:(id<RCTURLRequestDelegate>)delegate
|
|
34
44
|
{
|
|
45
|
+
std::lock_guard<std::mutex> lock(_operationHandlerMutexLock);
|
|
35
46
|
// Lazy setup
|
|
36
47
|
if (!_queue) {
|
|
37
48
|
_queue = [NSOperationQueue new];
|
|
@@ -73,7 +84,10 @@ RCT_EXPORT_MODULE()
|
|
|
73
84
|
|
|
74
85
|
- (void)cancelRequest:(NSOperation *)op
|
|
75
86
|
{
|
|
76
|
-
|
|
87
|
+
std::lock_guard<std::mutex> lock(_operationHandlerMutexLock);
|
|
88
|
+
if (!op.isCancelled && !op.isFinished) {
|
|
89
|
+
[op cancel];
|
|
90
|
+
}
|
|
77
91
|
}
|
|
78
92
|
|
|
79
93
|
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
|
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
|
|
8
8
|
#import <React/RCTFileRequestHandler.h>
|
|
9
9
|
|
|
10
|
+
#import <mutex>
|
|
11
|
+
|
|
10
12
|
#if !TARGET_OS_OSX // [macOS]
|
|
11
13
|
#import <MobileCoreServices/MobileCoreServices.h>
|
|
12
14
|
#else // [macOS
|
|
@@ -23,14 +25,22 @@
|
|
|
23
25
|
|
|
24
26
|
@implementation RCTFileRequestHandler {
|
|
25
27
|
NSOperationQueue *_fileQueue;
|
|
28
|
+
std::mutex _operationHandlerMutexLock;
|
|
26
29
|
}
|
|
27
30
|
|
|
28
31
|
RCT_EXPORT_MODULE()
|
|
29
32
|
|
|
30
33
|
- (void)invalidate
|
|
31
34
|
{
|
|
32
|
-
|
|
33
|
-
_fileQueue
|
|
35
|
+
std::lock_guard<std::mutex> lock(_operationHandlerMutexLock);
|
|
36
|
+
if (_fileQueue) {
|
|
37
|
+
for (NSOperation *operation in _fileQueue.operations) {
|
|
38
|
+
if (!operation.isCancelled && !operation.isFinished) {
|
|
39
|
+
[operation cancel];
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
_fileQueue = nil;
|
|
43
|
+
}
|
|
34
44
|
}
|
|
35
45
|
|
|
36
46
|
- (BOOL)canHandleRequest:(NSURLRequest *)request
|
|
@@ -40,6 +50,7 @@ RCT_EXPORT_MODULE()
|
|
|
40
50
|
|
|
41
51
|
- (NSOperation *)sendRequest:(NSURLRequest *)request withDelegate:(id<RCTURLRequestDelegate>)delegate
|
|
42
52
|
{
|
|
53
|
+
std::lock_guard<std::mutex> lock(_operationHandlerMutexLock);
|
|
43
54
|
// Lazy setup
|
|
44
55
|
if (!_fileQueue) {
|
|
45
56
|
_fileQueue = [NSOperationQueue new];
|
|
@@ -91,7 +102,10 @@ RCT_EXPORT_MODULE()
|
|
|
91
102
|
|
|
92
103
|
- (void)cancelRequest:(NSOperation *)op
|
|
93
104
|
{
|
|
94
|
-
|
|
105
|
+
std::lock_guard<std::mutex> lock(_operationHandlerMutexLock);
|
|
106
|
+
if (!op.isCancelled && !op.isFinished) {
|
|
107
|
+
[op cancel];
|
|
108
|
+
}
|
|
95
109
|
}
|
|
96
110
|
|
|
97
111
|
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
|
package/Libraries/Text/Text.d.ts
CHANGED
|
@@ -153,7 +153,7 @@
|
|
|
153
153
|
|
|
154
154
|
- (NSArray<NSAttributedStringKey> *)validAttributesForMarkedText
|
|
155
155
|
{
|
|
156
|
-
return ((NSTextView *)self.currentEditor).validAttributesForMarkedText;
|
|
156
|
+
return ((NSTextView *)self.currentEditor).validAttributesForMarkedText ?: @[];
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
#endif // macOS]
|
|
@@ -18,7 +18,7 @@ const Switch = require('../Components/Switch/Switch').default;
|
|
|
18
18
|
const TextInput = require('../Components/TextInput/TextInput');
|
|
19
19
|
const View = require('../Components/View/View');
|
|
20
20
|
const Text = require('../Text/Text');
|
|
21
|
-
const {VirtualizedList} = require('@react-native-
|
|
21
|
+
const {VirtualizedList} = require('@react-native-macos/virtualized-lists'); // [macOS]
|
|
22
22
|
const React = require('react');
|
|
23
23
|
const ReactTestRenderer = require('react-test-renderer');
|
|
24
24
|
|
package/React/Base/RCTVersion.m
CHANGED
|
@@ -20,14 +20,12 @@ folly_config = get_folly_config()
|
|
|
20
20
|
folly_compiler_flags = folly_config[:compiler_flags]
|
|
21
21
|
folly_version = folly_config[:version]
|
|
22
22
|
|
|
23
|
-
socket_rocket_config = get_socket_rocket_config()
|
|
24
|
-
socket_rocket_version = socket_rocket_config[:version]
|
|
25
|
-
|
|
26
23
|
header_search_paths = [
|
|
27
24
|
"\"$(PODS_ROOT)/boost\"",
|
|
28
25
|
"\"$(PODS_TARGET_SRCROOT)/React/CoreModules\"",
|
|
29
26
|
"\"$(PODS_ROOT)/RCT-Folly\"",
|
|
30
27
|
"\"$(PODS_ROOT)/DoubleConversion\"",
|
|
28
|
+
"\"$(PODS_ROOT)/fast_float/include\"",
|
|
31
29
|
"\"$(PODS_ROOT)/fmt/include\"",
|
|
32
30
|
"\"${PODS_ROOT}/Headers/Public/ReactCodegen/react/renderer/components\"",
|
|
33
31
|
]
|
|
@@ -59,14 +57,15 @@ Pod::Spec.new do |s|
|
|
|
59
57
|
s.osx.framework = "Appkit"
|
|
60
58
|
# macOS]
|
|
61
59
|
s.dependency "DoubleConversion"
|
|
62
|
-
s.dependency "
|
|
63
|
-
s.dependency "
|
|
64
|
-
s.dependency "
|
|
65
|
-
s.dependency "
|
|
66
|
-
s.dependency "React-
|
|
67
|
-
s.dependency "React-
|
|
60
|
+
s.dependency "fast_float"
|
|
61
|
+
s.dependency "fmt"
|
|
62
|
+
s.dependency "RCT-Folly"
|
|
63
|
+
s.dependency "RCTTypeSafety"
|
|
64
|
+
s.dependency "React-Core/CoreModulesHeaders"
|
|
65
|
+
s.dependency "React-RCTImage"
|
|
66
|
+
s.dependency "React-jsi"
|
|
68
67
|
s.dependency 'React-RCTBlob'
|
|
69
|
-
s.dependency "SocketRocket"
|
|
68
|
+
s.dependency "SocketRocket"
|
|
70
69
|
add_dependency(s, "React-jsinspector", :framework_name => 'jsinspector_modern')
|
|
71
70
|
|
|
72
71
|
add_dependency(s, "ReactCodegen")
|
|
@@ -98,14 +98,22 @@ using namespace facebook::react;
|
|
|
98
98
|
NSNumber *id2 = arguments[arguments.count - 1];
|
|
99
99
|
|
|
100
100
|
second = ^(std::vector<folly::dynamic> args) {
|
|
101
|
-
|
|
101
|
+
folly::dynamic obj = folly::dynamic::array;
|
|
102
|
+
for (auto &arg : args) {
|
|
103
|
+
obj.push_back(std::move(arg));
|
|
104
|
+
}
|
|
105
|
+
[bridge enqueueCallback:id2 args:convertFollyDynamicToId(std::move(obj))];
|
|
102
106
|
};
|
|
103
107
|
} else {
|
|
104
108
|
id1 = arguments[arguments.count - 1];
|
|
105
109
|
}
|
|
106
110
|
|
|
107
111
|
first = ^(std::vector<folly::dynamic> args) {
|
|
108
|
-
|
|
112
|
+
folly::dynamic obj = folly::dynamic::array;
|
|
113
|
+
for (auto &arg : args) {
|
|
114
|
+
obj.push_back(std::move(arg));
|
|
115
|
+
}
|
|
116
|
+
[bridge enqueueCallback:id1 args:convertFollyDynamicToId(std::move(obj))];
|
|
109
117
|
};
|
|
110
118
|
}
|
|
111
119
|
|