@office-iss/react-native-win32 0.0.0-canary.266 → 0.0.0-canary.268

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.
Files changed (60) hide show
  1. package/.flowconfig +1 -1
  2. package/CHANGELOG.json +55 -1
  3. package/CHANGELOG.md +24 -4
  4. package/Libraries/Animated/animations/Animation.js +4 -1
  5. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.win32.js +15 -15
  6. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.js +3 -1
  7. package/Libraries/Components/Keyboard/KeyboardAvoidingView.js +17 -0
  8. package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js +1 -0
  9. package/Libraries/Components/TextInput/TextInput.win32.js +17 -12
  10. package/Libraries/Components/Touchable/BoundingDimensions.js +11 -3
  11. package/Libraries/Components/Touchable/Position.js +7 -2
  12. package/Libraries/Components/Touchable/Touchable.js +4 -0
  13. package/Libraries/Components/Touchable/Touchable.win32.js +6 -2
  14. package/Libraries/Components/View/ReactNativeStyleAttributes.js +1 -1
  15. package/Libraries/Components/View/ViewWin32.js +3 -3
  16. package/Libraries/Core/ReactNativeVersion.js +1 -1
  17. package/Libraries/Core/setUpReactDevTools.js +33 -7
  18. package/Libraries/Inspector/NetworkOverlay.js +4 -0
  19. package/Libraries/Inspector/ReactDevToolsOverlay.js +8 -13
  20. package/Libraries/Interaction/TouchHistoryMath.js +22 -19
  21. package/Libraries/LogBox/Data/LogBoxData.js +2 -2
  22. package/Libraries/NativeComponent/BaseViewConfig.android.js +1 -1
  23. package/Libraries/NativeComponent/BaseViewConfig.ios.js +1 -1
  24. package/Libraries/NativeComponent/BaseViewConfig.win32.js +1 -1
  25. package/Libraries/Network/XHRInterceptor.js +63 -14
  26. package/Libraries/Renderer/shims/ReactNativeTypes.js +2 -1
  27. package/Libraries/StyleSheet/StyleSheetTypes.js +1 -1
  28. package/Libraries/Text/Text.win32.js +11 -7
  29. package/Libraries/Utilities/Platform.win32.js +4 -4
  30. package/Libraries/WebSocket/WebSocketEvent.js +4 -1
  31. package/Libraries/WebSocket/WebSocketInterceptor.js +31 -13
  32. package/index.js +4 -0
  33. package/index.win32.js +4 -0
  34. package/just-task.js +1 -1
  35. package/overrides.json +12 -12
  36. package/package.json +16 -16
  37. package/src/private/devmenu/DevMenu.d.ts +20 -0
  38. package/src/private/devmenu/DevMenu.js +31 -0
  39. package/src/private/featureflags/ReactNativeFeatureFlags.js +22 -11
  40. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +4 -3
  41. package/src/private/reactdevtools/ReactDevToolsSettingsManager.android.js +20 -0
  42. package/src/private/reactdevtools/ReactDevToolsSettingsManager.ios.js +30 -0
  43. package/src/private/reactdevtools/ReactDevToolsSettingsManager.win32.js +20 -0
  44. package/src/private/specs/components/AndroidHorizontalScrollContentViewNativeComponent.js +1 -0
  45. package/src/private/specs/modules/{NativeDevToolsSettingsManager.js → NativeReactDevToolsSettingsManager.js} +3 -5
  46. package/src/private/webapis/performance/EventTiming.js +1 -1
  47. package/src/private/webapis/performance/Performance.js +3 -21
  48. package/src/private/webapis/performance/PerformanceObserver.js +68 -155
  49. package/src/private/webapis/performance/Utilities.js +25 -0
  50. package/src/private/webapis/performance/specs/NativePerformanceObserver.js +24 -16
  51. package/src/private/webapis/performance/specs/__mocks__/NativePerformance.js +11 -9
  52. package/src/private/webapis/performance/specs/__mocks__/NativePerformanceObserver.js +85 -58
  53. package/types/experimental.d.ts +1 -1
  54. package/types/index.d.ts +1 -1
  55. package/types/public/ReactNativeTypes.d.ts +0 -4
  56. package/Libraries/DevToolsSettings/DevToolsSettingsManager.android.js +0 -35
  57. package/Libraries/DevToolsSettings/DevToolsSettingsManager.d.ts +0 -20
  58. package/Libraries/DevToolsSettings/DevToolsSettingsManager.ios.js +0 -49
  59. package/Libraries/DevToolsSettings/DevToolsSettingsManager.win32.js +0 -35
  60. package/Libraries/DevToolsSettings/NativeDevToolsSettingsManager.js +0 -13
