@office-iss/react-native-win32 0.0.0-canary.270 → 0.0.0-canary.271
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/CHANGELOG.json +16 -1
- package/CHANGELOG.md +12 -4
- package/Libraries/Animated/animations/Animation.js +63 -24
- package/Libraries/Animated/animations/DecayAnimation.js +26 -38
- package/Libraries/Animated/animations/SpringAnimation.js +33 -39
- package/Libraries/Animated/animations/TimingAnimation.js +34 -42
- package/Libraries/Animated/createAnimatedComponent.js +46 -32
- package/Libraries/Animated/nodes/AnimatedProps.js +16 -10
- package/Libraries/Animated/nodes/AnimatedStyle.js +4 -0
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts +19 -3
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +61 -3
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.win32.js +61 -3
- package/Libraries/Components/Button.js +6 -4
- package/Libraries/Components/Button.win32.js +9 -4
- package/Libraries/Components/ScrollView/ScrollView.js +5 -5
- package/Libraries/Components/Switch/Switch.js +8 -6
- package/Libraries/Components/TextInput/TextInput.d.ts +4 -4
- package/Libraries/Components/TextInput/TextInput.flow.js +7 -10
- package/Libraries/Components/TextInput/TextInput.js +7 -7
- package/Libraries/Components/TextInput/TextInput.win32.js +7 -7
- package/Libraries/Components/TextInput/TextInputState.js +11 -13
- package/Libraries/Components/TextInput/TextInputState.win32.js +13 -16
- package/Libraries/Components/View/ReactNativeStyleAttributes.js +1 -0
- package/Libraries/Components/View/ViewNativeComponent.js +3 -10
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Core/setUpBatchedBridge.js +1 -10
- package/Libraries/Core/setUpReactDevTools.js +3 -3
- package/Libraries/Core/setUpSegmentFetcher.js +1 -0
- package/Libraries/Core/setUpTimers.js +8 -8
- package/Libraries/Image/ImageBackground.js +2 -5
- package/Libraries/Image/ImageProps.js +1 -1
- package/Libraries/Image/ImageViewNativeComponent.js +2 -2
- package/Libraries/Inspector/ReactDevToolsOverlay.js +0 -1
- package/Libraries/Inspector/getInspectorDataForViewAtPoint.js +3 -5
- package/Libraries/JSInspector/NetworkAgent.js +1 -1
- package/Libraries/Lists/FlatList.d.ts +1 -2
- package/Libraries/Lists/__flowtests__/FlatList-flowtest.js +2 -2
- package/Libraries/Lists/__flowtests__/SectionList-flowtest.js +1 -1
- package/Libraries/LogBox/Data/LogBoxData.js +1 -1
- package/Libraries/LogBox/UI/LogBoxInspectorStackFrames.js +1 -1
- package/Libraries/LogBox/UI/LogBoxMessage.js +2 -2
- package/Libraries/NativeComponent/BaseViewConfig.android.js +1 -0
- package/Libraries/NativeComponent/BaseViewConfig.ios.js +1 -0
- package/Libraries/NativeComponent/BaseViewConfig.win32.js +1 -0
- package/Libraries/Network/XMLHttpRequest.js +26 -1
- package/Libraries/Pressability/HoverState.js +2 -0
- package/Libraries/Pressability/HoverState.win32.js +2 -0
- package/Libraries/Pressability/Pressability.js +2 -3
- package/Libraries/Pressability/Pressability.win32.js +2 -3
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent.js +2 -3
- package/Libraries/ReactNative/RendererImplementation.js +4 -3
- package/Libraries/Renderer/shims/ReactNativeTypes.js +13 -18
- package/Libraries/StyleSheet/StyleSheetTypes.d.ts +1 -0
- package/Libraries/StyleSheet/StyleSheetTypes.js +13 -0
- package/Libraries/StyleSheet/processTransform.js +3 -34
- package/Libraries/Text/Text.js +251 -249
- package/Libraries/Text/Text.win32.js +285 -295
- package/Libraries/Types/CoreEventTypes.d.ts +3 -10
- package/Libraries/Types/CoreEventTypes.js +4 -6
- package/Libraries/Types/CoreEventTypes.win32.js +4 -6
- package/Libraries/Utilities/Platform.flow.js +2 -2
- package/Libraries/Utilities/Platform.flow.win32.js +2 -2
- package/Libraries/__flowtests__/ReactNativeTypes-flowtest.js +5 -4
- package/index.js +5 -2
- package/index.win32.js +5 -2
- package/jest/setup.js +30 -0
- package/overrides.json +18 -17
- package/package.json +13 -13
- package/src/private/animated/NativeAnimatedHelper.js +2 -4
- package/src/private/animated/NativeAnimatedHelper.win32.js +2 -3
- package/src/private/components/HScrollViewNativeComponents.js +4 -5
- package/src/private/{fusebox → debugging}/setUpFuseboxReactDevToolsDispatcher.js +6 -0
- package/src/private/featureflags/ReactNativeFeatureFlags.js +14 -23
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +2 -5
- package/src/private/specs/modules/NativeAccessibilityInfo.js +3 -0
- package/src/private/specs/modules/NativeAccessibilityInfoWin32.js +3 -0
- package/src/private/specs/modules/NativeAccessibilityManager.js +4 -0
- package/src/private/webapis/dom/nodes/ReactNativeElement.js +2 -3
- package/src/private/webapis/performance/EventTiming.js +13 -8
- package/src/private/webapis/performance/Performance.js +30 -40
- package/src/private/webapis/performance/PerformanceEntry.js +2 -5
- package/src/private/webapis/performance/PerformanceObserver.js +20 -32
- package/src/private/webapis/performance/RawPerformanceEntry.js +1 -1
- package/src/private/webapis/performance/UserTiming.js +6 -2
- package/src/private/webapis/performance/Utilities.js +0 -7
- package/src/private/webapis/performance/specs/NativePerformance.js +53 -0
- package/src/private/webapis/performance/specs/__mocks__/NativePerformanceMock.js +247 -0
- package/src-win/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts +19 -3
- package/types/public/ReactNativeTypes.d.ts +4 -4
- package/src/private/webapis/performance/specs/NativePerformanceObserver.js +0 -69
- package/src/private/webapis/performance/specs/__mocks__/NativePerformance.js +0 -69
- package/src/private/webapis/performance/specs/__mocks__/NativePerformanceObserver.js +0 -154
- /package/src/private/{fusebox → debugging}/FuseboxSessionObserver.js +0 -0
- /package/src/private/{reactdevtools → debugging}/ReactDevToolsSettingsManager.android.js +0 -0
- /package/src/private/{reactdevtools → debugging}/ReactDevToolsSettingsManager.ios.js +0 -0
- /package/src/private/{reactdevtools → debugging}/ReactDevToolsSettingsManager.win32.js +0 -0
|
@@ -130,12 +130,14 @@ const returnsTrue = () => true;
|
|
|
130
130
|
```
|
|
131
131
|
*/
|
|
132
132
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
133
|
+
type SwitchRef = React.ElementRef<
|
|
134
|
+
typeof SwitchNativeComponent | typeof AndroidSwitchNativeComponent,
|
|
135
|
+
>;
|
|
136
|
+
|
|
137
|
+
const SwitchWithForwardedRef: component(
|
|
138
|
+
ref: React.RefSetter<SwitchRef>,
|
|
139
|
+
...props: Props
|
|
140
|
+
) = React.forwardRef(function Switch(props, forwardedRef): React.Node {
|
|
139
141
|
const {
|
|
140
142
|
disabled,
|
|
141
143
|
ios_backgroundColor,
|
|
@@ -11,7 +11,7 @@ import type * as React from 'react';
|
|
|
11
11
|
import {Constructor} from '../../../types/private/Utilities';
|
|
12
12
|
import {TimerMixin} from '../../../types/private/TimerMixin';
|
|
13
13
|
import {
|
|
14
|
-
|
|
14
|
+
HostInstance,
|
|
15
15
|
NativeMethods,
|
|
16
16
|
} from '../../../types/public/ReactNativeTypes';
|
|
17
17
|
import {ColorValue, StyleProp} from '../../StyleSheet/StyleSheet';
|
|
@@ -956,21 +956,21 @@ interface TextInputState {
|
|
|
956
956
|
* Returns the ref of the currently focused text field, if one exists
|
|
957
957
|
* If no text field is focused it returns null
|
|
958
958
|
*/
|
|
959
|
-
currentlyFocusedInput():
|
|
959
|
+
currentlyFocusedInput(): HostInstance;
|
|
960
960
|
|
|
961
961
|
/**
|
|
962
962
|
* @param textField ref of the text field to focus
|
|
963
963
|
* Focuses the specified text field
|
|
964
964
|
* noop if the text field was already focused
|
|
965
965
|
*/
|
|
966
|
-
focusTextInput(textField?:
|
|
966
|
+
focusTextInput(textField?: HostInstance): void;
|
|
967
967
|
|
|
968
968
|
/**
|
|
969
969
|
* @param textField ref of the text field to focus
|
|
970
970
|
* Unfocuses the specified text field
|
|
971
971
|
* noop if it wasn't focused
|
|
972
972
|
*/
|
|
973
|
-
blurTextInput(textField?:
|
|
973
|
+
blurTextInput(textField?: HostInstance): void;
|
|
974
974
|
}
|
|
975
975
|
|
|
976
976
|
/**
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @format
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import type {
|
|
11
|
+
import type {HostInstance} from '../../Renderer/shims/ReactNativeTypes';
|
|
12
12
|
import type {
|
|
13
13
|
PressEvent,
|
|
14
14
|
ScrollEvent,
|
|
@@ -22,7 +22,6 @@ import {
|
|
|
22
22
|
type ViewStyleProp,
|
|
23
23
|
} from '../../StyleSheet/StyleSheet';
|
|
24
24
|
import * as React from 'react';
|
|
25
|
-
type ComponentRef = React.ElementRef<HostComponent<mixed>>;
|
|
26
25
|
|
|
27
26
|
type ReactRefSetter<T> = {current: null | T, ...} | ((ref: null | T) => mixed);
|
|
28
27
|
|
|
@@ -624,9 +623,7 @@ export type Props = $ReadOnly<{|
|
|
|
624
623
|
*/
|
|
625
624
|
editable?: ?boolean,
|
|
626
625
|
|
|
627
|
-
forwardedRef?: ?ReactRefSetter<
|
|
628
|
-
React.ElementRef<HostComponent<mixed>> & ImperativeMethods,
|
|
629
|
-
>,
|
|
626
|
+
forwardedRef?: ?ReactRefSetter<HostInstance & ImperativeMethods>,
|
|
630
627
|
|
|
631
628
|
/**
|
|
632
629
|
* `enterKeyHint` defines what action label (or icon) to present for the enter key on virtual keyboards.
|
|
@@ -972,7 +969,7 @@ export type Props = $ReadOnly<{|
|
|
|
972
969
|
type ImperativeMethods = $ReadOnly<{|
|
|
973
970
|
clear: () => void,
|
|
974
971
|
isFocused: () => boolean,
|
|
975
|
-
getNativeRef: () => ?
|
|
972
|
+
getNativeRef: () => ?HostInstance,
|
|
976
973
|
setSelection: (start: number, end: number) => void,
|
|
977
974
|
|}>;
|
|
978
975
|
|
|
@@ -1091,17 +1088,17 @@ type InternalTextInput = (props: Props) => React.Node;
|
|
|
1091
1088
|
|
|
1092
1089
|
export type TextInputComponentStatics = $ReadOnly<{|
|
|
1093
1090
|
State: $ReadOnly<{|
|
|
1094
|
-
currentlyFocusedInput: () => ?
|
|
1091
|
+
currentlyFocusedInput: () => ?HostInstance,
|
|
1095
1092
|
currentlyFocusedField: () => ?number,
|
|
1096
|
-
focusTextInput: (textField: ?
|
|
1097
|
-
blurTextInput: (textField: ?
|
|
1093
|
+
focusTextInput: (textField: ?HostInstance) => void,
|
|
1094
|
+
blurTextInput: (textField: ?HostInstance) => void,
|
|
1098
1095
|
|}>,
|
|
1099
1096
|
|}>;
|
|
1100
1097
|
|
|
1101
1098
|
export type TextInputType = React.AbstractComponent<
|
|
1102
1099
|
React.ElementConfig<InternalTextInput>,
|
|
1103
1100
|
$ReadOnly<{|
|
|
1104
|
-
...
|
|
1101
|
+
...HostInstance,
|
|
1105
1102
|
...ImperativeMethods,
|
|
1106
1103
|
|}>,
|
|
1107
1104
|
> &
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @format
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import type {
|
|
11
|
+
import type {HostInstance} from '../../Renderer/shims/ReactNativeTypes';
|
|
12
12
|
import type {____TextStyle_Internal as TextStyleInternal} from '../../StyleSheet/StyleSheetTypes';
|
|
13
13
|
import type {
|
|
14
14
|
PressEvent,
|
|
@@ -37,10 +37,10 @@ import * as React from 'react';
|
|
|
37
37
|
import {useCallback, useLayoutEffect, useRef, useState} from 'react';
|
|
38
38
|
|
|
39
39
|
type ReactRefSetter<T> = {current: null | T, ...} | ((ref: null | T) => mixed);
|
|
40
|
-
type TextInputInstance =
|
|
40
|
+
type TextInputInstance = HostInstance & {
|
|
41
41
|
+clear: () => void,
|
|
42
42
|
+isFocused: () => boolean,
|
|
43
|
-
+getNativeRef: () => ?
|
|
43
|
+
+getNativeRef: () => ?HostInstance,
|
|
44
44
|
+setSelection: (start: number, end: number) => void,
|
|
45
45
|
};
|
|
46
46
|
|
|
@@ -1004,7 +1004,7 @@ function useTextInputStateSynchronization_STATE({
|
|
|
1004
1004
|
props: Props,
|
|
1005
1005
|
mostRecentEventCount: number,
|
|
1006
1006
|
selection: ?Selection,
|
|
1007
|
-
inputRef: React.RefObject<null |
|
|
1007
|
+
inputRef: React.RefObject<null | HostInstance>,
|
|
1008
1008
|
text: string,
|
|
1009
1009
|
viewCommands: ViewCommands,
|
|
1010
1010
|
}): {
|
|
@@ -1085,7 +1085,7 @@ function useTextInputStateSynchronization_REFS({
|
|
|
1085
1085
|
props: Props,
|
|
1086
1086
|
mostRecentEventCount: number,
|
|
1087
1087
|
selection: ?Selection,
|
|
1088
|
-
inputRef: React.RefObject<null |
|
|
1088
|
+
inputRef: React.RefObject<null | HostInstance>,
|
|
1089
1089
|
text: string,
|
|
1090
1090
|
viewCommands: ViewCommands,
|
|
1091
1091
|
}): {
|
|
@@ -1285,7 +1285,7 @@ function InternalTextInput(props: Props): React.Node {
|
|
|
1285
1285
|
...otherProps
|
|
1286
1286
|
} = props;
|
|
1287
1287
|
|
|
1288
|
-
const inputRef = useRef<null |
|
|
1288
|
+
const inputRef = useRef<null | HostInstance>(null);
|
|
1289
1289
|
|
|
1290
1290
|
const selection: ?Selection =
|
|
1291
1291
|
propsSelection == null
|
|
@@ -1383,7 +1383,7 @@ function InternalTextInput(props: Props): React.Node {
|
|
|
1383
1383
|
isFocused(): boolean {
|
|
1384
1384
|
return TextInputState.currentlyFocusedInput() === inputRef.current;
|
|
1385
1385
|
},
|
|
1386
|
-
getNativeRef(): ?
|
|
1386
|
+
getNativeRef(): ?HostInstance {
|
|
1387
1387
|
return inputRef.current;
|
|
1388
1388
|
},
|
|
1389
1389
|
setSelection(start: number, end: number): void {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @format
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import type {
|
|
11
|
+
import type {HostInstance} from '../../Renderer/shims/ReactNativeTypes';
|
|
12
12
|
import type {____TextStyle_Internal as TextStyleInternal} from '../../StyleSheet/StyleSheetTypes';
|
|
13
13
|
import type {
|
|
14
14
|
PressEvent,
|
|
@@ -37,10 +37,10 @@ import * as React from 'react';
|
|
|
37
37
|
import {useCallback, useLayoutEffect, useRef, useState} from 'react';
|
|
38
38
|
|
|
39
39
|
type ReactRefSetter<T> = {current: null | T, ...} | ((ref: null | T) => mixed);
|
|
40
|
-
type TextInputInstance =
|
|
40
|
+
type TextInputInstance = HostInstance & {
|
|
41
41
|
+clear: () => void,
|
|
42
42
|
+isFocused: () => boolean,
|
|
43
|
-
+getNativeRef: () => ?
|
|
43
|
+
+getNativeRef: () => ?HostInstance,
|
|
44
44
|
+setSelection: (start: number, end: number) => void,
|
|
45
45
|
};
|
|
46
46
|
|
|
@@ -1047,7 +1047,7 @@ function useTextInputStateSynchronization_STATE({
|
|
|
1047
1047
|
props: Props,
|
|
1048
1048
|
mostRecentEventCount: number,
|
|
1049
1049
|
selection: ?Selection,
|
|
1050
|
-
inputRef: React.RefObject<null |
|
|
1050
|
+
inputRef: React.RefObject<null | HostInstance>,
|
|
1051
1051
|
text: string,
|
|
1052
1052
|
viewCommands: ViewCommands,
|
|
1053
1053
|
}): {
|
|
@@ -1128,7 +1128,7 @@ function useTextInputStateSynchronization_REFS({
|
|
|
1128
1128
|
props: Props,
|
|
1129
1129
|
mostRecentEventCount: number,
|
|
1130
1130
|
selection: ?Selection,
|
|
1131
|
-
inputRef: React.RefObject<null |
|
|
1131
|
+
inputRef: React.RefObject<null | HostInstance>,
|
|
1132
1132
|
text: string,
|
|
1133
1133
|
viewCommands: ViewCommands,
|
|
1134
1134
|
}): {
|
|
@@ -1330,7 +1330,7 @@ function InternalTextInput(props: Props): React.Node {
|
|
|
1330
1330
|
...otherProps
|
|
1331
1331
|
} = props;
|
|
1332
1332
|
|
|
1333
|
-
const inputRef = useRef<null |
|
|
1333
|
+
const inputRef = useRef<null | HostInstance>(null);
|
|
1334
1334
|
|
|
1335
1335
|
const selection: ?Selection =
|
|
1336
1336
|
propsSelection == null
|
|
@@ -1433,7 +1433,7 @@ function InternalTextInput(props: Props): React.Node {
|
|
|
1433
1433
|
currentlyFocusedInput === inputRef.current
|
|
1434
1434
|
);
|
|
1435
1435
|
},
|
|
1436
|
-
getNativeRef(): ?
|
|
1436
|
+
getNativeRef(): ?HostInstance {
|
|
1437
1437
|
return inputRef.current;
|
|
1438
1438
|
},
|
|
1439
1439
|
setSelection(start: number, end: number): void {
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
// through here.
|
|
14
14
|
|
|
15
15
|
import type {
|
|
16
|
-
|
|
16
|
+
HostInstance,
|
|
17
17
|
MeasureInWindowOnSuccessCallback,
|
|
18
18
|
MeasureLayoutOnSuccessCallback,
|
|
19
19
|
MeasureOnSuccessCallback,
|
|
@@ -24,24 +24,22 @@ import {Commands as iOSTextInputCommands} from '../../Components/TextInput/RCTSi
|
|
|
24
24
|
|
|
25
25
|
const {findNodeHandle} = require('../../ReactNative/RendererProxy');
|
|
26
26
|
const Platform = require('../../Utilities/Platform');
|
|
27
|
-
const React = require('react');
|
|
28
|
-
type ComponentRef = React.ElementRef<HostComponent<mixed>>;
|
|
29
27
|
|
|
30
|
-
let currentlyFocusedInputRef: ?
|
|
28
|
+
let currentlyFocusedInputRef: ?HostInstance = null;
|
|
31
29
|
const inputs = new Set<{
|
|
32
30
|
blur(): void,
|
|
33
31
|
focus(): void,
|
|
34
32
|
measure(callback: MeasureOnSuccessCallback): void,
|
|
35
33
|
measureInWindow(callback: MeasureInWindowOnSuccessCallback): void,
|
|
36
34
|
measureLayout(
|
|
37
|
-
relativeToNativeNode: number |
|
|
35
|
+
relativeToNativeNode: number | HostInstance,
|
|
38
36
|
onSuccess: MeasureLayoutOnSuccessCallback,
|
|
39
37
|
onFail?: () => void,
|
|
40
38
|
): void,
|
|
41
39
|
setNativeProps(nativeProps: {...}): void,
|
|
42
40
|
}>();
|
|
43
41
|
|
|
44
|
-
function currentlyFocusedInput(): ?
|
|
42
|
+
function currentlyFocusedInput(): ?HostInstance {
|
|
45
43
|
return currentlyFocusedInputRef;
|
|
46
44
|
}
|
|
47
45
|
|
|
@@ -59,13 +57,13 @@ function currentlyFocusedField(): ?number {
|
|
|
59
57
|
return findNodeHandle(currentlyFocusedInputRef);
|
|
60
58
|
}
|
|
61
59
|
|
|
62
|
-
function focusInput(textField: ?
|
|
60
|
+
function focusInput(textField: ?HostInstance): void {
|
|
63
61
|
if (currentlyFocusedInputRef !== textField && textField != null) {
|
|
64
62
|
currentlyFocusedInputRef = textField;
|
|
65
63
|
}
|
|
66
64
|
}
|
|
67
65
|
|
|
68
|
-
function blurInput(textField: ?
|
|
66
|
+
function blurInput(textField: ?HostInstance): void {
|
|
69
67
|
if (currentlyFocusedInputRef === textField && textField != null) {
|
|
70
68
|
currentlyFocusedInputRef = null;
|
|
71
69
|
}
|
|
@@ -92,7 +90,7 @@ function blurField(textFieldID: ?number) {
|
|
|
92
90
|
* Focuses the specified text field
|
|
93
91
|
* noop if the text field was already focused or if the field is not editable
|
|
94
92
|
*/
|
|
95
|
-
function focusTextInput(textField: ?
|
|
93
|
+
function focusTextInput(textField: ?HostInstance) {
|
|
96
94
|
if (typeof textField === 'number') {
|
|
97
95
|
if (__DEV__) {
|
|
98
96
|
console.error(
|
|
@@ -131,7 +129,7 @@ function focusTextInput(textField: ?ComponentRef) {
|
|
|
131
129
|
* Unfocuses the specified text field
|
|
132
130
|
* noop if it wasn't focused
|
|
133
131
|
*/
|
|
134
|
-
function blurTextInput(textField: ?
|
|
132
|
+
function blurTextInput(textField: ?HostInstance) {
|
|
135
133
|
if (typeof textField === 'number') {
|
|
136
134
|
if (__DEV__) {
|
|
137
135
|
console.error(
|
|
@@ -157,7 +155,7 @@ function blurTextInput(textField: ?ComponentRef) {
|
|
|
157
155
|
}
|
|
158
156
|
}
|
|
159
157
|
|
|
160
|
-
function registerInput(textField:
|
|
158
|
+
function registerInput(textField: HostInstance) {
|
|
161
159
|
if (typeof textField === 'number') {
|
|
162
160
|
if (__DEV__) {
|
|
163
161
|
console.error(
|
|
@@ -171,7 +169,7 @@ function registerInput(textField: ComponentRef) {
|
|
|
171
169
|
inputs.add(textField);
|
|
172
170
|
}
|
|
173
171
|
|
|
174
|
-
function unregisterInput(textField:
|
|
172
|
+
function unregisterInput(textField: HostInstance) {
|
|
175
173
|
if (typeof textField === 'number') {
|
|
176
174
|
if (__DEV__) {
|
|
177
175
|
console.error(
|
|
@@ -184,7 +182,7 @@ function unregisterInput(textField: ComponentRef) {
|
|
|
184
182
|
inputs.delete(textField);
|
|
185
183
|
}
|
|
186
184
|
|
|
187
|
-
function isTextInput(textField:
|
|
185
|
+
function isTextInput(textField: HostInstance): boolean {
|
|
188
186
|
if (typeof textField === 'number') {
|
|
189
187
|
if (__DEV__) {
|
|
190
188
|
console.error(
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
// through here.
|
|
14
14
|
|
|
15
15
|
import type {
|
|
16
|
-
|
|
16
|
+
HostInstance,
|
|
17
17
|
MeasureInWindowOnSuccessCallback,
|
|
18
18
|
MeasureLayoutOnSuccessCallback,
|
|
19
19
|
MeasureOnSuccessCallback,
|
|
@@ -25,25 +25,22 @@ import {Commands as Win32TextInputCommands} from '../../Components/TextInput/Win
|
|
|
25
25
|
|
|
26
26
|
const {findNodeHandle} = require('../../ReactNative/RendererProxy');
|
|
27
27
|
const Platform = require('../../Utilities/Platform');
|
|
28
|
-
const React = require('react');
|
|
29
28
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
let currentlyFocusedInputRef: ?ComponentRef = null;
|
|
29
|
+
let currentlyFocusedInputRef: ?HostInstance = null;
|
|
33
30
|
const inputs = new Set<{
|
|
34
31
|
blur(): void,
|
|
35
32
|
focus(): void,
|
|
36
33
|
measure(callback: MeasureOnSuccessCallback): void,
|
|
37
34
|
measureInWindow(callback: MeasureInWindowOnSuccessCallback): void,
|
|
38
35
|
measureLayout(
|
|
39
|
-
relativeToNativeNode: number |
|
|
36
|
+
relativeToNativeNode: number | HostInstance,
|
|
40
37
|
onSuccess: MeasureLayoutOnSuccessCallback,
|
|
41
38
|
onFail?: () => void,
|
|
42
39
|
): void,
|
|
43
40
|
setNativeProps(nativeProps: {...}): void,
|
|
44
41
|
}>();
|
|
45
42
|
|
|
46
|
-
function currentlyFocusedInput(): ?
|
|
43
|
+
function currentlyFocusedInput(): ?HostInstance {
|
|
47
44
|
return currentlyFocusedInputRef;
|
|
48
45
|
}
|
|
49
46
|
|
|
@@ -61,13 +58,13 @@ function currentlyFocusedField(): ?number {
|
|
|
61
58
|
return findNodeHandle(currentlyFocusedInputRef);
|
|
62
59
|
}
|
|
63
60
|
|
|
64
|
-
function focusInput(textField: ?
|
|
61
|
+
function focusInput(textField: ?HostInstance): void {
|
|
65
62
|
if (currentlyFocusedInputRef !== textField && textField != null) {
|
|
66
63
|
currentlyFocusedInputRef = textField;
|
|
67
64
|
}
|
|
68
65
|
}
|
|
69
66
|
|
|
70
|
-
function blurInput(textField: ?
|
|
67
|
+
function blurInput(textField: ?HostInstance): void {
|
|
71
68
|
if (currentlyFocusedInputRef === textField && textField != null) {
|
|
72
69
|
currentlyFocusedInputRef = null;
|
|
73
70
|
}
|
|
@@ -94,7 +91,7 @@ function blurField(textFieldID: ?number) {
|
|
|
94
91
|
* Focuses the specified text field
|
|
95
92
|
* noop if the text field was already focused or if the field is not editable
|
|
96
93
|
*/
|
|
97
|
-
function focusTextInput(textField: ?
|
|
94
|
+
function focusTextInput(textField: ?HostInstance) {
|
|
98
95
|
if (typeof textField === 'number') {
|
|
99
96
|
if (__DEV__) {
|
|
100
97
|
console.error(
|
|
@@ -142,7 +139,7 @@ function focusTextInput(textField: ?ComponentRef) {
|
|
|
142
139
|
* Unfocuses the specified text field
|
|
143
140
|
* noop if it wasn't focused
|
|
144
141
|
*/
|
|
145
|
-
function blurTextInput(textField: ?
|
|
142
|
+
function blurTextInput(textField: ?HostInstance) {
|
|
146
143
|
if (typeof textField === 'number') {
|
|
147
144
|
if (__DEV__) {
|
|
148
145
|
console.error(
|
|
@@ -179,7 +176,7 @@ function blurTextInput(textField: ?ComponentRef) {
|
|
|
179
176
|
* Should be called after the view has received focus and fired the onFocus event
|
|
180
177
|
* noop if the focused text field is same
|
|
181
178
|
*/
|
|
182
|
-
function setFocusedTextInput(textField:
|
|
179
|
+
function setFocusedTextInput(textField: HostInstance) {
|
|
183
180
|
if (currentlyFocusedInputRef !== textField && textField !== null) {
|
|
184
181
|
currentlyFocusedInputRef = textField;
|
|
185
182
|
}
|
|
@@ -190,14 +187,14 @@ function setFocusedTextInput(textField: ComponentRef) {
|
|
|
190
187
|
* Should be called after the view has cleared focus and fired the onFocus event
|
|
191
188
|
* noop if the focused text field is not same
|
|
192
189
|
*/
|
|
193
|
-
function clearFocusedTextInput(textField:
|
|
190
|
+
function clearFocusedTextInput(textField: HostInstance) {
|
|
194
191
|
if (currentlyFocusedInputRef === textField && textField !== null) {
|
|
195
192
|
currentlyFocusedInputRef = null;
|
|
196
193
|
}
|
|
197
194
|
}
|
|
198
195
|
// Win32]
|
|
199
196
|
|
|
200
|
-
function registerInput(textField:
|
|
197
|
+
function registerInput(textField: HostInstance) {
|
|
201
198
|
if (typeof textField === 'number') {
|
|
202
199
|
if (__DEV__) {
|
|
203
200
|
console.error(
|
|
@@ -211,7 +208,7 @@ function registerInput(textField: ComponentRef) {
|
|
|
211
208
|
inputs.add(textField);
|
|
212
209
|
}
|
|
213
210
|
|
|
214
|
-
function unregisterInput(textField:
|
|
211
|
+
function unregisterInput(textField: HostInstance) {
|
|
215
212
|
if (typeof textField === 'number') {
|
|
216
213
|
if (__DEV__) {
|
|
217
214
|
console.error(
|
|
@@ -224,7 +221,7 @@ function unregisterInput(textField: ComponentRef) {
|
|
|
224
221
|
inputs.delete(textField);
|
|
225
222
|
}
|
|
226
223
|
|
|
227
|
-
function isTextInput(textField:
|
|
224
|
+
function isTextInput(textField: HostInstance): boolean {
|
|
228
225
|
if (typeof textField === 'number') {
|
|
229
226
|
if (__DEV__) {
|
|
230
227
|
console.error(
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
import type {
|
|
12
12
|
HostComponent,
|
|
13
|
+
HostInstance,
|
|
13
14
|
PartialViewConfig,
|
|
14
15
|
} from '../../Renderer/shims/ReactNativeTypes';
|
|
15
16
|
|
|
@@ -17,7 +18,6 @@ import * as NativeComponentRegistry from '../../NativeComponent/NativeComponentR
|
|
|
17
18
|
import codegenNativeCommands from '../../Utilities/codegenNativeCommands';
|
|
18
19
|
import Platform from '../../Utilities/Platform';
|
|
19
20
|
import {type ViewProps as Props} from './ViewPropTypes';
|
|
20
|
-
import * as React from 'react';
|
|
21
21
|
|
|
22
22
|
export const __INTERNAL_VIEW_CONFIG: PartialViewConfig =
|
|
23
23
|
Platform.OS === 'android'
|
|
@@ -108,15 +108,8 @@ const ViewNativeComponent: HostComponent<Props> =
|
|
|
108
108
|
NativeComponentRegistry.get<Props>('RCTView', () => __INTERNAL_VIEW_CONFIG);
|
|
109
109
|
|
|
110
110
|
interface NativeCommands {
|
|
111
|
-
+hotspotUpdate: (
|
|
112
|
-
|
|
113
|
-
x: number,
|
|
114
|
-
y: number,
|
|
115
|
-
) => void;
|
|
116
|
-
+setPressed: (
|
|
117
|
-
viewRef: React.ElementRef<HostComponent<mixed>>,
|
|
118
|
-
pressed: boolean,
|
|
119
|
-
) => void;
|
|
111
|
+
+hotspotUpdate: (viewRef: HostInstance, x: number, y: number) => void;
|
|
112
|
+
+setPressed: (viewRef: HostInstance, pressed: boolean) => void;
|
|
120
113
|
}
|
|
121
114
|
|
|
122
115
|
export const Commands: NativeCommands = codegenNativeCommands<NativeCommands>({
|
|
@@ -16,16 +16,7 @@ if (global.RN$Bridgeless === true && global.RN$registerCallableModule) {
|
|
|
16
16
|
} else {
|
|
17
17
|
const BatchedBridge = require('../BatchedBridge/BatchedBridge');
|
|
18
18
|
registerModule = (
|
|
19
|
-
moduleName:
|
|
20
|
-
| $TEMPORARY$string<'GlobalPerformanceLogger'>
|
|
21
|
-
| $TEMPORARY$string<'HMRClient'>
|
|
22
|
-
| $TEMPORARY$string<'HeapCapture'>
|
|
23
|
-
| $TEMPORARY$string<'JSTimers'>
|
|
24
|
-
| $TEMPORARY$string<'RCTDeviceEventEmitter'>
|
|
25
|
-
| $TEMPORARY$string<'RCTLog'>
|
|
26
|
-
| $TEMPORARY$string<'RCTNativeAppEventEmitter'>
|
|
27
|
-
| $TEMPORARY$string<'SamplingProfiler'>
|
|
28
|
-
| $TEMPORARY$string<'Systrace'>,
|
|
19
|
+
moduleName: string,
|
|
29
20
|
/* $FlowFixMe[missing-local-annot] The type annotation(s) required by
|
|
30
21
|
* Flow's LTI update could not be added via codemod */
|
|
31
22
|
factory,
|
|
@@ -10,18 +10,18 @@
|
|
|
10
10
|
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
|
-
import type {Domain} from '../../src/private/
|
|
13
|
+
import type {Domain} from '../../src/private/debugging/setUpFuseboxReactDevToolsDispatcher';
|
|
14
14
|
|
|
15
15
|
if (__DEV__) {
|
|
16
16
|
// Register dispatcher on global, which can be used later by Chrome DevTools frontend
|
|
17
|
-
require('../../src/private/
|
|
17
|
+
require('../../src/private/debugging/setUpFuseboxReactDevToolsDispatcher');
|
|
18
18
|
const {
|
|
19
19
|
initialize,
|
|
20
20
|
connectToDevTools,
|
|
21
21
|
connectWithCustomMessagingProtocol,
|
|
22
22
|
} = require('react-devtools-core');
|
|
23
23
|
|
|
24
|
-
const reactDevToolsSettingsManager = require('../../src/private/
|
|
24
|
+
const reactDevToolsSettingsManager = require('../../src/private/debugging/ReactDevToolsSettingsManager');
|
|
25
25
|
const serializedHookSettings =
|
|
26
26
|
reactDevToolsSettingsManager.getGlobalHookSettings();
|
|
27
27
|
|
|
@@ -29,14 +29,14 @@ if (global.RN$Bridgeless !== true) {
|
|
|
29
29
|
*/
|
|
30
30
|
const defineLazyTimer = (
|
|
31
31
|
name:
|
|
32
|
-
|
|
|
33
|
-
|
|
|
34
|
-
|
|
|
35
|
-
|
|
|
36
|
-
|
|
|
37
|
-
|
|
|
38
|
-
|
|
|
39
|
-
|
|
|
32
|
+
| 'cancelAnimationFrame'
|
|
33
|
+
| 'cancelIdleCallback'
|
|
34
|
+
| 'clearInterval'
|
|
35
|
+
| 'clearTimeout'
|
|
36
|
+
| 'requestAnimationFrame'
|
|
37
|
+
| 'requestIdleCallback'
|
|
38
|
+
| 'setInterval'
|
|
39
|
+
| 'setTimeout',
|
|
40
40
|
) => {
|
|
41
41
|
polyfillGlobal(name, () => require('./Timers/JSTimers')[name]);
|
|
42
42
|
};
|
|
@@ -8,10 +8,7 @@
|
|
|
8
8
|
* @format
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
import type {ViewProps} from '../Components/View/ViewPropTypes';
|
|
14
|
-
import type {HostComponent} from '../Renderer/shims/ReactNativeTypes';
|
|
11
|
+
import type {HostInstance} from '../Renderer/shims/ReactNativeTypes';
|
|
15
12
|
import type {ImageBackgroundProps} from './ImageProps';
|
|
16
13
|
|
|
17
14
|
import View from '../Components/View/View';
|
|
@@ -55,7 +52,7 @@ class ImageBackground extends React.Component<ImageBackgroundProps> {
|
|
|
55
52
|
|
|
56
53
|
_viewRef: ?React.ElementRef<typeof View> = null;
|
|
57
54
|
|
|
58
|
-
_captureRef = (ref: null |
|
|
55
|
+
_captureRef = (ref: null | HostInstance) => {
|
|
59
56
|
this._viewRef = ref;
|
|
60
57
|
};
|
|
61
58
|
|
|
@@ -65,7 +65,7 @@ type AndroidImageProps = $ReadOnly<{|
|
|
|
65
65
|
* dimensions differ from the image view's dimensions. Defaults to `'auto'`.
|
|
66
66
|
* See https://reactnative.dev/docs/image#resizemethod-android
|
|
67
67
|
*/
|
|
68
|
-
resizeMethod?: ?('auto' | 'resize' | 'scale'),
|
|
68
|
+
resizeMethod?: ?('auto' | 'resize' | 'scale' | 'none'),
|
|
69
69
|
|
|
70
70
|
/**
|
|
71
71
|
* When the `resizeMethod` is set to `resize`, the destination dimensions are
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
import type {ViewProps} from '../Components/View/ViewPropTypes';
|
|
12
12
|
import type {
|
|
13
13
|
HostComponent,
|
|
14
|
+
HostInstance,
|
|
14
15
|
PartialViewConfig,
|
|
15
16
|
} from '../Renderer/shims/ReactNativeTypes';
|
|
16
17
|
import type {
|
|
@@ -20,7 +21,6 @@ import type {
|
|
|
20
21
|
} from '../StyleSheet/StyleSheet';
|
|
21
22
|
import type {ResolvedAssetSource} from './AssetSourceResolver';
|
|
22
23
|
import type {ImageProps} from './ImageProps';
|
|
23
|
-
import type {ElementRef} from 'react';
|
|
24
24
|
|
|
25
25
|
import * as NativeComponentRegistry from '../NativeComponent/NativeComponentRegistry';
|
|
26
26
|
import {ConditionallyIgnoredEventHandlers} from '../NativeComponent/ViewConfigIgnore';
|
|
@@ -48,7 +48,7 @@ type Props = $ReadOnly<{
|
|
|
48
48
|
|
|
49
49
|
interface NativeCommands {
|
|
50
50
|
+setIsVisible_EXPERIMENTAL: (
|
|
51
|
-
viewRef:
|
|
51
|
+
viewRef: HostInstance,
|
|
52
52
|
isVisible: boolean,
|
|
53
53
|
time: number,
|
|
54
54
|
) => void;
|
|
@@ -20,7 +20,6 @@ import StyleSheet from '../StyleSheet/StyleSheet';
|
|
|
20
20
|
import ElementBox from './ElementBox';
|
|
21
21
|
import * as React from 'react';
|
|
22
22
|
|
|
23
|
-
const {findNodeHandle} = require('../ReactNative/RendererProxy');
|
|
24
23
|
const getInspectorDataForViewAtPoint = require('./getInspectorDataForViewAtPoint');
|
|
25
24
|
|
|
26
25
|
const {useEffect, useState, useCallback} = React;
|
|
@@ -9,18 +9,16 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import type {
|
|
12
|
-
|
|
12
|
+
HostInstance,
|
|
13
13
|
TouchedViewDataAtPoint,
|
|
14
14
|
} from '../Renderer/shims/ReactNativeTypes';
|
|
15
15
|
|
|
16
16
|
const invariant = require('invariant');
|
|
17
|
-
const React = require('react');
|
|
18
17
|
|
|
19
|
-
export type HostRef = React.ElementRef<HostComponent<mixed>>;
|
|
20
18
|
export type ReactRenderer = {
|
|
21
19
|
rendererConfig: {
|
|
22
20
|
getInspectorDataForViewAtPoint: (
|
|
23
|
-
inspectedView: ?
|
|
21
|
+
inspectedView: ?HostInstance,
|
|
24
22
|
locationX: number,
|
|
25
23
|
locationY: number,
|
|
26
24
|
callback: Function,
|
|
@@ -52,7 +50,7 @@ function validateRenderers(): void {
|
|
|
52
50
|
}
|
|
53
51
|
|
|
54
52
|
module.exports = function getInspectorDataForViewAtPoint(
|
|
55
|
-
inspectedView: ?
|
|
53
|
+
inspectedView: ?HostInstance,
|
|
56
54
|
locationX: number,
|
|
57
55
|
locationY: number,
|
|
58
56
|
callback: (viewData: TouchedViewDataAtPoint) => boolean,
|