@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
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
import type {HostInstance} from '../Renderer/shims/ReactNativeTypes';
|
|
12
12
|
|
|
13
|
-
export type
|
|
13
|
+
export type NativeSyntheticEvent<+T> = $ReadOnly<{
|
|
14
14
|
bubbles: ?boolean,
|
|
15
15
|
cancelable: ?boolean,
|
|
16
16
|
currentTarget: number | HostInstance,
|
|
@@ -32,7 +32,7 @@ export type SyntheticEvent<+T> = $ReadOnly<{
|
|
|
32
32
|
}>;
|
|
33
33
|
|
|
34
34
|
export type ResponderSyntheticEvent<T> = $ReadOnly<{
|
|
35
|
-
...
|
|
35
|
+
...NativeSyntheticEvent<T>,
|
|
36
36
|
touchHistory: $ReadOnly<{
|
|
37
37
|
indexOfSingleActiveTouch: number,
|
|
38
38
|
mostRecentTimeStamp: number,
|
|
@@ -54,15 +54,15 @@ export type ResponderSyntheticEvent<T> = $ReadOnly<{
|
|
|
54
54
|
}>,
|
|
55
55
|
}>;
|
|
56
56
|
|
|
57
|
-
export type
|
|
57
|
+
export type LayoutRectangle = $ReadOnly<{
|
|
58
58
|
x: number,
|
|
59
59
|
y: number,
|
|
60
60
|
width: number,
|
|
61
61
|
height: number,
|
|
62
62
|
}>;
|
|
63
63
|
|
|
64
|
-
export type
|
|
65
|
-
...
|
|
64
|
+
export type TextLayoutLine = $ReadOnly<{
|
|
65
|
+
...LayoutRectangle,
|
|
66
66
|
ascender: number,
|
|
67
67
|
capHeight: number,
|
|
68
68
|
descender: number,
|
|
@@ -70,17 +70,17 @@ export type TextLayout = $ReadOnly<{
|
|
|
70
70
|
xHeight: number,
|
|
71
71
|
}>;
|
|
72
72
|
|
|
73
|
-
export type
|
|
73
|
+
export type LayoutChangeEvent = NativeSyntheticEvent<
|
|
74
74
|
$ReadOnly<{
|
|
75
|
-
layout:
|
|
75
|
+
layout: LayoutRectangle,
|
|
76
76
|
}>,
|
|
77
77
|
>;
|
|
78
78
|
|
|
79
|
-
export type
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
>;
|
|
79
|
+
export type TextLayoutEventData = $ReadOnly<{
|
|
80
|
+
lines: Array<TextLayoutLine>,
|
|
81
|
+
}>;
|
|
82
|
+
|
|
83
|
+
export type TextLayoutEvent = NativeSyntheticEvent<TextLayoutEventData>;
|
|
84
84
|
|
|
85
85
|
/**
|
|
86
86
|
* https://developer.mozilla.org/en-US/docs/Web/API/UIEvent
|
|
@@ -228,80 +228,116 @@ export interface NativePointerEvent extends NativeMouseEvent {
|
|
|
228
228
|
+isPrimary: boolean;
|
|
229
229
|
}
|
|
230
230
|
|
|
231
|
-
export type PointerEvent =
|
|
231
|
+
export type PointerEvent = NativeSyntheticEvent<NativePointerEvent>;
|
|
232
232
|
|
|
233
|
-
export type
|
|
234
|
-
|
|
235
|
-
altKey: ?boolean, // TODO(macOS)
|
|
236
|
-
button: ?number, // TODO(macOS)
|
|
237
|
-
changedTouches: $ReadOnlyArray<$PropertyType<PressEvent, 'nativeEvent'>>,
|
|
238
|
-
ctrlKey: ?boolean, // TODO(macOS)
|
|
239
|
-
force?: number,
|
|
240
|
-
identifier: number,
|
|
241
|
-
locationX: number,
|
|
242
|
-
locationY: number,
|
|
243
|
-
metaKey: ?boolean, // TODO(macOS)
|
|
244
|
-
pageX: number,
|
|
245
|
-
pageY: number,
|
|
246
|
-
shiftKey: ?boolean, // TODO(macOS)
|
|
247
|
-
target: ?number,
|
|
248
|
-
timestamp: number,
|
|
249
|
-
touches: $ReadOnlyArray<$PropertyType<PressEvent, 'nativeEvent'>>,
|
|
250
|
-
}>,
|
|
251
|
-
>;
|
|
233
|
+
export type NativeTouchEvent = $ReadOnly<{
|
|
234
|
+
altKey: ?boolean, // TODO(macOS)
|
|
252
235
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
right: number,
|
|
259
|
-
top: number,
|
|
260
|
-
}>,
|
|
261
|
-
contentOffset: $ReadOnly<{
|
|
262
|
-
y: number,
|
|
263
|
-
x: number,
|
|
264
|
-
}>,
|
|
265
|
-
contentSize: $ReadOnly<{
|
|
266
|
-
height: number,
|
|
267
|
-
width: number,
|
|
268
|
-
}>,
|
|
269
|
-
layoutMeasurement: $ReadOnly<{
|
|
270
|
-
height: number,
|
|
271
|
-
width: number,
|
|
272
|
-
}>,
|
|
273
|
-
targetContentOffset?: $ReadOnly<{
|
|
274
|
-
y: number,
|
|
275
|
-
x: number,
|
|
276
|
-
}>,
|
|
277
|
-
velocity?: $ReadOnly<{
|
|
278
|
-
y: number,
|
|
279
|
-
x: number,
|
|
280
|
-
}>,
|
|
281
|
-
zoomScale?: number,
|
|
282
|
-
responderIgnoreScroll?: boolean,
|
|
283
|
-
key?: string, // TODO(macOS)
|
|
284
|
-
}>,
|
|
285
|
-
>;
|
|
236
|
+
button: ?number, // TODO(macOS)
|
|
237
|
+
/**
|
|
238
|
+
* Array of all touch events that have changed since the last event
|
|
239
|
+
*/
|
|
240
|
+
changedTouches: $ReadOnlyArray<NativeTouchEvent>,
|
|
286
241
|
|
|
287
|
-
|
|
288
|
-
$ReadOnly<{
|
|
289
|
-
target: number,
|
|
290
|
-
...
|
|
291
|
-
}>,
|
|
292
|
-
>;
|
|
242
|
+
ctrlKey: ?boolean, // TODO(macOS)
|
|
293
243
|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
244
|
+
/**
|
|
245
|
+
* 3D Touch reported force
|
|
246
|
+
* @platform ios
|
|
247
|
+
*/
|
|
248
|
+
force?: number,
|
|
249
|
+
/**
|
|
250
|
+
* The ID of the touch
|
|
251
|
+
*/
|
|
252
|
+
identifier: number,
|
|
253
|
+
/**
|
|
254
|
+
* The X position of the touch, relative to the element
|
|
255
|
+
*/
|
|
256
|
+
locationX: number,
|
|
257
|
+
/**
|
|
258
|
+
* The Y position of the touch, relative to the element
|
|
259
|
+
*/
|
|
260
|
+
locationY: number,
|
|
261
|
+
/**
|
|
262
|
+
* The X position of the touch, relative to the screen
|
|
263
|
+
*/
|
|
264
|
+
|
|
265
|
+
metaKey: ?boolean, // TODO(macOS)
|
|
266
|
+
|
|
267
|
+
pageX: number,
|
|
268
|
+
/**
|
|
269
|
+
* The Y position of the touch, relative to the screen
|
|
270
|
+
*/
|
|
271
|
+
pageY: number,
|
|
272
|
+
|
|
273
|
+
shiftKey: ?boolean, // TODO(macOS)
|
|
274
|
+
/**
|
|
275
|
+
* The node id of the element receiving the touch event
|
|
276
|
+
*/
|
|
277
|
+
target: ?number,
|
|
278
|
+
/**
|
|
279
|
+
* A time identifier for the touch, useful for velocity calculation
|
|
280
|
+
*/
|
|
281
|
+
timestamp: number,
|
|
282
|
+
/**
|
|
283
|
+
* Array of all current touches on the screen
|
|
284
|
+
*/
|
|
285
|
+
touches: $ReadOnlyArray<NativeTouchEvent>,
|
|
286
|
+
}>;
|
|
287
|
+
|
|
288
|
+
export type GestureResponderEvent = ResponderSyntheticEvent<NativeTouchEvent>;
|
|
289
|
+
|
|
290
|
+
export type NativeScrollRectangle = $ReadOnly<{
|
|
291
|
+
bottom: number,
|
|
292
|
+
left: number,
|
|
293
|
+
right: number,
|
|
294
|
+
top: number,
|
|
295
|
+
}>;
|
|
296
|
+
|
|
297
|
+
export type NativeScrollPoint = $ReadOnly<{
|
|
298
|
+
y: number,
|
|
299
|
+
x: number,
|
|
300
|
+
}>;
|
|
301
|
+
|
|
302
|
+
export type NativeScrollVelocity = $ReadOnly<{
|
|
303
|
+
y: number,
|
|
304
|
+
x: number,
|
|
305
|
+
}>;
|
|
306
|
+
|
|
307
|
+
export type NativeScrollSize = $ReadOnly<{
|
|
308
|
+
height: number,
|
|
309
|
+
width: number,
|
|
310
|
+
}>;
|
|
311
|
+
|
|
312
|
+
export type NativeScrollEvent = $ReadOnly<{
|
|
313
|
+
contentInset: NativeScrollRectangle,
|
|
314
|
+
contentOffset: NativeScrollPoint,
|
|
315
|
+
contentSize: NativeScrollSize,
|
|
316
|
+
layoutMeasurement: NativeScrollSize,
|
|
317
|
+
velocity?: NativeScrollVelocity,
|
|
318
|
+
zoomScale?: number,
|
|
319
|
+
responderIgnoreScroll?: boolean,
|
|
320
|
+
/**
|
|
321
|
+
* @platform ios
|
|
322
|
+
*/
|
|
323
|
+
targetContentOffset?: NativeScrollPoint,
|
|
324
|
+
}>;
|
|
325
|
+
|
|
326
|
+
export type ScrollEvent = NativeSyntheticEvent<NativeScrollEvent>;
|
|
327
|
+
|
|
328
|
+
export type TargetedEvent = $ReadOnly<{
|
|
329
|
+
target: number,
|
|
330
|
+
...
|
|
331
|
+
}>;
|
|
332
|
+
|
|
333
|
+
export type BlurEvent = NativeSyntheticEvent<TargetedEvent>;
|
|
334
|
+
|
|
335
|
+
export type FocusEvent = NativeSyntheticEvent<TargetedEvent>;
|
|
300
336
|
|
|
301
337
|
// [Windows Mouse events on Windows don't match up with the version in core
|
|
302
338
|
// introduced for react-native-web. Replace typings with our values to catch
|
|
303
339
|
// anything dependent on react-native-web specific values
|
|
304
|
-
export type MouseEvent =
|
|
340
|
+
export type MouseEvent = NativeSyntheticEvent<
|
|
305
341
|
$ReadOnly<{
|
|
306
342
|
target: number,
|
|
307
343
|
identifier: number,
|
|
@@ -328,7 +364,7 @@ export type MouseEvent = SyntheticEvent<
|
|
|
328
364
|
// Windows]
|
|
329
365
|
|
|
330
366
|
// [Windows
|
|
331
|
-
export type KeyEvent =
|
|
367
|
+
export type KeyEvent = NativeSyntheticEvent<
|
|
332
368
|
$ReadOnly<{|
|
|
333
369
|
altKey: boolean,
|
|
334
370
|
ctrlKey: boolean,
|
package/Libraries/UTFSequence.js
CHANGED
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
|
-
const deepFreezeAndThrowOnMutationInDev =
|
|
13
|
+
const deepFreezeAndThrowOnMutationInDev =
|
|
14
|
+
require('./Utilities/deepFreezeAndThrowOnMutationInDev').default;
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
17
|
* A collection of Unicode sequences for various characters and emoji.
|
|
@@ -14,14 +14,14 @@ type BackPressHandler = () => ?boolean;
|
|
|
14
14
|
function emptyFunction(): void {}
|
|
15
15
|
|
|
16
16
|
type TBackHandler = {
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
exitApp(): void,
|
|
18
|
+
addEventListener(
|
|
19
19
|
eventName: BackPressEventName,
|
|
20
20
|
handler: BackPressHandler,
|
|
21
|
-
)
|
|
21
|
+
): {remove: () => void, ...},
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
const BackHandler: TBackHandler = {
|
|
25
25
|
exitApp: emptyFunction,
|
|
26
26
|
addEventListener(_eventName: BackPressEventName, _handler: BackPressHandler) {
|
|
27
27
|
return {
|
|
@@ -30,4 +30,4 @@ let BackHandler: TBackHandler = {
|
|
|
30
30
|
},
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
export default BackHandler;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* Note that a polyfill can technically fake this behavior but few does it.
|
|
16
16
|
* Therefore, this is usually good enough for our purpose.
|
|
17
17
|
*/
|
|
18
|
-
function isNativeFunction(f: Function): boolean {
|
|
18
|
+
export function isNativeFunction(f: Function): boolean {
|
|
19
19
|
return typeof f === 'function' && f.toString().indexOf('[native code]') > -1;
|
|
20
20
|
}
|
|
21
21
|
|
|
@@ -23,9 +23,7 @@ function isNativeFunction(f: Function): boolean {
|
|
|
23
23
|
* @return whether or not the constructor of @param {object} o is an native
|
|
24
24
|
* function named with @param {string} expectedName.
|
|
25
25
|
*/
|
|
26
|
-
function hasNativeConstructor(o: Object, expectedName: string): boolean {
|
|
26
|
+
export function hasNativeConstructor(o: Object, expectedName: string): boolean {
|
|
27
27
|
const con = Object.getPrototypeOf(o).constructor;
|
|
28
28
|
return con.name === expectedName && isNativeFunction(con);
|
|
29
29
|
}
|
|
30
|
-
|
|
31
|
-
module.exports = {isNativeFunction, hasNativeConstructor};
|
|
@@ -25,18 +25,18 @@ class FocusManager {
|
|
|
25
25
|
// $FlowIgnoreMe[incompatible-call]
|
|
26
26
|
findNodeHandle(ref),
|
|
27
27
|
UIManager.getViewManagerConfig('RCTView').Commands.aggressivefocus,
|
|
28
|
-
|
|
28
|
+
[],
|
|
29
29
|
);
|
|
30
30
|
} else {
|
|
31
31
|
UIManager.dispatchViewManagerCommand(
|
|
32
32
|
// $FlowIgnoreMe[incompatible-call]
|
|
33
33
|
findNodeHandle(ref),
|
|
34
34
|
UIManager.getViewManagerConfig('RCTView').Commands.politefocus,
|
|
35
|
-
|
|
35
|
+
[],
|
|
36
36
|
);
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
export default FocusManager;
|
|
@@ -14,8 +14,8 @@ import getDevServer from '../Core/Devtools/getDevServer';
|
|
|
14
14
|
import LogBox from '../LogBox/LogBox';
|
|
15
15
|
import NativeRedBox from '../NativeModules/specs/NativeRedBox';
|
|
16
16
|
|
|
17
|
-
const DevSettings = require('./DevSettings');
|
|
18
|
-
const Platform = require('./Platform');
|
|
17
|
+
const DevSettings = require('./DevSettings').default;
|
|
18
|
+
const Platform = require('./Platform').default;
|
|
19
19
|
const invariant = require('invariant');
|
|
20
20
|
const MetroHMRClient = require('metro-runtime/src/modules/HMRClient');
|
|
21
21
|
const prettyFormat = require('pretty-format');
|
|
@@ -26,7 +26,6 @@ let hmrUnavailableReason: string | null = null;
|
|
|
26
26
|
let currentCompileErrorMessage: string | null = null;
|
|
27
27
|
let didConnect: boolean = false;
|
|
28
28
|
let pendingLogs: Array<[LogLevel, $ReadOnlyArray<mixed>]> = [];
|
|
29
|
-
let pendingFuseboxConsoleNotification = false;
|
|
30
29
|
|
|
31
30
|
type LogLevel =
|
|
32
31
|
| 'trace'
|
|
@@ -52,7 +51,6 @@ export type HMRClientNativeInterface = {
|
|
|
52
51
|
isEnabled: boolean,
|
|
53
52
|
scheme?: string,
|
|
54
53
|
): void,
|
|
55
|
-
unstable_notifyFuseboxConsoleEnabled(): void,
|
|
56
54
|
};
|
|
57
55
|
|
|
58
56
|
/**
|
|
@@ -70,7 +68,7 @@ const HMRClient: HMRClientNativeInterface = {
|
|
|
70
68
|
}
|
|
71
69
|
|
|
72
70
|
invariant(hmrClient, 'Expected HMRClient.setup() call at startup.');
|
|
73
|
-
const DevLoadingView = require('./DevLoadingView');
|
|
71
|
+
const DevLoadingView = require('./DevLoadingView').default;
|
|
74
72
|
|
|
75
73
|
// We use this for internal logging only.
|
|
76
74
|
// It doesn't affect the logic.
|
|
@@ -142,29 +140,6 @@ const HMRClient: HMRClientNativeInterface = {
|
|
|
142
140
|
}
|
|
143
141
|
},
|
|
144
142
|
|
|
145
|
-
unstable_notifyFuseboxConsoleEnabled() {
|
|
146
|
-
if (!hmrClient) {
|
|
147
|
-
pendingFuseboxConsoleNotification = true;
|
|
148
|
-
return;
|
|
149
|
-
}
|
|
150
|
-
hmrClient.send(
|
|
151
|
-
JSON.stringify({
|
|
152
|
-
type: 'log',
|
|
153
|
-
level: 'info',
|
|
154
|
-
data: [
|
|
155
|
-
'\n' +
|
|
156
|
-
'\u001B[7m' +
|
|
157
|
-
' \u001B[1m💡 JavaScript logs have moved!\u001B[22m They can now be ' +
|
|
158
|
-
'viewed in React Native DevTools. Tip: Type \u001B[1mj\u001B[22m in ' +
|
|
159
|
-
'the terminal to open (requires Google Chrome or Microsoft Edge).' +
|
|
160
|
-
'\u001B[27m' +
|
|
161
|
-
'\n',
|
|
162
|
-
],
|
|
163
|
-
}),
|
|
164
|
-
);
|
|
165
|
-
pendingFuseboxConsoleNotification = false;
|
|
166
|
-
},
|
|
167
|
-
|
|
168
143
|
// Called once by the bridge on startup, even if Fast Refresh is off.
|
|
169
144
|
// It creates the HMR client but doesn't actually set up the socket yet.
|
|
170
145
|
setup(
|
|
@@ -181,7 +156,7 @@ const HMRClient: HMRClientNativeInterface = {
|
|
|
181
156
|
invariant(!hmrClient, 'Cannot initialize hmrClient twice');
|
|
182
157
|
|
|
183
158
|
// Moving to top gives errors due to NativeModules not being initialized
|
|
184
|
-
const DevLoadingView = require('./DevLoadingView');
|
|
159
|
+
const DevLoadingView = require('./DevLoadingView').default;
|
|
185
160
|
|
|
186
161
|
const serverHost = port !== null && port !== '' ? `${host}:${port}` : host;
|
|
187
162
|
|
|
@@ -341,9 +316,6 @@ function flushEarlyLogs(client: MetroHMRClient) {
|
|
|
341
316
|
pendingLogs.forEach(([level, data]) => {
|
|
342
317
|
HMRClient.log(level, data);
|
|
343
318
|
});
|
|
344
|
-
if (pendingFuseboxConsoleNotification) {
|
|
345
|
-
HMRClient.unstable_notifyFuseboxConsoleEnabled();
|
|
346
|
-
}
|
|
347
319
|
} finally {
|
|
348
320
|
pendingLogs.length = 0;
|
|
349
321
|
}
|
|
@@ -387,4 +359,4 @@ function showCompileError() {
|
|
|
387
359
|
throw error;
|
|
388
360
|
}
|
|
389
361
|
|
|
390
|
-
|
|
362
|
+
export default HMRClient;
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
import type {
|
|
12
12
|
Platform as PlatformType,
|
|
13
13
|
PlatformSelectSpec,
|
|
14
|
-
} from './
|
|
14
|
+
} from './PlatformTypes';
|
|
15
15
|
|
|
16
16
|
import NativePlatformConstantsAndroid from './NativePlatformConstantsAndroid';
|
|
17
17
|
|
|
@@ -84,4 +84,4 @@ const Platform: PlatformType = {
|
|
|
84
84
|
spec.default,
|
|
85
85
|
};
|
|
86
86
|
|
|
87
|
-
|
|
87
|
+
export default Platform;
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
import type {
|
|
12
12
|
Platform as PlatformType,
|
|
13
13
|
PlatformSelectSpec,
|
|
14
|
-
} from './
|
|
14
|
+
} from './PlatformTypes';
|
|
15
15
|
|
|
16
16
|
import NativePlatformConstantsIOS from './NativePlatformConstantsIOS';
|
|
17
17
|
|
|
@@ -85,4 +85,4 @@ const Platform: PlatformType = {
|
|
|
85
85
|
'ios' in spec ? spec.ios : 'native' in spec ? spec.native : spec.default,
|
|
86
86
|
};
|
|
87
87
|
|
|
88
|
-
|
|
88
|
+
export default Platform;
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import type {
|
|
10
10
|
Platform as PlatformType,
|
|
11
11
|
PlatformSelectSpec,
|
|
12
|
-
} from './
|
|
12
|
+
} from './PlatformTypes';
|
|
13
13
|
|
|
14
14
|
import NativePlatformConstantsWin from './NativePlatformConstantsWin';
|
|
15
15
|
|
|
@@ -78,4 +78,4 @@ const Platform: PlatformType = {
|
|
|
78
78
|
spec.default,
|
|
79
79
|
};
|
|
80
80
|
|
|
81
|
-
|
|
81
|
+
export default Platform;
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
|
-
const defineLazyObjectProperty = require('./defineLazyObjectProperty');
|
|
13
|
+
const defineLazyObjectProperty = require('./defineLazyObjectProperty').default;
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Sets an object's property. If a property with the same name exists, this will
|
|
@@ -25,7 +25,7 @@ const defineLazyObjectProperty = require('./defineLazyObjectProperty');
|
|
|
25
25
|
*
|
|
26
26
|
* @see https://github.com/facebook/react-native/issues/934
|
|
27
27
|
*/
|
|
28
|
-
function polyfillObjectProperty<T>(
|
|
28
|
+
export function polyfillObjectProperty<T>(
|
|
29
29
|
object: {...},
|
|
30
30
|
name: string,
|
|
31
31
|
getValue: () => T,
|
|
@@ -49,8 +49,6 @@ function polyfillObjectProperty<T>(
|
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
function polyfillGlobal<T>(name: string, getValue: () => T): void {
|
|
52
|
+
export function polyfillGlobal<T>(name: string, getValue: () => T): void {
|
|
53
53
|
polyfillObjectProperty(global, name, getValue);
|
|
54
54
|
}
|
|
55
|
-
|
|
56
|
-
module.exports = {polyfillObjectProperty, polyfillGlobal};
|
|
@@ -20,7 +20,7 @@ const Switch = require('../Components/Switch/Switch').default;
|
|
|
20
20
|
const TextInput = require('../Components/TextInput/TextInput').default;
|
|
21
21
|
const View = require('../Components/View/View').default;
|
|
22
22
|
const Text = require('../Text/Text').default;
|
|
23
|
-
const {VirtualizedList} = require('@react-native/virtualized-lists');
|
|
23
|
+
const {VirtualizedList} = require('@react-native/virtualized-lists').default;
|
|
24
24
|
|
|
25
25
|
export type ReactTestInstance = $PropertyType<ReactTestRendererType, 'root'>;
|
|
26
26
|
export type Predicate = (node: ReactTestInstance) => boolean;
|
|
@@ -11,6 +11,6 @@
|
|
|
11
11
|
|
|
12
12
|
const GlobalPerformanceLogger = jest
|
|
13
13
|
.unmock('../createPerformanceLogger')
|
|
14
|
-
.genMockFromModule('../GlobalPerformanceLogger');
|
|
14
|
+
.genMockFromModule('../GlobalPerformanceLogger').default;
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
export default GlobalPerformanceLogger;
|
|
@@ -25,7 +25,7 @@ function unstable_setLogListeners(listeners: ?LogListeners) {
|
|
|
25
25
|
/*
|
|
26
26
|
* @returns {bool} true if different, false if equal
|
|
27
27
|
*/
|
|
28
|
-
|
|
28
|
+
function deepDiffer(
|
|
29
29
|
one: any,
|
|
30
30
|
two: any,
|
|
31
31
|
maxDepthOrOptions: Options | number = -1,
|
|
@@ -95,7 +95,7 @@ const deepDiffer = function (
|
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
return false;
|
|
98
|
-
}
|
|
98
|
+
}
|
|
99
99
|
|
|
100
100
|
deepDiffer.unstable_setLogListeners = unstable_setLogListeners;
|
|
101
|
-
|
|
101
|
+
export default deepDiffer;
|
|
@@ -25,7 +25,7 @@ const dummyInsets = {
|
|
|
25
25
|
bottom: undefined,
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
function insetsDiffer(one: Inset, two: Inset): boolean {
|
|
29
29
|
one = one || dummyInsets;
|
|
30
30
|
two = two || dummyInsets;
|
|
31
31
|
return (
|
|
@@ -35,6 +35,6 @@ const insetsDiffer = function (one: Inset, two: Inset): boolean {
|
|
|
35
35
|
one.right !== two.right ||
|
|
36
36
|
one.bottom !== two.bottom)
|
|
37
37
|
);
|
|
38
|
-
}
|
|
38
|
+
}
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
export default insetsDiffer;
|