@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
|
@@ -73,7 +73,7 @@ let RCTMultilineTextInputView;
|
|
|
73
73
|
let RCTMultilineTextInputNativeCommands;
|
|
74
74
|
let WindowsTextInput; // [Windows]
|
|
75
75
|
let WindowsTextInputCommands; // [Windows]
|
|
76
|
-
import type {
|
|
76
|
+
import type {KeyUpEvent, KeyDownEvent} from '../../Types/CoreEventTypes'; // [Windows]
|
|
77
77
|
|
|
78
78
|
// [Windows
|
|
79
79
|
if (Platform.OS === 'android') {
|
|
@@ -162,7 +162,7 @@ type TextInputStateType = $ReadOnly<{
|
|
|
162
162
|
blurTextInput: (textField: ?HostInstance) => void,
|
|
163
163
|
}>;
|
|
164
164
|
|
|
165
|
-
type ViewCommands =
|
|
165
|
+
type ViewCommands = NonNullable<
|
|
166
166
|
| typeof AndroidTextInputCommands
|
|
167
167
|
| typeof RCTMultilineTextInputNativeCommands
|
|
168
168
|
| typeof RCTSinglelineTextInputNativeCommands,
|
|
@@ -201,8 +201,8 @@ function useTextInputStateSynchronization({
|
|
|
201
201
|
const [lastNativeText, setLastNativeText] = useState<?Stringish>(props.value);
|
|
202
202
|
const [lastNativeSelectionState, setLastNativeSelection] =
|
|
203
203
|
useState<LastNativeSelection>({
|
|
204
|
-
|
|
205
|
-
|
|
204
|
+
mostRecentEventCount,
|
|
205
|
+
selection: {end: -1, start: -1},
|
|
206
206
|
});
|
|
207
207
|
|
|
208
208
|
const lastNativeSelection = lastNativeSelectionState.selection;
|
|
@@ -225,7 +225,7 @@ function useTextInputStateSynchronization({
|
|
|
225
225
|
lastNativeSelection.end !== selection.end)
|
|
226
226
|
) {
|
|
227
227
|
nativeUpdate.selection = selection;
|
|
228
|
-
setLastNativeSelection({
|
|
228
|
+
setLastNativeSelection({mostRecentEventCount, selection});
|
|
229
229
|
}
|
|
230
230
|
|
|
231
231
|
if (Object.keys(nativeUpdate).length === 0) {
|
|
@@ -253,7 +253,7 @@ function useTextInputStateSynchronization({
|
|
|
253
253
|
viewCommands,
|
|
254
254
|
]);
|
|
255
255
|
|
|
256
|
-
return {
|
|
256
|
+
return {setLastNativeSelection, setLastNativeText};
|
|
257
257
|
}
|
|
258
258
|
|
|
259
259
|
/**
|
|
@@ -392,8 +392,8 @@ function InternalTextInput(props: TextInputProps): React.Node {
|
|
|
392
392
|
propsSelection == null
|
|
393
393
|
? null
|
|
394
394
|
: {
|
|
395
|
-
start: propsSelection.start,
|
|
396
395
|
end: propsSelection.end ?? propsSelection.start,
|
|
396
|
+
start: propsSelection.start,
|
|
397
397
|
};
|
|
398
398
|
|
|
399
399
|
const text =
|
|
@@ -413,9 +413,9 @@ function InternalTextInput(props: TextInputProps): React.Node {
|
|
|
413
413
|
const [mostRecentEventCount, setMostRecentEventCount] = useState<number>(0);
|
|
414
414
|
const {setLastNativeText, setLastNativeSelection} =
|
|
415
415
|
useTextInputStateSynchronization({
|
|
416
|
-
props,
|
|
417
416
|
inputRef,
|
|
418
417
|
mostRecentEventCount,
|
|
418
|
+
props,
|
|
419
419
|
selection,
|
|
420
420
|
text,
|
|
421
421
|
// $FlowFixMe[incompatible-call]
|
|
@@ -486,6 +486,10 @@ function InternalTextInput(props: TextInputProps): React.Node {
|
|
|
486
486
|
);
|
|
487
487
|
}
|
|
488
488
|
},
|
|
489
|
+
getNativeRef(): ?TextInputInstance {
|
|
490
|
+
return inputRef.current;
|
|
491
|
+
},
|
|
492
|
+
// TODO: Fix this returning true on null === null, when no input is focused
|
|
489
493
|
isFocused(): boolean {
|
|
490
494
|
const currentlyFocusedInput =
|
|
491
495
|
TextInputState.currentlyFocusedInput();
|
|
@@ -494,9 +498,6 @@ function InternalTextInput(props: TextInputProps): React.Node {
|
|
|
494
498
|
currentlyFocusedInput === inputRef.current
|
|
495
499
|
);
|
|
496
500
|
},
|
|
497
|
-
getNativeRef(): ?TextInputInstance {
|
|
498
|
-
return inputRef.current;
|
|
499
|
-
},
|
|
500
501
|
setSelection(start: number, end: number): void {
|
|
501
502
|
if (inputRef.current != null) {
|
|
502
503
|
viewCommands.setTextAndSelection(
|
|
@@ -546,8 +547,8 @@ function InternalTextInput(props: TextInputProps): React.Node {
|
|
|
546
547
|
}
|
|
547
548
|
|
|
548
549
|
setLastNativeSelection({
|
|
549
|
-
selection: event.nativeEvent.selection,
|
|
550
550
|
mostRecentEventCount,
|
|
551
|
+
selection: event.nativeEvent.selection,
|
|
551
552
|
});
|
|
552
553
|
};
|
|
553
554
|
|
|
@@ -617,6 +618,7 @@ function InternalTextInput(props: TextInputProps): React.Node {
|
|
|
617
618
|
|
|
618
619
|
const config = useMemo(
|
|
619
620
|
() => ({
|
|
621
|
+
cancelable: Platform.OS === 'ios' ? !rejectResponderTermination : null,
|
|
620
622
|
hitSlop,
|
|
621
623
|
onPress: (event: GestureResponderEvent) => {
|
|
622
624
|
onPress?.(event);
|
|
@@ -626,9 +628,8 @@ function InternalTextInput(props: TextInputProps): React.Node {
|
|
|
626
628
|
}
|
|
627
629
|
}
|
|
628
630
|
},
|
|
629
|
-
onPressIn
|
|
630
|
-
onPressOut
|
|
631
|
-
cancelable: Platform.OS === 'ios' ? !rejectResponderTermination : null,
|
|
631
|
+
onPressIn,
|
|
632
|
+
onPressOut,
|
|
632
633
|
}),
|
|
633
634
|
[
|
|
634
635
|
editable,
|
|
@@ -651,7 +652,7 @@ function InternalTextInput(props: TextInputProps): React.Node {
|
|
|
651
652
|
// so omitting onBlur and onFocus pressability handlers here.
|
|
652
653
|
const {onBlur, onFocus, ...eventHandlers} = usePressability(config);
|
|
653
654
|
const eventPhase = Object.freeze({Capturing: 1, Bubbling: 3});
|
|
654
|
-
const _keyDown = (event:
|
|
655
|
+
const _keyDown = (event: KeyDownEvent) => {
|
|
655
656
|
const keyDownEvents = props.keyDownEvents;
|
|
656
657
|
if (keyDownEvents != null && event.isPropagationStopped() !== true) {
|
|
657
658
|
for (const el of keyDownEvents) {
|
|
@@ -670,7 +671,7 @@ function InternalTextInput(props: TextInputProps): React.Node {
|
|
|
670
671
|
props.onKeyDown && props.onKeyDown(event);
|
|
671
672
|
};
|
|
672
673
|
|
|
673
|
-
const _keyUp = (event:
|
|
674
|
+
const _keyUp = (event: KeyUpEvent) => {
|
|
674
675
|
const keyUpEvents = props.keyUpEvents;
|
|
675
676
|
if (keyUpEvents != null && event.isPropagationStopped() !== true) {
|
|
676
677
|
for (const el of keyUpEvents) {
|
|
@@ -689,7 +690,7 @@ function InternalTextInput(props: TextInputProps): React.Node {
|
|
|
689
690
|
props.onKeyUp && props.onKeyUp(event);
|
|
690
691
|
};
|
|
691
692
|
|
|
692
|
-
const _keyDownCapture = (event:
|
|
693
|
+
const _keyDownCapture = (event: KeyDownEvent) => {
|
|
693
694
|
const keyDownEvents = props.keyDownEvents;
|
|
694
695
|
if (keyDownEvents != null && event.isPropagationStopped() !== true) {
|
|
695
696
|
for (const el of keyDownEvents) {
|
|
@@ -708,7 +709,7 @@ function InternalTextInput(props: TextInputProps): React.Node {
|
|
|
708
709
|
props.onKeyDownCapture && props.onKeyDownCapture(event);
|
|
709
710
|
};
|
|
710
711
|
|
|
711
|
-
const _keyUpCapture = (event:
|
|
712
|
+
const _keyUpCapture = (event: KeyUpEvent) => {
|
|
712
713
|
const keyUpEvents = props.keyUpEvents;
|
|
713
714
|
if (keyUpEvents != null && event.isPropagationStopped() !== true) {
|
|
714
715
|
for (const el of keyUpEvents) {
|
|
@@ -848,12 +849,12 @@ function InternalTextInput(props: TextInputProps): React.Node {
|
|
|
848
849
|
}
|
|
849
850
|
// For consistency with iOS set cursor/selectionHandle color as selectionColor
|
|
850
851
|
const colorProps = {
|
|
852
|
+
cursorColor: cursorColor === undefined ? selectionColor : cursorColor,
|
|
851
853
|
selectionColor,
|
|
852
854
|
selectionHandleColor:
|
|
853
855
|
selectionHandleColor === undefined
|
|
854
856
|
? selectionColor
|
|
855
857
|
: selectionHandleColor,
|
|
856
|
-
cursorColor: cursorColor === undefined ? selectionColor : cursorColor,
|
|
857
858
|
};
|
|
858
859
|
textInput = (
|
|
859
860
|
/* $FlowFixMe[prop-missing] the types for AndroidTextInput don't match up
|
|
@@ -935,8 +936,8 @@ function InternalTextInput(props: TextInputProps): React.Node {
|
|
|
935
936
|
}
|
|
936
937
|
|
|
937
938
|
const enterKeyHintToReturnTypeMap = {
|
|
938
|
-
enter: 'default',
|
|
939
939
|
done: 'done',
|
|
940
|
+
enter: 'default',
|
|
940
941
|
go: 'go',
|
|
941
942
|
next: 'next',
|
|
942
943
|
previous: 'previous',
|
|
@@ -945,19 +946,20 @@ const enterKeyHintToReturnTypeMap = {
|
|
|
945
946
|
} as const;
|
|
946
947
|
|
|
947
948
|
const inputModeToKeyboardTypeMap = {
|
|
948
|
-
none: 'default',
|
|
949
|
-
text: 'default',
|
|
950
949
|
decimal: 'decimal-pad',
|
|
950
|
+
email: 'email-address',
|
|
951
|
+
none: 'default',
|
|
951
952
|
numeric: 'number-pad',
|
|
952
|
-
tel: 'phone-pad',
|
|
953
953
|
search:
|
|
954
954
|
Platform.OS === 'ios' ? ('web-search' as const) : ('default' as const),
|
|
955
|
-
|
|
955
|
+
tel: 'phone-pad',
|
|
956
|
+
text: 'default',
|
|
956
957
|
url: 'url',
|
|
957
958
|
} as const;
|
|
958
959
|
|
|
959
960
|
// Map HTML autocomplete values to Android autoComplete values
|
|
960
961
|
const autoCompleteWebToAutoCompleteAndroidMap = {
|
|
962
|
+
'additional-name': 'name-middle',
|
|
961
963
|
'address-line1': 'postal-address-region',
|
|
962
964
|
'address-line2': 'postal-address-locality',
|
|
963
965
|
bday: 'birthdate-full',
|
|
@@ -972,12 +974,11 @@ const autoCompleteWebToAutoCompleteAndroidMap = {
|
|
|
972
974
|
country: 'postal-address-country',
|
|
973
975
|
'current-password': 'password',
|
|
974
976
|
email: 'email',
|
|
977
|
+
'family-name': 'name-family',
|
|
978
|
+
'given-name': 'name-given',
|
|
975
979
|
'honorific-prefix': 'name-prefix',
|
|
976
980
|
'honorific-suffix': 'name-suffix',
|
|
977
981
|
name: 'name',
|
|
978
|
-
'additional-name': 'name-middle',
|
|
979
|
-
'family-name': 'name-family',
|
|
980
|
-
'given-name': 'name-given',
|
|
981
982
|
'new-password': 'password-new',
|
|
982
983
|
off: 'off',
|
|
983
984
|
'one-time-code': 'sms-otp',
|
|
@@ -992,33 +993,33 @@ const autoCompleteWebToAutoCompleteAndroidMap = {
|
|
|
992
993
|
|
|
993
994
|
// Map HTML autocomplete values to iOS textContentType values
|
|
994
995
|
const autoCompleteWebToTextContentTypeMap = {
|
|
996
|
+
'additional-name': 'middleName',
|
|
995
997
|
'address-line1': 'streetAddressLine1',
|
|
996
998
|
'address-line2': 'streetAddressLine2',
|
|
997
999
|
bday: 'birthdate',
|
|
998
1000
|
'bday-day': 'birthdateDay',
|
|
999
1001
|
'bday-month': 'birthdateMonth',
|
|
1000
1002
|
'bday-year': 'birthdateYear',
|
|
1003
|
+
'cc-additional-name': 'creditCardMiddleName',
|
|
1001
1004
|
'cc-csc': 'creditCardSecurityCode',
|
|
1005
|
+
'cc-exp': 'creditCardExpiration',
|
|
1002
1006
|
'cc-exp-month': 'creditCardExpirationMonth',
|
|
1003
1007
|
'cc-exp-year': 'creditCardExpirationYear',
|
|
1004
|
-
'cc-exp': 'creditCardExpiration',
|
|
1005
|
-
'cc-given-name': 'creditCardGivenName',
|
|
1006
|
-
'cc-additional-name': 'creditCardMiddleName',
|
|
1007
1008
|
'cc-family-name': 'creditCardFamilyName',
|
|
1009
|
+
'cc-given-name': 'creditCardGivenName',
|
|
1008
1010
|
'cc-name': 'creditCardName',
|
|
1009
1011
|
'cc-number': 'creditCardNumber',
|
|
1010
1012
|
'cc-type': 'creditCardType',
|
|
1011
|
-
'current-password': 'password',
|
|
1012
1013
|
country: 'countryName',
|
|
1014
|
+
'current-password': 'password',
|
|
1013
1015
|
email: 'emailAddress',
|
|
1014
|
-
name: 'name',
|
|
1015
|
-
'additional-name': 'middleName',
|
|
1016
1016
|
'family-name': 'familyName',
|
|
1017
1017
|
'given-name': 'givenName',
|
|
1018
|
-
nickname: 'nickname',
|
|
1019
1018
|
'honorific-prefix': 'namePrefix',
|
|
1020
1019
|
'honorific-suffix': 'nameSuffix',
|
|
1020
|
+
name: 'name',
|
|
1021
1021
|
'new-password': 'newPassword',
|
|
1022
|
+
nickname: 'nickname',
|
|
1022
1023
|
off: 'none',
|
|
1023
1024
|
'one-time-code': 'oneTimeCode',
|
|
1024
1025
|
organization: 'organizationName',
|
|
@@ -1095,11 +1096,10 @@ TextInput.displayName = 'TextInput';
|
|
|
1095
1096
|
|
|
1096
1097
|
// $FlowFixMe[prop-missing]
|
|
1097
1098
|
TextInput.State = {
|
|
1098
|
-
|
|
1099
|
-
|
|
1099
|
+
blurTextInput: TextInputState.blurTextInput,
|
|
1100
1100
|
currentlyFocusedField: TextInputState.currentlyFocusedField,
|
|
1101
|
+
currentlyFocusedInput: TextInputState.currentlyFocusedInput,
|
|
1101
1102
|
focusTextInput: TextInputState.focusTextInput,
|
|
1102
|
-
blurTextInput: TextInputState.blurTextInput,
|
|
1103
1103
|
};
|
|
1104
1104
|
|
|
1105
1105
|
export type TextInputComponentStatics = $ReadOnly<{
|
|
@@ -1117,9 +1117,9 @@ const styles = StyleSheet.create({
|
|
|
1117
1117
|
|
|
1118
1118
|
const verticalAlignToTextAlignVerticalMap = {
|
|
1119
1119
|
auto: 'auto',
|
|
1120
|
-
top: 'top',
|
|
1121
1120
|
bottom: 'bottom',
|
|
1122
1121
|
middle: 'center',
|
|
1122
|
+
top: 'top',
|
|
1123
1123
|
} as const;
|
|
1124
1124
|
|
|
1125
1125
|
// $FlowFixMe[unclear-type] Unclear type. Using `any` type is not safe.
|
|
@@ -105,9 +105,9 @@ const addPoolingTo = function <T>(
|
|
|
105
105
|
pooler: Pooler,
|
|
106
106
|
): Class<T> & {
|
|
107
107
|
getPooled(
|
|
108
|
-
...args: $ReadOnlyArray<
|
|
108
|
+
...args: $ReadOnlyArray<unknown>
|
|
109
109
|
): /* arguments of the constructor */ T,
|
|
110
|
-
release(instance:
|
|
110
|
+
release(instance: unknown): void,
|
|
111
111
|
...
|
|
112
112
|
} {
|
|
113
113
|
// Casting as any so that flow ignores the actual implementation and trusts
|
|
@@ -211,7 +211,7 @@ class TouchableBounce extends React.Component<
|
|
|
211
211
|
this.state.pressability.configure(this._createPressabilityConfig());
|
|
212
212
|
}
|
|
213
213
|
|
|
214
|
-
componentDidMount():
|
|
214
|
+
componentDidMount(): unknown {
|
|
215
215
|
this.state.pressability.configure(this._createPressabilityConfig());
|
|
216
216
|
}
|
|
217
217
|
|
|
@@ -225,11 +225,11 @@ export default (function TouchableBounceWrapper({
|
|
|
225
225
|
ref: hostRef,
|
|
226
226
|
...props
|
|
227
227
|
}: {
|
|
228
|
-
ref: React.RefSetter<
|
|
228
|
+
ref: React.RefSetter<unknown>,
|
|
229
229
|
...$ReadOnly<Omit<TouchableBounceProps, 'hostRef'>>,
|
|
230
230
|
}) {
|
|
231
231
|
return <TouchableBounce {...props} hostRef={hostRef} />;
|
|
232
232
|
} as component(
|
|
233
|
-
ref?: React.RefSetter<
|
|
233
|
+
ref?: React.RefSetter<unknown>,
|
|
234
234
|
...props: $ReadOnly<Omit<TouchableBounceProps, 'hostRef'>>
|
|
235
235
|
));
|
|
@@ -390,7 +390,7 @@ class TouchableNativeFeedback extends React.Component<
|
|
|
390
390
|
this.state.pressability.configure(this._createPressabilityConfig());
|
|
391
391
|
}
|
|
392
392
|
|
|
393
|
-
componentDidMount():
|
|
393
|
+
componentDidMount(): unknown {
|
|
394
394
|
this.state.pressability.configure(this._createPressabilityConfig());
|
|
395
395
|
}
|
|
396
396
|
|
|
@@ -293,7 +293,7 @@ class TouchableNativeFeedback extends React.Component<
|
|
|
293
293
|
this.state.pressability.configure(this._createPressabilityConfig());
|
|
294
294
|
}
|
|
295
295
|
|
|
296
|
-
componentDidMount():
|
|
296
|
+
componentDidMount(): unknown {
|
|
297
297
|
this.state.pressability.configure(this._createPressabilityConfig());
|
|
298
298
|
}
|
|
299
299
|
|
|
@@ -79,32 +79,32 @@ export type TouchableWithoutFeedbackProps = $ReadOnly<
|
|
|
79
79
|
| 'no-hide-descendants'
|
|
80
80
|
),
|
|
81
81
|
nativeID?: ?string,
|
|
82
|
-
onAccessibilityAction?: ?(event: AccessibilityActionEvent) =>
|
|
82
|
+
onAccessibilityAction?: ?(event: AccessibilityActionEvent) => unknown,
|
|
83
83
|
/**
|
|
84
84
|
* When `accessible` is true (which is the default) this may be called when
|
|
85
85
|
* the OS-specific concept of "blur" occurs, meaning the element lost focus.
|
|
86
86
|
* Some platforms may not have the concept of blur.
|
|
87
87
|
*/
|
|
88
|
-
onBlur?: ?(event: BlurEvent) =>
|
|
88
|
+
onBlur?: ?(event: BlurEvent) => unknown,
|
|
89
89
|
/**
|
|
90
90
|
* When `accessible` is true (which is the default) this may be called when
|
|
91
91
|
* the OS-specific concept of "focus" occurs. Some platforms may not have
|
|
92
92
|
* the concept of focus.
|
|
93
93
|
*/
|
|
94
|
-
onFocus?: ?(event: FocusEvent) =>
|
|
94
|
+
onFocus?: ?(event: FocusEvent) => unknown,
|
|
95
95
|
/**
|
|
96
96
|
* Invoked on mount and layout changes with
|
|
97
97
|
* {nativeEvent: {layout: {x, y, width, height}}}
|
|
98
98
|
*/
|
|
99
|
-
onLayout?: ?(event: LayoutChangeEvent) =>
|
|
100
|
-
onLongPress?: ?(event: GestureResponderEvent) =>
|
|
99
|
+
onLayout?: ?(event: LayoutChangeEvent) => unknown,
|
|
100
|
+
onLongPress?: ?(event: GestureResponderEvent) => unknown,
|
|
101
101
|
/**
|
|
102
102
|
* Called when the touch is released,
|
|
103
103
|
* but not if cancelled (e.g. by a scroll that steals the responder lock).
|
|
104
104
|
*/
|
|
105
|
-
onPress?: ?(event: GestureResponderEvent) =>
|
|
106
|
-
onPressIn?: ?(event: GestureResponderEvent) =>
|
|
107
|
-
onPressOut?: ?(event: GestureResponderEvent) =>
|
|
105
|
+
onPress?: ?(event: GestureResponderEvent) => unknown,
|
|
106
|
+
onPressIn?: ?(event: GestureResponderEvent) => unknown,
|
|
107
|
+
onPressOut?: ?(event: GestureResponderEvent) => unknown,
|
|
108
108
|
/**
|
|
109
109
|
* When the scroll view is disabled, this defines how far your
|
|
110
110
|
* touch may move off of the button, before deactivating the button.
|
|
@@ -250,7 +250,7 @@ export default function TouchableWithoutFeedback(
|
|
|
250
250
|
// adopting `Pressability`, so preserve that behavior.
|
|
251
251
|
const {onBlur, onFocus, ...eventHandlersWithoutBlurAndFocus} = eventHandlers;
|
|
252
252
|
|
|
253
|
-
const elementProps: {[string]:
|
|
253
|
+
const elementProps: {[string]: unknown, ...} = {
|
|
254
254
|
...eventHandlersWithoutBlurAndFocus,
|
|
255
255
|
accessible: props.accessible !== false,
|
|
256
256
|
accessibilityState:
|
|
@@ -15,7 +15,7 @@ import ViewNativeComponent from './ViewNativeComponent';
|
|
|
15
15
|
import * as React from 'react';
|
|
16
16
|
import invariant from 'invariant'; // [Windows]
|
|
17
17
|
// [Windows
|
|
18
|
-
import type {
|
|
18
|
+
import type {KeyUpEvent, KeyDownEvent} from '../../Types/CoreEventTypes';
|
|
19
19
|
// Windows]
|
|
20
20
|
|
|
21
21
|
/**
|
|
@@ -111,7 +111,7 @@ const View: component(
|
|
|
111
111
|
}
|
|
112
112
|
: undefined;
|
|
113
113
|
|
|
114
|
-
const _keyDown = (event:
|
|
114
|
+
const _keyDown = (event: KeyDownEvent) => {
|
|
115
115
|
const keyDownEvents = otherProps.keyDownEvents;
|
|
116
116
|
if (keyDownEvents != null && event.isPropagationStopped() !== true) {
|
|
117
117
|
for (const el of keyDownEvents) {
|
|
@@ -130,7 +130,7 @@ const View: component(
|
|
|
130
130
|
otherProps.onKeyDown && otherProps.onKeyDown(event);
|
|
131
131
|
};
|
|
132
132
|
|
|
133
|
-
const _keyUp = (event:
|
|
133
|
+
const _keyUp = (event: KeyUpEvent) => {
|
|
134
134
|
const keyUpEvents = otherProps.keyUpEvents;
|
|
135
135
|
if (keyUpEvents != null && event.isPropagationStopped() !== true) {
|
|
136
136
|
for (const el of keyUpEvents) {
|
|
@@ -149,7 +149,7 @@ const View: component(
|
|
|
149
149
|
otherProps.onKeyUp && otherProps.onKeyUp(event);
|
|
150
150
|
};
|
|
151
151
|
|
|
152
|
-
const _keyDownCapture = (event:
|
|
152
|
+
const _keyDownCapture = (event: KeyDownEvent) => {
|
|
153
153
|
const keyDownEvents = otherProps.keyDownEvents;
|
|
154
154
|
if (keyDownEvents != null && event.isPropagationStopped() !== true) {
|
|
155
155
|
for (const el of keyDownEvents) {
|
|
@@ -168,7 +168,7 @@ const View: component(
|
|
|
168
168
|
otherProps.onKeyDownCapture && otherProps.onKeyDownCapture(event);
|
|
169
169
|
};
|
|
170
170
|
|
|
171
|
-
const _keyUpCapture = (event:
|
|
171
|
+
const _keyUpCapture = (event: KeyUpEvent) => {
|
|
172
172
|
const keyUpEvents = otherProps.keyUpEvents;
|
|
173
173
|
if (keyUpEvents != null && event.isPropagationStopped() !== true) {
|
|
174
174
|
for (const el of keyUpEvents) {
|
|
@@ -16,6 +16,8 @@ import type {
|
|
|
16
16
|
BlurEvent,
|
|
17
17
|
FocusEvent,
|
|
18
18
|
GestureResponderEvent,
|
|
19
|
+
KeyDownEvent,
|
|
20
|
+
KeyUpEvent,
|
|
19
21
|
LayoutChangeEvent,
|
|
20
22
|
LayoutRectangle,
|
|
21
23
|
MouseEvent,
|
|
@@ -37,7 +39,7 @@ type DirectEventProps = $ReadOnly<{
|
|
|
37
39
|
* when the user performs an accessibility custom action.
|
|
38
40
|
*
|
|
39
41
|
*/
|
|
40
|
-
onAccessibilityAction?: ?(event: AccessibilityActionEvent) =>
|
|
42
|
+
onAccessibilityAction?: ?(event: AccessibilityActionEvent) => unknown,
|
|
41
43
|
|
|
42
44
|
/**
|
|
43
45
|
* When `accessible` is true, the system will try to invoke this function
|
|
@@ -45,7 +47,7 @@ type DirectEventProps = $ReadOnly<{
|
|
|
45
47
|
*
|
|
46
48
|
* See https://reactnative.dev/docs/view#onaccessibilitytap
|
|
47
49
|
*/
|
|
48
|
-
onAccessibilityTap?: ?() =>
|
|
50
|
+
onAccessibilityTap?: ?() => unknown,
|
|
49
51
|
|
|
50
52
|
/**
|
|
51
53
|
* Invoked on mount and layout changes with:
|
|
@@ -58,7 +60,7 @@ type DirectEventProps = $ReadOnly<{
|
|
|
58
60
|
*
|
|
59
61
|
* See https://reactnative.dev/docs/view#onlayout
|
|
60
62
|
*/
|
|
61
|
-
onLayout?: ?(event: LayoutChangeEvent) =>
|
|
63
|
+
onLayout?: ?(event: LayoutChangeEvent) => unknown,
|
|
62
64
|
|
|
63
65
|
/**
|
|
64
66
|
* When `accessible` is `true`, the system will invoke this function when the
|
|
@@ -66,7 +68,7 @@ type DirectEventProps = $ReadOnly<{
|
|
|
66
68
|
*
|
|
67
69
|
* See https://reactnative.dev/docs/view#onmagictap
|
|
68
70
|
*/
|
|
69
|
-
onMagicTap?: ?() =>
|
|
71
|
+
onMagicTap?: ?() => unknown,
|
|
70
72
|
|
|
71
73
|
/**
|
|
72
74
|
* When `accessible` is `true`, the system will invoke this function when the
|
|
@@ -74,7 +76,7 @@ type DirectEventProps = $ReadOnly<{
|
|
|
74
76
|
*
|
|
75
77
|
* See https://reactnative.dev/docs/view#onaccessibilityescape
|
|
76
78
|
*/
|
|
77
|
-
onAccessibilityEscape?: ?() =>
|
|
79
|
+
onAccessibilityEscape?: ?() => unknown,
|
|
78
80
|
}>;
|
|
79
81
|
|
|
80
82
|
type MouseEventProps = $ReadOnly<{
|
|
@@ -115,6 +117,13 @@ type FocusEventProps = $ReadOnly<{
|
|
|
115
117
|
onFocusCapture?: ?(event: FocusEvent) => void,
|
|
116
118
|
}>;
|
|
117
119
|
|
|
120
|
+
type KeyEventProps = $ReadOnly<{
|
|
121
|
+
onKeyDown?: ?(event: KeyDownEvent) => void,
|
|
122
|
+
onKeyDownCapture?: ?(event: KeyDownEvent) => void,
|
|
123
|
+
onKeyUp?: ?(event: KeyUpEvent) => void,
|
|
124
|
+
onKeyUpCapture?: ?(event: KeyUpEvent) => void,
|
|
125
|
+
}>;
|
|
126
|
+
|
|
118
127
|
type TouchEventProps = $ReadOnly<{
|
|
119
128
|
onTouchCancel?: ?(e: GestureResponderEvent) => void,
|
|
120
129
|
onTouchCancelCapture?: ?(e: GestureResponderEvent) => void,
|
|
@@ -344,7 +353,7 @@ export type ViewPropsAndroid = $ReadOnly<{
|
|
|
344
353
|
*
|
|
345
354
|
* @platform android
|
|
346
355
|
*/
|
|
347
|
-
onClick?: ?(event: GestureResponderEvent) =>
|
|
356
|
+
onClick?: ?(event: GestureResponderEvent) => unknown,
|
|
348
357
|
}>;
|
|
349
358
|
|
|
350
359
|
export type TVViewPropsIOS = $ReadOnly<{
|
|
@@ -505,6 +514,7 @@ export type ViewProps = $ReadOnly<{
|
|
|
505
514
|
...MouseEventProps,
|
|
506
515
|
...PointerEventProps,
|
|
507
516
|
...FocusEventProps,
|
|
517
|
+
...KeyEventProps,
|
|
508
518
|
...TouchEventProps,
|
|
509
519
|
...ViewPropsAndroid,
|
|
510
520
|
...ViewPropsIOS,
|
|
@@ -16,6 +16,8 @@ import type {
|
|
|
16
16
|
BlurEvent,
|
|
17
17
|
FocusEvent,
|
|
18
18
|
GestureResponderEvent,
|
|
19
|
+
KeyDownEvent,
|
|
20
|
+
KeyUpEvent,
|
|
19
21
|
LayoutChangeEvent,
|
|
20
22
|
LayoutRectangle,
|
|
21
23
|
MouseEvent,
|
|
@@ -38,7 +40,7 @@ type DirectEventProps = $ReadOnly<{
|
|
|
38
40
|
* when the user performs an accessibility custom action.
|
|
39
41
|
*
|
|
40
42
|
*/
|
|
41
|
-
onAccessibilityAction?: ?(event: AccessibilityActionEvent) =>
|
|
43
|
+
onAccessibilityAction?: ?(event: AccessibilityActionEvent) => unknown,
|
|
42
44
|
|
|
43
45
|
/**
|
|
44
46
|
* When `accessible` is true, the system will try to invoke this function
|
|
@@ -46,7 +48,7 @@ type DirectEventProps = $ReadOnly<{
|
|
|
46
48
|
*
|
|
47
49
|
* See https://reactnative.dev/docs/view#onaccessibilitytap
|
|
48
50
|
*/
|
|
49
|
-
onAccessibilityTap?: ?() =>
|
|
51
|
+
onAccessibilityTap?: ?() => unknown,
|
|
50
52
|
|
|
51
53
|
/**
|
|
52
54
|
* Invoked on mount and layout changes with:
|
|
@@ -59,7 +61,7 @@ type DirectEventProps = $ReadOnly<{
|
|
|
59
61
|
*
|
|
60
62
|
* See https://reactnative.dev/docs/view#onlayout
|
|
61
63
|
*/
|
|
62
|
-
onLayout?: ?(event: LayoutChangeEvent) =>
|
|
64
|
+
onLayout?: ?(event: LayoutChangeEvent) => unknown,
|
|
63
65
|
|
|
64
66
|
/**
|
|
65
67
|
* When `accessible` is `true`, the system will invoke this function when the
|
|
@@ -67,7 +69,7 @@ type DirectEventProps = $ReadOnly<{
|
|
|
67
69
|
*
|
|
68
70
|
* See https://reactnative.dev/docs/view#onmagictap
|
|
69
71
|
*/
|
|
70
|
-
onMagicTap?: ?() =>
|
|
72
|
+
onMagicTap?: ?() => unknown,
|
|
71
73
|
|
|
72
74
|
/**
|
|
73
75
|
* When `accessible` is `true`, the system will invoke this function when the
|
|
@@ -75,7 +77,7 @@ type DirectEventProps = $ReadOnly<{
|
|
|
75
77
|
*
|
|
76
78
|
* See https://reactnative.dev/docs/view#onaccessibilityescape
|
|
77
79
|
*/
|
|
78
|
-
onAccessibilityEscape?: ?() =>
|
|
80
|
+
onAccessibilityEscape?: ?() => unknown,
|
|
79
81
|
}>;
|
|
80
82
|
|
|
81
83
|
type MouseEventProps = $ReadOnly<{
|
|
@@ -116,6 +118,13 @@ type FocusEventProps = $ReadOnly<{
|
|
|
116
118
|
onFocusCapture?: ?(event: FocusEvent) => void,
|
|
117
119
|
}>;
|
|
118
120
|
|
|
121
|
+
type KeyEventProps = $ReadOnly<{
|
|
122
|
+
onKeyDown?: ?(event: KeyDownEvent) => void,
|
|
123
|
+
onKeyDownCapture?: ?(event: KeyDownEvent) => void,
|
|
124
|
+
onKeyUp?: ?(event: KeyUpEvent) => void,
|
|
125
|
+
onKeyUpCapture?: ?(event: KeyUpEvent) => void,
|
|
126
|
+
}>;
|
|
127
|
+
|
|
119
128
|
type TouchEventProps = $ReadOnly<{
|
|
120
129
|
onTouchCancel?: ?(e: GestureResponderEvent) => void,
|
|
121
130
|
onTouchCancelCapture?: ?(e: GestureResponderEvent) => void,
|
|
@@ -345,7 +354,7 @@ export type ViewPropsAndroid = $ReadOnly<{
|
|
|
345
354
|
*
|
|
346
355
|
* @platform android
|
|
347
356
|
*/
|
|
348
|
-
onClick?: ?(event: GestureResponderEvent) =>
|
|
357
|
+
onClick?: ?(event: GestureResponderEvent) => unknown,
|
|
349
358
|
}>;
|
|
350
359
|
|
|
351
360
|
export type TVViewPropsIOS = $ReadOnly<{
|
|
@@ -539,12 +548,12 @@ type ViewPropsWindows = $ReadOnly<{|
|
|
|
539
548
|
*
|
|
540
549
|
* @platform windows
|
|
541
550
|
*/
|
|
542
|
-
onKeyUp?: ?(e:
|
|
543
|
-
onKeyUpCapture?: ?(e:
|
|
551
|
+
onKeyUp?: ?(e: KeyUpEvent) => void,
|
|
552
|
+
onKeyUpCapture?: ?(e: KeyUpEvent) => void,
|
|
544
553
|
keyUpEvents?: ?$ReadOnlyArray<HandledKeyboardEvent>,
|
|
545
554
|
|
|
546
|
-
onKeyDown?: ?(e:
|
|
547
|
-
onKeyDownCapture?: ?(e:
|
|
555
|
+
onKeyDown?: ?(e: KeyDownEvent) => void,
|
|
556
|
+
onKeyDownCapture?: ?(e: KeyDownEvent) => void,
|
|
548
557
|
keyDownEvents?: ?$ReadOnlyArray<HandledKeyboardEvent>,
|
|
549
558
|
/**
|
|
550
559
|
* Specifies the Tooltip for the view
|
|
@@ -587,6 +596,7 @@ export type ViewProps = $ReadOnly<{
|
|
|
587
596
|
...MouseEventProps,
|
|
588
597
|
...PointerEventProps,
|
|
589
598
|
...FocusEventProps,
|
|
599
|
+
...KeyEventProps,
|
|
590
600
|
...TouchEventProps,
|
|
591
601
|
...ViewPropsAndroid,
|
|
592
602
|
...ViewPropsIOS,
|
|
@@ -13,7 +13,10 @@ import DevLoadingView from '../../Utilities/DevLoadingView';
|
|
|
13
13
|
import HMRClient from '../../Utilities/HMRClient';
|
|
14
14
|
import getDevServer from './getDevServer';
|
|
15
15
|
|
|
16
|
-
declare var global: {
|
|
16
|
+
declare var global: {
|
|
17
|
+
globalEvalWithSourceUrl?: (string, string) => unknown,
|
|
18
|
+
...
|
|
19
|
+
};
|
|
17
20
|
|
|
18
21
|
let pendingRequests = 0;
|
|
19
22
|
|
|
@@ -26,7 +29,7 @@ export class LoadBundleFromServerError extends Error {
|
|
|
26
29
|
message: string,
|
|
27
30
|
url: string,
|
|
28
31
|
isTimeout: boolean,
|
|
29
|
-
options?: {cause:
|
|
32
|
+
options?: {cause: unknown, ...},
|
|
30
33
|
): void {
|
|
31
34
|
super(message, options);
|
|
32
35
|
this.url = url;
|
|
@@ -40,7 +43,7 @@ export class LoadBundleFromServerRequestError extends LoadBundleFromServerError
|
|
|
40
43
|
message: string,
|
|
41
44
|
url: string,
|
|
42
45
|
isTimeout: boolean,
|
|
43
|
-
options?: {cause:
|
|
46
|
+
options?: {cause: unknown, ...},
|
|
44
47
|
): void {
|
|
45
48
|
super(message, url, isTimeout, options);
|
|
46
49
|
this.name = 'LoadBundleFromServerRequestError';
|
|
@@ -13,7 +13,10 @@ import DevLoadingView from '../../Utilities/DevLoadingView';
|
|
|
13
13
|
import HMRClient from '../../Utilities/HMRClient';
|
|
14
14
|
import getDevServer from './getDevServer';
|
|
15
15
|
|
|
16
|
-
declare var global: {
|
|
16
|
+
declare var global: {
|
|
17
|
+
globalEvalWithSourceUrl?: (string, string) => unknown,
|
|
18
|
+
...
|
|
19
|
+
};
|
|
17
20
|
|
|
18
21
|
let pendingRequests = 0;
|
|
19
22
|
|
|
@@ -26,7 +29,7 @@ export class LoadBundleFromServerError extends Error {
|
|
|
26
29
|
message: string,
|
|
27
30
|
url: string,
|
|
28
31
|
isTimeout: boolean,
|
|
29
|
-
options?: {cause:
|
|
32
|
+
options?: {cause: unknown, ...},
|
|
30
33
|
): void {
|
|
31
34
|
super(message, options);
|
|
32
35
|
this.url = url;
|
|
@@ -40,7 +43,7 @@ export class LoadBundleFromServerRequestError extends LoadBundleFromServerError
|
|
|
40
43
|
message: string,
|
|
41
44
|
url: string,
|
|
42
45
|
isTimeout: boolean,
|
|
43
|
-
options?: {cause:
|
|
46
|
+
options?: {cause: unknown, ...},
|
|
44
47
|
): void {
|
|
45
48
|
super(message, url, isTimeout, options);
|
|
46
49
|
this.name = 'LoadBundleFromServerRequestError';
|
|
@@ -31,7 +31,7 @@ export type SymbolicatedStackTrace = $ReadOnly<{
|
|
|
31
31
|
|
|
32
32
|
export default async function symbolicateStackTrace(
|
|
33
33
|
stack: Array<StackFrame>,
|
|
34
|
-
extraData?:
|
|
34
|
+
extraData?: unknown,
|
|
35
35
|
): Promise<SymbolicatedStackTrace> {
|
|
36
36
|
const devServer = getDevServer();
|
|
37
37
|
if (!devServer.bundleLoadedFromServer) {
|