react-native 0.71.11 → 0.71.13

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.
@@ -1061,6 +1061,18 @@ const emptyFunctionThatReturnsTrue = () => true;
1061
1061
  *
1062
1062
  */
1063
1063
  function InternalTextInput(props: Props): React.Node {
1064
+ const {
1065
+ 'aria-busy': ariaBusy,
1066
+ 'aria-checked': ariaChecked,
1067
+ 'aria-disabled': ariaDisabled,
1068
+ 'aria-expanded': ariaExpanded,
1069
+ 'aria-selected': ariaSelected,
1070
+ accessibilityState,
1071
+ id,
1072
+ tabIndex,
1073
+ ...otherProps
1074
+ } = props;
1075
+
1064
1076
  const inputRef = useRef<null | React.ElementRef<HostComponent<mixed>>>(null);
1065
1077
 
1066
1078
  // Android sends a "onTextChanged" event followed by a "onSelectionChanged" event, for
@@ -1381,13 +1393,25 @@ function InternalTextInput(props: Props): React.Node {
1381
1393
  // so omitting onBlur and onFocus pressability handlers here.
1382
1394
  const {onBlur, onFocus, ...eventHandlers} = usePressability(config) || {};
1383
1395
 
1384
- const _accessibilityState = {
1385
- busy: props['aria-busy'] ?? props.accessibilityState?.busy,
1386
- checked: props['aria-checked'] ?? props.accessibilityState?.checked,
1387
- disabled: props['aria-disabled'] ?? props.accessibilityState?.disabled,
1388
- expanded: props['aria-expanded'] ?? props.accessibilityState?.expanded,
1389
- selected: props['aria-selected'] ?? props.accessibilityState?.selected,
1390
- };
1396
+ let _accessibilityState;
1397
+ if (
1398
+ accessibilityState != null ||
1399
+ ariaBusy != null ||
1400
+ ariaChecked != null ||
1401
+ ariaDisabled != null ||
1402
+ ariaExpanded != null ||
1403
+ ariaSelected != null
1404
+ ) {
1405
+ _accessibilityState = {
1406
+ busy: ariaBusy ?? accessibilityState?.busy,
1407
+ checked: ariaChecked ?? accessibilityState?.checked,
1408
+ disabled: ariaDisabled ?? accessibilityState?.disabled,
1409
+ expanded: ariaExpanded ?? accessibilityState?.expanded,
1410
+ selected: ariaSelected ?? accessibilityState?.selected,
1411
+ };
1412
+ }
1413
+
1414
+ let style = flattenStyle(props.style);
1391
1415
 
1392
1416
  if (Platform.OS === 'ios') {
1393
1417
  const RCTTextInputView =
@@ -1395,10 +1419,7 @@ function InternalTextInput(props: Props): React.Node {
1395
1419
  ? RCTMultilineTextInputView
1396
1420
  : RCTSinglelineTextInputView;
1397
1421
 
1398
- const style =
1399
- props.multiline === true
1400
- ? StyleSheet.flatten([styles.multilineInput, props.style])
1401
- : props.style;
1422
+ style = props.multiline === true ? [styles.multilineInput, style] : style;
1402
1423
 
1403
1424
  const useOnChangeSync =
1404
1425
  (props.unstable_onChangeSync || props.unstable_onChangeTextSync) &&
@@ -1407,15 +1428,16 @@ function InternalTextInput(props: Props): React.Node {
1407
1428
  textInput = (
1408
1429
  <RCTTextInputView
1409
1430
  ref={_setNativeRef}
1410
- {...props}
1431
+ {...otherProps}
1411
1432
  {...eventHandlers}
1412
- accessible={accessible}
1413
1433
  accessibilityState={_accessibilityState}
1434
+ accessible={accessible}
1414
1435
  submitBehavior={submitBehavior}
1415
1436
  caretHidden={caretHidden}
1416
1437
  dataDetectorTypes={props.dataDetectorTypes}
1417
- focusable={focusable}
1438
+ focusable={tabIndex !== undefined ? !tabIndex : focusable}
1418
1439
  mostRecentEventCount={mostRecentEventCount}
1440
+ nativeID={id ?? props.nativeID}
1419
1441
  onBlur={_onBlur}
1420
1442
  onKeyPressSync={props.unstable_onKeyPressSync}
1421
1443
  onChange={_onChange}
@@ -1431,7 +1453,6 @@ function InternalTextInput(props: Props): React.Node {
1431
1453
  />
1432
1454
  );
1433
1455
  } else if (Platform.OS === 'android') {
1434
- const style = [props.style];
1435
1456
  const autoCapitalize = props.autoCapitalize || 'sentences';
1436
1457
  const _accessibilityLabelledBy =
1437
1458
  props?.['aria-labelledby'] ?? props?.accessibilityLabelledBy;
@@ -1457,18 +1478,19 @@ function InternalTextInput(props: Props): React.Node {
1457
1478
  * fixed */
1458
1479
  <AndroidTextInput
1459
1480
  ref={_setNativeRef}
1460
- {...props}
1481
+ {...otherProps}
1461
1482
  {...eventHandlers}
1462
- accessible={accessible}
1463
1483
  accessibilityState={_accessibilityState}
1464
1484
  accessibilityLabelledBy={_accessibilityLabelledBy}
1485
+ accessible={accessible}
1465
1486
  autoCapitalize={autoCapitalize}
1466
1487
  submitBehavior={submitBehavior}
1467
1488
  caretHidden={caretHidden}
1468
1489
  children={children}
1469
1490
  disableFullscreenUI={props.disableFullscreenUI}
1470
- focusable={focusable}
1491
+ focusable={tabIndex !== undefined ? !tabIndex : focusable}
1471
1492
  mostRecentEventCount={mostRecentEventCount}
1493
+ nativeID={id ?? props.nativeID}
1472
1494
  numberOfLines={props.rows ?? props.numberOfLines}
1473
1495
  onBlur={_onBlur}
1474
1496
  onChange={_onChange}
@@ -1598,11 +1620,12 @@ const ExportedForwardRef: React.AbstractComponent<
1598
1620
  React.ElementRef<HostComponent<mixed>> & ImperativeMethods,
1599
1621
  >,
1600
1622
  ) {
1601
- const style = flattenStyle(restProps.style);
1623
+ let style = flattenStyle(restProps.style);
1602
1624
 
1603
1625
  if (style?.verticalAlign != null) {
1604
1626
  style.textAlignVertical =
1605
1627
  verticalAlignToTextAlignVerticalMap[style.verticalAlign];
1628
+ delete style.verticalAlign;
1606
1629
  }
1607
1630
 
1608
1631
  return (
@@ -1643,6 +1666,8 @@ const ExportedForwardRef: React.AbstractComponent<
1643
1666
  );
1644
1667
  });
1645
1668
 
1669
+ ExportedForwardRef.displayName = 'TextInput';
1670
+
1646
1671
  /**
1647
1672
  * Switch to `deprecated-react-native-prop-types` for compatibility with future
1648
1673
  * releases. This is deprecated and will be removed in the future.
@@ -57,7 +57,6 @@ const View: React.AbstractComponent<
57
57
  nativeID,
58
58
  pointerEvents,
59
59
  role,
60
- style,
61
60
  tabIndex,
62
61
  ...otherProps
63
62
  }: ViewProps,
@@ -66,23 +65,42 @@ const View: React.AbstractComponent<
66
65
  const _accessibilityLabelledBy =
67
66
  ariaLabelledBy?.split(/\s*,\s*/g) ?? accessibilityLabelledBy;
68
67
 
69
- const _accessibilityState = {
70
- busy: ariaBusy ?? accessibilityState?.busy,
71
- checked: ariaChecked ?? accessibilityState?.checked,
72
- disabled: ariaDisabled ?? accessibilityState?.disabled,
73
- expanded: ariaExpanded ?? accessibilityState?.expanded,
74
- selected: ariaSelected ?? accessibilityState?.selected,
75
- };
68
+ let _accessibilityState;
69
+ if (
70
+ accessibilityState != null ||
71
+ ariaBusy != null ||
72
+ ariaChecked != null ||
73
+ ariaDisabled != null ||
74
+ ariaExpanded != null ||
75
+ ariaSelected != null
76
+ ) {
77
+ _accessibilityState = {
78
+ busy: ariaBusy ?? accessibilityState?.busy,
79
+ checked: ariaChecked ?? accessibilityState?.checked,
80
+ disabled: ariaDisabled ?? accessibilityState?.disabled,
81
+ expanded: ariaExpanded ?? accessibilityState?.expanded,
82
+ selected: ariaSelected ?? accessibilityState?.selected,
83
+ };
84
+ }
85
+ let _accessibilityValue;
86
+ if (
87
+ accessibilityValue != null ||
88
+ ariaValueMax != null ||
89
+ ariaValueMin != null ||
90
+ ariaValueNow != null ||
91
+ ariaValueText != null
92
+ ) {
93
+ _accessibilityValue = {
94
+ max: ariaValueMax ?? accessibilityValue?.max,
95
+ min: ariaValueMin ?? accessibilityValue?.min,
96
+ now: ariaValueNow ?? accessibilityValue?.now,
97
+ text: ariaValueText ?? accessibilityValue?.text,
98
+ };
99
+ }
76
100
 
77
- const _accessibilityValue = {
78
- max: ariaValueMax ?? accessibilityValue?.max,
79
- min: ariaValueMin ?? accessibilityValue?.min,
80
- now: ariaValueNow ?? accessibilityValue?.now,
81
- text: ariaValueText ?? accessibilityValue?.text,
82
- };
101
+ let style = flattenStyle(otherProps.style);
83
102
 
84
- const flattenedStyle = flattenStyle(style);
85
- const newPointerEvents = flattenedStyle?.pointerEvents || pointerEvents;
103
+ const newPointerEvents = style?.pointerEvents || pointerEvents;
86
104
 
87
105
  return (
88
106
  <TextAncestor.Provider value={false}>
@@ -12,6 +12,6 @@
12
12
  exports.version = {
13
13
  major: 0,
14
14
  minor: 71,
15
- patch: 11,
15
+ patch: 13,
16
16
  prerelease: null,
17
17
  };
@@ -158,13 +158,13 @@ const BaseImage = (props: ImagePropsType, forwardedRef) => {
158
158
  const {width = props.width, height = props.height, uri} = source;
159
159
  style = flattenStyle([{width, height}, styles.base, props.style]);
160
160
  sources = [source];
161
-
162
161
  if (uri === '') {
163
162
  console.warn('source.uri should not be an empty string');
164
163
  }
165
164
  }
166
165
 
167
166
  const {height, width, ...restProps} = props;
167
+
168
168
  const {onLoadStart, onLoad, onLoadEnd, onError} = props;
169
169
  const nativeProps = {
170
170
  ...restProps,
@@ -14,12 +14,38 @@ import type {LogBoxLogData} from './LogBoxLog';
14
14
  import parseErrorStack from '../../Core/Devtools/parseErrorStack';
15
15
  import UTFSequence from '../../UTFSequence';
16
16
  import stringifySafe from '../../Utilities/stringifySafe';
17
+ import ansiRegex from 'ansi-regex';
18
+
19
+ const ANSI_REGEX = ansiRegex().source;
17
20
 
18
21
  const BABEL_TRANSFORM_ERROR_FORMAT =
19
22
  /^(?:TransformError )?(?:SyntaxError: |ReferenceError: )(.*): (.*) \((\d+):(\d+)\)\n\n([\s\S]+)/;
23
+
24
+ // https://github.com/babel/babel/blob/33dbb85e9e9fe36915273080ecc42aee62ed0ade/packages/babel-code-frame/src/index.ts#L183-L184
25
+ const BABEL_CODE_FRAME_MARKER_PATTERN = new RegExp(
26
+ [
27
+ // Beginning of a line (per 'm' flag)
28
+ '^',
29
+ // Optional ANSI escapes for colors
30
+ `(?:${ANSI_REGEX})*`,
31
+ // Marker
32
+ '>',
33
+ // Optional ANSI escapes for colors
34
+ `(?:${ANSI_REGEX})*`,
35
+ // Left padding for line number
36
+ ' +',
37
+ // Line number
38
+ '[0-9]+',
39
+ // Gutter
40
+ ' \\|',
41
+ ].join(''),
42
+ 'm',
43
+ );
44
+
20
45
  const BABEL_CODE_FRAME_ERROR_FORMAT =
21
46
  // eslint-disable-next-line no-control-regex
22
47
  /^(?:TransformError )?(?:.*):? (?:.*?)(\/.*): ([\s\S]+?)\n([ >]{2}[\d\s]+ \|[\s\S]+|\u{001b}[\s\S]+)/u;
48
+
23
49
  const METRO_ERROR_FORMAT =
24
50
  /^(?:InternalError Metro has encountered an error:) (.*): (.*) \((\d+):(\d+)\)\n\n([\s\S]+)/u;
25
51
 
@@ -241,27 +267,31 @@ export function parseLogBoxException(
241
267
  };
242
268
  }
243
269
 
244
- const babelCodeFrameError = message.match(BABEL_CODE_FRAME_ERROR_FORMAT);
270
+ // Perform a cheap match first before trying to parse the full message, which
271
+ // can get expensive for arbitrary input.
272
+ if (BABEL_CODE_FRAME_MARKER_PATTERN.test(message)) {
273
+ const babelCodeFrameError = message.match(BABEL_CODE_FRAME_ERROR_FORMAT);
245
274
 
246
- if (babelCodeFrameError) {
247
- // Codeframe errors are thrown from any use of buildCodeFrameError.
248
- const [fileName, content, codeFrame] = babelCodeFrameError.slice(1);
249
- return {
250
- level: 'syntax',
251
- stack: [],
252
- isComponentError: false,
253
- componentStack: [],
254
- codeFrame: {
255
- fileName,
256
- location: null, // We are not given the location.
257
- content: codeFrame,
258
- },
259
- message: {
260
- content,
261
- substitutions: [],
262
- },
263
- category: `${fileName}-${1}-${1}`,
264
- };
275
+ if (babelCodeFrameError) {
276
+ // Codeframe errors are thrown from any use of buildCodeFrameError.
277
+ const [fileName, content, codeFrame] = babelCodeFrameError.slice(1);
278
+ return {
279
+ level: 'syntax',
280
+ stack: [],
281
+ isComponentError: false,
282
+ componentStack: [],
283
+ codeFrame: {
284
+ fileName,
285
+ location: null, // We are not given the location.
286
+ content: codeFrame,
287
+ },
288
+ message: {
289
+ content,
290
+ substitutions: [],
291
+ },
292
+ category: `${fileName}-${1}-${1}`,
293
+ };
294
+ }
265
295
  }
266
296
 
267
297
  if (message.match(/^TransformError /)) {
@@ -17,6 +17,8 @@ import {type EventSubscription} from '../vendor/emitter/EventEmitter';
17
17
  import {RootTagContext, createRootTag} from './RootTag';
18
18
  import * as React from 'react';
19
19
 
20
+ const reactDevToolsHook = window.__REACT_DEVTOOLS_GLOBAL_HOOK__;
21
+
20
22
  type Props = $ReadOnly<{|
21
23
  children?: React.Node,
22
24
  fabric?: boolean,
@@ -45,9 +47,17 @@ class AppContainer extends React.Component<Props, State> {
45
47
  };
46
48
  _mainRef: ?React.ElementRef<typeof View>;
47
49
  _subscription: ?EventSubscription = null;
50
+ _reactDevToolsAgentListener: ?() => void = null;
48
51
 
49
52
  static getDerivedStateFromError: any = undefined;
50
53
 
54
+ mountReactDevToolsOverlays(): void {
55
+ const DevtoolsOverlay = require('../Inspector/DevtoolsOverlay').default;
56
+ const devtoolsOverlay = <DevtoolsOverlay inspectedView={this._mainRef} />;
57
+
58
+ this.setState({devtoolsOverlay});
59
+ }
60
+
51
61
  componentDidMount(): void {
52
62
  if (__DEV__) {
53
63
  if (!this.props.internal_excludeInspector) {
@@ -69,13 +79,21 @@ class AppContainer extends React.Component<Props, State> {
69
79
  this.setState({inspector});
70
80
  },
71
81
  );
72
- if (window.__REACT_DEVTOOLS_GLOBAL_HOOK__ != null) {
73
- const DevtoolsOverlay =
74
- require('../Inspector/DevtoolsOverlay').default;
75
- const devtoolsOverlay = (
76
- <DevtoolsOverlay inspectedView={this._mainRef} />
82
+
83
+ if (reactDevToolsHook != null) {
84
+ if (reactDevToolsHook.reactDevtoolsAgent) {
85
+ // In case if this is not the first AppContainer rendered and React DevTools are already attached
86
+ this.mountReactDevToolsOverlays();
87
+ return;
88
+ }
89
+
90
+ this._reactDevToolsAgentListener = () =>
91
+ this.mountReactDevToolsOverlays();
92
+
93
+ reactDevToolsHook.on(
94
+ 'react-devtools',
95
+ this._reactDevToolsAgentListener,
77
96
  );
78
- this.setState({devtoolsOverlay});
79
97
  }
80
98
  }
81
99
  }
@@ -85,6 +103,10 @@ class AppContainer extends React.Component<Props, State> {
85
103
  if (this._subscription != null) {
86
104
  this._subscription.remove();
87
105
  }
106
+
107
+ if (reactDevToolsHook != null && this._reactDevToolsAgentListener != null) {
108
+ reactDevToolsHook.off('react-devtools', this._reactDevToolsAgentListener);
109
+ }
88
110
  }
89
111
 
90
112
  render(): React.Node {
@@ -9,17 +9,16 @@
9
9
  */
10
10
 
11
11
  import type {PressEvent} from '../Types/CoreEventTypes';
12
+ import type {TextProps} from './TextProps';
12
13
 
13
14
  import * as PressabilityDebug from '../Pressability/PressabilityDebug';
14
15
  import usePressability from '../Pressability/usePressability';
15
16
  import flattenStyle from '../StyleSheet/flattenStyle';
16
17
  import processColor from '../StyleSheet/processColor';
17
- import StyleSheet from '../StyleSheet/StyleSheet';
18
18
  import {getAccessibilityRoleFromRole} from '../Utilities/AcessibilityMapping';
19
19
  import Platform from '../Utilities/Platform';
20
20
  import TextAncestor from './TextAncestor';
21
21
  import {NativeText, NativeVirtualText} from './TextNativeComponent';
22
- import {type TextProps} from './TextProps';
23
22
  import * as React from 'react';
24
23
  import {useContext, useMemo, useState} from 'react';
25
24
 
@@ -36,6 +35,7 @@ const Text: React.AbstractComponent<
36
35
  accessible,
37
36
  accessibilityLabel,
38
37
  accessibilityRole,
38
+ accessibilityState,
39
39
  allowFontScaling,
40
40
  'aria-busy': ariaBusy,
41
41
  'aria-checked': ariaChecked,
@@ -64,13 +64,23 @@ const Text: React.AbstractComponent<
64
64
 
65
65
  const [isHighlighted, setHighlighted] = useState(false);
66
66
 
67
- const _accessibilityState = {
68
- busy: ariaBusy ?? props.accessibilityState?.busy,
69
- checked: ariaChecked ?? props.accessibilityState?.checked,
70
- disabled: ariaDisabled ?? props.accessibilityState?.disabled,
71
- expanded: ariaExpanded ?? props.accessibilityState?.expanded,
72
- selected: ariaSelected ?? props.accessibilityState?.selected,
73
- };
67
+ let _accessibilityState;
68
+ if (
69
+ accessibilityState != null ||
70
+ ariaBusy != null ||
71
+ ariaChecked != null ||
72
+ ariaDisabled != null ||
73
+ ariaExpanded != null ||
74
+ ariaSelected != null
75
+ ) {
76
+ _accessibilityState = {
77
+ busy: ariaBusy ?? accessibilityState?.busy,
78
+ checked: ariaChecked ?? accessibilityState?.checked,
79
+ disabled: ariaDisabled ?? accessibilityState?.disabled,
80
+ expanded: ariaExpanded ?? accessibilityState?.expanded,
81
+ selected: ariaSelected ?? accessibilityState?.selected,
82
+ };
83
+ }
74
84
 
75
85
  const _disabled =
76
86
  restProps.disabled != null
@@ -174,25 +184,11 @@ const Text: React.AbstractComponent<
174
184
  ? null
175
185
  : processColor(restProps.selectionColor);
176
186
 
177
- let style = flattenStyle(restProps.style);
178
-
179
- let _selectable = restProps.selectable;
180
- if (style?.userSelect != null) {
181
- _selectable = userSelectToSelectableMap[style.userSelect];
182
- }
183
-
184
- if (style?.verticalAlign != null) {
185
- style = StyleSheet.compose(style, {
186
- textAlignVertical:
187
- verticalAlignToTextAlignVerticalMap[style.verticalAlign],
188
- });
189
- }
187
+ let style = restProps.style;
190
188
 
191
189
  if (__DEV__) {
192
190
  if (PressabilityDebug.isEnabled() && onPress != null) {
193
- style = StyleSheet.compose(restProps.style, {
194
- color: 'magenta',
195
- });
191
+ style = [restProps.style, {color: 'magenta'}];
196
192
  }
197
193
  }
198
194
 
@@ -211,10 +207,22 @@ const Text: React.AbstractComponent<
211
207
  default: accessible,
212
208
  });
213
209
 
214
- let flattenedStyle = flattenStyle(style);
210
+ style = flattenStyle(style);
211
+
212
+ if (typeof style?.fontWeight === 'number') {
213
+ style.fontWeight = style?.fontWeight.toString();
214
+ }
215
+
216
+ let _selectable = restProps.selectable;
217
+ if (style?.userSelect != null) {
218
+ _selectable = userSelectToSelectableMap[style.userSelect];
219
+ delete style.userSelect;
220
+ }
215
221
 
216
- if (typeof flattenedStyle?.fontWeight === 'number') {
217
- flattenedStyle.fontWeight = flattenedStyle?.fontWeight.toString();
222
+ if (style?.verticalAlign != null) {
223
+ style.textAlignVertical =
224
+ verticalAlignToTextAlignVerticalMap[style.verticalAlign];
225
+ delete style.verticalAlign;
218
226
  }
219
227
 
220
228
  const _hasOnPressOrOnLongPress =
@@ -223,46 +231,46 @@ const Text: React.AbstractComponent<
223
231
  return hasTextAncestor ? (
224
232
  <NativeVirtualText
225
233
  {...restProps}
226
- accessibilityState={_accessibilityState}
227
234
  {...eventHandlersForText}
228
235
  accessibilityLabel={ariaLabel ?? accessibilityLabel}
229
236
  accessibilityRole={
230
237
  role ? getAccessibilityRoleFromRole(role) : accessibilityRole
231
238
  }
239
+ accessibilityState={_accessibilityState}
232
240
  isHighlighted={isHighlighted}
233
241
  isPressable={isPressable}
234
- selectable={_selectable}
235
242
  nativeID={id ?? nativeID}
236
243
  numberOfLines={numberOfLines}
237
- selectionColor={selectionColor}
238
- style={flattenedStyle}
239
244
  ref={forwardedRef}
245
+ selectable={_selectable}
246
+ selectionColor={selectionColor}
247
+ style={style}
240
248
  />
241
249
  ) : (
242
250
  <TextAncestor.Provider value={true}>
243
251
  <NativeText
244
252
  {...restProps}
245
253
  {...eventHandlersForText}
246
- disabled={_disabled}
247
- selectable={_selectable}
254
+ accessibilityLabel={ariaLabel ?? accessibilityLabel}
255
+ accessibilityRole={
256
+ role ? getAccessibilityRoleFromRole(role) : accessibilityRole
257
+ }
258
+ accessibilityState={nativeTextAccessibilityState}
248
259
  accessible={
249
260
  accessible == null && Platform.OS === 'android'
250
261
  ? _hasOnPressOrOnLongPress
251
262
  : _accessible
252
263
  }
253
- accessibilityLabel={ariaLabel ?? accessibilityLabel}
254
- accessibilityState={nativeTextAccessibilityState}
255
- accessibilityRole={
256
- role ? getAccessibilityRoleFromRole(role) : accessibilityRole
257
- }
258
264
  allowFontScaling={allowFontScaling !== false}
265
+ disabled={_disabled}
259
266
  ellipsizeMode={ellipsizeMode ?? 'tail'}
260
267
  isHighlighted={isHighlighted}
261
268
  nativeID={id ?? nativeID}
262
269
  numberOfLines={numberOfLines}
263
- selectionColor={selectionColor}
264
- style={flattenedStyle}
265
270
  ref={forwardedRef}
271
+ selectable={_selectable}
272
+ selectionColor={selectionColor}
273
+ style={style}
266
274
  />
267
275
  </TextAncestor.Provider>
268
276
  );
@@ -256,7 +256,7 @@ static void *TextFieldSelectionObservingContext = &TextFieldSelectionObservingCo
256
256
 
257
257
  - (void)textViewDidChange:(__unused UITextView *)textView
258
258
  {
259
- if (_ignoreNextTextInputCall) {
259
+ if (_ignoreNextTextInputCall && [_lastStringStateWasUpdatedWith isEqual:_backedTextInputView.attributedText]) {
260
260
  _ignoreNextTextInputCall = NO;
261
261
  return;
262
262
  }
@@ -101,6 +101,7 @@ RCT_EXTERN void RCTBundleURLProviderAllowPackagerServerAccess(BOOL allowed);
101
101
 
102
102
  @property (nonatomic, assign) BOOL enableMinification;
103
103
  @property (nonatomic, assign) BOOL enableDev;
104
+ @property (nonatomic, assign) BOOL inlineSourceMap;
104
105
 
105
106
  /**
106
107
  * The scheme/protocol used of the packager, the default is the http protocol
@@ -125,13 +126,32 @@ RCT_EXTERN void RCTBundleURLProviderAllowPackagerServerAccess(BOOL allowed);
125
126
  + (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot
126
127
  packagerHost:(NSString *)packagerHost
127
128
  enableDev:(BOOL)enableDev
128
- enableMinification:(BOOL)enableMinification;
129
+ enableMinification:(BOOL)enableMinification
130
+ __deprecated_msg(
131
+ "Use `jsBundleURLForBundleRoot:packagerHost:enableDev:enableMinification:inlineSourceMap:` instead");
132
+
133
+ + (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot
134
+ packagerHost:(NSString *)packagerHost
135
+ packagerScheme:(NSString *)scheme
136
+ enableDev:(BOOL)enableDev
137
+ enableMinification:(BOOL)enableMinification
138
+ modulesOnly:(BOOL)modulesOnly
139
+ runModule:(BOOL)runModule
140
+ __deprecated_msg(
141
+ "Use jsBundleURLForBundleRoot:packagerHost:enableDev:enableMinification:inlineSourceMap:modulesOnly:runModule:` instead");
142
+
143
+ + (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot
144
+ packagerHost:(NSString *)packagerHost
145
+ enableDev:(BOOL)enableDev
146
+ enableMinification:(BOOL)enableMinification
147
+ inlineSourceMap:(BOOL)inlineSourceMap;
129
148
 
130
149
  + (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot
131
150
  packagerHost:(NSString *)packagerHost
132
151
  packagerScheme:(NSString *)scheme
133
152
  enableDev:(BOOL)enableDev
134
153
  enableMinification:(BOOL)enableMinification
154
+ inlineSourceMap:(BOOL)inlineSourceMap
135
155
  modulesOnly:(BOOL)modulesOnly
136
156
  runModule:(BOOL)runModule;
137
157
  /**
@@ -142,6 +162,17 @@ RCT_EXTERN void RCTBundleURLProviderAllowPackagerServerAccess(BOOL allowed);
142
162
  + (NSURL *)resourceURLForResourcePath:(NSString *)path
143
163
  packagerHost:(NSString *)packagerHost
144
164
  scheme:(NSString *)scheme
145
- query:(NSString *)query;
165
+ query:(NSString *)query
166
+ __deprecated_msg("Use version with queryItems parameter instead");
167
+
168
+ /**
169
+ * Given a hostname for the packager and a resource path (including "/"), return the URL to the resource.
170
+ * In general, please use the instance method to decide if the packager is running and fallback to the pre-packaged
171
+ * resource if it is not: -resourceURLForResourceRoot:resourceName:resourceExtension:offlineBundle:
172
+ */
173
+ + (NSURL *)resourceURLForResourcePath:(NSString *)path
174
+ packagerHost:(NSString *)packagerHost
175
+ scheme:(NSString *)scheme
176
+ queryItems:(NSArray<NSURLQueryItem *> *)queryItems;
146
177
 
147
178
  @end
@@ -22,10 +22,12 @@ void RCTBundleURLProviderAllowPackagerServerAccess(BOOL allowed)
22
22
  kRCTAllowPackagerAccess = allowed;
23
23
  }
24
24
  #endif
25
+ static NSString *const kRCTPlatformName = @"ios";
25
26
  static NSString *const kRCTPackagerSchemeKey = @"RCT_packager_scheme";
26
27
  static NSString *const kRCTJsLocationKey = @"RCT_jsLocation";
27
28
  static NSString *const kRCTEnableDevKey = @"RCT_enableDev";
28
29
  static NSString *const kRCTEnableMinificationKey = @"RCT_enableMinification";
30
+ static NSString *const kRCTInlineSourceMapKey = @"RCT_inlineSourceMap";
29
31
 
30
32
  @implementation RCTBundleURLProvider
31
33
 
@@ -183,6 +185,7 @@ static NSURL *serverRootWithHostPort(NSString *hostPort, NSString *scheme)
183
185
  packagerScheme:[self packagerScheme]
184
186
  enableDev:[self enableDev]
185
187
  enableMinification:[self enableMinification]
188
+ inlineSourceMap:[self inlineSourceMap]
186
189
  modulesOnly:NO
187
190
  runModule:YES];
188
191
  }
@@ -195,6 +198,7 @@ static NSURL *serverRootWithHostPort(NSString *hostPort, NSString *scheme)
195
198
  packagerScheme:[self packagerScheme]
196
199
  enableDev:[self enableDev]
197
200
  enableMinification:[self enableMinification]
201
+ inlineSourceMap:[self inlineSourceMap]
198
202
  modulesOnly:YES
199
203
  runModule:NO];
200
204
  }
@@ -234,13 +238,29 @@ static NSURL *serverRootWithHostPort(NSString *hostPort, NSString *scheme)
234
238
  return [[self class] resourceURLForResourcePath:path
235
239
  packagerHost:packagerServerHostPort
236
240
  scheme:packagerServerScheme
237
- query:nil];
241
+ queryItems:nil];
238
242
  }
239
243
 
240
244
  + (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot
241
245
  packagerHost:(NSString *)packagerHost
242
246
  enableDev:(BOOL)enableDev
243
247
  enableMinification:(BOOL)enableMinification
248
+ {
249
+ return [self jsBundleURLForBundleRoot:bundleRoot
250
+ packagerHost:packagerHost
251
+ packagerScheme:nil
252
+ enableDev:enableDev
253
+ enableMinification:enableMinification
254
+ inlineSourceMap:NO
255
+ modulesOnly:NO
256
+ runModule:YES];
257
+ }
258
+
259
+ + (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot
260
+ packagerHost:(NSString *)packagerHost
261
+ enableDev:(BOOL)enableDev
262
+ enableMinification:(BOOL)enableMinification
263
+ inlineSourceMap:(BOOL)inlineSourceMap
244
264
 
245
265
  {
246
266
  return [self jsBundleURLForBundleRoot:bundleRoot
@@ -248,6 +268,7 @@ static NSURL *serverRootWithHostPort(NSString *hostPort, NSString *scheme)
248
268
  packagerScheme:nil
249
269
  enableDev:enableDev
250
270
  enableMinification:enableMinification
271
+ inlineSourceMap:inlineSourceMap
251
272
  modulesOnly:NO
252
273
  runModule:YES];
253
274
  }
@@ -259,27 +280,45 @@ static NSURL *serverRootWithHostPort(NSString *hostPort, NSString *scheme)
259
280
  enableMinification:(BOOL)enableMinification
260
281
  modulesOnly:(BOOL)modulesOnly
261
282
  runModule:(BOOL)runModule
283
+ {
284
+ return [self jsBundleURLForBundleRoot:bundleRoot
285
+ packagerHost:packagerHost
286
+ packagerScheme:nil
287
+ enableDev:enableDev
288
+ enableMinification:enableMinification
289
+ inlineSourceMap:NO
290
+ modulesOnly:modulesOnly
291
+ runModule:runModule];
292
+ }
293
+
294
+ + (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot
295
+ packagerHost:(NSString *)packagerHost
296
+ packagerScheme:(NSString *)scheme
297
+ enableDev:(BOOL)enableDev
298
+ enableMinification:(BOOL)enableMinification
299
+ inlineSourceMap:(BOOL)inlineSourceMap
300
+ modulesOnly:(BOOL)modulesOnly
301
+ runModule:(BOOL)runModule
262
302
  {
263
303
  NSString *path = [NSString stringWithFormat:@"/%@.bundle", bundleRoot];
304
+ BOOL lazy = enableDev;
305
+ NSArray<NSURLQueryItem *> *queryItems = @[
306
+ [[NSURLQueryItem alloc] initWithName:@"platform" value:kRCTPlatformName],
307
+ [[NSURLQueryItem alloc] initWithName:@"dev" value:enableDev ? @"true" : @"false"],
308
+ [[NSURLQueryItem alloc] initWithName:@"minify" value:enableMinification ? @"true" : @"false"],
309
+ [[NSURLQueryItem alloc] initWithName:@"inlineSourceMap" value:inlineSourceMap ? @"true" : @"false"],
310
+ [[NSURLQueryItem alloc] initWithName:@"modulesOnly" value:modulesOnly ? @"true" : @"false"],
311
+ [[NSURLQueryItem alloc] initWithName:@"runModule" value:runModule ? @"true" : @"false"],
264
312
  #ifdef HERMES_BYTECODE_VERSION
265
- NSString *runtimeBytecodeVersion = [NSString stringWithFormat:@"&runtimeBytecodeVersion=%u", HERMES_BYTECODE_VERSION];
266
- #else
267
- NSString *runtimeBytecodeVersion = @"";
313
+ [[NSURLQueryItem alloc] initWithName:@"runtimeBytecodeVersion" value:HERMES_BYTECODE_VERSION],
268
314
  #endif
269
-
270
- // When we support only iOS 8 and above, use queryItems for a better API.
271
- NSString *query = [NSString stringWithFormat:@"platform=ios&dev=%@&minify=%@&modulesOnly=%@&runModule=%@%@",
272
- enableDev ? @"true" : @"false",
273
- enableMinification ? @"true" : @"false",
274
- modulesOnly ? @"true" : @"false",
275
- runModule ? @"true" : @"false",
276
- runtimeBytecodeVersion];
315
+ ];
277
316
 
278
317
  NSString *bundleID = [[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString *)kCFBundleIdentifierKey];
279
318
  if (bundleID) {
280
- query = [NSString stringWithFormat:@"%@&app=%@", query, bundleID];
319
+ queryItems = [queryItems arrayByAddingObject:[[NSURLQueryItem alloc] initWithName:@"app" value:bundleID]];
281
320
  }
282
- return [[self class] resourceURLForResourcePath:path packagerHost:packagerHost scheme:scheme query:query];
321
+ return [[self class] resourceURLForResourcePath:path packagerHost:packagerHost scheme:scheme queryItems:queryItems];
283
322
  }
284
323
 
285
324
  + (NSURL *)resourceURLForResourcePath:(NSString *)path
@@ -296,6 +335,20 @@ static NSURL *serverRootWithHostPort(NSString *hostPort, NSString *scheme)
296
335
  return components.URL;
297
336
  }
298
337
 
338
+ + (NSURL *)resourceURLForResourcePath:(NSString *)path
339
+ packagerHost:(NSString *)packagerHost
340
+ scheme:(NSString *)scheme
341
+ queryItems:(NSArray<NSURLQueryItem *> *)queryItems
342
+ {
343
+ NSURLComponents *components = [NSURLComponents componentsWithURL:serverRootWithHostPort(packagerHost, scheme)
344
+ resolvingAgainstBaseURL:NO];
345
+ components.path = path;
346
+ if (queryItems != nil) {
347
+ components.queryItems = queryItems;
348
+ }
349
+ return components.URL;
350
+ }
351
+
299
352
  - (void)updateValue:(id)object forKey:(NSString *)key
300
353
  {
301
354
  [[NSUserDefaults standardUserDefaults] setObject:object forKey:key];
@@ -313,6 +366,11 @@ static NSURL *serverRootWithHostPort(NSString *hostPort, NSString *scheme)
313
366
  return [[NSUserDefaults standardUserDefaults] boolForKey:kRCTEnableMinificationKey];
314
367
  }
315
368
 
369
+ - (BOOL)inlineSourceMap
370
+ {
371
+ return [[NSUserDefaults standardUserDefaults] boolForKey:kRCTInlineSourceMapKey];
372
+ }
373
+
316
374
  - (NSString *)jsLocation
317
375
  {
318
376
  return [[NSUserDefaults standardUserDefaults] stringForKey:kRCTJsLocationKey];
@@ -342,6 +400,11 @@ static NSURL *serverRootWithHostPort(NSString *hostPort, NSString *scheme)
342
400
  [self updateValue:@(enableMinification) forKey:kRCTEnableMinificationKey];
343
401
  }
344
402
 
403
+ - (void)setInlineSourceMap:(BOOL)inlineSourceMap
404
+ {
405
+ [self updateValue:@(inlineSourceMap) forKey:kRCTInlineSourceMapKey];
406
+ }
407
+
345
408
  - (void)setPackagerScheme:(NSString *)packagerScheme
346
409
  {
347
410
  [self updateValue:packagerScheme forKey:kRCTPackagerSchemeKey];
@@ -23,7 +23,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
23
23
  __rnVersion = @{
24
24
  RCTVersionMajor: @(0),
25
25
  RCTVersionMinor: @(71),
26
- RCTVersionPatch: @(11),
26
+ RCTVersionPatch: @(13),
27
27
  RCTVersionPrerelease: [NSNull null],
28
28
  };
29
29
  });
@@ -1,4 +1,4 @@
1
- VERSION_NAME=0.71.11
1
+ VERSION_NAME=0.71.13
2
2
  GROUP=com.facebook.react
3
3
 
4
4
  # JVM Versions
@@ -20,6 +20,7 @@ import android.content.pm.PackageManager;
20
20
  import android.graphics.Color;
21
21
  import android.graphics.Typeface;
22
22
  import android.hardware.SensorManager;
23
+ import android.os.Build;
23
24
  import android.util.Pair;
24
25
  import android.view.Gravity;
25
26
  import android.view.View;
@@ -1098,7 +1099,7 @@ public abstract class DevSupportManagerBase implements DevSupportManager {
1098
1099
  if (!mIsReceiverRegistered) {
1099
1100
  IntentFilter filter = new IntentFilter();
1100
1101
  filter.addAction(getReloadAppAction(mApplicationContext));
1101
- mApplicationContext.registerReceiver(mReloadAppBroadcastReceiver, filter);
1102
+ compatRegisterReceiver(mApplicationContext, mReloadAppBroadcastReceiver, filter, true);
1102
1103
  mIsReceiverRegistered = true;
1103
1104
  }
1104
1105
 
@@ -1214,4 +1215,21 @@ public abstract class DevSupportManagerBase implements DevSupportManager {
1214
1215
 
1215
1216
  return mSurfaceDelegateFactory.createSurfaceDelegate(moduleName);
1216
1217
  }
1218
+
1219
+ /**
1220
+ * Starting with Android 14, apps and services that target Android 14 and use context-registered
1221
+ * receivers are required to specify a flag to indicate whether or not the receiver should be
1222
+ * exported to all other apps on the device: either RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED
1223
+ *
1224
+ * <p>https://developer.android.com/about/versions/14/behavior-changes-14#runtime-receivers-exported
1225
+ */
1226
+ private void compatRegisterReceiver(
1227
+ Context context, BroadcastReceiver receiver, IntentFilter filter, boolean exported) {
1228
+ if (Build.VERSION.SDK_INT >= 34 && context.getApplicationInfo().targetSdkVersion >= 34) {
1229
+ context.registerReceiver(
1230
+ receiver, filter, exported ? Context.RECEIVER_EXPORTED : Context.RECEIVER_NOT_EXPORTED);
1231
+ } else {
1232
+ context.registerReceiver(receiver, filter);
1233
+ }
1234
+ }
1217
1235
  }
@@ -17,6 +17,6 @@ public class ReactNativeVersion {
17
17
  public static final Map<String, Object> VERSION = MapBuilder.<String, Object>of(
18
18
  "major", 0,
19
19
  "minor", 71,
20
- "patch", 11,
20
+ "patch", 13,
21
21
  "prerelease", null);
22
22
  }
@@ -17,7 +17,7 @@ namespace facebook::react {
17
17
  constexpr struct {
18
18
  int32_t Major = 0;
19
19
  int32_t Minor = 71;
20
- int32_t Patch = 11;
20
+ int32_t Patch = 13;
21
21
  std::string_view Prerelease = "";
22
22
  } ReactNativeVersion;
23
23
 
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @flow strict
3
+ * @format
4
+ */
5
+
6
+ declare module 'ansi-regex' {
7
+ declare export type Options = {
8
+ /**
9
+ * Match only the first ANSI escape.
10
+ */
11
+ +onlyFirst?: boolean,
12
+ };
13
+ declare export default function ansiRegex(options?: Options): RegExp;
14
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native",
3
- "version": "0.71.11",
3
+ "version": "0.71.13",
4
4
  "bin": "./cli.js",
5
5
  "description": "A framework for building native apps using React",
6
6
  "license": "MIT",
@@ -103,7 +103,8 @@
103
103
  "test-typescript": "dtslint types",
104
104
  "test-typescript-offline": "dtslint --localTs node_modules/typescript/lib types",
105
105
  "bump-all-updated-packages": "node ./scripts/monorepo/bump-all-updated-packages",
106
- "align-package-versions": "node ./scripts/monorepo/align-package-versions.js"
106
+ "align-package-versions": "node ./scripts/monorepo/align-package-versions.js",
107
+ "trigger-react-native-release": "node ./scripts/trigger-react-native-release.js"
107
108
  },
108
109
  "peerDependencies": {
109
110
  "react": "18.2.0"
@@ -118,6 +119,7 @@
118
119
  "@react-native/polyfills": "2.0.0",
119
120
  "abort-controller": "^3.0.0",
120
121
  "anser": "^1.4.9",
122
+ "ansi-regex": "^5.0.0",
121
123
  "base64-js": "^1.1.2",
122
124
  "deprecated-react-native-prop-types": "^3.0.1",
123
125
  "event-target-shim": "^5.0.1",
@@ -274,7 +274,7 @@ class CodegenUtils
274
274
  :config_key => config_key
275
275
  )
276
276
  react_codegen_spec = codegen_utils.get_react_codegen_spec(
277
- File.join(react_native_path, "package.json"),
277
+ File.join(relative_installation_root, react_native_path, "package.json"),
278
278
  :folly_version => folly_version,
279
279
  :fabric_enabled => fabric_enabled,
280
280
  :hermes_enabled => hermes_enabled,
Binary file
Binary file
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "react": "18.2.0",
14
- "react-native": "0.71.11"
14
+ "react-native": "0.71.13"
15
15
  },
16
16
  "devDependencies": {
17
17
  "@babel/core": "^7.20.0",