package/.flowconfig CHANGED
@@ -160,4 +160,4 @@ untyped-import
160
160
  untyped-type-import
161
161
 
162
162
  [version]
163
- ^0.246.0
163
+ ^0.247.1
package/CHANGELOG.json CHANGED
@@ -2,7 +2,61 @@
2
2
  "name": "@office-iss/react-native-win32",
3
3
  "entries": [
4
4
  {
5
- "date": "Thu, 10 Oct 2024 05:15:29 GMT",
5
+ "date": "Sat, 19 Oct 2024 05:27:56 GMT",
6
+ "version": "0.0.0-canary.268",
7
+ "tag": "@office-iss/react-native-win32_v0.0.0-canary.268",
8
+ "comments": {
9
+ "prerelease": [
10
+ {
11
+ "author": "jthysell@microsoft.com",
12
+ "package": "@office-iss/react-native-win32",
13
+ "commit": "d0c7fa8199238da974905788351a45694fa39e57",
14
+ "comment": "Fix repo linting with prettier"
15
+ },
16
+ {
17
+ "author": "beachball",
18
+ "package": "@office-iss/react-native-win32",
19
+ "comment": "Bump @rnw-scripts/eslint-config to v1.2.30",
20
+ "commit": "not available"
21
+ },
22
+ {
23
+ "author": "beachball",
24
+ "package": "@office-iss/react-native-win32",
25
+ "comment": "Bump @rnw-scripts/jest-out-of-tree-snapshot-resolver to v1.1.34",
26
+ "commit": "not available"
27
+ },
28
+ {
29
+ "author": "beachball",
30
+ "package": "@office-iss/react-native-win32",
31
+ "comment": "Bump @rnw-scripts/just-task to v2.3.47",
32
+ "commit": "not available"
33
+ },
34
+ {
35
+ "author": "beachball",
36
+ "package": "@office-iss/react-native-win32",
37
+ "comment": "Bump react-native-platform-override to v1.9.49",
38
+ "commit": "not available"
39
+ }
40
+ ]
41
+ }
42
+ },
43
+ {
44
+ "date": "Wed, 16 Oct 2024 05:20:54 GMT",
45
+ "version": "0.0.0-canary.267",
46
+ "tag": "@office-iss/react-native-win32_v0.0.0-canary.267",
47
+ "comments": {
48
+ "prerelease": [
49
+ {
50
+ "author": "tatianakapos@microsoft.com",
51
+ "package": "@office-iss/react-native-win32",
52
+ "commit": "e265163b8cab921b5643d552775403b45c01bf6f",
53
+ "comment": "integrate rn nightly 0.77.0-nightly-20241001-223e98cc4"
54
+ }
55
+ ]
56
+ }
57
+ },
58
+ {
59
+ "date": "Thu, 10 Oct 2024 18:14:30 GMT",
6
60
  "version": "0.0.0-canary.266",
7
61
  "tag": "@office-iss/react-native-win32_v0.0.0-canary.266",
8
62
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,17 +1,37 @@
1
1
  # Change Log - @office-iss/react-native-win32
2
2
 
3
- <!-- This log was last generated on Thu, 10 Oct 2024 05:15:29 GMT and should not be manually modified. -->
3
+ <!-- This log was last generated on Sat, 19 Oct 2024 05:27:56 GMT and should not be manually modified. -->
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## 0.0.0-canary.266
7
+ ## 0.0.0-canary.268
8
8
 
9
- Thu, 10 Oct 2024 05:15:29 GMT
9
+ Sat, 19 Oct 2024 05:27:56 GMT
10
10
 
11
11
  ### Changes
12
12
 
13
- - Update to @react-native-community/cli@15.0.0-alpha.2 (jthysell@microsoft.com)
13
+ - Fix repo linting with prettier (jthysell@microsoft.com)
14
+ - Bump @rnw-scripts/eslint-config to v1.2.30
15
+ - Bump @rnw-scripts/jest-out-of-tree-snapshot-resolver to v1.1.34
16
+ - Bump @rnw-scripts/just-task to v2.3.47
17
+ - Bump react-native-platform-override to v1.9.49
14
18
 
19
+ ## 0.0.0-canary.267
20
+
21
+ Wed, 16 Oct 2024 05:20:54 GMT
22
+
23
+ ### Changes
24
+
25
+ - integrate rn nightly 0.77.0-nightly-20241001-223e98cc4 (tatianakapos@microsoft.com)
26
+
27
+ ## 0.0.0-canary.266
28
+
29
+ Thu, 10 Oct 2024 18:14:30 GMT
30
+
31
+ ### Changes
32
+
33
+ - Update to @react-native-community/cli@15.0.0-alpha.2 (jthysell@microsoft.com)
34
+
15
35
  ## 0.0.0-canary.265
16
36
 
17
37
  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 (this.__isLooping) {
113
+ if (
114
+ ReactNativeFeatureFlags.shouldSkipStateUpdatesForLoopingAnimations() &&
115
+ this.__isLooping
116
+ ) {
114
117
  return;
115
118
  }
116
119
 
@@ -56,21 +56,21 @@ const EventNames: Map<
56
56
  ['accessibilityServiceChanged', 'accessibilityServiceDidChange'],
57
57
  ])
58
58
  : Platform.OS === 'win32'
59
- ? new Map([
60
- ['change', 'TOUCH_EXPLORATION_EVENT'],
61
- ['reduceMotionChanged', 'REDUCE_MOTION_EVENT'],
62
- ['screenReaderChanged', 'TOUCH_EXPLORATION_EVENT'],
63
- ])
64
- : new Map([
65
- ['announcementFinished', 'announcementFinished'],
66
- ['boldTextChanged', 'boldTextChanged'],
67
- ['change', 'screenReaderChanged'],
68
- ['grayscaleChanged', 'grayscaleChanged'],
69
- ['invertColorsChanged', 'invertColorsChanged'],
70
- ['reduceMotionChanged', 'reduceMotionChanged'],
71
- ['reduceTransparencyChanged', 'reduceTransparencyChanged'],
72
- ['screenReaderChanged', 'screenReaderChanged'],
73
- ]);
59
+ ? new Map([
60
+ ['change', 'TOUCH_EXPLORATION_EVENT'],
61
+ ['reduceMotionChanged', 'REDUCE_MOTION_EVENT'],
62
+ ['screenReaderChanged', 'TOUCH_EXPLORATION_EVENT'],
63
+ ])
64
+ : new Map([
65
+ ['announcementFinished', 'announcementFinished'],
66
+ ['boldTextChanged', 'boldTextChanged'],
67
+ ['change', 'screenReaderChanged'],
68
+ ['grayscaleChanged', 'grayscaleChanged'],
69
+ ['invertColorsChanged', 'invertColorsChanged'],
70
+ ['reduceMotionChanged', 'reduceMotionChanged'],
71
+ ['reduceTransparencyChanged', 'reduceTransparencyChanged'],
72
+ ['screenReaderChanged', 'screenReaderChanged'],
73
+ ]);
74
74
 
75
75
  /**
76
76
  * Sometimes it's useful to know whether or not the device has a screen reader
@@ -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 = require('../UnimplementedViews/UnimplementedView');
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 = [
@@ -80,6 +80,7 @@ export type ProgressBarAndroidProps = $ReadOnly<{|
80
80
  */
81
81
  const ProgressBarAndroid = (
82
82
  {
83
+ // $FlowFixMe[incompatible-type]
83
84
  styleAttr = 'Normal',
84
85
  indeterminate = true,
85
86
  animating = true,
@@ -1344,14 +1344,15 @@ function InternalTextInput(props: Props): React.Node {
1344
1344
  typeof props.value === 'string'
1345
1345
  ? props.value
1346
1346
  : typeof props.defaultValue === 'string'
1347
- ? props.defaultValue
1348
- : '';
1347
+ ? props.defaultValue
1348
+ : '';
1349
1349
 
1350
1350
  const viewCommands =
1351
- WindowsTextInputCommands || AndroidTextInputCommands || // [Windows]
1351
+ WindowsTextInputCommands || // [Windows]
1352
+ AndroidTextInputCommands ||
1352
1353
  (props.multiline === true
1353
1354
  ? RCTMultilineTextInputNativeCommands
1354
- : RCTSinglelineTextInputNativeCommands)
1355
+ : RCTSinglelineTextInputNativeCommands);
1355
1356
 
1356
1357
  const [mostRecentEventCount, setMostRecentEventCount] = useState<number>(0);
1357
1358
  const useTextInputStateSynchronization =
@@ -1425,8 +1426,12 @@ function InternalTextInput(props: Props): React.Node {
1425
1426
  }
1426
1427
  },
1427
1428
  isFocused(): boolean {
1428
- const currentlyFocusedInput = TextInputState.currentlyFocusedInput();
1429
- return currentlyFocusedInput !== null && currentlyFocusedInput === inputRef.current;
1429
+ const currentlyFocusedInput =
1430
+ TextInputState.currentlyFocusedInput();
1431
+ return (
1432
+ currentlyFocusedInput !== null &&
1433
+ currentlyFocusedInput === inputRef.current
1434
+ );
1430
1435
  },
1431
1436
  getNativeRef(): ?React.ElementRef<HostComponent<mixed>> {
1432
1437
  return inputRef.current;
@@ -1970,12 +1975,12 @@ const ExportedForwardRef: React.AbstractComponent<
1970
1975
  textContentType != null
1971
1976
  ? textContentType
1972
1977
  : Platform.OS === 'ios' &&
1973
- autoComplete &&
1974
- autoComplete in autoCompleteWebToTextContentTypeMap
1975
- ? // $FlowFixMe[invalid-computed-prop]
1976
- // $FlowFixMe[prop-missing]
1977
- autoCompleteWebToTextContentTypeMap[autoComplete]
1978
- : textContentType
1978
+ autoComplete &&
1979
+ autoComplete in autoCompleteWebToTextContentTypeMap
1980
+ ? // $FlowFixMe[invalid-computed-prop]
1981
+ // $FlowFixMe[prop-missing]
1982
+ autoCompleteWebToTextContentTypeMap[autoComplete]
1983
+ : textContentType
1979
1984
  }
1980
1985
  {...restProps}
1981
1986
  forwardedRef={forwardedRef}
@@ -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
- function BoundingDimensions(width, height) {
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 (element) {
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
- function Position(left, top) {
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,
@@ -45,8 +45,8 @@ const extractSingleTouch = (nativeEvent: {
45
45
  return !hasTouches && hasChangedTouches
46
46
  ? changedTouches[0]
47
47
  : hasTouches
48
- ? touches[0]
49
- : nativeEvent;
48
+ ? touches[0]
49
+ : nativeEvent;
50
50
  };
51
51
 
52
52
  /**
@@ -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,
@@ -125,7 +125,7 @@ const ReactNativeStyleAttributes: {[string]: AnyAttributeType, ...} = {
125
125
  /**
126
126
  * MixBlendMode
127
127
  */
128
- experimental_mixBlendMode: true,
128
+ mixBlendMode: true,
129
129
 
130
130
  /**
131
131
  * Isolation
@@ -113,9 +113,9 @@ const ViewWin32: React.AbstractComponent<
113
113
  ? // $FlowFixMe[exponential-spread]
114
114
  {accessibilityDescribedBy: describedByTarget}
115
115
  : // $FlowFixMe[exponential-spread]
116
- typeof accessibilityDescribedBy === 'string'
117
- ? {accessibilityDescribedBy}
118
- : {})}
116
+ typeof accessibilityDescribedBy === 'string'
117
+ ? {accessibilityDescribedBy}
118
+ : {})}
119
119
  {...(typeof accessibilityControls === 'string'
120
120
  ? {accessibilityControls}
121
121
  : {})}
@@ -17,7 +17,7 @@ const version: $ReadOnly<{
17
17
  major: 0,
18
18
  minor: 77,
19
19
  patch: 0,
20
- prerelease: 'nightly-20240921-1747f57c6',
20
+ prerelease: 'nightly-20241001-223e98cc4',
21
21
  };
22
22
 
23
23
  module.exports = {version};
@@ -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
- const reactDevTools = require('react-devtools-core');
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 = reactDevTools.connectWithCustomMessagingProtocol({
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
- reactDevTools.connectToDevTools({
130
+ connectToDevTools({
105
131
  isAppActive,
106
132
  resolveRNStyle,
107
133
  nativeStyleEditorValidAttributes: Object.keys(
108
134
  ReactNativeStyleAttributes,
109
135
  ),
110
136
  websocket: ws,
111
- devToolsSettingsManager,
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 {touchedViewTag, closestInstance, frame} = viewData;
82
- if (closestInstance != null || touchedViewTag != null) {
83
- // We call `selectNode` for both non-fabric(viewTag) and fabric(instance),
84
- // this makes sure it works for both architectures.
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
- return false;
86
+
87
+ reactDevToolsAgent.selectNode(closestPublicInstance);
88
+ setInspected({frame});
89
+ return true;
95
90
  },
96
91
  );
97
92
  },