@office-iss/react-native-win32 0.0.0-canary.266 → 0.0.0-canary.267
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.flowconfig +1 -1
- package/CHANGELOG.json +16 -1
- package/CHANGELOG.md +12 -4
- package/Libraries/Animated/animations/Animation.js +4 -1
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.js +3 -1
- package/Libraries/Components/Keyboard/KeyboardAvoidingView.js +17 -0
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js +1 -0
- package/Libraries/Components/Touchable/BoundingDimensions.js +11 -3
- package/Libraries/Components/Touchable/Position.js +7 -2
- package/Libraries/Components/Touchable/Touchable.js +4 -0
- package/Libraries/Components/Touchable/Touchable.win32.js +4 -0
- package/Libraries/Components/View/ReactNativeStyleAttributes.js +1 -1
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Core/setUpReactDevTools.js +33 -7
- package/Libraries/Inspector/NetworkOverlay.js +4 -0
- package/Libraries/Inspector/ReactDevToolsOverlay.js +8 -13
- package/Libraries/Interaction/TouchHistoryMath.js +22 -19
- package/Libraries/LogBox/Data/LogBoxData.js +2 -2
- package/Libraries/NativeComponent/BaseViewConfig.android.js +1 -1
- package/Libraries/NativeComponent/BaseViewConfig.ios.js +1 -1
- package/Libraries/NativeComponent/BaseViewConfig.win32.js +1 -1
- package/Libraries/Network/XHRInterceptor.js +63 -14
- package/Libraries/Renderer/shims/ReactNativeTypes.js +2 -1
- package/Libraries/StyleSheet/StyleSheetTypes.js +1 -1
- package/Libraries/WebSocket/WebSocketEvent.js +4 -1
- package/Libraries/WebSocket/WebSocketInterceptor.js +31 -13
- package/index.js +4 -0
- package/index.win32.js +4 -0
- package/overrides.json +12 -12
- package/package.json +11 -11
- package/src/private/devmenu/DevMenu.d.ts +20 -0
- package/src/private/devmenu/DevMenu.js +31 -0
- package/src/private/featureflags/ReactNativeFeatureFlags.js +22 -11
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +4 -3
- package/src/private/reactdevtools/ReactDevToolsSettingsManager.android.js +20 -0
- package/src/private/reactdevtools/ReactDevToolsSettingsManager.ios.js +30 -0
- package/src/private/reactdevtools/ReactDevToolsSettingsManager.win32.js +20 -0
- package/src/private/specs/components/AndroidHorizontalScrollContentViewNativeComponent.js +1 -0
- package/src/private/specs/modules/{NativeDevToolsSettingsManager.js → NativeReactDevToolsSettingsManager.js} +3 -5
- package/src/private/webapis/performance/EventTiming.js +1 -1
- package/src/private/webapis/performance/Performance.js +3 -21
- package/src/private/webapis/performance/PerformanceObserver.js +68 -155
- package/src/private/webapis/performance/Utilities.js +25 -0
- package/src/private/webapis/performance/specs/NativePerformanceObserver.js +24 -16
- package/src/private/webapis/performance/specs/__mocks__/NativePerformance.js +11 -9
- package/src/private/webapis/performance/specs/__mocks__/NativePerformanceObserver.js +85 -58
- package/types/experimental.d.ts +1 -1
- package/types/index.d.ts +1 -1
- package/types/public/ReactNativeTypes.d.ts +0 -4
- package/Libraries/DevToolsSettings/DevToolsSettingsManager.android.js +0 -35
- package/Libraries/DevToolsSettings/DevToolsSettingsManager.d.ts +0 -20
- package/Libraries/DevToolsSettings/DevToolsSettingsManager.ios.js +0 -49
- package/Libraries/DevToolsSettings/DevToolsSettingsManager.win32.js +0 -35
- package/Libraries/DevToolsSettings/NativeDevToolsSettingsManager.js +0 -13
package/.flowconfig
CHANGED
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,22 @@
|
|
|
2
2
|
"name": "@office-iss/react-native-win32",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Wed, 16 Oct 2024 05:19:58 GMT",
|
|
6
|
+
"version": "0.0.0-canary.267",
|
|
7
|
+
"tag": "@office-iss/react-native-win32_v0.0.0-canary.267",
|
|
8
|
+
"comments": {
|
|
9
|
+
"prerelease": [
|
|
10
|
+
{
|
|
11
|
+
"author": "tatianakapos@microsoft.com",
|
|
12
|
+
"package": "@office-iss/react-native-win32",
|
|
13
|
+
"commit": "e265163b8cab921b5643d552775403b45c01bf6f",
|
|
14
|
+
"comment": "integrate rn nightly 0.77.0-nightly-20241001-223e98cc4"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"date": "Thu, 10 Oct 2024 18:14:30 GMT",
|
|
6
21
|
"version": "0.0.0-canary.266",
|
|
7
22
|
"tag": "@office-iss/react-native-win32_v0.0.0-canary.266",
|
|
8
23
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,17 +1,25 @@
|
|
|
1
1
|
# Change Log - @office-iss/react-native-win32
|
|
2
2
|
|
|
3
|
-
<!-- This log was last generated on
|
|
3
|
+
<!-- This log was last generated on Wed, 16 Oct 2024 05:19:58 GMT and should not be manually modified. -->
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
-
## 0.0.0-canary.
|
|
7
|
+
## 0.0.0-canary.267
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Wed, 16 Oct 2024 05:19:58 GMT
|
|
10
10
|
|
|
11
11
|
### Changes
|
|
12
12
|
|
|
13
|
-
-
|
|
13
|
+
- integrate rn nightly 0.77.0-nightly-20241001-223e98cc4 (tatianakapos@microsoft.com)
|
|
14
14
|
|
|
15
|
+
## 0.0.0-canary.266
|
|
16
|
+
|
|
17
|
+
Thu, 10 Oct 2024 18:14:30 GMT
|
|
18
|
+
|
|
19
|
+
### Changes
|
|
20
|
+
|
|
21
|
+
- Update to @react-native-community/cli@15.0.0-alpha.2 (jthysell@microsoft.com)
|
|
22
|
+
|
|
15
23
|
## 0.0.0-canary.265
|
|
16
24
|
|
|
17
25
|
Mon, 07 Oct 2024 19:54:26 GMT
|
|
@@ -110,7 +110,10 @@ export default class Animation {
|
|
|
110
110
|
if (value != null) {
|
|
111
111
|
animatedValue.__onAnimatedValueUpdateReceived(value);
|
|
112
112
|
|
|
113
|
-
if (
|
|
113
|
+
if (
|
|
114
|
+
ReactNativeFeatureFlags.shouldSkipStateUpdatesForLoopingAnimations() &&
|
|
115
|
+
this.__isLooping
|
|
116
|
+
) {
|
|
114
117
|
return;
|
|
115
118
|
}
|
|
116
119
|
|
|
@@ -5,8 +5,10 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
7
|
* @format
|
|
8
|
+
* @flow strict-local
|
|
8
9
|
*/
|
|
9
10
|
|
|
10
11
|
'use strict';
|
|
11
12
|
|
|
12
|
-
module.exports =
|
|
13
|
+
module.exports =
|
|
14
|
+
require('../UnimplementedViews/UnimplementedView') as $FlowFixMe;
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import type {ViewStyleProp} from '../../StyleSheet/StyleSheet';
|
|
12
|
+
import type {DimensionsPayload} from '../../Utilities/NativeDeviceInfo';
|
|
12
13
|
import type {
|
|
13
14
|
ViewLayout,
|
|
14
15
|
ViewLayoutEvent,
|
|
@@ -18,6 +19,7 @@ import type {KeyboardEvent, KeyboardMetrics} from './Keyboard';
|
|
|
18
19
|
|
|
19
20
|
import LayoutAnimation from '../../LayoutAnimation/LayoutAnimation';
|
|
20
21
|
import StyleSheet from '../../StyleSheet/StyleSheet';
|
|
22
|
+
import Dimensions from '../../Utilities/Dimensions';
|
|
21
23
|
import Platform from '../../Utilities/Platform';
|
|
22
24
|
import {type EventSubscription} from '../../vendor/emitter/EventEmitter';
|
|
23
25
|
import AccessibilityInfo from '../AccessibilityInfo/AccessibilityInfo';
|
|
@@ -66,6 +68,7 @@ class KeyboardAvoidingView extends React.Component<Props, State> {
|
|
|
66
68
|
viewRef: {current: React.ElementRef<typeof View> | null, ...};
|
|
67
69
|
_initialFrameHeight: number = 0;
|
|
68
70
|
_bottom: number = 0;
|
|
71
|
+
_windowWidth: number = Dimensions.get('window').width;
|
|
69
72
|
|
|
70
73
|
constructor(props: Props) {
|
|
71
74
|
super(props);
|
|
@@ -130,6 +133,10 @@ class KeyboardAvoidingView extends React.Component<Props, State> {
|
|
|
130
133
|
}
|
|
131
134
|
};
|
|
132
135
|
|
|
136
|
+
_onDimensionsChange = ({window}: DimensionsPayload) => {
|
|
137
|
+
this._windowWidth = window?.width ?? 0;
|
|
138
|
+
};
|
|
139
|
+
|
|
133
140
|
// Avoid unnecessary renders if the KeyboardAvoidingView is disabled.
|
|
134
141
|
_setBottom = (value: number) => {
|
|
135
142
|
const enabled = this.props.enabled ?? true;
|
|
@@ -145,6 +152,15 @@ class KeyboardAvoidingView extends React.Component<Props, State> {
|
|
|
145
152
|
return;
|
|
146
153
|
}
|
|
147
154
|
|
|
155
|
+
if (
|
|
156
|
+
Platform.OS === 'ios' &&
|
|
157
|
+
this._windowWidth !== this._keyboardEvent.endCoordinates.width
|
|
158
|
+
) {
|
|
159
|
+
// The keyboard is not the standard bottom-of-the-screen keyboard. For example, floating keyboard on iPadOS.
|
|
160
|
+
this._setBottom(0);
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
|
|
148
164
|
const {duration, easing, endCoordinates} = this._keyboardEvent;
|
|
149
165
|
const height = await this._relativeKeyboardHeight(endCoordinates);
|
|
150
166
|
|
|
@@ -178,6 +194,7 @@ class KeyboardAvoidingView extends React.Component<Props, State> {
|
|
|
178
194
|
if (Platform.OS === 'ios') {
|
|
179
195
|
this._subscriptions = [
|
|
180
196
|
Keyboard.addListener('keyboardWillChangeFrame', this._onKeyboardChange),
|
|
197
|
+
Dimensions.addEventListener('change', this._onDimensionsChange),
|
|
181
198
|
];
|
|
182
199
|
} else {
|
|
183
200
|
this._subscriptions = [
|
|
@@ -5,9 +5,11 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
7
|
* @format
|
|
8
|
+
* @flow strict-local
|
|
8
9
|
*/
|
|
9
10
|
|
|
10
11
|
'use strict';
|
|
12
|
+
|
|
11
13
|
import PooledClass from './PooledClass';
|
|
12
14
|
|
|
13
15
|
const twoArgumentPooler = PooledClass.twoArgumentPooler;
|
|
@@ -19,11 +21,14 @@ const twoArgumentPooler = PooledClass.twoArgumentPooler;
|
|
|
19
21
|
* @param {number} height Height of bounding rectangle.
|
|
20
22
|
* @constructor BoundingDimensions
|
|
21
23
|
*/
|
|
22
|
-
|
|
24
|
+
// $FlowFixMe[missing-this-annot]
|
|
25
|
+
function BoundingDimensions(width: number, height: number) {
|
|
23
26
|
this.width = width;
|
|
24
27
|
this.height = height;
|
|
25
28
|
}
|
|
26
29
|
|
|
30
|
+
// $FlowFixMe[prop-missing]
|
|
31
|
+
// $FlowFixMe[missing-this-annot]
|
|
27
32
|
BoundingDimensions.prototype.destructor = function () {
|
|
28
33
|
this.width = null;
|
|
29
34
|
this.height = null;
|
|
@@ -33,13 +38,16 @@ BoundingDimensions.prototype.destructor = function () {
|
|
|
33
38
|
* @param {HTMLElement} element Element to return `BoundingDimensions` for.
|
|
34
39
|
* @return {BoundingDimensions} Bounding dimensions of `element`.
|
|
35
40
|
*/
|
|
36
|
-
BoundingDimensions.getPooledFromElement = function (
|
|
41
|
+
BoundingDimensions.getPooledFromElement = function (
|
|
42
|
+
element: HTMLElement,
|
|
43
|
+
): typeof BoundingDimensions {
|
|
44
|
+
// $FlowFixMe[prop-missing]
|
|
37
45
|
return BoundingDimensions.getPooled(
|
|
38
46
|
element.offsetWidth,
|
|
39
47
|
element.offsetHeight,
|
|
40
48
|
);
|
|
41
49
|
};
|
|
42
50
|
|
|
43
|
-
PooledClass.addPoolingTo(BoundingDimensions, twoArgumentPooler);
|
|
51
|
+
PooledClass.addPoolingTo(BoundingDimensions as $FlowFixMe, twoArgumentPooler);
|
|
44
52
|
|
|
45
53
|
module.exports = BoundingDimensions;
|
|
@@ -5,9 +5,11 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
7
|
* @format
|
|
8
|
+
* @flow strict-local
|
|
8
9
|
*/
|
|
9
10
|
|
|
10
11
|
'use strict';
|
|
12
|
+
|
|
11
13
|
import PooledClass from './PooledClass';
|
|
12
14
|
|
|
13
15
|
const twoArgumentPooler = PooledClass.twoArgumentPooler;
|
|
@@ -20,16 +22,19 @@ const twoArgumentPooler = PooledClass.twoArgumentPooler;
|
|
|
20
22
|
* @param {number} windowStartKey Key that window starts at.
|
|
21
23
|
* @param {number} windowEndKey Key that window ends at.
|
|
22
24
|
*/
|
|
23
|
-
|
|
25
|
+
// $FlowFixMe[missing-this-annot]
|
|
26
|
+
function Position(left: number, top: number) {
|
|
24
27
|
this.left = left;
|
|
25
28
|
this.top = top;
|
|
26
29
|
}
|
|
27
30
|
|
|
31
|
+
// $FlowFixMe[prop-missing]
|
|
32
|
+
// $FlowFixMe[missing-this-annot]
|
|
28
33
|
Position.prototype.destructor = function () {
|
|
29
34
|
this.left = null;
|
|
30
35
|
this.top = null;
|
|
31
36
|
};
|
|
32
37
|
|
|
33
|
-
PooledClass.addPoolingTo(Position, twoArgumentPooler);
|
|
38
|
+
PooledClass.addPoolingTo(Position as $FlowFixMe, twoArgumentPooler);
|
|
34
39
|
|
|
35
40
|
module.exports = Position;
|
|
@@ -713,13 +713,17 @@ const TouchableMixin = {
|
|
|
713
713
|
return;
|
|
714
714
|
}
|
|
715
715
|
this.state.touchable.positionOnActivate &&
|
|
716
|
+
// $FlowFixMe[prop-missing]
|
|
716
717
|
Position.release(this.state.touchable.positionOnActivate);
|
|
717
718
|
this.state.touchable.dimensionsOnActivate &&
|
|
719
|
+
// $FlowFixMe[prop-missing]
|
|
718
720
|
BoundingDimensions.release(this.state.touchable.dimensionsOnActivate);
|
|
721
|
+
// $FlowFixMe[prop-missing]
|
|
719
722
|
this.state.touchable.positionOnActivate = Position.getPooled(
|
|
720
723
|
globalX,
|
|
721
724
|
globalY,
|
|
722
725
|
);
|
|
726
|
+
// $FlowFixMe[prop-missing]
|
|
723
727
|
this.state.touchable.dimensionsOnActivate = BoundingDimensions.getPooled(
|
|
724
728
|
w,
|
|
725
729
|
h,
|
|
@@ -718,13 +718,17 @@ const TouchableMixin = {
|
|
|
718
718
|
return;
|
|
719
719
|
}
|
|
720
720
|
this.state.touchable.positionOnActivate &&
|
|
721
|
+
// $FlowFixMe[prop-missing]
|
|
721
722
|
Position.release(this.state.touchable.positionOnActivate);
|
|
722
723
|
this.state.touchable.dimensionsOnActivate &&
|
|
724
|
+
// $FlowFixMe[prop-missing]
|
|
723
725
|
BoundingDimensions.release(this.state.touchable.dimensionsOnActivate);
|
|
726
|
+
// $FlowFixMe[prop-missing]
|
|
724
727
|
this.state.touchable.positionOnActivate = Position.getPooled(
|
|
725
728
|
globalX,
|
|
726
729
|
globalY,
|
|
727
730
|
);
|
|
731
|
+
// $FlowFixMe[prop-missing]
|
|
728
732
|
this.state.touchable.dimensionsOnActivate = BoundingDimensions.getPooled(
|
|
729
733
|
w,
|
|
730
734
|
h,
|
|
@@ -15,9 +15,30 @@ import type {Domain} from '../../src/private/fusebox/setUpFuseboxReactDevToolsDi
|
|
|
15
15
|
if (__DEV__) {
|
|
16
16
|
// Register dispatcher on global, which can be used later by Chrome DevTools frontend
|
|
17
17
|
require('../../src/private/fusebox/setUpFuseboxReactDevToolsDispatcher');
|
|
18
|
-
|
|
18
|
+
const {
|
|
19
|
+
initialize,
|
|
20
|
+
connectToDevTools,
|
|
21
|
+
connectWithCustomMessagingProtocol,
|
|
22
|
+
} = require('react-devtools-core');
|
|
23
|
+
|
|
24
|
+
const reactDevToolsSettingsManager = require('../../src/private/reactdevtools/ReactDevToolsSettingsManager');
|
|
25
|
+
const serializedHookSettings =
|
|
26
|
+
reactDevToolsSettingsManager.getGlobalHookSettings();
|
|
27
|
+
|
|
28
|
+
let hookSettings = null;
|
|
29
|
+
if (serializedHookSettings != null) {
|
|
30
|
+
try {
|
|
31
|
+
const parsedSettings = JSON.parse(serializedHookSettings);
|
|
32
|
+
hookSettings = parsedSettings;
|
|
33
|
+
} catch {
|
|
34
|
+
console.error(
|
|
35
|
+
'Failed to parse persisted React DevTools hook settings. React DevTools will be initialized with default settings.',
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
19
39
|
// Install hook before React is loaded.
|
|
20
|
-
|
|
40
|
+
initialize(hookSettings);
|
|
41
|
+
|
|
21
42
|
// This should be defined in DEV, otherwise error is expected.
|
|
22
43
|
const fuseboxReactDevToolsDispatcher =
|
|
23
44
|
global.__FUSEBOX_REACT_DEVTOOLS_DISPATCHER__;
|
|
@@ -25,9 +46,14 @@ if (__DEV__) {
|
|
|
25
46
|
fuseboxReactDevToolsDispatcher.BINDING_NAME;
|
|
26
47
|
|
|
27
48
|
const ReactNativeStyleAttributes = require('../Components/View/ReactNativeStyleAttributes');
|
|
28
|
-
const devToolsSettingsManager = require('../DevToolsSettings/DevToolsSettingsManager');
|
|
29
49
|
const resolveRNStyle = require('../StyleSheet/flattenStyle');
|
|
30
50
|
|
|
51
|
+
function handleReactDevToolsSettingsUpdate(settings: Object) {
|
|
52
|
+
reactDevToolsSettingsManager.setGlobalHookSettings(
|
|
53
|
+
JSON.stringify(settings),
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
31
57
|
let disconnect = null;
|
|
32
58
|
function disconnectBackendFromReactDevToolsInFuseboxIfNeeded() {
|
|
33
59
|
if (disconnect != null) {
|
|
@@ -37,7 +63,7 @@ if (__DEV__) {
|
|
|
37
63
|
}
|
|
38
64
|
|
|
39
65
|
function connectToReactDevToolsInFusebox(domain: Domain) {
|
|
40
|
-
disconnect =
|
|
66
|
+
disconnect = connectWithCustomMessagingProtocol({
|
|
41
67
|
onSubscribe: listener => {
|
|
42
68
|
domain.onMessage.addEventListener(listener);
|
|
43
69
|
},
|
|
@@ -47,9 +73,9 @@ if (__DEV__) {
|
|
|
47
73
|
onMessage: (event, payload) => {
|
|
48
74
|
domain.sendMessage({event, payload});
|
|
49
75
|
},
|
|
50
|
-
settingsManager: devToolsSettingsManager,
|
|
51
76
|
nativeStyleEditorValidAttributes: Object.keys(ReactNativeStyleAttributes),
|
|
52
77
|
resolveRNStyle,
|
|
78
|
+
onSettingsUpdated: handleReactDevToolsSettingsUpdate,
|
|
53
79
|
});
|
|
54
80
|
}
|
|
55
81
|
|
|
@@ -101,14 +127,14 @@ if (__DEV__) {
|
|
|
101
127
|
isWebSocketOpen = true;
|
|
102
128
|
});
|
|
103
129
|
|
|
104
|
-
|
|
130
|
+
connectToDevTools({
|
|
105
131
|
isAppActive,
|
|
106
132
|
resolveRNStyle,
|
|
107
133
|
nativeStyleEditorValidAttributes: Object.keys(
|
|
108
134
|
ReactNativeStyleAttributes,
|
|
109
135
|
),
|
|
110
136
|
websocket: ws,
|
|
111
|
-
|
|
137
|
+
onSettingsUpdated: handleReactDevToolsSettingsUpdate,
|
|
112
138
|
});
|
|
113
139
|
}
|
|
114
140
|
}
|
|
@@ -143,6 +143,7 @@ class NetworkOverlay extends React.Component<Props, State> {
|
|
|
143
143
|
});
|
|
144
144
|
|
|
145
145
|
XHRInterceptor.setRequestHeaderCallback((header, value, xhr) => {
|
|
146
|
+
// $FlowFixMe[prop-missing]
|
|
146
147
|
const xhrIndex = this._getRequestIndexByXHRID(xhr._index);
|
|
147
148
|
if (xhrIndex === -1) {
|
|
148
149
|
return;
|
|
@@ -159,6 +160,7 @@ class NetworkOverlay extends React.Component<Props, State> {
|
|
|
159
160
|
});
|
|
160
161
|
|
|
161
162
|
XHRInterceptor.setSendCallback((data, xhr) => {
|
|
163
|
+
// $FlowFixMe[prop-missing]
|
|
162
164
|
const xhrIndex = this._getRequestIndexByXHRID(xhr._index);
|
|
163
165
|
if (xhrIndex === -1) {
|
|
164
166
|
return;
|
|
@@ -173,6 +175,7 @@ class NetworkOverlay extends React.Component<Props, State> {
|
|
|
173
175
|
|
|
174
176
|
XHRInterceptor.setHeaderReceivedCallback(
|
|
175
177
|
(type, size, responseHeaders, xhr) => {
|
|
178
|
+
// $FlowFixMe[prop-missing]
|
|
176
179
|
const xhrIndex = this._getRequestIndexByXHRID(xhr._index);
|
|
177
180
|
if (xhrIndex === -1) {
|
|
178
181
|
return;
|
|
@@ -190,6 +193,7 @@ class NetworkOverlay extends React.Component<Props, State> {
|
|
|
190
193
|
|
|
191
194
|
XHRInterceptor.setResponseCallback(
|
|
192
195
|
(status, timeout, response, responseURL, responseType, xhr) => {
|
|
196
|
+
// $FlowFixMe[prop-missing]
|
|
193
197
|
const xhrIndex = this._getRequestIndexByXHRID(xhr._index);
|
|
194
198
|
if (xhrIndex === -1) {
|
|
195
199
|
return;
|
|
@@ -78,20 +78,15 @@ export default function ReactDevToolsOverlay({
|
|
|
78
78
|
x,
|
|
79
79
|
y,
|
|
80
80
|
viewData => {
|
|
81
|
-
const {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
reactDevToolsAgent.selectNode(findNodeHandle(touchedViewTag));
|
|
86
|
-
if (closestInstance != null) {
|
|
87
|
-
reactDevToolsAgent.selectNode(closestInstance);
|
|
88
|
-
}
|
|
89
|
-
setInspected({
|
|
90
|
-
frame,
|
|
91
|
-
});
|
|
92
|
-
return true;
|
|
81
|
+
const {frame, closestPublicInstance} = viewData;
|
|
82
|
+
|
|
83
|
+
if (closestPublicInstance == null) {
|
|
84
|
+
return false;
|
|
93
85
|
}
|
|
94
|
-
|
|
86
|
+
|
|
87
|
+
reactDevToolsAgent.selectNode(closestPublicInstance);
|
|
88
|
+
setInspected({frame});
|
|
89
|
+
return true;
|
|
95
90
|
},
|
|
96
91
|
);
|
|
97
92
|
},
|
|
@@ -5,8 +5,11 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
7
|
* @format
|
|
8
|
+
* @flow strict-local
|
|
8
9
|
*/
|
|
9
10
|
|
|
11
|
+
// $FlowFixMe[definition-cycle]
|
|
12
|
+
// $FlowFixMe[recursive-definition]
|
|
10
13
|
const TouchHistoryMath = {
|
|
11
14
|
/**
|
|
12
15
|
* This code is optimized and not intended to look beautiful. This allows
|
|
@@ -25,11 +28,11 @@ const TouchHistoryMath = {
|
|
|
25
28
|
* @return {number} value of centroid in specified dimension.
|
|
26
29
|
*/
|
|
27
30
|
centroidDimension: function (
|
|
28
|
-
touchHistory,
|
|
29
|
-
touchesChangedAfter,
|
|
30
|
-
isXAxis,
|
|
31
|
-
ofCurrent,
|
|
32
|
-
) {
|
|
31
|
+
touchHistory: TouchHistoryMath,
|
|
32
|
+
touchesChangedAfter: number,
|
|
33
|
+
isXAxis: boolean,
|
|
34
|
+
ofCurrent: boolean,
|
|
35
|
+
): number {
|
|
33
36
|
const touchBank = touchHistory.touchBank;
|
|
34
37
|
let total = 0;
|
|
35
38
|
let count = 0;
|
|
@@ -82,9 +85,9 @@ const TouchHistoryMath = {
|
|
|
82
85
|
},
|
|
83
86
|
|
|
84
87
|
currentCentroidXOfTouchesChangedAfter: function (
|
|
85
|
-
touchHistory,
|
|
86
|
-
touchesChangedAfter,
|
|
87
|
-
) {
|
|
88
|
+
touchHistory: TouchHistoryMath,
|
|
89
|
+
touchesChangedAfter: number,
|
|
90
|
+
): number {
|
|
88
91
|
return TouchHistoryMath.centroidDimension(
|
|
89
92
|
touchHistory,
|
|
90
93
|
touchesChangedAfter,
|
|
@@ -94,9 +97,9 @@ const TouchHistoryMath = {
|
|
|
94
97
|
},
|
|
95
98
|
|
|
96
99
|
currentCentroidYOfTouchesChangedAfter: function (
|
|
97
|
-
touchHistory,
|
|
98
|
-
touchesChangedAfter,
|
|
99
|
-
) {
|
|
100
|
+
touchHistory: TouchHistoryMath,
|
|
101
|
+
touchesChangedAfter: number,
|
|
102
|
+
): number {
|
|
100
103
|
return TouchHistoryMath.centroidDimension(
|
|
101
104
|
touchHistory,
|
|
102
105
|
touchesChangedAfter,
|
|
@@ -106,9 +109,9 @@ const TouchHistoryMath = {
|
|
|
106
109
|
},
|
|
107
110
|
|
|
108
111
|
previousCentroidXOfTouchesChangedAfter: function (
|
|
109
|
-
touchHistory,
|
|
110
|
-
touchesChangedAfter,
|
|
111
|
-
) {
|
|
112
|
+
touchHistory: TouchHistoryMath,
|
|
113
|
+
touchesChangedAfter: number,
|
|
114
|
+
): number {
|
|
112
115
|
return TouchHistoryMath.centroidDimension(
|
|
113
116
|
touchHistory,
|
|
114
117
|
touchesChangedAfter,
|
|
@@ -118,9 +121,9 @@ const TouchHistoryMath = {
|
|
|
118
121
|
},
|
|
119
122
|
|
|
120
123
|
previousCentroidYOfTouchesChangedAfter: function (
|
|
121
|
-
touchHistory,
|
|
122
|
-
touchesChangedAfter,
|
|
123
|
-
) {
|
|
124
|
+
touchHistory: TouchHistoryMath,
|
|
125
|
+
touchesChangedAfter: number,
|
|
126
|
+
): number {
|
|
124
127
|
return TouchHistoryMath.centroidDimension(
|
|
125
128
|
touchHistory,
|
|
126
129
|
touchesChangedAfter,
|
|
@@ -129,7 +132,7 @@ const TouchHistoryMath = {
|
|
|
129
132
|
);
|
|
130
133
|
},
|
|
131
134
|
|
|
132
|
-
currentCentroidX: function (touchHistory) {
|
|
135
|
+
currentCentroidX: function (touchHistory: TouchHistoryMath): number {
|
|
133
136
|
return TouchHistoryMath.centroidDimension(
|
|
134
137
|
touchHistory,
|
|
135
138
|
0, // touchesChangedAfter
|
|
@@ -138,7 +141,7 @@ const TouchHistoryMath = {
|
|
|
138
141
|
);
|
|
139
142
|
},
|
|
140
143
|
|
|
141
|
-
currentCentroidY: function (touchHistory) {
|
|
144
|
+
currentCentroidY: function (touchHistory: TouchHistoryMath): number {
|
|
142
145
|
return TouchHistoryMath.centroidDimension(
|
|
143
146
|
touchHistory,
|
|
144
147
|
0, // touchesChangedAfter
|
|
@@ -82,9 +82,9 @@ let warningFilter: WarningFilter = function (format) {
|
|
|
82
82
|
return {
|
|
83
83
|
finalFormat: format,
|
|
84
84
|
forceDialogImmediately: false,
|
|
85
|
-
suppressDialog_LEGACY:
|
|
85
|
+
suppressDialog_LEGACY: false,
|
|
86
86
|
suppressCompletely: false,
|
|
87
|
-
monitorEvent: '
|
|
87
|
+
monitorEvent: 'warning_unhandled',
|
|
88
88
|
monitorListVersion: 0,
|
|
89
89
|
monitorSampleRate: 1,
|
|
90
90
|
};
|