@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
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
import type {ImageStyleProp, TextStyleProp} from '../StyleSheet';
|
|
14
14
|
|
|
15
|
-
const StyleSheet = require('../StyleSheet');
|
|
15
|
+
const StyleSheet = require('../StyleSheet').default;
|
|
16
16
|
const imageStyle = {tintColor: 'rgb(0, 0, 0)'};
|
|
17
17
|
const textStyle = {color: 'rgb(0, 0, 0)'};
|
|
18
18
|
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
|
|
13
13
|
import type {ColorValue, NativeColorValue} from './StyleSheet';
|
|
14
14
|
|
|
15
|
-
const Platform = require('../Utilities/Platform');
|
|
16
|
-
const normalizeColor = require('./normalizeColor');
|
|
15
|
+
const Platform = require('../Utilities/Platform').default;
|
|
16
|
+
const normalizeColor = require('./normalizeColor').default;
|
|
17
17
|
|
|
18
18
|
export type ProcessedColorValue = number | NativeColorValue;
|
|
19
19
|
|
package/Libraries/Text/Text.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
import type {TextStyleProp} from '../StyleSheet/StyleSheet';
|
|
12
12
|
import type {____TextStyle_Internal as TextStyleInternal} from '../StyleSheet/StyleSheetTypes';
|
|
13
|
-
import type {
|
|
13
|
+
import type {GestureResponderEvent} from '../Types/CoreEventTypes';
|
|
14
14
|
import type {NativeTextProps} from './TextNativeComponent';
|
|
15
15
|
import type {PressRetentionOffset, TextProps} from './TextProps';
|
|
16
16
|
|
|
@@ -331,14 +331,14 @@ const Text: component(
|
|
|
331
331
|
Text.displayName = 'Text';
|
|
332
332
|
|
|
333
333
|
type TextPressabilityProps = $ReadOnly<{
|
|
334
|
-
onLongPress?: ?(event:
|
|
335
|
-
onPress?: ?(event:
|
|
336
|
-
onPressIn?: ?(event:
|
|
337
|
-
onPressOut?: ?(event:
|
|
338
|
-
onResponderGrant?: ?(event:
|
|
339
|
-
onResponderMove?: ?(event:
|
|
340
|
-
onResponderRelease?: ?(event:
|
|
341
|
-
onResponderTerminate?: ?(event:
|
|
334
|
+
onLongPress?: ?(event: GestureResponderEvent) => mixed,
|
|
335
|
+
onPress?: ?(event: GestureResponderEvent) => mixed,
|
|
336
|
+
onPressIn?: ?(event: GestureResponderEvent) => mixed,
|
|
337
|
+
onPressOut?: ?(event: GestureResponderEvent) => mixed,
|
|
338
|
+
onResponderGrant?: ?(event: GestureResponderEvent) => void,
|
|
339
|
+
onResponderMove?: ?(event: GestureResponderEvent) => void,
|
|
340
|
+
onResponderRelease?: ?(event: GestureResponderEvent) => void,
|
|
341
|
+
onResponderTerminate?: ?(event: GestureResponderEvent) => void,
|
|
342
342
|
onResponderTerminationRequest?: ?() => boolean,
|
|
343
343
|
onStartShouldSetResponder?: ?() => boolean,
|
|
344
344
|
pressRetentionOffset?: ?PressRetentionOffset,
|
|
@@ -375,12 +375,12 @@ function useTextPressability({
|
|
|
375
375
|
// in the best case, and cause issues with text selection in the worst case. Forcing
|
|
376
376
|
// the isHighlighted prop to false on all platforms except iOS.
|
|
377
377
|
if (Platform.OS === 'ios') {
|
|
378
|
-
_onPressIn = (event:
|
|
378
|
+
_onPressIn = (event: GestureResponderEvent) => {
|
|
379
379
|
setHighlighted(suppressHighlighting == null || !suppressHighlighting);
|
|
380
380
|
onPressIn?.(event);
|
|
381
381
|
};
|
|
382
382
|
|
|
383
|
-
_onPressOut = (event:
|
|
383
|
+
_onPressOut = (event: GestureResponderEvent) => {
|
|
384
384
|
setHighlighted(false);
|
|
385
385
|
onPressOut?.(event);
|
|
386
386
|
};
|
|
@@ -412,25 +412,25 @@ function useTextPressability({
|
|
|
412
412
|
eventHandlers == null
|
|
413
413
|
? null
|
|
414
414
|
: {
|
|
415
|
-
onResponderGrant(event:
|
|
415
|
+
onResponderGrant(event: GestureResponderEvent) {
|
|
416
416
|
eventHandlers.onResponderGrant(event);
|
|
417
417
|
if (onResponderGrant != null) {
|
|
418
418
|
onResponderGrant(event);
|
|
419
419
|
}
|
|
420
420
|
},
|
|
421
|
-
onResponderMove(event:
|
|
421
|
+
onResponderMove(event: GestureResponderEvent) {
|
|
422
422
|
eventHandlers.onResponderMove(event);
|
|
423
423
|
if (onResponderMove != null) {
|
|
424
424
|
onResponderMove(event);
|
|
425
425
|
}
|
|
426
426
|
},
|
|
427
|
-
onResponderRelease(event:
|
|
427
|
+
onResponderRelease(event: GestureResponderEvent) {
|
|
428
428
|
eventHandlers.onResponderRelease(event);
|
|
429
429
|
if (onResponderRelease != null) {
|
|
430
430
|
onResponderRelease(event);
|
|
431
431
|
}
|
|
432
432
|
},
|
|
433
|
-
onResponderTerminate(event:
|
|
433
|
+
onResponderTerminate(event: GestureResponderEvent) {
|
|
434
434
|
eventHandlers.onResponderTerminate(event);
|
|
435
435
|
if (onResponderTerminate != null) {
|
|
436
436
|
onResponderTerminate(event);
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
import type {TextStyleProp} from '../StyleSheet/StyleSheet';
|
|
12
12
|
import type {____TextStyle_Internal as TextStyleInternal} from '../StyleSheet/StyleSheetTypes';
|
|
13
|
-
import type {
|
|
13
|
+
import type {GestureResponderEvent} from '../Types/CoreEventTypes';
|
|
14
14
|
import type {NativeTextProps} from './TextNativeComponent';
|
|
15
15
|
import type {PressRetentionOffset, TextProps} from './TextProps';
|
|
16
16
|
|
|
@@ -371,14 +371,14 @@ const Text: component(
|
|
|
371
371
|
Text.displayName = 'Text';
|
|
372
372
|
|
|
373
373
|
type TextPressabilityProps = $ReadOnly<{
|
|
374
|
-
onLongPress?: ?(event:
|
|
375
|
-
onPress?: ?(event:
|
|
376
|
-
onPressIn?: ?(event:
|
|
377
|
-
onPressOut?: ?(event:
|
|
378
|
-
onResponderGrant?: ?(event:
|
|
379
|
-
onResponderMove?: ?(event:
|
|
380
|
-
onResponderRelease?: ?(event:
|
|
381
|
-
onResponderTerminate?: ?(event:
|
|
374
|
+
onLongPress?: ?(event: GestureResponderEvent) => mixed,
|
|
375
|
+
onPress?: ?(event: GestureResponderEvent) => mixed,
|
|
376
|
+
onPressIn?: ?(event: GestureResponderEvent) => mixed,
|
|
377
|
+
onPressOut?: ?(event: GestureResponderEvent) => mixed,
|
|
378
|
+
onResponderGrant?: ?(event: GestureResponderEvent) => void,
|
|
379
|
+
onResponderMove?: ?(event: GestureResponderEvent) => void,
|
|
380
|
+
onResponderRelease?: ?(event: GestureResponderEvent) => void,
|
|
381
|
+
onResponderTerminate?: ?(event: GestureResponderEvent) => void,
|
|
382
382
|
onResponderTerminationRequest?: ?() => boolean,
|
|
383
383
|
onStartShouldSetResponder?: ?() => boolean,
|
|
384
384
|
pressRetentionOffset?: ?PressRetentionOffset,
|
|
@@ -415,12 +415,12 @@ function useTextPressability({
|
|
|
415
415
|
// in the best case, and cause issues with text selection in the worst case. Forcing
|
|
416
416
|
// the isHighlighted prop to false on all platforms except iOS.
|
|
417
417
|
if (Platform.OS === 'ios') {
|
|
418
|
-
_onPressIn = (event:
|
|
418
|
+
_onPressIn = (event: GestureResponderEvent) => {
|
|
419
419
|
setHighlighted(suppressHighlighting == null || !suppressHighlighting);
|
|
420
420
|
onPressIn?.(event);
|
|
421
421
|
};
|
|
422
422
|
|
|
423
|
-
_onPressOut = (event:
|
|
423
|
+
_onPressOut = (event: GestureResponderEvent) => {
|
|
424
424
|
setHighlighted(false);
|
|
425
425
|
onPressOut?.(event);
|
|
426
426
|
};
|
|
@@ -452,25 +452,25 @@ function useTextPressability({
|
|
|
452
452
|
eventHandlers == null
|
|
453
453
|
? null
|
|
454
454
|
: {
|
|
455
|
-
onResponderGrant(event:
|
|
455
|
+
onResponderGrant(event: GestureResponderEvent) {
|
|
456
456
|
eventHandlers.onResponderGrant(event);
|
|
457
457
|
if (onResponderGrant != null) {
|
|
458
458
|
onResponderGrant(event);
|
|
459
459
|
}
|
|
460
460
|
},
|
|
461
|
-
onResponderMove(event:
|
|
461
|
+
onResponderMove(event: GestureResponderEvent) {
|
|
462
462
|
eventHandlers.onResponderMove(event);
|
|
463
463
|
if (onResponderMove != null) {
|
|
464
464
|
onResponderMove(event);
|
|
465
465
|
}
|
|
466
466
|
},
|
|
467
|
-
onResponderRelease(event:
|
|
467
|
+
onResponderRelease(event: GestureResponderEvent) {
|
|
468
468
|
eventHandlers.onResponderRelease(event);
|
|
469
469
|
if (onResponderRelease != null) {
|
|
470
470
|
onResponderRelease(event);
|
|
471
471
|
}
|
|
472
472
|
},
|
|
473
|
-
onResponderTerminate(event:
|
|
473
|
+
onResponderTerminate(event: GestureResponderEvent) {
|
|
474
474
|
eventHandlers.onResponderTerminate(event);
|
|
475
475
|
if (onResponderTerminate != null) {
|
|
476
476
|
onResponderTerminate(event);
|
|
@@ -15,7 +15,7 @@ const React = require('react');
|
|
|
15
15
|
/**
|
|
16
16
|
* Whether the current element is the descendant of a <Text> element.
|
|
17
17
|
*/
|
|
18
|
-
const TextAncestorContext: React
|
|
18
|
+
const TextAncestorContext: React.Context<boolean> = React.createContext(false);
|
|
19
19
|
if (__DEV__) {
|
|
20
20
|
TextAncestorContext.displayName = 'TextAncestorContext';
|
|
21
21
|
}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
import type {HostComponent} from '../Renderer/shims/ReactNativeTypes';
|
|
12
12
|
import type {ProcessedColorValue} from '../StyleSheet/processColor';
|
|
13
|
-
import type {
|
|
13
|
+
import type {GestureResponderEvent} from '../Types/CoreEventTypes';
|
|
14
14
|
import type {TextProps} from './TextProps';
|
|
15
15
|
|
|
16
16
|
import {createViewConfig} from '../NativeComponent/ViewConfig';
|
|
@@ -21,7 +21,7 @@ export type NativeTextProps = $ReadOnly<{
|
|
|
21
21
|
...TextProps,
|
|
22
22
|
isHighlighted?: ?boolean,
|
|
23
23
|
selectionColor?: ?ProcessedColorValue,
|
|
24
|
-
onClick?: ?(event:
|
|
24
|
+
onClick?: ?(event: GestureResponderEvent) => mixed,
|
|
25
25
|
// This is only needed for platforms that optimize text hit testing, e.g.,
|
|
26
26
|
// react-native-windows. It can be used to only hit test virtual text spans
|
|
27
27
|
// that have pressable events attached to them.
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
import type {HostComponent} from '../Renderer/shims/ReactNativeTypes';
|
|
12
12
|
import type {ProcessedColorValue} from '../StyleSheet/processColor';
|
|
13
|
-
import type {
|
|
13
|
+
import type {GestureResponderEvent} from '../Types/CoreEventTypes';
|
|
14
14
|
import type {TextProps} from './TextProps';
|
|
15
15
|
|
|
16
16
|
import {createViewConfig} from '../NativeComponent/ViewConfig';
|
|
@@ -21,7 +21,7 @@ export type NativeTextProps = $ReadOnly<{
|
|
|
21
21
|
...TextProps,
|
|
22
22
|
isHighlighted?: ?boolean,
|
|
23
23
|
selectionColor?: ?ProcessedColorValue,
|
|
24
|
-
onClick?: ?(event:
|
|
24
|
+
onClick?: ?(event: GestureResponderEvent) => mixed,
|
|
25
25
|
// This is only needed for platforms that optimize text hit testing, e.g.,
|
|
26
26
|
// react-native-windows. It can be used to only hit test virtual text spans
|
|
27
27
|
// that have pressable events attached to them.
|
|
@@ -19,9 +19,9 @@ import type {
|
|
|
19
19
|
} from '../Components/View/ViewAccessibility';
|
|
20
20
|
import type {ColorValue, TextStyleProp} from '../StyleSheet/StyleSheet';
|
|
21
21
|
import type {
|
|
22
|
-
|
|
22
|
+
LayoutChangeEvent,
|
|
23
23
|
PointerEvent,
|
|
24
|
-
|
|
24
|
+
GestureResponderEvent,
|
|
25
25
|
TextLayoutEvent,
|
|
26
26
|
} from '../Types/CoreEventTypes';
|
|
27
27
|
import type {Node} from 'react';
|
|
@@ -142,27 +142,27 @@ export type TextProps = $ReadOnly<{
|
|
|
142
142
|
*
|
|
143
143
|
* See https://reactnative.dev/docs/text#onlayout
|
|
144
144
|
*/
|
|
145
|
-
onLayout?: ?(event:
|
|
145
|
+
onLayout?: ?(event: LayoutChangeEvent) => mixed,
|
|
146
146
|
|
|
147
147
|
/**
|
|
148
148
|
* This function is called on long press.
|
|
149
149
|
*
|
|
150
150
|
* See https://reactnative.dev/docs/text#onlongpress
|
|
151
151
|
*/
|
|
152
|
-
onLongPress?: ?(event:
|
|
152
|
+
onLongPress?: ?(event: GestureResponderEvent) => mixed,
|
|
153
153
|
|
|
154
154
|
/**
|
|
155
155
|
* This function is called on press.
|
|
156
156
|
*
|
|
157
157
|
* See https://reactnative.dev/docs/text#onpress
|
|
158
158
|
*/
|
|
159
|
-
onPress?: ?(event:
|
|
160
|
-
onPressIn?: ?(event:
|
|
161
|
-
onPressOut?: ?(event:
|
|
162
|
-
onResponderGrant?: ?(event:
|
|
163
|
-
onResponderMove?: ?(event:
|
|
164
|
-
onResponderRelease?: ?(event:
|
|
165
|
-
onResponderTerminate?: ?(event:
|
|
159
|
+
onPress?: ?(event: GestureResponderEvent) => mixed,
|
|
160
|
+
onPressIn?: ?(event: GestureResponderEvent) => mixed,
|
|
161
|
+
onPressOut?: ?(event: GestureResponderEvent) => mixed,
|
|
162
|
+
onResponderGrant?: ?(event: GestureResponderEvent) => void,
|
|
163
|
+
onResponderMove?: ?(event: GestureResponderEvent) => void,
|
|
164
|
+
onResponderRelease?: ?(event: GestureResponderEvent) => void,
|
|
165
|
+
onResponderTerminate?: ?(event: GestureResponderEvent) => void,
|
|
166
166
|
onResponderTerminationRequest?: ?() => boolean,
|
|
167
167
|
onStartShouldSetResponder?: ?() => boolean,
|
|
168
168
|
onMoveShouldSetResponder?: ?() => boolean,
|
|
@@ -19,9 +19,9 @@ import type {
|
|
|
19
19
|
} from '../Components/View/ViewAccessibility';
|
|
20
20
|
import type {ColorValue, TextStyleProp} from '../StyleSheet/StyleSheet';
|
|
21
21
|
import type {
|
|
22
|
-
|
|
22
|
+
LayoutChangeEvent,
|
|
23
23
|
PointerEvent,
|
|
24
|
-
|
|
24
|
+
GestureResponderEvent,
|
|
25
25
|
TextLayoutEvent,
|
|
26
26
|
} from '../Types/CoreEventTypes';
|
|
27
27
|
import type {Node} from 'react';
|
|
@@ -155,27 +155,27 @@ export type TextProps = $ReadOnly<{
|
|
|
155
155
|
*
|
|
156
156
|
* See https://reactnative.dev/docs/text#onlayout
|
|
157
157
|
*/
|
|
158
|
-
onLayout?: ?(event:
|
|
158
|
+
onLayout?: ?(event: LayoutChangeEvent) => mixed,
|
|
159
159
|
|
|
160
160
|
/**
|
|
161
161
|
* This function is called on long press.
|
|
162
162
|
*
|
|
163
163
|
* See https://reactnative.dev/docs/text#onlongpress
|
|
164
164
|
*/
|
|
165
|
-
onLongPress?: ?(event:
|
|
165
|
+
onLongPress?: ?(event: GestureResponderEvent) => mixed,
|
|
166
166
|
|
|
167
167
|
/**
|
|
168
168
|
* This function is called on press.
|
|
169
169
|
*
|
|
170
170
|
* See https://reactnative.dev/docs/text#onpress
|
|
171
171
|
*/
|
|
172
|
-
onPress?: ?(event:
|
|
173
|
-
onPressIn?: ?(event:
|
|
174
|
-
onPressOut?: ?(event:
|
|
175
|
-
onResponderGrant?: ?(event:
|
|
176
|
-
onResponderMove?: ?(event:
|
|
177
|
-
onResponderRelease?: ?(event:
|
|
178
|
-
onResponderTerminate?: ?(event:
|
|
172
|
+
onPress?: ?(event: GestureResponderEvent) => mixed,
|
|
173
|
+
onPressIn?: ?(event: GestureResponderEvent) => mixed,
|
|
174
|
+
onPressOut?: ?(event: GestureResponderEvent) => mixed,
|
|
175
|
+
onResponderGrant?: ?(event: GestureResponderEvent) => void,
|
|
176
|
+
onResponderMove?: ?(event: GestureResponderEvent) => void,
|
|
177
|
+
onResponderRelease?: ?(event: GestureResponderEvent) => void,
|
|
178
|
+
onResponderTerminate?: ?(event: GestureResponderEvent) => void,
|
|
179
179
|
onResponderTerminationRequest?: ?() => boolean,
|
|
180
180
|
onStartShouldSetResponder?: ?() => boolean,
|
|
181
181
|
onMoveShouldSetResponder?: ?() => boolean,
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
13
|
import type {EventSubscription} from '../vendor/emitter/EventEmitter';
|
|
14
|
-
import type {
|
|
14
|
+
import type {NativeSyntheticEvent} from './CoreEventTypes';
|
|
15
15
|
|
|
16
16
|
// Event types
|
|
17
17
|
// We're not using the PaperName, it is only used to codegen view config settings
|
|
@@ -19,11 +19,11 @@ import type {SyntheticEvent} from './CoreEventTypes';
|
|
|
19
19
|
export type BubblingEventHandler<
|
|
20
20
|
T,
|
|
21
21
|
PaperName: string | empty = empty, // eslint-disable-line no-unused-vars
|
|
22
|
-
> = (event:
|
|
22
|
+
> = (event: NativeSyntheticEvent<T>) => void | Promise<void>;
|
|
23
23
|
export type DirectEventHandler<
|
|
24
24
|
T,
|
|
25
25
|
PaperName: string | empty = empty, // eslint-disable-line no-unused-vars
|
|
26
|
-
> = (event:
|
|
26
|
+
> = (event: NativeSyntheticEvent<T>) => void | Promise<void>;
|
|
27
27
|
|
|
28
28
|
// Prop types
|
|
29
29
|
export type Double = number;
|
|
@@ -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
|
|
@@ -218,71 +218,102 @@ export interface NativePointerEvent extends NativeMouseEvent {
|
|
|
218
218
|
+isPrimary: boolean;
|
|
219
219
|
}
|
|
220
220
|
|
|
221
|
-
export type PointerEvent =
|
|
221
|
+
export type PointerEvent = NativeSyntheticEvent<NativePointerEvent>;
|
|
222
222
|
|
|
223
|
-
export type
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
223
|
+
export type NativeTouchEvent = $ReadOnly<{
|
|
224
|
+
/**
|
|
225
|
+
* Array of all touch events that have changed since the last event
|
|
226
|
+
*/
|
|
227
|
+
changedTouches: $ReadOnlyArray<NativeTouchEvent>,
|
|
228
|
+
/**
|
|
229
|
+
* 3D Touch reported force
|
|
230
|
+
* @platform ios
|
|
231
|
+
*/
|
|
232
|
+
force?: number,
|
|
233
|
+
/**
|
|
234
|
+
* The ID of the touch
|
|
235
|
+
*/
|
|
236
|
+
identifier: number,
|
|
237
|
+
/**
|
|
238
|
+
* The X position of the touch, relative to the element
|
|
239
|
+
*/
|
|
240
|
+
locationX: number,
|
|
241
|
+
/**
|
|
242
|
+
* The Y position of the touch, relative to the element
|
|
243
|
+
*/
|
|
244
|
+
locationY: number,
|
|
245
|
+
/**
|
|
246
|
+
* The X position of the touch, relative to the screen
|
|
247
|
+
*/
|
|
248
|
+
pageX: number,
|
|
249
|
+
/**
|
|
250
|
+
* The Y position of the touch, relative to the screen
|
|
251
|
+
*/
|
|
252
|
+
pageY: number,
|
|
253
|
+
/**
|
|
254
|
+
* The node id of the element receiving the touch event
|
|
255
|
+
*/
|
|
256
|
+
target: ?number,
|
|
257
|
+
/**
|
|
258
|
+
* A time identifier for the touch, useful for velocity calculation
|
|
259
|
+
*/
|
|
260
|
+
timestamp: number,
|
|
261
|
+
/**
|
|
262
|
+
* Array of all current touches on the screen
|
|
263
|
+
*/
|
|
264
|
+
touches: $ReadOnlyArray<NativeTouchEvent>,
|
|
265
|
+
}>;
|
|
237
266
|
|
|
238
|
-
export type
|
|
239
|
-
$ReadOnly<{
|
|
240
|
-
contentInset: $ReadOnly<{
|
|
241
|
-
bottom: number,
|
|
242
|
-
left: number,
|
|
243
|
-
right: number,
|
|
244
|
-
top: number,
|
|
245
|
-
}>,
|
|
246
|
-
contentOffset: $ReadOnly<{
|
|
247
|
-
y: number,
|
|
248
|
-
x: number,
|
|
249
|
-
}>,
|
|
250
|
-
contentSize: $ReadOnly<{
|
|
251
|
-
height: number,
|
|
252
|
-
width: number,
|
|
253
|
-
}>,
|
|
254
|
-
layoutMeasurement: $ReadOnly<{
|
|
255
|
-
height: number,
|
|
256
|
-
width: number,
|
|
257
|
-
}>,
|
|
258
|
-
targetContentOffset?: $ReadOnly<{
|
|
259
|
-
y: number,
|
|
260
|
-
x: number,
|
|
261
|
-
}>,
|
|
262
|
-
velocity?: $ReadOnly<{
|
|
263
|
-
y: number,
|
|
264
|
-
x: number,
|
|
265
|
-
}>,
|
|
266
|
-
zoomScale?: number,
|
|
267
|
-
responderIgnoreScroll?: boolean,
|
|
268
|
-
}>,
|
|
269
|
-
>;
|
|
267
|
+
export type GestureResponderEvent = ResponderSyntheticEvent<NativeTouchEvent>;
|
|
270
268
|
|
|
271
|
-
export type
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
>;
|
|
269
|
+
export type NativeScrollRectangle = $ReadOnly<{
|
|
270
|
+
bottom: number,
|
|
271
|
+
left: number,
|
|
272
|
+
right: number,
|
|
273
|
+
top: number,
|
|
274
|
+
}>;
|
|
277
275
|
|
|
278
|
-
export type
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
276
|
+
export type NativeScrollPoint = $ReadOnly<{
|
|
277
|
+
y: number,
|
|
278
|
+
x: number,
|
|
279
|
+
}>;
|
|
280
|
+
|
|
281
|
+
export type NativeScrollVelocity = $ReadOnly<{
|
|
282
|
+
y: number,
|
|
283
|
+
x: number,
|
|
284
|
+
}>;
|
|
285
|
+
|
|
286
|
+
export type NativeScrollSize = $ReadOnly<{
|
|
287
|
+
height: number,
|
|
288
|
+
width: number,
|
|
289
|
+
}>;
|
|
290
|
+
|
|
291
|
+
export type NativeScrollEvent = $ReadOnly<{
|
|
292
|
+
contentInset: NativeScrollRectangle,
|
|
293
|
+
contentOffset: NativeScrollPoint,
|
|
294
|
+
contentSize: NativeScrollSize,
|
|
295
|
+
layoutMeasurement: NativeScrollSize,
|
|
296
|
+
velocity?: NativeScrollVelocity,
|
|
297
|
+
zoomScale?: number,
|
|
298
|
+
responderIgnoreScroll?: boolean,
|
|
299
|
+
/**
|
|
300
|
+
* @platform ios
|
|
301
|
+
*/
|
|
302
|
+
targetContentOffset?: NativeScrollPoint,
|
|
303
|
+
}>;
|
|
304
|
+
|
|
305
|
+
export type ScrollEvent = NativeSyntheticEvent<NativeScrollEvent>;
|
|
306
|
+
|
|
307
|
+
export type TargetedEvent = $ReadOnly<{
|
|
308
|
+
target: number,
|
|
309
|
+
...
|
|
310
|
+
}>;
|
|
311
|
+
|
|
312
|
+
export type BlurEvent = NativeSyntheticEvent<TargetedEvent>;
|
|
313
|
+
|
|
314
|
+
export type FocusEvent = NativeSyntheticEvent<TargetedEvent>;
|
|
284
315
|
|
|
285
|
-
export type MouseEvent =
|
|
316
|
+
export type MouseEvent = NativeSyntheticEvent<
|
|
286
317
|
$ReadOnly<{
|
|
287
318
|
clientX: number,
|
|
288
319
|
clientY: number,
|