@office-iss/react-native-win32 0.83.0-preview.1 → 0.84.0-preview.2
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 +2 -2
- package/CHANGELOG.json +57 -6
- package/CHANGELOG.md +30 -5
- package/IntegrationTests/AccessibilityManagerTest.js +10 -7
- package/IntegrationTests/ImageCachePolicyTest.js +8 -8
- package/IntegrationTests/IntegrationTestsApp.js +3 -3
- package/IntegrationTests/LayoutEventsTest.js +1 -1
- package/IntegrationTests/TimersTest.js +1 -1
- package/IntegrationTests/WebSocketTest.js +1 -1
- package/Libraries/Animated/AnimatedEvent.js +2 -2
- package/Libraries/Animated/animations/Animation.js +1 -3
- package/Libraries/Animated/createAnimatedComponent.js +8 -5
- package/Libraries/Animated/nodes/AnimatedColor.js +1 -1
- package/Libraries/Animated/nodes/AnimatedInterpolation.js +40 -4
- package/Libraries/Animated/nodes/AnimatedNode.js +3 -3
- package/Libraries/Animated/nodes/AnimatedObject.js +16 -11
- package/Libraries/Animated/nodes/AnimatedProps.js +43 -12
- package/Libraries/Animated/nodes/AnimatedStyle.js +12 -12
- package/Libraries/Animated/nodes/AnimatedValue.js +6 -3
- package/Libraries/Animated/nodes/AnimatedValueXY.js +1 -1
- package/Libraries/BatchedBridge/MessageQueue.js +24 -22
- package/Libraries/Blob/URL.js +34 -3
- package/Libraries/Blob/URLSearchParams.js +1 -0
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts +6 -0
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +6 -1
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.win32.js +8 -1
- package/Libraries/Components/Button.js +2 -5
- package/Libraries/Components/Button.win32.js +2 -5
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +1 -1
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroidTypes.js +4 -4
- package/Libraries/Components/Keyboard/Keyboard.js +2 -2
- package/Libraries/Components/Pressable/Pressable.js +8 -8
- package/Libraries/Components/Pressable/Pressable.win32.js +14 -13
- package/Libraries/Components/TextInput/TextInput.flow.js +13 -13
- package/Libraries/Components/TextInput/TextInput.flow.win32.js +13 -13
- package/Libraries/Components/TextInput/TextInput.js +33 -34
- package/Libraries/Components/TextInput/TextInput.win32.js +39 -39
- package/Libraries/Components/Touchable/PooledClass.js +2 -2
- package/Libraries/Components/Touchable/TouchableBounce.js +3 -3
- package/Libraries/Components/Touchable/TouchableNativeFeedback.js +1 -1
- package/Libraries/Components/Touchable/TouchableNativeFeedback.win32.js +1 -1
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +9 -9
- package/Libraries/Components/View/View.win32.js +5 -5
- package/Libraries/Components/View/ViewPropTypes.js +16 -6
- package/Libraries/Components/View/ViewPropTypes.win32.js +20 -10
- package/Libraries/Core/Devtools/loadBundleFromServer.js +6 -3
- package/Libraries/Core/Devtools/loadBundleFromServer.win32.js +6 -3
- package/Libraries/Core/Devtools/symbolicateStackTrace.js +1 -1
- package/Libraries/Core/ExceptionsManager.js +3 -3
- package/Libraries/Core/RawEventEmitter.js +1 -1
- package/Libraries/Core/ReactFiberErrorDialog.js +1 -1
- package/Libraries/Core/ReactNativeVersion.js +3 -3
- package/Libraries/Core/setUpDeveloperTools.js +1 -1
- package/Libraries/Core/setUpErrorHandling.js +1 -1
- package/Libraries/EventEmitter/NativeEventEmitter.js +2 -2
- package/Libraries/Image/Image.android.js +2 -2
- package/Libraries/Image/Image.ios.js +2 -2
- package/Libraries/Image/Image.win32.js +1 -1
- package/Libraries/Image/ImageProps.js +1 -1
- package/Libraries/Image/ImageTypes.flow.js +2 -2
- package/Libraries/Interaction/InteractionManager.js +3 -3
- package/Libraries/Interaction/PanResponder.js +1 -1
- package/Libraries/LayoutAnimation/LayoutAnimation.js +1 -1
- package/Libraries/Linking/Linking.js +1 -1
- package/Libraries/Lists/FlatList.js +2 -2
- package/Libraries/LogBox/Data/LogBoxData.js +31 -4
- package/Libraries/LogBox/Data/LogBoxLog.js +2 -2
- package/Libraries/LogBox/Data/LogBoxSymbolication.js +1 -1
- package/Libraries/LogBox/Data/parseLogBoxLog.js +5 -5
- package/Libraries/LogBox/LogBox.js +7 -7
- package/Libraries/NativeComponent/BaseViewConfig.android.js +12 -0
- package/Libraries/NativeComponent/StaticViewConfigValidator.js +4 -4
- package/Libraries/NativeComponent/ViewConfigIgnore.js +1 -1
- package/Libraries/Network/RCTNetworking.android.js +3 -3
- package/Libraries/Network/RCTNetworking.ios.js +2 -2
- package/Libraries/Network/RCTNetworking.js.flow +2 -2
- package/Libraries/Network/RCTNetworking.win32.js +2 -2
- package/Libraries/Pressability/Pressability.js +9 -9
- package/Libraries/Pressability/Pressability.win32.js +17 -16
- package/Libraries/ReactNative/AppRegistry.flow.js +1 -1
- package/Libraries/ReactNative/BridgelessUIManager.js +1 -1
- package/Libraries/ReactNative/FabricUIManager.js +1 -1
- package/Libraries/ReactNative/PaperUIManager.js +1 -1
- package/Libraries/ReactNative/PaperUIManager.win32.js +1 -1
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.js +1 -1
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstanceUtils.js +2 -2
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactNativeAttributePayload.js +1 -1
- package/Libraries/ReactNative/RendererImplementation.js +1 -1
- package/Libraries/ReactNative/getNativeComponentAttributes.js +1 -1
- package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +1 -2
- package/Libraries/Renderer/implementations/ReactFabric-dev.js +3 -3
- package/Libraries/Renderer/implementations/ReactFabric-prod.js +3 -3
- package/Libraries/Renderer/implementations/ReactFabric-profiling.js +3 -3
- package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +11 -4
- package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +11 -4
- package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +11 -4
- package/Libraries/Renderer/shims/ReactFabric.js +3 -1
- package/Libraries/Renderer/shims/ReactFeatureFlags.js +3 -1
- package/Libraries/Renderer/shims/ReactNative.js +2 -2
- package/Libraries/Renderer/shims/ReactNativeTypes.js +3 -1
- package/Libraries/Renderer/shims/ReactNativeTypes.win32.js +3 -1
- package/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js +3 -1
- package/Libraries/Renderer/shims/createReactNativeComponentClass.js +3 -1
- package/Libraries/Settings/Settings.ios.js +1 -1
- package/Libraries/StyleSheet/PlatformColorValueTypes.android.js +2 -2
- package/Libraries/StyleSheet/PlatformColorValueTypes.ios.js +1 -1
- package/Libraries/StyleSheet/PlatformColorValueTypes.js.flow +4 -2
- package/Libraries/StyleSheet/StyleSheetExports.js +1 -1
- package/Libraries/StyleSheet/StyleSheetTypes.d.ts +99 -4
- package/Libraries/StyleSheet/StyleSheetTypes.js +6 -8
- package/Libraries/StyleSheet/processFilter.js +1 -1
- package/Libraries/Text/Text.js +46 -6
- package/Libraries/Text/Text.win32.js +46 -6
- package/Libraries/Text/TextNativeComponent.js +1 -1
- package/Libraries/Text/TextNativeComponent.win32.js +1 -1
- package/Libraries/Text/TextProps.js +7 -7
- package/Libraries/Text/TextProps.win32.js +7 -7
- package/Libraries/Types/CodegenTypes.js +1 -1
- package/Libraries/Types/CoreEventTypes.js +31 -0
- package/Libraries/Types/CoreEventTypes.win32.js +30 -13
- package/Libraries/Types/ReactDevToolsTypes.js +2 -2
- package/Libraries/Utilities/Appearance.js +2 -2
- package/Libraries/Utilities/DevLoadingView.js +8 -1
- package/Libraries/Utilities/DevSettings.js +3 -3
- package/Libraries/Utilities/HMRClient.js +4 -3
- package/Libraries/Utilities/RCTLog.js +3 -3
- package/Libraries/Utilities/ReactNativeTestTools.js +1 -1
- package/Libraries/Utilities/SceneTracker.js +1 -1
- package/Libraries/Utilities/codegenNativeCommands.js +1 -1
- package/Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.js +3 -3
- package/Libraries/Utilities/logError.js +1 -1
- package/Libraries/Utilities/stringifySafe.js +7 -7
- package/Libraries/Utilities/useRefEffect.js +1 -1
- package/Libraries/WebSocket/WebSocketInterceptor.js +3 -3
- package/Libraries/promiseRejectionTrackingOptions.js +8 -8
- package/Libraries/vendor/core/ErrorUtils.js +10 -10
- package/Libraries/vendor/emitter/EventEmitter.js +6 -6
- package/flow/HermesInternalType.js +6 -6
- package/flow/bom.js.flow +35 -28
- package/flow/cssom.js.flow +3 -3
- package/flow/dom.js.flow +34 -33
- package/index.js +3 -0
- package/index.win32.js +3 -0
- package/index.win32.js.flow +8 -0
- package/jest/mock.js +2 -2
- package/jest/mockComponent.js +1 -1
- package/jest/setup.js +1 -1
- package/overrides.json +23 -23
- package/package.json +19 -18
- package/src/private/animated/NativeAnimatedHelper.js +130 -125
- package/src/private/animated/NativeAnimatedHelper.win32.js +130 -125
- package/src/private/animated/NativeAnimatedValidation.js +7 -4
- package/src/private/animated/createAnimatedPropsHook.js +13 -5
- package/src/private/animated/createAnimatedPropsMemoHook.js +10 -10
- package/src/private/components/virtualview/VirtualView.js +16 -9
- package/src/private/components/virtualview/logger/VirtualViewLogger.js +21 -0
- package/src/private/components/virtualview/logger/VirtualViewLoggerTypes.js +24 -0
- package/src/private/devsupport/devmenu/elementinspector/ElementProperties.js +1 -1
- package/src/private/devsupport/devmenu/elementinspector/Inspector.js +6 -25
- package/src/private/devsupport/devmenu/elementinspector/InspectorPanel.js +1 -27
- package/src/private/devsupport/devmenu/elementinspector/XHRInterceptor.js +3 -2
- package/src/private/featureflags/ReactNativeFeatureFlags.js +63 -42
- package/src/private/featureflags/ReactNativeFeatureFlagsBase.js +3 -3
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +12 -9
- package/src/private/renderer/errorhandling/ErrorHandlers.js +7 -4
- package/src/private/specs_DEPRECATED/modules/NativeAccessibilityManager.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativeAnimatedModule.js +4 -0
- package/src/private/specs_DEPRECATED/modules/NativeDevLoadingView.js +1 -0
- package/src/private/webapis/dom/events/CustomEvent.js +3 -3
- package/src/private/webapis/dom/nodes/internals/ReactNativeDocumentElementInstanceHandle.js +1 -1
- package/src/private/webapis/dom/nodes/internals/ReactNativeDocumentInstanceHandle.js +1 -1
- package/src/private/webapis/dom/nodes/specs/NativeDOM.js +29 -29
- package/src/private/webapis/dom/oldstylecollections/HTMLCollection.js +1 -1
- package/src/private/webapis/dom/oldstylecollections/NodeList.js +2 -2
- package/src/private/webapis/geometry/DOMRectReadOnly.js +1 -1
- package/src/private/webapis/html/events/MessageEvent.js +3 -3
- package/src/private/webapis/idlecallbacks/specs/NativeIdleCallbacks.js +3 -3
- package/src/private/webapis/intersectionobserver/IntersectionObserver.js +53 -5
- package/src/private/webapis/intersectionobserver/internals/IntersectionObserverManager.js +2 -2
- package/src/private/webapis/intersectionobserver/specs/NativeIntersectionObserver.js +4 -4
- package/src/private/webapis/microtasks/specs/NativeMicrotasks.js +1 -1
- package/src/private/webapis/mutationobserver/MutationObserver.js +1 -1
- package/src/private/webapis/mutationobserver/MutationRecord.js +1 -1
- package/src/private/webapis/mutationobserver/specs/NativeMutationObserver.js +4 -4
- package/src/private/webapis/performance/Performance.js +1 -1
- package/src/private/webapis/performance/UserTiming.js +1 -1
- package/src/private/webapis/performance/specs/NativePerformance.js +3 -3
- package/src/private/webapis/structuredClone/structuredClone.js +3 -3
- package/src/types/globals.d.ts +30 -1
- package/src-win/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts +6 -0
- package/src-win/index.win32.js.flow +8 -0
- package/src/private/devsupport/devmenu/elementinspector/NetworkOverlay.js +0 -628
- package/src/private/devsupport/devmenu/perfmonitor/PerformanceOverlay.js +0 -66
|
@@ -343,8 +343,8 @@ export type DropShadowValue = {
|
|
|
343
343
|
export type BoxShadowValue = {
|
|
344
344
|
offsetX: number | string;
|
|
345
345
|
offsetY: number | string;
|
|
346
|
-
color?:
|
|
347
|
-
blurRadius?:
|
|
346
|
+
color?: ColorValue | undefined;
|
|
347
|
+
blurRadius?: string | number | undefined;
|
|
348
348
|
spreadDistance?: number | string | undefined;
|
|
349
349
|
inset?: boolean | undefined;
|
|
350
350
|
};
|
|
@@ -367,7 +367,7 @@ export type BlendMode =
|
|
|
367
367
|
| 'color'
|
|
368
368
|
| 'luminosity';
|
|
369
369
|
|
|
370
|
-
export type
|
|
370
|
+
export type LinearGradientValue = {
|
|
371
371
|
type: 'linear-gradient';
|
|
372
372
|
// Angle or direction enums
|
|
373
373
|
direction?: string | undefined;
|
|
@@ -377,6 +377,89 @@ export type GradientValue = {
|
|
|
377
377
|
}>;
|
|
378
378
|
};
|
|
379
379
|
|
|
380
|
+
export type GradientValue = LinearGradientValue;
|
|
381
|
+
|
|
382
|
+
type RadialExtent =
|
|
383
|
+
| 'closest-corner'
|
|
384
|
+
| 'closest-side'
|
|
385
|
+
| 'farthest-corner'
|
|
386
|
+
| 'farthest-side';
|
|
387
|
+
export type RadialGradientPosition =
|
|
388
|
+
| {
|
|
389
|
+
top: number | string;
|
|
390
|
+
left: number | string;
|
|
391
|
+
}
|
|
392
|
+
| {
|
|
393
|
+
top: number | string;
|
|
394
|
+
right: number | string;
|
|
395
|
+
}
|
|
396
|
+
| {
|
|
397
|
+
bottom: number | string;
|
|
398
|
+
left: number | string;
|
|
399
|
+
}
|
|
400
|
+
| {
|
|
401
|
+
bottom: number | string;
|
|
402
|
+
right: number | string;
|
|
403
|
+
};
|
|
404
|
+
|
|
405
|
+
export type RadialGradientShape = 'circle' | 'ellipse';
|
|
406
|
+
export type RadialGradientSize =
|
|
407
|
+
| RadialExtent
|
|
408
|
+
| {
|
|
409
|
+
x: string | number;
|
|
410
|
+
y: string | number;
|
|
411
|
+
};
|
|
412
|
+
|
|
413
|
+
type RadialGradientValue = {
|
|
414
|
+
type: 'radial-gradient';
|
|
415
|
+
shape: RadialGradientShape;
|
|
416
|
+
size: RadialGradientSize;
|
|
417
|
+
position: RadialGradientPosition;
|
|
418
|
+
colorStops: ReadonlyArray<{
|
|
419
|
+
color: ColorValue | null;
|
|
420
|
+
positions?: ReadonlyArray<string> | undefined;
|
|
421
|
+
}>;
|
|
422
|
+
};
|
|
423
|
+
|
|
424
|
+
export type BackgroundImageValue = LinearGradientValue | RadialGradientValue;
|
|
425
|
+
|
|
426
|
+
export type BackgroundSizeValue =
|
|
427
|
+
| {
|
|
428
|
+
x: string | number;
|
|
429
|
+
y: string | number;
|
|
430
|
+
}
|
|
431
|
+
| 'cover'
|
|
432
|
+
| 'contain';
|
|
433
|
+
|
|
434
|
+
export type BackgroundRepeatKeyword =
|
|
435
|
+
| 'repeat'
|
|
436
|
+
| 'space'
|
|
437
|
+
| 'round'
|
|
438
|
+
| 'no-repeat';
|
|
439
|
+
|
|
440
|
+
export type BackgroundPositionValue =
|
|
441
|
+
| {
|
|
442
|
+
top: number | string;
|
|
443
|
+
left: number | string;
|
|
444
|
+
}
|
|
445
|
+
| {
|
|
446
|
+
top: number | string;
|
|
447
|
+
right: number | string;
|
|
448
|
+
}
|
|
449
|
+
| {
|
|
450
|
+
bottom: number | string;
|
|
451
|
+
left: number | string;
|
|
452
|
+
}
|
|
453
|
+
| {
|
|
454
|
+
bottom: number | string;
|
|
455
|
+
right: number | string;
|
|
456
|
+
};
|
|
457
|
+
|
|
458
|
+
export type BackgroundRepeatValue = {
|
|
459
|
+
x: BackgroundRepeatKeyword;
|
|
460
|
+
y: BackgroundRepeatKeyword;
|
|
461
|
+
};
|
|
462
|
+
|
|
380
463
|
/**
|
|
381
464
|
* @see https://reactnative.dev/docs/view#style
|
|
382
465
|
*/
|
|
@@ -437,7 +520,19 @@ export interface ViewStyle extends FlexStyle, ShadowStyleIOS, TransformsStyle {
|
|
|
437
520
|
|
|
438
521
|
mixBlendMode?: BlendMode | undefined;
|
|
439
522
|
experimental_backgroundImage?:
|
|
440
|
-
| ReadonlyArray<
|
|
523
|
+
| ReadonlyArray<BackgroundImageValue>
|
|
524
|
+
| string
|
|
525
|
+
| undefined;
|
|
526
|
+
experimental_backgroundSize?:
|
|
527
|
+
| ReadonlyArray<BackgroundSizeValue>
|
|
528
|
+
| string
|
|
529
|
+
| undefined;
|
|
530
|
+
experimental_backgroundPosition?:
|
|
531
|
+
| ReadonlyArray<BackgroundPositionValue>
|
|
532
|
+
| string
|
|
533
|
+
| undefined;
|
|
534
|
+
experimental_backgroundRepeat?:
|
|
535
|
+
| ReadonlyArray<BackgroundRepeatValue>
|
|
441
536
|
| string
|
|
442
537
|
| undefined;
|
|
443
538
|
}
|
|
@@ -1104,22 +1104,20 @@ export type ____Styles_Internal = {
|
|
|
1104
1104
|
// ____FlattenStyleProp_Helper should be considered internal.
|
|
1105
1105
|
type FlattenDepthLimiter = [void, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
|
|
1106
1106
|
type ____FlattenStyleProp_Helper<
|
|
1107
|
-
+TStyleProp: StyleProp<
|
|
1107
|
+
+TStyleProp: StyleProp<unknown>,
|
|
1108
1108
|
Depth: $Values<FlattenDepthLimiter> = 9,
|
|
1109
1109
|
> = Depth extends 0
|
|
1110
1110
|
? empty
|
|
1111
1111
|
: TStyleProp extends null | void | false | ''
|
|
1112
|
-
? empty
|
|
1113
|
-
:
|
|
1114
|
-
TStyleProp extends $ReadOnlyArray<infer V>
|
|
1112
|
+
? empty // When TStyleProp is an array, recurse with decremented Depth
|
|
1113
|
+
: TStyleProp extends $ReadOnlyArray<infer V>
|
|
1115
1114
|
? ____FlattenStyleProp_Helper<
|
|
1116
1115
|
V,
|
|
1117
1116
|
Depth extends number ? FlattenDepthLimiter[Depth] : 0,
|
|
1118
1117
|
>
|
|
1119
1118
|
: TStyleProp;
|
|
1120
1119
|
|
|
1121
|
-
export type ____FlattenStyleProp_Internal<+TStyleProp: StyleProp<
|
|
1122
|
-
____FlattenStyleProp_Helper<TStyleProp> extends empty
|
|
1123
|
-
?
|
|
1124
|
-
any
|
|
1120
|
+
export type ____FlattenStyleProp_Internal<+TStyleProp: StyleProp<unknown>> =
|
|
1121
|
+
____FlattenStyleProp_Helper<TStyleProp> extends empty // $FlowFixMe[unclear-type]
|
|
1122
|
+
? any
|
|
1125
1123
|
: ____FlattenStyleProp_Helper<TStyleProp>;
|
|
@@ -115,7 +115,7 @@ export default function processFilter(
|
|
|
115
115
|
return result;
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
function _getFilterAmount(filterName: string, filterArgs:
|
|
118
|
+
function _getFilterAmount(filterName: string, filterArgs: unknown): ?number {
|
|
119
119
|
let filterArgAsNumber: number;
|
|
120
120
|
let unit: string;
|
|
121
121
|
if (typeof filterArgs === 'string') {
|
package/Libraries/Text/Text.js
CHANGED
|
@@ -45,6 +45,7 @@ if (ReactNativeFeatureFlags.reduceDefaultPropsInText()) {
|
|
|
45
45
|
ref: forwardedRef,
|
|
46
46
|
accessible,
|
|
47
47
|
accessibilityLabel,
|
|
48
|
+
accessibilityRole,
|
|
48
49
|
accessibilityState,
|
|
49
50
|
allowFontScaling,
|
|
50
51
|
'aria-busy': ariaBusy,
|
|
@@ -71,6 +72,7 @@ if (ReactNativeFeatureFlags.reduceDefaultPropsInText()) {
|
|
|
71
72
|
onResponderTerminationRequest,
|
|
72
73
|
onStartShouldSetResponder,
|
|
73
74
|
pressRetentionOffset,
|
|
75
|
+
role,
|
|
74
76
|
selectable,
|
|
75
77
|
selectionColor,
|
|
76
78
|
suppressHighlighting,
|
|
@@ -149,6 +151,17 @@ if (ReactNativeFeatureFlags.reduceDefaultPropsInText()) {
|
|
|
149
151
|
onStartShouldSetResponder != null) &&
|
|
150
152
|
_disabled !== true;
|
|
151
153
|
|
|
154
|
+
const shouldUseLinkRole =
|
|
155
|
+
ReactNativeFeatureFlags.shouldUseLinkRoleForPressableText() &&
|
|
156
|
+
isPressable &&
|
|
157
|
+
accessibilityRole == null &&
|
|
158
|
+
role == null;
|
|
159
|
+
|
|
160
|
+
const _accessibilityRole =
|
|
161
|
+
accessibilityRole ?? (shouldUseLinkRole ? 'link' : undefined);
|
|
162
|
+
|
|
163
|
+
const _role = shouldUseLinkRole ? undefined : role;
|
|
164
|
+
|
|
152
165
|
// TODO: Move this processing to the view configuration.
|
|
153
166
|
const _selectionColor =
|
|
154
167
|
selectionColor != null ? processColor(selectionColor) : undefined;
|
|
@@ -206,6 +219,9 @@ if (ReactNativeFeatureFlags.reduceDefaultPropsInText()) {
|
|
|
206
219
|
if (_accessibilityLabel !== undefined) {
|
|
207
220
|
processedProps.accessibilityLabel = _accessibilityLabel;
|
|
208
221
|
}
|
|
222
|
+
if (_accessibilityRole !== undefined) {
|
|
223
|
+
processedProps.accessibilityRole = _accessibilityRole;
|
|
224
|
+
}
|
|
209
225
|
if (_accessibilityState !== undefined) {
|
|
210
226
|
processedProps.accessibilityState = _accessibilityState;
|
|
211
227
|
}
|
|
@@ -224,6 +240,9 @@ if (ReactNativeFeatureFlags.reduceDefaultPropsInText()) {
|
|
|
224
240
|
if (_selectionColor !== undefined) {
|
|
225
241
|
processedProps.selectionColor = _selectionColor;
|
|
226
242
|
}
|
|
243
|
+
if (_role !== undefined) {
|
|
244
|
+
processedProps.role = _role;
|
|
245
|
+
}
|
|
227
246
|
|
|
228
247
|
let textPressabilityProps: ?TextPressabilityProps;
|
|
229
248
|
if (isPressable) {
|
|
@@ -317,6 +336,7 @@ if (ReactNativeFeatureFlags.reduceDefaultPropsInText()) {
|
|
|
317
336
|
accessibilityElementsHidden,
|
|
318
337
|
importantForAccessibility,
|
|
319
338
|
accessibilityLabel,
|
|
339
|
+
accessibilityRole,
|
|
320
340
|
accessibilityState,
|
|
321
341
|
allowFontScaling,
|
|
322
342
|
'aria-busy': ariaBusy,
|
|
@@ -343,6 +363,7 @@ if (ReactNativeFeatureFlags.reduceDefaultPropsInText()) {
|
|
|
343
363
|
onResponderTerminationRequest,
|
|
344
364
|
onStartShouldSetResponder,
|
|
345
365
|
pressRetentionOffset,
|
|
366
|
+
role,
|
|
346
367
|
selectable,
|
|
347
368
|
selectionColor,
|
|
348
369
|
suppressHighlighting,
|
|
@@ -398,6 +419,17 @@ if (ReactNativeFeatureFlags.reduceDefaultPropsInText()) {
|
|
|
398
419
|
onStartShouldSetResponder != null) &&
|
|
399
420
|
_disabled !== true;
|
|
400
421
|
|
|
422
|
+
const shouldUseLinkRole =
|
|
423
|
+
ReactNativeFeatureFlags.shouldUseLinkRoleForPressableText() &&
|
|
424
|
+
isPressable &&
|
|
425
|
+
accessibilityRole == null &&
|
|
426
|
+
role == null;
|
|
427
|
+
|
|
428
|
+
const _accessibilityRole =
|
|
429
|
+
accessibilityRole ?? (shouldUseLinkRole ? 'link' : undefined);
|
|
430
|
+
|
|
431
|
+
const _role = shouldUseLinkRole ? undefined : role;
|
|
432
|
+
|
|
401
433
|
// TODO: Move this processing to the view configuration.
|
|
402
434
|
const _selectionColor =
|
|
403
435
|
selectionColor != null ? processColor(selectionColor) : undefined;
|
|
@@ -462,6 +494,7 @@ if (ReactNativeFeatureFlags.reduceDefaultPropsInText()) {
|
|
|
462
494
|
...restProps,
|
|
463
495
|
accessibilityElementsHidden: _accessibilityElementsHidden,
|
|
464
496
|
accessibilityLabel: _accessibilityLabel,
|
|
497
|
+
accessibilityRole: _accessibilityRole,
|
|
465
498
|
accessibilityState: _accessibilityState,
|
|
466
499
|
importantForAccessibility: _importantForAccessibility,
|
|
467
500
|
nativeID: _nativeID,
|
|
@@ -470,6 +503,7 @@ if (ReactNativeFeatureFlags.reduceDefaultPropsInText()) {
|
|
|
470
503
|
selectionColor: _selectionColor,
|
|
471
504
|
style: _style,
|
|
472
505
|
disabled: disabled,
|
|
506
|
+
role: _role,
|
|
473
507
|
children,
|
|
474
508
|
}}
|
|
475
509
|
textPressabilityProps={{
|
|
@@ -495,6 +529,7 @@ if (ReactNativeFeatureFlags.reduceDefaultPropsInText()) {
|
|
|
495
529
|
{...restProps}
|
|
496
530
|
accessibilityElementsHidden={_accessibilityElementsHidden}
|
|
497
531
|
accessibilityLabel={_accessibilityLabel}
|
|
532
|
+
accessibilityRole={_accessibilityRole}
|
|
498
533
|
accessibilityState={_accessibilityState}
|
|
499
534
|
importantForAccessibility={_importantForAccessibility}
|
|
500
535
|
nativeID={_nativeID}
|
|
@@ -503,7 +538,8 @@ if (ReactNativeFeatureFlags.reduceDefaultPropsInText()) {
|
|
|
503
538
|
selectable={_selectable}
|
|
504
539
|
selectionColor={_selectionColor}
|
|
505
540
|
style={_style}
|
|
506
|
-
disabled={disabled}
|
|
541
|
+
disabled={disabled}
|
|
542
|
+
role={_role}>
|
|
507
543
|
{children}
|
|
508
544
|
</NativeVirtualText>
|
|
509
545
|
);
|
|
@@ -538,6 +574,7 @@ if (ReactNativeFeatureFlags.reduceDefaultPropsInText()) {
|
|
|
538
574
|
...restProps,
|
|
539
575
|
accessibilityElementsHidden: _accessibilityElementsHidden,
|
|
540
576
|
accessibilityLabel: _accessibilityLabel,
|
|
577
|
+
accessibilityRole: _accessibilityRole,
|
|
541
578
|
accessibilityState: _accessibilityState,
|
|
542
579
|
accessible: _accessible,
|
|
543
580
|
allowFontScaling: allowFontScaling !== false,
|
|
@@ -549,6 +586,7 @@ if (ReactNativeFeatureFlags.reduceDefaultPropsInText()) {
|
|
|
549
586
|
selectable: _selectable,
|
|
550
587
|
selectionColor: _selectionColor,
|
|
551
588
|
style: _style,
|
|
589
|
+
role: _role,
|
|
552
590
|
children,
|
|
553
591
|
}}
|
|
554
592
|
textPressabilityProps={{
|
|
@@ -573,6 +611,7 @@ if (ReactNativeFeatureFlags.reduceDefaultPropsInText()) {
|
|
|
573
611
|
{...restProps}
|
|
574
612
|
accessibilityElementsHidden={_accessibilityElementsHidden}
|
|
575
613
|
accessibilityLabel={_accessibilityLabel}
|
|
614
|
+
accessibilityRole={_accessibilityRole}
|
|
576
615
|
accessibilityState={_accessibilityState}
|
|
577
616
|
accessible={_accessible}
|
|
578
617
|
allowFontScaling={allowFontScaling !== false}
|
|
@@ -584,7 +623,8 @@ if (ReactNativeFeatureFlags.reduceDefaultPropsInText()) {
|
|
|
584
623
|
ref={forwardedRef}
|
|
585
624
|
selectable={_selectable}
|
|
586
625
|
selectionColor={_selectionColor}
|
|
587
|
-
style={_style}
|
|
626
|
+
style={_style}
|
|
627
|
+
role={_role}>
|
|
588
628
|
{children}
|
|
589
629
|
</NativeText>
|
|
590
630
|
);
|
|
@@ -628,10 +668,10 @@ const TextImpl: component(
|
|
|
628
668
|
TextImpl.displayName = 'Text';
|
|
629
669
|
|
|
630
670
|
type TextPressabilityProps = $ReadOnly<{
|
|
631
|
-
onLongPress?: ?(event: GestureResponderEvent) =>
|
|
632
|
-
onPress?: ?(event: GestureResponderEvent) =>
|
|
633
|
-
onPressIn?: ?(event: GestureResponderEvent) =>
|
|
634
|
-
onPressOut?: ?(event: GestureResponderEvent) =>
|
|
671
|
+
onLongPress?: ?(event: GestureResponderEvent) => unknown,
|
|
672
|
+
onPress?: ?(event: GestureResponderEvent) => unknown,
|
|
673
|
+
onPressIn?: ?(event: GestureResponderEvent) => unknown,
|
|
674
|
+
onPressOut?: ?(event: GestureResponderEvent) => unknown,
|
|
635
675
|
onResponderGrant?: ?(event: GestureResponderEvent) => void,
|
|
636
676
|
onResponderMove?: ?(event: GestureResponderEvent) => void,
|
|
637
677
|
onResponderRelease?: ?(event: GestureResponderEvent) => void,
|
|
@@ -45,6 +45,7 @@ if (ReactNativeFeatureFlags.reduceDefaultPropsInText()) {
|
|
|
45
45
|
ref: forwardedRef,
|
|
46
46
|
accessible,
|
|
47
47
|
accessibilityLabel,
|
|
48
|
+
accessibilityRole,
|
|
48
49
|
accessibilityState,
|
|
49
50
|
allowFontScaling,
|
|
50
51
|
'aria-busy': ariaBusy,
|
|
@@ -87,6 +88,7 @@ if (ReactNativeFeatureFlags.reduceDefaultPropsInText()) {
|
|
|
87
88
|
onResponderTerminationRequest,
|
|
88
89
|
onStartShouldSetResponder,
|
|
89
90
|
pressRetentionOffset,
|
|
91
|
+
role,
|
|
90
92
|
selectable,
|
|
91
93
|
selectionColor,
|
|
92
94
|
suppressHighlighting,
|
|
@@ -186,6 +188,17 @@ if (ReactNativeFeatureFlags.reduceDefaultPropsInText()) {
|
|
|
186
188
|
onStartShouldSetResponder != null) &&
|
|
187
189
|
_disabled !== true;
|
|
188
190
|
|
|
191
|
+
const shouldUseLinkRole =
|
|
192
|
+
ReactNativeFeatureFlags.shouldUseLinkRoleForPressableText() &&
|
|
193
|
+
isPressable &&
|
|
194
|
+
accessibilityRole == null &&
|
|
195
|
+
role == null;
|
|
196
|
+
|
|
197
|
+
const _accessibilityRole =
|
|
198
|
+
accessibilityRole ?? (shouldUseLinkRole ? 'link' : undefined);
|
|
199
|
+
|
|
200
|
+
const _role = shouldUseLinkRole ? undefined : role;
|
|
201
|
+
|
|
189
202
|
// TODO: Move this processing to the view configuration.
|
|
190
203
|
const _selectionColor =
|
|
191
204
|
selectionColor != null ? processColor(selectionColor) : undefined;
|
|
@@ -243,6 +256,9 @@ if (ReactNativeFeatureFlags.reduceDefaultPropsInText()) {
|
|
|
243
256
|
if (_accessibilityLabel !== undefined) {
|
|
244
257
|
processedProps.accessibilityLabel = _accessibilityLabel;
|
|
245
258
|
}
|
|
259
|
+
if (_accessibilityRole !== undefined) {
|
|
260
|
+
processedProps.accessibilityRole = _accessibilityRole;
|
|
261
|
+
}
|
|
246
262
|
if (_accessibilityState !== undefined) {
|
|
247
263
|
processedProps.accessibilityState = _accessibilityState;
|
|
248
264
|
}
|
|
@@ -261,6 +277,9 @@ if (ReactNativeFeatureFlags.reduceDefaultPropsInText()) {
|
|
|
261
277
|
if (_selectionColor !== undefined) {
|
|
262
278
|
processedProps.selectionColor = _selectionColor;
|
|
263
279
|
}
|
|
280
|
+
if (_role !== undefined) {
|
|
281
|
+
processedProps.role = _role;
|
|
282
|
+
}
|
|
264
283
|
|
|
265
284
|
// [Windows accessibility properties
|
|
266
285
|
if (_accessibilityControls !== undefined) {
|
|
@@ -378,6 +397,7 @@ if (ReactNativeFeatureFlags.reduceDefaultPropsInText()) {
|
|
|
378
397
|
accessibilityElementsHidden,
|
|
379
398
|
importantForAccessibility,
|
|
380
399
|
accessibilityLabel,
|
|
400
|
+
accessibilityRole,
|
|
381
401
|
accessibilityState,
|
|
382
402
|
allowFontScaling,
|
|
383
403
|
'aria-busy': ariaBusy,
|
|
@@ -420,6 +440,7 @@ if (ReactNativeFeatureFlags.reduceDefaultPropsInText()) {
|
|
|
420
440
|
onResponderTerminationRequest,
|
|
421
441
|
onStartShouldSetResponder,
|
|
422
442
|
pressRetentionOffset,
|
|
443
|
+
role,
|
|
423
444
|
selectable,
|
|
424
445
|
selectionColor,
|
|
425
446
|
suppressHighlighting,
|
|
@@ -495,6 +516,17 @@ if (ReactNativeFeatureFlags.reduceDefaultPropsInText()) {
|
|
|
495
516
|
onStartShouldSetResponder != null) &&
|
|
496
517
|
_disabled !== true;
|
|
497
518
|
|
|
519
|
+
const shouldUseLinkRole =
|
|
520
|
+
ReactNativeFeatureFlags.shouldUseLinkRoleForPressableText() &&
|
|
521
|
+
isPressable &&
|
|
522
|
+
accessibilityRole == null &&
|
|
523
|
+
role == null;
|
|
524
|
+
|
|
525
|
+
const _accessibilityRole =
|
|
526
|
+
accessibilityRole ?? (shouldUseLinkRole ? 'link' : undefined);
|
|
527
|
+
|
|
528
|
+
const _role = shouldUseLinkRole ? undefined : role;
|
|
529
|
+
|
|
498
530
|
// TODO: Move this processing to the view configuration.
|
|
499
531
|
const _selectionColor =
|
|
500
532
|
selectionColor != null ? processColor(selectionColor) : undefined;
|
|
@@ -559,6 +591,7 @@ if (ReactNativeFeatureFlags.reduceDefaultPropsInText()) {
|
|
|
559
591
|
...restProps,
|
|
560
592
|
accessibilityElementsHidden: _accessibilityElementsHidden,
|
|
561
593
|
accessibilityLabel: _accessibilityLabel,
|
|
594
|
+
accessibilityRole: _accessibilityRole,
|
|
562
595
|
accessibilityState: _accessibilityState,
|
|
563
596
|
importantForAccessibility: _importantForAccessibility,
|
|
564
597
|
// #[ Win32
|
|
@@ -575,6 +608,7 @@ if (ReactNativeFeatureFlags.reduceDefaultPropsInText()) {
|
|
|
575
608
|
selectionColor: _selectionColor,
|
|
576
609
|
style: _style,
|
|
577
610
|
disabled: disabled,
|
|
611
|
+
role: _role,
|
|
578
612
|
children,
|
|
579
613
|
}}
|
|
580
614
|
textPressabilityProps={{
|
|
@@ -600,6 +634,7 @@ if (ReactNativeFeatureFlags.reduceDefaultPropsInText()) {
|
|
|
600
634
|
{...restProps}
|
|
601
635
|
accessibilityElementsHidden={_accessibilityElementsHidden}
|
|
602
636
|
accessibilityLabel={_accessibilityLabel}
|
|
637
|
+
accessibilityRole={_accessibilityRole}
|
|
603
638
|
accessibilityState={_accessibilityState}
|
|
604
639
|
importantForAccessibility={_importantForAccessibility}
|
|
605
640
|
// #[ Win32
|
|
@@ -616,7 +651,8 @@ if (ReactNativeFeatureFlags.reduceDefaultPropsInText()) {
|
|
|
616
651
|
selectable={_selectable}
|
|
617
652
|
selectionColor={_selectionColor}
|
|
618
653
|
style={_style}
|
|
619
|
-
disabled={disabled}
|
|
654
|
+
disabled={disabled}
|
|
655
|
+
role={_role}>
|
|
620
656
|
{children}
|
|
621
657
|
</NativeVirtualText>
|
|
622
658
|
);
|
|
@@ -651,6 +687,7 @@ if (ReactNativeFeatureFlags.reduceDefaultPropsInText()) {
|
|
|
651
687
|
...restProps,
|
|
652
688
|
accessibilityElementsHidden: _accessibilityElementsHidden,
|
|
653
689
|
accessibilityLabel: _accessibilityLabel,
|
|
690
|
+
accessibilityRole: _accessibilityRole,
|
|
654
691
|
accessibilityState: _accessibilityState,
|
|
655
692
|
accessible: _accessible,
|
|
656
693
|
allowFontScaling: allowFontScaling !== false,
|
|
@@ -662,6 +699,7 @@ if (ReactNativeFeatureFlags.reduceDefaultPropsInText()) {
|
|
|
662
699
|
selectable: _selectable,
|
|
663
700
|
selectionColor: _selectionColor,
|
|
664
701
|
style: _style,
|
|
702
|
+
role: _role,
|
|
665
703
|
children,
|
|
666
704
|
}}
|
|
667
705
|
textPressabilityProps={{
|
|
@@ -686,6 +724,7 @@ if (ReactNativeFeatureFlags.reduceDefaultPropsInText()) {
|
|
|
686
724
|
{...restProps}
|
|
687
725
|
accessibilityElementsHidden={_accessibilityElementsHidden}
|
|
688
726
|
accessibilityLabel={_accessibilityLabel}
|
|
727
|
+
accessibilityRole={_accessibilityRole}
|
|
689
728
|
accessibilityState={_accessibilityState}
|
|
690
729
|
accessible={_accessible}
|
|
691
730
|
allowFontScaling={allowFontScaling !== false}
|
|
@@ -697,7 +736,8 @@ if (ReactNativeFeatureFlags.reduceDefaultPropsInText()) {
|
|
|
697
736
|
ref={forwardedRef}
|
|
698
737
|
selectable={_selectable}
|
|
699
738
|
selectionColor={_selectionColor}
|
|
700
|
-
style={_style}
|
|
739
|
+
style={_style}
|
|
740
|
+
role={_role}>
|
|
701
741
|
{children}
|
|
702
742
|
</NativeText>
|
|
703
743
|
);
|
|
@@ -741,10 +781,10 @@ const TextImpl: component(
|
|
|
741
781
|
TextImpl.displayName = 'Text';
|
|
742
782
|
|
|
743
783
|
type TextPressabilityProps = $ReadOnly<{
|
|
744
|
-
onLongPress?: ?(event: GestureResponderEvent) =>
|
|
745
|
-
onPress?: ?(event: GestureResponderEvent) =>
|
|
746
|
-
onPressIn?: ?(event: GestureResponderEvent) =>
|
|
747
|
-
onPressOut?: ?(event: GestureResponderEvent) =>
|
|
784
|
+
onLongPress?: ?(event: GestureResponderEvent) => unknown,
|
|
785
|
+
onPress?: ?(event: GestureResponderEvent) => unknown,
|
|
786
|
+
onPressIn?: ?(event: GestureResponderEvent) => unknown,
|
|
787
|
+
onPressOut?: ?(event: GestureResponderEvent) => unknown,
|
|
748
788
|
onResponderGrant?: ?(event: GestureResponderEvent) => void,
|
|
749
789
|
onResponderMove?: ?(event: GestureResponderEvent) => void,
|
|
750
790
|
onResponderRelease?: ?(event: GestureResponderEvent) => void,
|
|
@@ -21,7 +21,7 @@ export type NativeTextProps = $ReadOnly<{
|
|
|
21
21
|
...TextProps,
|
|
22
22
|
isHighlighted?: ?boolean,
|
|
23
23
|
selectionColor?: ?ProcessedColorValue,
|
|
24
|
-
onClick?: ?(event: GestureResponderEvent) =>
|
|
24
|
+
onClick?: ?(event: GestureResponderEvent) => unknown,
|
|
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.
|
|
@@ -21,7 +21,7 @@ export type NativeTextProps = $ReadOnly<{
|
|
|
21
21
|
...TextProps,
|
|
22
22
|
isHighlighted?: ?boolean,
|
|
23
23
|
selectionColor?: ?ProcessedColorValue,
|
|
24
|
-
onClick?: ?(event: GestureResponderEvent) =>
|
|
24
|
+
onClick?: ?(event: GestureResponderEvent) => unknown,
|
|
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.
|
|
@@ -122,7 +122,7 @@ export type TextPropsAndroid = {
|
|
|
122
122
|
};
|
|
123
123
|
|
|
124
124
|
type TextBaseProps = $ReadOnly<{
|
|
125
|
-
onAccessibilityAction?: ?(event: AccessibilityActionEvent) =>
|
|
125
|
+
onAccessibilityAction?: ?(event: AccessibilityActionEvent) => unknown,
|
|
126
126
|
|
|
127
127
|
/**
|
|
128
128
|
* Whether fonts should scale to respect Text Size accessibility settings.
|
|
@@ -204,7 +204,7 @@ type TextBaseProps = $ReadOnly<{
|
|
|
204
204
|
*
|
|
205
205
|
* See https://reactnative.dev/docs/text#onlayout
|
|
206
206
|
*/
|
|
207
|
-
onLayout?: ?(event: LayoutChangeEvent) =>
|
|
207
|
+
onLayout?: ?(event: LayoutChangeEvent) => unknown,
|
|
208
208
|
|
|
209
209
|
/**
|
|
210
210
|
* This function is called on long press.
|
|
@@ -212,7 +212,7 @@ type TextBaseProps = $ReadOnly<{
|
|
|
212
212
|
*
|
|
213
213
|
* See https://reactnative.dev/docs/text#onlongpress
|
|
214
214
|
*/
|
|
215
|
-
onLongPress?: ?(event: GestureResponderEvent) =>
|
|
215
|
+
onLongPress?: ?(event: GestureResponderEvent) => unknown,
|
|
216
216
|
|
|
217
217
|
/**
|
|
218
218
|
* This function is called on press.
|
|
@@ -220,9 +220,9 @@ type TextBaseProps = $ReadOnly<{
|
|
|
220
220
|
*
|
|
221
221
|
* See https://reactnative.dev/docs/text#onpress
|
|
222
222
|
*/
|
|
223
|
-
onPress?: ?(event: GestureResponderEvent) =>
|
|
224
|
-
onPressIn?: ?(event: GestureResponderEvent) =>
|
|
225
|
-
onPressOut?: ?(event: GestureResponderEvent) =>
|
|
223
|
+
onPress?: ?(event: GestureResponderEvent) => unknown,
|
|
224
|
+
onPressIn?: ?(event: GestureResponderEvent) => unknown,
|
|
225
|
+
onPressOut?: ?(event: GestureResponderEvent) => unknown,
|
|
226
226
|
onResponderGrant?: ?(event: GestureResponderEvent) => void,
|
|
227
227
|
onResponderMove?: ?(event: GestureResponderEvent) => void,
|
|
228
228
|
onResponderRelease?: ?(event: GestureResponderEvent) => void,
|
|
@@ -230,7 +230,7 @@ type TextBaseProps = $ReadOnly<{
|
|
|
230
230
|
onResponderTerminationRequest?: ?() => boolean,
|
|
231
231
|
onStartShouldSetResponder?: ?() => boolean,
|
|
232
232
|
onMoveShouldSetResponder?: ?() => boolean,
|
|
233
|
-
onTextLayout?: ?(event: TextLayoutEvent) =>
|
|
233
|
+
onTextLayout?: ?(event: TextLayoutEvent) => unknown,
|
|
234
234
|
|
|
235
235
|
/**
|
|
236
236
|
* Defines how far your touch may move off of the button, before
|
|
@@ -122,7 +122,7 @@ export type TextPropsAndroid = {
|
|
|
122
122
|
};
|
|
123
123
|
|
|
124
124
|
type TextBaseProps = $ReadOnly<{
|
|
125
|
-
onAccessibilityAction?: ?(event: AccessibilityActionEvent) =>
|
|
125
|
+
onAccessibilityAction?: ?(event: AccessibilityActionEvent) => unknown,
|
|
126
126
|
accessibilityControls?: ?Stringish, // Win32
|
|
127
127
|
accessibilityDescribedBy?: ?Stringish, // Win32
|
|
128
128
|
accessibilityDescription?: ?Stringish, // Win32
|
|
@@ -218,7 +218,7 @@ type TextBaseProps = $ReadOnly<{
|
|
|
218
218
|
*
|
|
219
219
|
* See https://reactnative.dev/docs/text#onlayout
|
|
220
220
|
*/
|
|
221
|
-
onLayout?: ?(event: LayoutChangeEvent) =>
|
|
221
|
+
onLayout?: ?(event: LayoutChangeEvent) => unknown,
|
|
222
222
|
|
|
223
223
|
/**
|
|
224
224
|
* This function is called on long press.
|
|
@@ -226,7 +226,7 @@ type TextBaseProps = $ReadOnly<{
|
|
|
226
226
|
*
|
|
227
227
|
* See https://reactnative.dev/docs/text#onlongpress
|
|
228
228
|
*/
|
|
229
|
-
onLongPress?: ?(event: GestureResponderEvent) =>
|
|
229
|
+
onLongPress?: ?(event: GestureResponderEvent) => unknown,
|
|
230
230
|
|
|
231
231
|
/**
|
|
232
232
|
* This function is called on press.
|
|
@@ -234,9 +234,9 @@ type TextBaseProps = $ReadOnly<{
|
|
|
234
234
|
*
|
|
235
235
|
* See https://reactnative.dev/docs/text#onpress
|
|
236
236
|
*/
|
|
237
|
-
onPress?: ?(event: GestureResponderEvent) =>
|
|
238
|
-
onPressIn?: ?(event: GestureResponderEvent) =>
|
|
239
|
-
onPressOut?: ?(event: GestureResponderEvent) =>
|
|
237
|
+
onPress?: ?(event: GestureResponderEvent) => unknown,
|
|
238
|
+
onPressIn?: ?(event: GestureResponderEvent) => unknown,
|
|
239
|
+
onPressOut?: ?(event: GestureResponderEvent) => unknown,
|
|
240
240
|
onResponderGrant?: ?(event: GestureResponderEvent) => void,
|
|
241
241
|
onResponderMove?: ?(event: GestureResponderEvent) => void,
|
|
242
242
|
onResponderRelease?: ?(event: GestureResponderEvent) => void,
|
|
@@ -244,7 +244,7 @@ type TextBaseProps = $ReadOnly<{
|
|
|
244
244
|
onResponderTerminationRequest?: ?() => boolean,
|
|
245
245
|
onStartShouldSetResponder?: ?() => boolean,
|
|
246
246
|
onMoveShouldSetResponder?: ?() => boolean,
|
|
247
|
-
onTextLayout?: ?(event: TextLayoutEvent) =>
|
|
247
|
+
onTextLayout?: ?(event: TextLayoutEvent) => unknown,
|
|
248
248
|
|
|
249
249
|
/**
|
|
250
250
|
* Defines how far your touch may move off of the button, before
|
|
@@ -31,7 +31,7 @@ export type Float = number;
|
|
|
31
31
|
export type Int32 = number;
|
|
32
32
|
/* $FlowFixMe[unclear-type] Object is forbidden in strict mode */
|
|
33
33
|
export type UnsafeObject = Object;
|
|
34
|
-
export type UnsafeMixed =
|
|
34
|
+
export type UnsafeMixed = unknown;
|
|
35
35
|
|
|
36
36
|
type DefaultTypes = number | boolean | string | $ReadOnlyArray<string>;
|
|
37
37
|
// Default handling, ignore the unused value
|
|
@@ -322,3 +322,34 @@ export type MouseEvent = NativeSyntheticEvent<
|
|
|
322
322
|
timestamp: number,
|
|
323
323
|
}>,
|
|
324
324
|
>;
|
|
325
|
+
|
|
326
|
+
export type KeyEvent = $ReadOnly<{
|
|
327
|
+
/**
|
|
328
|
+
* The actual key that was pressed. For example, F would be "f" or "F" depending on the shift key.
|
|
329
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key
|
|
330
|
+
*/
|
|
331
|
+
key: string,
|
|
332
|
+
/**
|
|
333
|
+
* The key code of the key that was pressed. For example, F would be "KeyF"
|
|
334
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code
|
|
335
|
+
*/
|
|
336
|
+
code: string,
|
|
337
|
+
altKey: boolean,
|
|
338
|
+
ctrlKey: boolean,
|
|
339
|
+
metaKey: boolean,
|
|
340
|
+
shiftKey: boolean,
|
|
341
|
+
/**
|
|
342
|
+
* A boolean value that is true if the given key is being held down such that it is automatically repeating.
|
|
343
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/repeat
|
|
344
|
+
*/
|
|
345
|
+
repeat?: boolean,
|
|
346
|
+
/**
|
|
347
|
+
* Returns a boolean value indicating if the event is fired within a composition session
|
|
348
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/CompositionEvent/isComposing
|
|
349
|
+
*/
|
|
350
|
+
isComposing?: boolean,
|
|
351
|
+
}>;
|
|
352
|
+
|
|
353
|
+
export type KeyUpEvent = NativeSyntheticEvent<KeyEvent>;
|
|
354
|
+
|
|
355
|
+
export type KeyDownEvent = NativeSyntheticEvent<KeyEvent>;
|