@office-iss/react-native-win32 0.0.0-canary.285 → 0.0.0-canary.286
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/.flowconfig +1 -1
- package/CHANGELOG.json +16 -1
- package/CHANGELOG.md +16 -8
- package/IntegrationTests/LayoutEventsTest.js +16 -11
- package/Libraries/Alert/Alert.js +51 -5
- package/Libraries/Alert/Alert.win32.js +50 -5
- package/Libraries/Animated/animations/Animation.js +1 -4
- package/Libraries/Animated/nodes/AnimatedObject.js +1 -0
- package/Libraries/AppState/AppState.js +24 -7
- package/Libraries/BatchedBridge/MessageQueue.js +3 -2
- package/Libraries/BatchedBridge/NativeModules.js +2 -1
- package/Libraries/Blob/Blob.js +1 -1
- package/Libraries/Blob/FileReader_old.js +9 -9
- package/Libraries/Blob/URL.js +1 -1
- package/Libraries/Blob/URLSearchParams.js +9 -9
- package/Libraries/Components/Button.js +3 -3
- package/Libraries/Components/Button.win32.js +3 -6
- package/Libraries/Components/LayoutConformance/LayoutConformance.js +1 -1
- package/Libraries/Components/Pressable/Pressable.js +9 -9
- package/Libraries/Components/Pressable/Pressable.win32.js +9 -9
- package/Libraries/Components/Pressable/useAndroidRippleForView.js +7 -7
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js +7 -1
- package/Libraries/Components/RefreshControl/RefreshControl.js +1 -1
- package/Libraries/Components/ScrollView/ScrollView.js +74 -59
- package/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +5 -5
- package/Libraries/Components/ScrollView/ScrollViewNativeComponentType.js +5 -2
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +3 -3
- package/Libraries/Components/Switch/Switch.js +2 -2
- package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +3 -1
- package/Libraries/Components/TextInput/TextInput.flow.js +15 -13
- package/Libraries/Components/TextInput/TextInput.js +16 -14
- package/Libraries/Components/TextInput/TextInput.win32.js +16 -14
- package/Libraries/Components/TextInput/TextInputState.js +1 -1
- package/Libraries/Components/TextInput/TextInputState.win32.js +1 -1
- package/Libraries/Components/Touchable/Touchable.js +16 -16
- package/Libraries/Components/Touchable/Touchable.win32.js +16 -16
- package/Libraries/Components/Touchable/TouchableNativeFeedback.js +2 -2
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +7 -7
- package/Libraries/Components/View/ReactNativeStyleAttributes.js +16 -2
- package/Libraries/Components/View/ViewAccessibility.js +243 -3
- package/Libraries/Components/View/ViewAccessibility.win32.js +243 -3
- package/Libraries/Components/View/ViewPropTypes.d.ts +14 -14
- package/Libraries/Components/View/ViewPropTypes.js +35 -226
- package/Libraries/Components/View/ViewPropTypes.win32.js +37 -229
- package/Libraries/Core/Devtools/symbolicateStackTrace.js +1 -1
- package/Libraries/Core/InitializeCore.js +2 -1
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Core/Timers/JSTimers.js +6 -4
- package/Libraries/Core/setUpBatchedBridge.js +9 -5
- package/Libraries/Core/setUpDeveloperTools.js +3 -29
- package/Libraries/Core/setUpReactDevTools.js +1 -1
- package/Libraries/Core/setUpReactRefresh.js +1 -1
- package/Libraries/Core/setUpXHR.js +5 -2
- package/Libraries/EventEmitter/NativeEventEmitter.js +8 -2
- package/Libraries/EventEmitter/RCTDeviceEventEmitter.js +5 -4
- package/Libraries/EventEmitter/__mocks__/NativeEventEmitter.js +3 -2
- package/Libraries/Events/CustomEvent.js +1 -1
- package/Libraries/Events/EventPolyfill.js +2 -2
- package/Libraries/Image/AssetSourceResolver.js +1 -1
- package/Libraries/Image/ImageProps.js +8 -5
- package/Libraries/Image/ImageViewNativeComponent.js +1 -1
- package/Libraries/Image/resolveAssetSource.win32.js +1 -1
- package/Libraries/Interaction/InteractionManager.js +1 -1
- package/Libraries/Interaction/InteractionManagerStub.js +9 -1
- package/Libraries/Interaction/JSEventLoopWatchdog.js +1 -1
- package/Libraries/Interaction/PanResponder.js +32 -29
- package/Libraries/Interaction/TaskQueue.js +1 -1
- package/Libraries/LayoutAnimation/LayoutAnimation.js +18 -4
- package/Libraries/Lists/FillRateHelper.js +3 -3
- package/Libraries/Lists/FlatList.js +13 -13
- package/Libraries/Lists/SectionList.js +3 -1
- package/Libraries/Lists/SectionListModern.js +3 -1
- package/Libraries/Lists/ViewabilityHelper.js +3 -2
- package/Libraries/Lists/VirtualizeUtils.js +3 -3
- package/Libraries/Lists/VirtualizedList.js +5 -5
- package/Libraries/Lists/VirtualizedListContext.js +4 -2
- package/Libraries/Lists/VirtualizedSectionList.js +4 -2
- package/Libraries/LogBox/LogBox.js +9 -1
- package/Libraries/LogBox/UI/AnsiHighlight.js +7 -3
- package/Libraries/LogBox/UI/LogBoxButton.js +4 -2
- package/Libraries/LogBox/UI/LogBoxInspector.js +1 -1
- package/Libraries/LogBox/UI/LogBoxInspectorFooter.js +11 -3
- package/Libraries/LogBox/UI/LogBoxInspectorFooterButton.js +2 -0
- package/Libraries/LogBox/UI/LogBoxInspectorHeader.js +8 -2
- package/Libraries/LogBox/UI/LogBoxInspectorHeader.win32.js +8 -2
- package/Libraries/LogBox/UI/LogBoxInspectorHeaderButton.js +2 -0
- package/Libraries/LogBox/UI/LogBoxInspectorMessageHeader.js +4 -2
- package/Libraries/LogBox/UI/LogBoxInspectorReactFrames.js +3 -1
- package/Libraries/LogBox/UI/LogBoxInspectorReactFrames.win32.js +3 -1
- package/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.js +2 -2
- package/Libraries/LogBox/UI/LogBoxInspectorStackFrame.js +5 -3
- package/Libraries/LogBox/UI/LogBoxInspectorStackFrame.win32.js +5 -3
- package/Libraries/LogBox/UI/LogBoxNotification.js +6 -2
- package/Libraries/LogBox/UI/LogBoxNotificationCountBadge.js +3 -1
- package/Libraries/LogBox/UI/LogBoxNotificationDismissButton.js +2 -0
- package/Libraries/LogBox/UI/LogBoxNotificationMessage.js +4 -1
- package/Libraries/Modal/Modal.js +74 -81
- package/Libraries/NativeComponent/BaseViewConfig.android.js +16 -6
- package/Libraries/NativeComponent/BaseViewConfig.ios.js +19 -9
- package/Libraries/NativeComponent/BaseViewConfig.win32.js +19 -9
- package/Libraries/NativeComponent/StaticViewConfigValidator.js +5 -1
- package/Libraries/Network/FormData.js +1 -1
- package/Libraries/Network/XMLHttpRequest.js +5 -6
- package/Libraries/Network/XMLHttpRequest_new.js +3 -2
- package/Libraries/Network/XMLHttpRequest_old.js +3 -2
- package/Libraries/Network/convertRequestBody.js +4 -3
- package/Libraries/Network/fetch.js +4 -3
- package/Libraries/PermissionsAndroid/PermissionsAndroid.js +63 -61
- package/Libraries/Pressability/Pressability.js +23 -23
- package/Libraries/Pressability/Pressability.win32.js +23 -23
- package/Libraries/PushNotificationIOS/PushNotificationIOS.js +119 -16
- package/Libraries/ReactNative/AppContainer-dev.js +2 -1
- package/Libraries/ReactNative/AppRegistry.js +3 -3
- package/Libraries/ReactNative/PaperUIManager.js +3 -2
- package/Libraries/ReactNative/PaperUIManager.win32.js +3 -2
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.js +2 -1
- package/Libraries/ReactNative/RootTag.js +1 -1
- package/Libraries/ReactNative/getNativeComponentAttributes.js +4 -4
- package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +6 -4
- package/Libraries/Renderer/shims/ReactNativeTypes.js +4 -5
- package/Libraries/Settings/Settings.js +2 -2
- package/Libraries/Settings/Settings.win32.js +2 -2
- package/Libraries/Share/Share.js +10 -3
- package/Libraries/StyleSheet/PlatformColorValueTypes.ios.js +1 -1
- package/Libraries/StyleSheet/StyleSheet.js +1 -1
- package/Libraries/StyleSheet/StyleSheet.win32.js +2 -2
- package/Libraries/StyleSheet/__flowtests__/StyleSheet-flowtest.js +1 -1
- package/Libraries/StyleSheet/flattenStyle.js +1 -1
- package/Libraries/StyleSheet/normalizeColor.js +1 -1
- package/Libraries/StyleSheet/processAspectRatio.js +1 -1
- package/Libraries/StyleSheet/processColor.js +2 -2
- package/Libraries/StyleSheet/processFilter.js +4 -0
- package/Libraries/StyleSheet/processFontVariant.js +1 -1
- package/Libraries/StyleSheet/processTransform.js +1 -1
- package/Libraries/StyleSheet/setNormalizedColorAlpha.js +1 -1
- package/Libraries/Text/Text.js +15 -15
- package/Libraries/Text/Text.win32.js +15 -15
- package/Libraries/Text/TextAncestor.js +1 -1
- package/Libraries/Text/TextNativeComponent.js +2 -2
- package/Libraries/Text/TextNativeComponent.win32.js +2 -2
- package/Libraries/Text/TextProps.js +11 -11
- package/Libraries/Text/TextProps.win32.js +11 -11
- package/Libraries/Types/CodegenTypes.js +3 -3
- package/Libraries/Types/CoreEventTypes.js +103 -72
- package/Libraries/Types/CoreEventTypes.win32.js +115 -79
- package/Libraries/UTFSequence.js +2 -1
- package/Libraries/Utilities/BackHandler.android.js +1 -1
- package/Libraries/Utilities/BackHandler.ios.js +5 -5
- package/Libraries/Utilities/BackHandler.win32.js +1 -1
- package/Libraries/Utilities/DevLoadingView.js +1 -1
- package/Libraries/Utilities/DevSettings.js +1 -1
- package/Libraries/Utilities/DeviceInfo.js +1 -1
- package/Libraries/Utilities/DeviceInfo.win32.js +1 -1
- package/Libraries/Utilities/FeatureDetection.js +2 -4
- package/Libraries/Utilities/FocusManager.win32.js +3 -3
- package/Libraries/Utilities/GlobalPerformanceLogger.js +1 -1
- package/Libraries/Utilities/HMRClient.js +5 -33
- package/Libraries/Utilities/HMRClientProdShim.js +1 -2
- package/Libraries/Utilities/Platform.android.js +2 -2
- package/Libraries/Utilities/Platform.ios.js +2 -2
- package/Libraries/Utilities/Platform.win32.js +2 -2
- package/Libraries/Utilities/{Platform.flow.win32.js → PlatformTypes.js} +1 -0
- package/Libraries/Utilities/PolyfillFunctions.js +3 -5
- package/Libraries/Utilities/RCTLog.js +1 -1
- package/Libraries/Utilities/ReactNativeTestTools.js +1 -1
- package/Libraries/Utilities/SceneTracker.js +1 -1
- package/Libraries/Utilities/__mocks__/GlobalPerformanceLogger.js +2 -2
- package/Libraries/Utilities/binaryToBase64.js +1 -1
- package/Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.js +1 -1
- package/Libraries/Utilities/defineLazyObjectProperty.js +1 -1
- package/Libraries/Utilities/differ/deepDiffer.js +3 -3
- package/Libraries/Utilities/differ/insetsDiffer.js +3 -3
- package/Libraries/Utilities/differ/matricesDiffer.js +3 -6
- package/Libraries/Utilities/differ/pointsDiffer.js +3 -3
- package/Libraries/Utilities/differ/sizesDiffer.js +3 -3
- package/Libraries/Utilities/dismissKeyboard.js +1 -1
- package/Libraries/Utilities/infoLog.js +1 -1
- package/Libraries/Utilities/logError.js +1 -1
- package/Libraries/Utilities/mapWithSeparator.js +1 -1
- package/Libraries/Utilities/warnOnce.js +1 -1
- package/Libraries/Vibration/Vibration.js +3 -3
- package/Libraries/vendor/emitter/EventEmitter.js +21 -9
- package/index.js +113 -199
- package/index.win32.js +21 -13
- package/jest/setup.js +9 -2
- package/overrides.json +35 -34
- package/package.json +15 -15
- package/src/private/devmenu/DevMenu.js +1 -1
- package/src/private/featureflags/ReactNativeFeatureFlags.js +22 -23
- package/src/private/featureflags/ReactNativeFeatureFlagsBase.js +4 -7
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +5 -4
- package/src/private/inspector/BoxInspector.js +1 -1
- package/src/private/inspector/ElementBox.js +3 -2
- package/src/private/inspector/ElementProperties.js +5 -3
- package/src/private/inspector/Inspector.js +2 -2
- package/src/private/inspector/InspectorOverlay.js +4 -4
- package/src/private/inspector/InspectorPanel.js +1 -1
- package/src/private/inspector/NetworkOverlay.js +4 -4
- package/src/private/inspector/PerformanceOverlay.js +3 -2
- package/src/private/inspector/ReactDevToolsOverlay.js +3 -3
- package/src/private/inspector/StyleInspector.js +1 -1
- package/src/private/inspector/XHRInterceptor.js +5 -2
- package/src/private/renderer/errorhandling/ErrorHandlers.js +2 -1
- package/src/private/specs_DEPRECATED/modules/NativeExceptionsManager.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativePermissionsAndroid.js +5 -4
- package/src/private/specs_DEPRECATED/modules/NativeUIManager.js +92 -19
- package/src/private/webapis/dom/events/CustomEvent.js +5 -7
- package/src/private/webapis/dom/events/Event.js +5 -5
- package/src/private/webapis/dom/nodes/internals/ReactNativeDocumentInstanceHandle.js +1 -0
- package/src/private/webapis/html/events/MessageEvent.js +12 -19
- package/src/private/webapis/websockets/events/CloseEvent.js +9 -11
- package/src/private/webapis/xhr/events/ProgressEvent.js +9 -11
- package/src-win/Libraries/Components/View/ViewPropTypes.d.ts +14 -14
- package/Libraries/Alert/Alert.flow.js +0 -62
- package/Libraries/Alert/RCTAlertManager.flow.js +0 -20
- package/Libraries/Utilities/Platform.flow.js +0 -91
- package/flow/react.js +0 -15
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
13
|
import type XMLHttpRequest from '../../../Libraries/Network/XMLHttpRequest';
|
|
14
|
-
import type {
|
|
14
|
+
import type {ListRenderItemInfo} from '@react-native/virtualized-lists';
|
|
15
15
|
|
|
16
16
|
import ScrollView from '../../../Libraries/Components/ScrollView/ScrollView';
|
|
17
17
|
import React from 'react';
|
|
@@ -20,11 +20,11 @@ const TouchableHighlight =
|
|
|
20
20
|
require('../../../Libraries/Components/Touchable/TouchableHighlight').default;
|
|
21
21
|
const View = require('../../../Libraries/Components/View/View').default;
|
|
22
22
|
const FlatList = require('../../../Libraries/Lists/FlatList').default;
|
|
23
|
-
const StyleSheet = require('../../../Libraries/StyleSheet/StyleSheet');
|
|
23
|
+
const StyleSheet = require('../../../Libraries/StyleSheet/StyleSheet').default;
|
|
24
24
|
const Text = require('../../../Libraries/Text/Text').default;
|
|
25
25
|
const WebSocketInterceptor =
|
|
26
26
|
require('../../../Libraries/WebSocket/WebSocketInterceptor').default;
|
|
27
|
-
const XHRInterceptor = require('./XHRInterceptor');
|
|
27
|
+
const XHRInterceptor = require('./XHRInterceptor').default;
|
|
28
28
|
|
|
29
29
|
const LISTVIEW_CELL_HEIGHT = 15;
|
|
30
30
|
|
|
@@ -355,7 +355,7 @@ class NetworkOverlay extends React.Component<Props, State> {
|
|
|
355
355
|
_renderItem = ({
|
|
356
356
|
item,
|
|
357
357
|
index,
|
|
358
|
-
}:
|
|
358
|
+
}: ListRenderItemInfo<NetworkRequestInfo>): React.MixedElement => {
|
|
359
359
|
const tableRowViewStyle = [
|
|
360
360
|
styles.tableRow,
|
|
361
361
|
index % 2 === 1 ? styles.tableRowOdd : styles.tableRowEven,
|
|
@@ -13,9 +13,10 @@
|
|
|
13
13
|
import React from 'react';
|
|
14
14
|
|
|
15
15
|
const View = require('../../../Libraries/Components/View/View').default;
|
|
16
|
-
const StyleSheet = require('../../../Libraries/StyleSheet/StyleSheet');
|
|
16
|
+
const StyleSheet = require('../../../Libraries/StyleSheet/StyleSheet').default;
|
|
17
17
|
const Text = require('../../../Libraries/Text/Text').default;
|
|
18
|
-
const PerformanceLogger =
|
|
18
|
+
const PerformanceLogger =
|
|
19
|
+
require('../../../Libraries/Utilities/GlobalPerformanceLogger').default;
|
|
19
20
|
|
|
20
21
|
class PerformanceOverlay extends React.Component<{...}> {
|
|
21
22
|
render(): React.Node {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
import type {InspectedViewRef} from '../../../Libraries/ReactNative/AppContainer-dev';
|
|
12
12
|
import type {PointerEvent} from '../../../Libraries/Types/CoreEventTypes';
|
|
13
|
-
import type {
|
|
13
|
+
import type {GestureResponderEvent} from '../../../Libraries/Types/CoreEventTypes';
|
|
14
14
|
import type {ReactDevToolsAgent} from '../../../Libraries/Types/ReactDevToolsTypes';
|
|
15
15
|
import type {InspectedElement} from './Inspector';
|
|
16
16
|
|
|
@@ -107,7 +107,7 @@ export default function ReactDevToolsOverlay({
|
|
|
107
107
|
);
|
|
108
108
|
|
|
109
109
|
const onResponderMove = useCallback(
|
|
110
|
-
(e:
|
|
110
|
+
(e: GestureResponderEvent) => {
|
|
111
111
|
findViewForLocation(
|
|
112
112
|
e.nativeEvent.touches[0].locationX,
|
|
113
113
|
e.nativeEvent.touches[0].locationY,
|
|
@@ -117,7 +117,7 @@ export default function ReactDevToolsOverlay({
|
|
|
117
117
|
);
|
|
118
118
|
|
|
119
119
|
const shouldSetResponder = useCallback(
|
|
120
|
-
(e:
|
|
120
|
+
(e: GestureResponderEvent): boolean => {
|
|
121
121
|
onResponderMove(e);
|
|
122
122
|
return true;
|
|
123
123
|
},
|
|
@@ -16,7 +16,7 @@ import type {____FlattenStyleProp_Internal} from '../../../Libraries/StyleSheet/
|
|
|
16
16
|
import React from 'react';
|
|
17
17
|
|
|
18
18
|
const View = require('../../../Libraries/Components/View/View').default;
|
|
19
|
-
const StyleSheet = require('../../../Libraries/StyleSheet/StyleSheet');
|
|
19
|
+
const StyleSheet = require('../../../Libraries/StyleSheet/StyleSheet').default;
|
|
20
20
|
const Text = require('../../../Libraries/Text/Text').default;
|
|
21
21
|
|
|
22
22
|
type Props = $ReadOnly<{
|
|
@@ -10,7 +10,10 @@
|
|
|
10
10
|
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
import typeof XMLHttpRequestT from '../../../Libraries/Network/XMLHttpRequest';
|
|
14
|
+
|
|
15
|
+
const XMLHttpRequest: XMLHttpRequestT =
|
|
16
|
+
require('../../../Libraries/Network/XMLHttpRequest').default;
|
|
14
17
|
// $FlowFixMe[method-unbinding]
|
|
15
18
|
const originalXHROpen = XMLHttpRequest.prototype.open;
|
|
16
19
|
// $FlowFixMe[method-unbinding]
|
|
@@ -211,4 +214,4 @@ const XHRInterceptor = {
|
|
|
211
214
|
},
|
|
212
215
|
};
|
|
213
216
|
|
|
214
|
-
|
|
217
|
+
export default XHRInterceptor;
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import type {ExtendedError} from '../../../../Libraries/Core/ExtendedError';
|
|
12
|
+
import type {Component as ReactComponent} from 'react';
|
|
12
13
|
|
|
13
14
|
import ExceptionsManager, {
|
|
14
15
|
SyntheticError,
|
|
@@ -17,7 +18,7 @@ import ExceptionsManager, {
|
|
|
17
18
|
type ErrorInfo = {
|
|
18
19
|
+componentStack?: ?string,
|
|
19
20
|
// $FlowFixMe[unclear-type] unknown props and state.
|
|
20
|
-
+errorBoundary?: ?
|
|
21
|
+
+errorBoundary?: ?ReactComponent<any, any>,
|
|
21
22
|
};
|
|
22
23
|
|
|
23
24
|
function getExtendedError(
|
|
@@ -12,7 +12,7 @@ import type {TurboModule} from '../../../../Libraries/TurboModule/RCTExport';
|
|
|
12
12
|
|
|
13
13
|
import * as TurboModuleRegistry from '../../../../Libraries/TurboModule/TurboModuleRegistry';
|
|
14
14
|
|
|
15
|
-
const Platform = require('../../../../Libraries/Utilities/Platform');
|
|
15
|
+
const Platform = require('../../../../Libraries/Utilities/Platform').default;
|
|
16
16
|
|
|
17
17
|
export type StackFrame = {
|
|
18
18
|
column: ?number,
|
|
@@ -15,6 +15,7 @@ import * as TurboModuleRegistry from '../../../../Libraries/TurboModule/TurboMod
|
|
|
15
15
|
// TODO: Use proper enum types.
|
|
16
16
|
export type PermissionStatus = string;
|
|
17
17
|
export type PermissionType = string;
|
|
18
|
+
|
|
18
19
|
/*
|
|
19
20
|
export type PermissionStatus = 'granted' | 'denied' | 'never_ask_again';
|
|
20
21
|
export type PermissionType =
|
|
@@ -45,9 +46,9 @@ export type PermissionType =
|
|
|
45
46
|
| 'android.permission.RECEIVE_WAP_PUSH'
|
|
46
47
|
| 'android.permission.RECEIVE_MMS'
|
|
47
48
|
| 'android.permission.READ_EXTERNAL_STORAGE'
|
|
48
|
-
| 'android.permission.READ_MEDIA_IMAGES'
|
|
49
|
-
| 'android.permission.READ_MEDIA_VIDEO'
|
|
50
|
-
| 'android.permission.READ_MEDIA_AUDIO'
|
|
49
|
+
| 'android.permission.READ_MEDIA_IMAGES'
|
|
50
|
+
| 'android.permission.READ_MEDIA_VIDEO'
|
|
51
|
+
| 'android.permission.READ_MEDIA_AUDIO'
|
|
51
52
|
| 'android.permission.READ_MEDIA_VISUAL_USER_SELECTED'
|
|
52
53
|
| 'android.permission.WRITE_EXTERNAL_STORAGE'
|
|
53
54
|
| 'android.permission.BLUETOOTH_CONNECT'
|
|
@@ -61,7 +62,7 @@ export type PermissionType =
|
|
|
61
62
|
| 'android.permission.UWB_RANGING'
|
|
62
63
|
| 'android.permission.POST_NOTIFICATIONS'
|
|
63
64
|
| 'android.permission.NEARBY_WIFI_DEVICES';
|
|
64
|
-
*/
|
|
65
|
+
*/
|
|
65
66
|
|
|
66
67
|
export interface Spec extends TurboModule {
|
|
67
68
|
+checkPermission: (permission: PermissionType) => Promise<boolean>;
|
|
@@ -13,6 +13,29 @@ import type {TurboModule} from '../../../../Libraries/TurboModule/RCTExport';
|
|
|
13
13
|
|
|
14
14
|
import * as TurboModuleRegistry from '../../../../Libraries/TurboModule/TurboModuleRegistry';
|
|
15
15
|
|
|
16
|
+
export type MeasureOnSuccessCallback = (
|
|
17
|
+
x: number,
|
|
18
|
+
y: number,
|
|
19
|
+
width: number,
|
|
20
|
+
height: number,
|
|
21
|
+
pageX: number,
|
|
22
|
+
pageY: number,
|
|
23
|
+
) => void;
|
|
24
|
+
|
|
25
|
+
export type MeasureInWindowOnSuccessCallback = (
|
|
26
|
+
x: number,
|
|
27
|
+
y: number,
|
|
28
|
+
width: number,
|
|
29
|
+
height: number,
|
|
30
|
+
) => void;
|
|
31
|
+
|
|
32
|
+
export type MeasureLayoutOnSuccessCallback = (
|
|
33
|
+
left: number,
|
|
34
|
+
top: number,
|
|
35
|
+
width: number,
|
|
36
|
+
height: number,
|
|
37
|
+
) => void;
|
|
38
|
+
|
|
16
39
|
export interface Spec extends TurboModule {
|
|
17
40
|
+getConstants: () => Object;
|
|
18
41
|
+createView: (
|
|
@@ -33,41 +56,79 @@ export interface Spec extends TurboModule {
|
|
|
33
56
|
height: number,
|
|
34
57
|
) => void,
|
|
35
58
|
) => void;
|
|
59
|
+
/**
|
|
60
|
+
* Used to call a native view method from JavaScript
|
|
61
|
+
*
|
|
62
|
+
* reactTag - Id of react view.
|
|
63
|
+
* commandID - Id of the native method that should be called.
|
|
64
|
+
* commandArgs - Args of the native method that we can pass from JS to native.
|
|
65
|
+
*/
|
|
36
66
|
+dispatchViewManagerCommand: (
|
|
37
67
|
reactTag: number,
|
|
38
68
|
commandID: number, // number || string
|
|
39
|
-
commandArgs
|
|
40
|
-
) => void;
|
|
41
|
-
+measure: (
|
|
42
|
-
reactTag: number,
|
|
43
|
-
callback: (
|
|
44
|
-
left: number,
|
|
45
|
-
top: number,
|
|
46
|
-
width: number,
|
|
47
|
-
height: number,
|
|
48
|
-
pageX: number,
|
|
49
|
-
pageY: number,
|
|
50
|
-
) => void,
|
|
69
|
+
commandArgs?: Array<any>,
|
|
51
70
|
) => void;
|
|
71
|
+
/**
|
|
72
|
+
* Determines the location on screen, width, and height of the given view and
|
|
73
|
+
* returns the values via an async callback. If successful, the callback will
|
|
74
|
+
* be called with the following arguments:
|
|
75
|
+
*
|
|
76
|
+
* - x
|
|
77
|
+
* - y
|
|
78
|
+
* - width
|
|
79
|
+
* - height
|
|
80
|
+
* - pageX
|
|
81
|
+
* - pageY
|
|
82
|
+
*
|
|
83
|
+
* Note that these measurements are not available until after the rendering
|
|
84
|
+
* has been completed in native. If you need the measurements as soon as
|
|
85
|
+
* possible, consider using the [`onLayout`
|
|
86
|
+
* prop](docs/view.html#onlayout) instead.
|
|
87
|
+
*
|
|
88
|
+
* @deprecated Use `ref.measure` instead.
|
|
89
|
+
*/
|
|
90
|
+
+measure: (reactTag: number, callback: MeasureOnSuccessCallback) => void;
|
|
91
|
+
/**
|
|
92
|
+
* Determines the location of the given view in the window and returns the
|
|
93
|
+
* values via an async callback. If the React root view is embedded in
|
|
94
|
+
* another native view, this will give you the absolute coordinates. If
|
|
95
|
+
* successful, the callback will be called with the following
|
|
96
|
+
* arguments:
|
|
97
|
+
*
|
|
98
|
+
* - x
|
|
99
|
+
* - y
|
|
100
|
+
* - width
|
|
101
|
+
* - height
|
|
102
|
+
*
|
|
103
|
+
* Note that these measurements are not available until after the rendering
|
|
104
|
+
* has been completed in native.
|
|
105
|
+
*
|
|
106
|
+
* @deprecated Use `ref.measureInWindow` instead.
|
|
107
|
+
*/
|
|
52
108
|
+measureInWindow: (
|
|
53
109
|
reactTag: number,
|
|
54
|
-
callback:
|
|
110
|
+
callback: MeasureInWindowOnSuccessCallback,
|
|
55
111
|
) => void;
|
|
56
112
|
+viewIsDescendantOf: (
|
|
57
113
|
reactTag: number,
|
|
58
114
|
ancestorReactTag: number,
|
|
59
115
|
callback: (result: Array<boolean>) => void,
|
|
60
116
|
) => void;
|
|
117
|
+
/**
|
|
118
|
+
* Like [`measure()`](#measure), but measures the view relative an ancestor,
|
|
119
|
+
* specified as `relativeToNativeNode`. This means that the returned x, y
|
|
120
|
+
* are relative to the origin x, y of the ancestor view.
|
|
121
|
+
*
|
|
122
|
+
* As always, to obtain a native node handle for a component, you can use
|
|
123
|
+
* `React.findNodeHandle(component)`.
|
|
124
|
+
*
|
|
125
|
+
* @deprecated Use `ref.measureLayout` instead.
|
|
126
|
+
*/
|
|
61
127
|
+measureLayout: (
|
|
62
128
|
reactTag: number,
|
|
63
129
|
ancestorReactTag: number,
|
|
64
130
|
errorCallback: (error: Object) => void,
|
|
65
|
-
callback:
|
|
66
|
-
left: number,
|
|
67
|
-
top: number,
|
|
68
|
-
width: number,
|
|
69
|
-
height: number,
|
|
70
|
-
) => void,
|
|
131
|
+
callback: MeasureLayoutOnSuccessCallback,
|
|
71
132
|
) => void;
|
|
72
133
|
+measureLayoutRelativeToParent: (
|
|
73
134
|
reactTag: number,
|
|
@@ -99,6 +160,18 @@ export interface Spec extends TurboModule {
|
|
|
99
160
|
// Android only
|
|
100
161
|
+getConstantsForViewManager?: (viewManagerName: string) => ?Object;
|
|
101
162
|
+getDefaultEventTypes?: () => Array<string>;
|
|
163
|
+
/**
|
|
164
|
+
* Automatically animates views to their new positions when the
|
|
165
|
+
* next layout happens.
|
|
166
|
+
*
|
|
167
|
+
* A common way to use this API is to call it before calling `setState`.
|
|
168
|
+
*
|
|
169
|
+
* Note that in order to get this to work on **Android** you need to set the following flags via `UIManager`:
|
|
170
|
+
*
|
|
171
|
+
* ```js
|
|
172
|
+
* UIManager.setLayoutAnimationEnabledExperimental && UIManager.setLayoutAnimationEnabledExperimental(true);
|
|
173
|
+
* ```
|
|
174
|
+
*/
|
|
102
175
|
+setLayoutAnimationEnabledExperimental?: (enabled: boolean) => void;
|
|
103
176
|
+sendAccessibilityEvent?: (reactTag: number, eventType: number) => void;
|
|
104
177
|
|
|
@@ -19,19 +19,17 @@ import type {EventInit} from './Event';
|
|
|
19
19
|
|
|
20
20
|
import Event from './Event';
|
|
21
21
|
|
|
22
|
-
export
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}>;
|
|
22
|
+
export interface CustomEventInit extends EventInit {
|
|
23
|
+
+detail?: mixed;
|
|
24
|
+
}
|
|
26
25
|
|
|
27
26
|
export default class CustomEvent extends Event {
|
|
28
27
|
_detail: mixed;
|
|
29
28
|
|
|
30
29
|
constructor(type: string, options?: ?CustomEventInit) {
|
|
31
|
-
|
|
32
|
-
super(type, eventOptions);
|
|
30
|
+
super(type, options);
|
|
33
31
|
|
|
34
|
-
this._detail = detail;
|
|
32
|
+
this._detail = options?.detail;
|
|
35
33
|
}
|
|
36
34
|
|
|
37
35
|
get detail(): mixed {
|
|
@@ -36,11 +36,11 @@ import {
|
|
|
36
36
|
setStopPropagationFlag,
|
|
37
37
|
} from './internals/EventInternals';
|
|
38
38
|
|
|
39
|
-
export
|
|
40
|
-
bubbles?: boolean
|
|
41
|
-
cancelable?: boolean
|
|
42
|
-
composed?: boolean
|
|
43
|
-
}
|
|
39
|
+
export interface EventInit {
|
|
40
|
+
+bubbles?: boolean;
|
|
41
|
+
+cancelable?: boolean;
|
|
42
|
+
+composed?: boolean;
|
|
43
|
+
}
|
|
44
44
|
|
|
45
45
|
export default class Event {
|
|
46
46
|
static +NONE: 0;
|
|
@@ -39,5 +39,6 @@ export function isReactNativeDocumentInstanceHandle(
|
|
|
39
39
|
instanceHandle: mixed,
|
|
40
40
|
// $FlowExpectedError[incompatible-type-guard]
|
|
41
41
|
): instanceHandle is ReactNativeDocumentInstanceHandle {
|
|
42
|
+
// $FlowFixMe[incompatible-type-guard]
|
|
42
43
|
return typeof instanceHandle === 'number' && instanceHandle % 10 === 1;
|
|
43
44
|
}
|
|
@@ -19,16 +19,15 @@ import type {EventInit} from '../../dom/events/Event';
|
|
|
19
19
|
|
|
20
20
|
import Event from '../../dom/events/Event';
|
|
21
21
|
|
|
22
|
-
export
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
lastEventId?: string,
|
|
22
|
+
export interface MessageEventInit extends EventInit {
|
|
23
|
+
+data?: mixed;
|
|
24
|
+
+origin?: string;
|
|
25
|
+
+lastEventId?: string;
|
|
27
26
|
// Unsupported
|
|
28
|
-
// source?: MessageEventSource,
|
|
27
|
+
// +source?: MessageEventSource,
|
|
29
28
|
// Unsupported
|
|
30
|
-
// ports?: Array<MessagePort>,
|
|
31
|
-
}
|
|
29
|
+
// +ports?: Array<MessagePort>,
|
|
30
|
+
}
|
|
32
31
|
|
|
33
32
|
export default class MessageEvent extends Event {
|
|
34
33
|
_data: mixed;
|
|
@@ -36,17 +35,11 @@ export default class MessageEvent extends Event {
|
|
|
36
35
|
_lastEventId: string;
|
|
37
36
|
|
|
38
37
|
constructor(type: string, options?: ?MessageEventInit) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
} = options ?? {};
|
|
45
|
-
super(type, eventOptions);
|
|
46
|
-
|
|
47
|
-
this._data = data;
|
|
48
|
-
this._origin = String(origin);
|
|
49
|
-
this._lastEventId = String(lastEventId);
|
|
38
|
+
super(type, options);
|
|
39
|
+
|
|
40
|
+
this._data = options?.data;
|
|
41
|
+
this._origin = String(options?.origin ?? '');
|
|
42
|
+
this._lastEventId = String(options?.lastEventId ?? '');
|
|
50
43
|
}
|
|
51
44
|
|
|
52
45
|
get data(): mixed {
|
|
@@ -19,12 +19,11 @@ import type {EventInit} from '../../dom/events/Event';
|
|
|
19
19
|
|
|
20
20
|
import Event from '../../dom/events/Event';
|
|
21
21
|
|
|
22
|
-
export
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}>;
|
|
22
|
+
export interface CloseEventInit extends EventInit {
|
|
23
|
+
+wasClean?: boolean;
|
|
24
|
+
+code?: number;
|
|
25
|
+
+reason?: string;
|
|
26
|
+
}
|
|
28
27
|
|
|
29
28
|
export default class CloseEvent extends Event {
|
|
30
29
|
_wasClean: boolean;
|
|
@@ -32,12 +31,11 @@ export default class CloseEvent extends Event {
|
|
|
32
31
|
_reason: string;
|
|
33
32
|
|
|
34
33
|
constructor(type: string, options?: ?CloseEventInit) {
|
|
35
|
-
|
|
36
|
-
super(type, eventOptions);
|
|
34
|
+
super(type, options);
|
|
37
35
|
|
|
38
|
-
this._wasClean = Boolean(wasClean);
|
|
39
|
-
this._code = Number(code) || 0;
|
|
40
|
-
this._reason = reason != null ? String(reason) : '';
|
|
36
|
+
this._wasClean = Boolean(options?.wasClean);
|
|
37
|
+
this._code = Number(options?.code) || 0;
|
|
38
|
+
this._reason = options?.reason != null ? String(options.reason) : '';
|
|
41
39
|
}
|
|
42
40
|
|
|
43
41
|
get wasClean(): boolean {
|
|
@@ -19,12 +19,11 @@ import type {EventInit} from '../../dom/events/Event';
|
|
|
19
19
|
|
|
20
20
|
import Event from '../../dom/events/Event';
|
|
21
21
|
|
|
22
|
-
export
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}>;
|
|
22
|
+
export interface ProgressEventInit extends EventInit {
|
|
23
|
+
+lengthComputable: boolean;
|
|
24
|
+
+loaded: number;
|
|
25
|
+
+total: number;
|
|
26
|
+
}
|
|
28
27
|
|
|
29
28
|
export default class ProgressEvent extends Event {
|
|
30
29
|
_lengthComputable: boolean;
|
|
@@ -32,12 +31,11 @@ export default class ProgressEvent extends Event {
|
|
|
32
31
|
_total: number;
|
|
33
32
|
|
|
34
33
|
constructor(type: string, options?: ?ProgressEventInit) {
|
|
35
|
-
|
|
36
|
-
super(type, eventOptions);
|
|
34
|
+
super(type, options);
|
|
37
35
|
|
|
38
|
-
this._lengthComputable = Boolean(lengthComputable);
|
|
39
|
-
this._loaded = Number(loaded) || 0;
|
|
40
|
-
this._total = Number(total) || 0;
|
|
36
|
+
this._lengthComputable = Boolean(options?.lengthComputable);
|
|
37
|
+
this._loaded = Number(options?.loaded) || 0;
|
|
38
|
+
this._total = Number(options?.total) || 0;
|
|
41
39
|
}
|
|
42
40
|
|
|
43
41
|
get lengthComputable(): boolean {
|
|
@@ -81,20 +81,6 @@ export interface ViewPropsIOS extends TVViewPropsIOS {
|
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
export interface ViewPropsAndroid {
|
|
84
|
-
/**
|
|
85
|
-
* Views that are only used to layout their children or otherwise don't draw anything
|
|
86
|
-
* may be automatically removed from the native hierarchy as an optimization.
|
|
87
|
-
* Set this property to false to disable this optimization and ensure that this View exists in the native view hierarchy.
|
|
88
|
-
*/
|
|
89
|
-
collapsable?: boolean | undefined;
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Setting to false prevents direct children of the view from being removed
|
|
93
|
-
* from the native view hierarchy, similar to the effect of setting
|
|
94
|
-
* `collapsable={false}` on each child.
|
|
95
|
-
*/
|
|
96
|
-
collapsableChildren?: boolean | undefined;
|
|
97
|
-
|
|
98
84
|
/**
|
|
99
85
|
* Whether this view should render itself (and all of its children) into a single hardware texture on the GPU.
|
|
100
86
|
*
|
|
@@ -343,6 +329,20 @@ export interface ViewProps
|
|
|
343
329
|
* Used to reference react managed views from native code.
|
|
344
330
|
*/
|
|
345
331
|
nativeID?: string | undefined;
|
|
332
|
+
|
|
333
|
+
/**
|
|
334
|
+
* Views that are only used to layout their children or otherwise don't draw anything
|
|
335
|
+
* may be automatically removed from the native hierarchy as an optimization.
|
|
336
|
+
* Set this property to false to disable this optimization and ensure that this View exists in the native view hierarchy.
|
|
337
|
+
*/
|
|
338
|
+
collapsable?: boolean | undefined;
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* Setting to false prevents direct children of the view from being removed
|
|
342
|
+
* from the native view hierarchy, similar to the effect of setting
|
|
343
|
+
* `collapsable={false}` on each child.
|
|
344
|
+
*/
|
|
345
|
+
collapsableChildren?: boolean | undefined;
|
|
346
346
|
}
|
|
347
347
|
|
|
348
348
|
// For backwards compat.... // Win32
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and 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
|
-
* @format
|
|
8
|
-
* @flow
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
export type AlertType =
|
|
12
|
-
| 'default'
|
|
13
|
-
| 'plain-text'
|
|
14
|
-
| 'secure-text'
|
|
15
|
-
| 'login-password';
|
|
16
|
-
|
|
17
|
-
export type AlertButtonStyle = 'default' | 'cancel' | 'destructive';
|
|
18
|
-
|
|
19
|
-
export type AlertButton = {
|
|
20
|
-
text?: string,
|
|
21
|
-
onPress?: ?((value?: string) => any) | ?Function,
|
|
22
|
-
isPreferred?: boolean,
|
|
23
|
-
style?: AlertButtonStyle,
|
|
24
|
-
...
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export type Buttons = Array<AlertButton>;
|
|
28
|
-
|
|
29
|
-
export type AlertOptions = {
|
|
30
|
-
/** @platform android */
|
|
31
|
-
cancelable?: ?boolean,
|
|
32
|
-
userInterfaceStyle?: 'unspecified' | 'light' | 'dark',
|
|
33
|
-
/** @platform android */
|
|
34
|
-
onDismiss?: ?() => void,
|
|
35
|
-
...
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Launches an alert dialog with the specified title and message.
|
|
40
|
-
*
|
|
41
|
-
* See https://reactnative.dev/docs/alert
|
|
42
|
-
*/
|
|
43
|
-
declare class Alert {
|
|
44
|
-
static alert(
|
|
45
|
-
title: ?string,
|
|
46
|
-
message?: ?string,
|
|
47
|
-
buttons?: Buttons,
|
|
48
|
-
options?: AlertOptions,
|
|
49
|
-
): void;
|
|
50
|
-
|
|
51
|
-
static prompt(
|
|
52
|
-
title: ?string,
|
|
53
|
-
message?: ?string,
|
|
54
|
-
callbackOrButtons?: ?(((text: string) => void) | Buttons),
|
|
55
|
-
type?: ?AlertType,
|
|
56
|
-
defaultValue?: string,
|
|
57
|
-
keyboardType?: string,
|
|
58
|
-
options?: AlertOptions,
|
|
59
|
-
): void;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export default Alert;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and 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
|
-
* @format
|
|
8
|
-
* @flow strict-local
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import type {Args} from './NativeAlertManager';
|
|
12
|
-
|
|
13
|
-
declare const RCTAlertManager: {
|
|
14
|
-
alertWithArgs(
|
|
15
|
-
args: Args,
|
|
16
|
-
callback: (id: number, value: string) => void,
|
|
17
|
-
): void,
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export default RCTAlertManager;
|