@office-iss/react-native-win32 0.0.0-canary.274 → 0.0.0-canary.276

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 (96) hide show
  1. package/.flowconfig +5 -1
  2. package/CHANGELOG.json +31 -1
  3. package/CHANGELOG.md +20 -4
  4. package/Libraries/ActionSheetIOS/ActionSheetIOS.d.ts +1 -0
  5. package/Libraries/ActionSheetIOS/ActionSheetIOS.js +13 -0
  6. package/Libraries/Animated/animations/Animation.js +1 -5
  7. package/Libraries/Animated/components/AnimatedFlatList.js +1 -1
  8. package/Libraries/Animated/components/AnimatedSectionList.js +3 -1
  9. package/Libraries/Animated/useAnimatedProps.js +2 -14
  10. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +16 -2
  11. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.win32.js +21 -2
  12. package/Libraries/Components/Keyboard/KeyboardAvoidingView.js +2 -0
  13. package/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js +0 -1
  14. package/Libraries/Components/ScrollView/ScrollView.js +35 -74
  15. package/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +0 -2
  16. package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +0 -1
  17. package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +1 -0
  18. package/Libraries/Components/TextInput/TextInput.flow.js +6 -0
  19. package/Libraries/Components/TextInput/TextInput.js +7 -1
  20. package/Libraries/Components/TextInput/TextInput.win32.js +7 -1
  21. package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +1 -2
  22. package/Libraries/Components/View/ViewPropTypes.d.ts +7 -0
  23. package/Libraries/Components/View/ViewPropTypes.js +0 -3
  24. package/Libraries/Components/View/ViewPropTypes.win32.js +0 -3
  25. package/Libraries/Core/ExceptionsManager.js +7 -4
  26. package/Libraries/Core/ReactNativeVersion.js +1 -1
  27. package/Libraries/Core/setUpErrorHandling.js +20 -18
  28. package/Libraries/Core/setUpTimers.js +4 -12
  29. package/Libraries/Image/Image.android.js +0 -2
  30. package/Libraries/Image/Image.d.ts +2 -0
  31. package/Libraries/Image/ImageProps.js +2 -1
  32. package/Libraries/Image/ImageResizeMode.d.ts +8 -1
  33. package/Libraries/Image/ImageResizeMode.js +4 -1
  34. package/Libraries/Image/ImageSource.d.ts +0 -2
  35. package/Libraries/Image/ImageSource.js +0 -2
  36. package/Libraries/Image/ImageUtils.js +6 -3
  37. package/Libraries/Image/ImageViewNativeComponent.js +3 -1
  38. package/Libraries/Inspector/Inspector.win32.js +1 -1
  39. package/Libraries/Interaction/InteractionManager.js +6 -1
  40. package/Libraries/Interaction/InteractionManagerStub.js +176 -0
  41. package/Libraries/Lists/FlatList.js +2 -2
  42. package/Libraries/LogBox/LogBox.js +1 -1
  43. package/Libraries/LogBox/UI/AnsiHighlight.js +26 -17
  44. package/Libraries/LogBox/UI/LogBoxInspectorCodeFrame.js +6 -1
  45. package/Libraries/LogBox/UI/LogBoxInspectorCodeFrame.win32.js +6 -1
  46. package/Libraries/Modal/Modal.d.ts +5 -0
  47. package/Libraries/Modal/Modal.js +17 -0
  48. package/Libraries/NewAppScreen/components/HermesBadge.js +1 -1
  49. package/Libraries/PermissionsAndroid/PermissionsAndroid.d.ts +49 -2
  50. package/Libraries/Pressability/usePressability.js +4 -1
  51. package/Libraries/ReactNative/AppRegistry.js +0 -6
  52. package/Libraries/ReactNative/RendererImplementation.js +12 -12
  53. package/Libraries/ReactNative/renderApplication.js +3 -4
  54. package/Libraries/ReactNative/requireNativeComponent.js +2 -1
  55. package/Libraries/Renderer/implementations/ReactFabric-dev.js +26149 -15434
  56. package/Libraries/Renderer/implementations/ReactFabric-prod.js +1630 -2675
  57. package/Libraries/Renderer/implementations/ReactFabric-profiling.js +1691 -2954
  58. package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +27069 -16192
  59. package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +1657 -2714
  60. package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +1733 -2980
  61. package/Libraries/Renderer/shims/ReactFabric.js +3 -3
  62. package/Libraries/Renderer/shims/ReactFeatureFlags.js +2 -2
  63. package/Libraries/Renderer/shims/ReactNative.js +3 -3
  64. package/Libraries/Renderer/shims/createReactNativeComponentClass.js +2 -2
  65. package/Libraries/StyleSheet/StyleSheetTypes.d.ts +7 -1
  66. package/Libraries/StyleSheet/StyleSheetTypes.js +5 -4
  67. package/Libraries/StyleSheet/processBackgroundImage.js +87 -110
  68. package/Libraries/TurboModule/TurboModuleRegistry.js +5 -5
  69. package/Libraries/Utilities/Appearance.js +3 -1
  70. package/Libraries/Utilities/BackHandler.android.js +6 -18
  71. package/Libraries/Utilities/BackHandler.d.ts +0 -4
  72. package/Libraries/Utilities/BackHandler.ios.js +0 -7
  73. package/Libraries/Utilities/BackHandler.win32.js +6 -18
  74. package/Libraries/Utilities/__mocks__/BackHandler.js +3 -8
  75. package/jest/setup.js +5 -1
  76. package/overrides.json +9 -9
  77. package/package.json +14 -14
  78. package/src/private/components/HScrollViewNativeComponents.js +1 -26
  79. package/src/private/components/VScrollViewNativeComponents.js +2 -24
  80. package/src/private/featureflags/ReactNativeFeatureFlags.js +24 -55
  81. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +2 -7
  82. package/src/private/setup/setUpDOM.js +14 -6
  83. package/src/private/setup/setUpMutationObserver.js +5 -0
  84. package/src/private/specs/components/RCTModalHostViewNativeComponent.js +8 -0
  85. package/src/private/specs/modules/NativeAccessibilityInfo.js +6 -0
  86. package/src/private/specs/modules/NativeAccessibilityInfoWin32.js +6 -0
  87. package/src/private/specs/modules/NativeActionSheetManager.js +2 -0
  88. package/src/private/webapis/intersectionobserver/IntersectionObserver.js +96 -11
  89. package/src/private/webapis/intersectionobserver/IntersectionObserverEntry.js +26 -0
  90. package/src/private/webapis/intersectionobserver/IntersectionObserverManager.js +1 -0
  91. package/src/private/webapis/intersectionobserver/specs/NativeIntersectionObserver.js +1 -0
  92. package/src/private/webapis/intersectionobserver/specs/__mocks__/NativeIntersectionObserver.js +9 -0
  93. package/src-win/Libraries/Components/View/ViewPropTypes.d.ts +7 -0
  94. package/Libraries/ReactNative/ReactFabricInternals.js +0 -17
  95. package/src/private/components/useSyncOnScroll.js +0 -48
  96. package/types/experimental.d.ts +0 -59
@@ -121,6 +121,12 @@ function reportException(
121
121
  const NativeExceptionsManager =
122
122
  require('./NativeExceptionsManager').default;
123
123
  if (NativeExceptionsManager) {
124
+ if (isFatal) {
125
+ if (global.RN$hasHandledFatalException?.()) {
126
+ return;
127
+ }
128
+ global.RN$notifyOfFatalException?.();
129
+ }
124
130
  NativeExceptionsManager.reportException(data);
125
131
  }
126
132
  }
@@ -177,10 +183,7 @@ function reactConsoleErrorHandler(...args) {
177
183
  if (!console.reportErrorsAsExceptions) {
178
184
  return;
179
185
  }
180
- if (
181
- inExceptionHandler ||
182
- (global.RN$inExceptionHandler && global.RN$inExceptionHandler())
183
- ) {
186
+ if (inExceptionHandler || global.RN$inExceptionHandler?.()) {
184
187
  // The fundamental trick here is that are multiple entry point to logging errors:
185
188
  // (see D19743075 for more background)
186
189
  //
@@ -17,7 +17,7 @@ const version: $ReadOnly<{
17
17
  major: 0,
18
18
  minor: 77,
19
19
  patch: 0,
20
- prerelease: 'nightly-20241031-3a01a0c9c',
20
+ prerelease: 'nightly-20241125-4cffff35e',
21
21
  };
22
22
 
23
23
  module.exports = {version};
@@ -10,24 +10,26 @@
10
10
 
11
11
  'use strict';
12
12
 
13
- /**
14
- * Sets up the console and exception handling (redbox) for React Native.
15
- * You can use this module directly, or just require InitializeCore.
16
- */
17
- const ExceptionsManager = require('./ExceptionsManager');
18
- ExceptionsManager.installConsoleErrorReporter();
13
+ if (global.RN$useAlwaysAvailableJSErrorHandling !== true) {
14
+ /**
15
+ * Sets up the console and exception handling (redbox) for React Native.
16
+ * You can use this module directly, or just require InitializeCore.
17
+ */
18
+ const ExceptionsManager = require('./ExceptionsManager');
19
+ ExceptionsManager.installConsoleErrorReporter();
19
20
 
20
- // Set up error handler
21
- if (!global.__fbDisableExceptionsManager) {
22
- const handleError = (e: mixed, isFatal: boolean) => {
23
- try {
24
- ExceptionsManager.handleException(e, isFatal);
25
- } catch (ee) {
26
- console.log('Failed to print error: ', ee.message);
27
- throw e;
28
- }
29
- };
21
+ // Set up error handler
22
+ if (!global.__fbDisableExceptionsManager) {
23
+ const handleError = (e: mixed, isFatal: boolean) => {
24
+ try {
25
+ ExceptionsManager.handleException(e, isFatal);
26
+ } catch (ee) {
27
+ console.log('Failed to print error: ', ee.message);
28
+ throw e;
29
+ }
30
+ };
30
31
 
31
- const ErrorUtils = require('../vendor/core/ErrorUtils');
32
- ErrorUtils.setGlobalHandler(handleError);
32
+ const ErrorUtils = require('../vendor/core/ErrorUtils');
33
+ ErrorUtils.setGlobalHandler(handleError);
34
+ }
33
35
  }
@@ -26,18 +26,10 @@ const isEventLoopEnabled = (() => {
26
26
  return false;
27
27
  }
28
28
 
29
- if (NativeReactNativeFeatureFlags.disableEventLoopOnBridgeless == null) {
30
- // Flags not unified yet
31
- return (
32
- ReactNativeFeatureFlags.useModernRuntimeScheduler() &&
33
- ReactNativeFeatureFlags.enableMicrotasks()
34
- );
35
- } else {
36
- return (
37
- ReactNativeFeatureFlags.enableBridgelessArchitecture() &&
38
- !ReactNativeFeatureFlags.disableEventLoopOnBridgeless()
39
- );
40
- }
29
+ return (
30
+ ReactNativeFeatureFlags.enableBridgelessArchitecture() &&
31
+ !ReactNativeFeatureFlags.disableEventLoopOnBridgeless()
32
+ );
41
33
  })();
42
34
 
43
35
  // In bridgeless mode, timers are host functions installed from cpp.
@@ -133,7 +133,6 @@ let BaseImage: AbstractImageAndroid = React.forwardRef(
133
133
  width: undefined,
134
134
  height: undefined,
135
135
  };
136
- const defaultSource = resolveAssetSource(props.defaultSource);
137
136
  const loadingIndicatorSource = resolveAssetSource(
138
137
  props.loadingIndicatorSource,
139
138
  );
@@ -179,7 +178,6 @@ let BaseImage: AbstractImageAndroid = React.forwardRef(
179
178
  /* $FlowFixMe(>=0.78.0 site=react_native_android_fb) This issue was found
180
179
  * when making Flow check .android.js files. */
181
180
  headers: (source?.[0]?.headers || source?.headers: ?{[string]: string}),
182
- defaultSrc: defaultSource ? defaultSource.uri : null,
183
181
  loadingIndicatorSrc: loadingIndicatorSource
184
182
  ? loadingIndicatorSource.uri
185
183
  : null,
@@ -200,6 +200,8 @@ export interface ImagePropsBase
200
200
  * 'center': Scale the image down so that it is completely visible,
201
201
  * if bigger than the area of the view.
202
202
  * The image will not be scaled up.
203
+ *
204
+ * 'none': Do not resize the image. The image will be displayed at its intrinsic size.
203
205
  */
204
206
  resizeMode?: ImageResizeMode | undefined;
205
207
 
@@ -19,6 +19,7 @@ import type {
19
19
  } from '../StyleSheet/StyleSheet';
20
20
  import type {LayoutEvent, SyntheticEvent} from '../Types/CoreEventTypes';
21
21
  import typeof Image from './Image';
22
+ import type {ImageResizeMode} from './ImageResizeMode';
22
23
  import type {ImageSource} from './ImageSource';
23
24
  import type {ElementRef, Node, RefSetter} from 'react';
24
25
 
@@ -234,7 +235,7 @@ export type ImageProps = $ReadOnly<{|
234
235
  *
235
236
  * See https://reactnative.dev/docs/image#resizemode
236
237
  */
237
- resizeMode?: ?('cover' | 'contain' | 'stretch' | 'repeat' | 'center'),
238
+ resizeMode?: ?ImageResizeMode,
238
239
 
239
240
  /**
240
241
  * A unique identifier for this element to be used in UI Automation
@@ -12,7 +12,8 @@ export type ImageResizeMode =
12
12
  | 'contain'
13
13
  | 'stretch'
14
14
  | 'repeat'
15
- | 'center';
15
+ | 'center'
16
+ | 'none';
16
17
 
17
18
  /**
18
19
  * @see ImageResizeMode.js
@@ -46,4 +47,10 @@ export interface ImageResizeModeStatic {
46
47
  * image will keep it's size and aspect ratio.
47
48
  */
48
49
  repeat: ImageResizeMode;
50
+
51
+ /**
52
+ * none - The image will be displayed at its intrinsic size, which means the
53
+ * image will not be scaled up or down.
54
+ */
55
+ none: ImageResizeMode;
49
56
  }
@@ -33,4 +33,7 @@ export type ImageResizeMode =
33
33
 
34
34
  // Resize by stretching it to fill the entire frame of the view without
35
35
  // clipping. This may change the aspect ratio of the image, distorting it.
36
- | 'stretch';
36
+ | 'stretch'
37
+
38
+ // The image will not be resized at all.
39
+ | 'none';
@@ -50,8 +50,6 @@ export interface ImageURISource {
50
50
  * its age or expiration date. If there is no existing data in the cache corresponding
51
51
  * to a URL load request, no attempt is made to load the data from the originating source,
52
52
  * and the load is considered to have failed.
53
- *
54
- * @platform ios
55
53
  */
56
54
  cache?: 'default' | 'reload' | 'force-cache' | 'only-if-cached' | undefined;
57
55
  /**
@@ -65,8 +65,6 @@ export interface ImageURISource {
65
65
  * its age or expiration date. If there is no existing data in the cache corresponding
66
66
  * to a URL load request, no attempt is made to load the data from the originating source,
67
67
  * and the load is considered to have failed.
68
- *
69
- * @platform ios
70
68
  */
71
69
  +cache?: ?('default' | 'reload' | 'force-cache' | 'only-if-cached');
72
70
 
@@ -8,15 +8,18 @@
8
8
  * @format
9
9
  */
10
10
 
11
- type ResizeMode = 'cover' | 'contain' | 'stretch' | 'repeat' | 'center';
11
+ import type {ImageResizeMode} from './ImageResizeMode';
12
12
 
13
- const objectFitMap: {[string]: ResizeMode} = {
13
+ const objectFitMap: {[string]: ImageResizeMode} = {
14
14
  contain: 'contain',
15
15
  cover: 'cover',
16
16
  fill: 'stretch',
17
17
  'scale-down': 'contain',
18
+ none: 'none',
18
19
  };
19
20
 
20
- export function convertObjectFitToResizeMode(objectFit: ?string): ?ResizeMode {
21
+ export function convertObjectFitToResizeMode(
22
+ objectFit: ?string,
23
+ ): ?ImageResizeMode {
21
24
  return objectFit != null ? objectFitMap[objectFit] : undefined;
22
25
  }
@@ -82,6 +82,9 @@ export const __INTERNAL_VIEW_CONFIG: PartialViewConfig =
82
82
  },
83
83
  validAttributes: {
84
84
  blurRadius: true,
85
+ defaultSource: {
86
+ process: require('./resolveAssetSource'),
87
+ },
85
88
  internal_analyticTag: true,
86
89
  resizeMethod: true,
87
90
  resizeMode: true,
@@ -100,7 +103,6 @@ export const __INTERNAL_VIEW_CONFIG: PartialViewConfig =
100
103
  borderRadius: true,
101
104
  headers: true,
102
105
  shouldNotifyLoadEvents: true,
103
- defaultSrc: true,
104
106
  overlayColor: {
105
107
  process: require('../StyleSheet/processColor').default,
106
108
  },
@@ -21,7 +21,7 @@ import type {ReactDevToolsAgent} from '../Types/ReactDevToolsTypes';
21
21
  import SafeAreaView from '../../src/private/components/SafeAreaView_INTERNAL_DO_NOT_USE';
22
22
 
23
23
  const PressabilityDebug = require('../Pressability/PressabilityDebug');
24
- const ReactNative = require('../Renderer/shims/ReactNative');
24
+ const ReactNative = require('../Renderer/shims/ReactNative').default;
25
25
  const {findNodeHandle} = require('../ReactNative/RendererProxy');
26
26
  const StyleSheet = require('../StyleSheet/StyleSheet');
27
27
  const Platform = require('../Utilities/Platform');
@@ -10,6 +10,7 @@
10
10
 
11
11
  import type {Task} from './TaskQueue';
12
12
 
13
+ import * as ReactNativeFeatureFlags from '../../src/private/featureflags/ReactNativeFeatureFlags';
13
14
  import EventEmitter from '../vendor/emitter/EventEmitter';
14
15
 
15
16
  const BatchedBridge = require('../BatchedBridge/BatchedBridge');
@@ -208,4 +209,8 @@ function _processUpdate() {
208
209
  _deleteInteractionSet.clear();
209
210
  }
210
211
 
211
- module.exports = InteractionManager;
212
+ module.exports = (
213
+ ReactNativeFeatureFlags.disableInteractionManager()
214
+ ? require('./InteractionManagerStub')
215
+ : InteractionManager
216
+ ) as typeof InteractionManager;
@@ -0,0 +1,176 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @flow strict
8
+ * @format
9
+ */
10
+
11
+ import type {EventSubscription} from '../vendor/emitter/EventEmitter';
12
+
13
+ const invariant = require('invariant');
14
+
15
+ export type Handle = number;
16
+
17
+ type Task =
18
+ | {
19
+ name: string,
20
+ run: () => void,
21
+ }
22
+ | {
23
+ name: string,
24
+ gen: () => Promise<void>,
25
+ }
26
+ | (() => void);
27
+
28
+ /**
29
+ * InteractionManager allows long-running work to be scheduled after any
30
+ * interactions/animations have completed. In particular, this allows JavaScript
31
+ * animations to run smoothly.
32
+ *
33
+ * Applications can schedule tasks to run after interactions with the following:
34
+ *
35
+ * ```
36
+ * InteractionManager.runAfterInteractions(() => {
37
+ * // ...long-running synchronous task...
38
+ * });
39
+ * ```
40
+ *
41
+ * Compare this to other scheduling alternatives:
42
+ *
43
+ * - requestAnimationFrame(): for code that animates a view over time.
44
+ * - setImmediate/setTimeout(): run code later, note this may delay animations.
45
+ * - runAfterInteractions(): run code later, without delaying active animations.
46
+ *
47
+ * The touch handling system considers one or more active touches to be an
48
+ * 'interaction' and will delay `runAfterInteractions()` callbacks until all
49
+ * touches have ended or been cancelled.
50
+ *
51
+ * InteractionManager also allows applications to register animations by
52
+ * creating an interaction 'handle' on animation start, and clearing it upon
53
+ * completion:
54
+ *
55
+ * ```
56
+ * var handle = InteractionManager.createInteractionHandle();
57
+ * // run animation... (`runAfterInteractions` tasks are queued)
58
+ * // later, on animation completion:
59
+ * InteractionManager.clearInteractionHandle(handle);
60
+ * // queued tasks run if all handles were cleared
61
+ * ```
62
+ *
63
+ * `runAfterInteractions` takes either a plain callback function, or a
64
+ * `PromiseTask` object with a `gen` method that returns a `Promise`. If a
65
+ * `PromiseTask` is supplied, then it is fully resolved (including asynchronous
66
+ * dependencies that also schedule more tasks via `runAfterInteractions`) before
67
+ * starting on the next task that might have been queued up synchronously
68
+ * earlier.
69
+ *
70
+ * By default, queued tasks are executed together in a loop in one
71
+ * `setImmediate` batch. If `setDeadline` is called with a positive number, then
72
+ * tasks will only be executed until the deadline (in terms of js event loop run
73
+ * time) approaches, at which point execution will yield via setTimeout,
74
+ * allowing events such as touches to start interactions and block queued tasks
75
+ * from executing, making apps more responsive.
76
+ *
77
+ * @deprecated
78
+ */
79
+ const InteractionManagerStub = {
80
+ Events: {
81
+ interactionStart: 'interactionStart',
82
+ interactionComplete: 'interactionComplete',
83
+ },
84
+
85
+ /**
86
+ * Schedule a function to run after all interactions have completed. Returns a cancellable
87
+ * "promise".
88
+ *
89
+ * @deprecated
90
+ */
91
+ runAfterInteractions(task: ?Task): {
92
+ then: <U>(
93
+ onFulfill?: ?(void) => ?(Promise<U> | U),
94
+ onReject?: ?(error: mixed) => ?(Promise<U> | U),
95
+ ) => Promise<U>,
96
+ cancel: () => void,
97
+ ...
98
+ } {
99
+ let immediateID: ?$FlowIssue;
100
+ const promise = new Promise((resolve, reject) => {
101
+ immediateID = setImmediate(() => {
102
+ if (typeof task === 'object' && task !== null) {
103
+ if (typeof task.gen === 'function') {
104
+ task.gen().then(resolve, reject);
105
+ } else if (typeof task.run === 'function') {
106
+ try {
107
+ task.run();
108
+ resolve();
109
+ } catch (error) {
110
+ reject(error);
111
+ }
112
+ } else {
113
+ reject(new TypeError(`Task "${task.name}" missing gen or run.`));
114
+ }
115
+ } else if (typeof task === 'function') {
116
+ try {
117
+ task();
118
+ resolve();
119
+ } catch (error) {
120
+ reject(error);
121
+ }
122
+ } else {
123
+ reject(new TypeError('Invalid task of type: ' + typeof task));
124
+ }
125
+ });
126
+ });
127
+
128
+ return {
129
+ // $FlowFixMe[method-unbinding] added when improving typing for this parameters
130
+ then: promise.then.bind(promise),
131
+ cancel() {
132
+ clearImmediate(immediateID);
133
+ },
134
+ };
135
+ },
136
+
137
+ /**
138
+ * Notify manager that an interaction has started.
139
+ *
140
+ * @deprecated
141
+ */
142
+ createInteractionHandle(): Handle {
143
+ return -1;
144
+ },
145
+
146
+ /**
147
+ * Notify manager that an interaction has completed.
148
+ *
149
+ * @deprecated
150
+ */
151
+ clearInteractionHandle(handle: Handle) {
152
+ invariant(!!handle, 'InteractionManager: Must provide a handle to clear.');
153
+ },
154
+
155
+ /**
156
+ * @deprecated
157
+ */
158
+ addListener(): EventSubscription {
159
+ return {
160
+ remove() {},
161
+ };
162
+ },
163
+
164
+ /**
165
+ * A positive number will use setTimeout to schedule any tasks after the
166
+ * eventLoopRunningTime hits the deadline value, otherwise all tasks will be
167
+ * executed in one setImmediate batch (default).
168
+ *
169
+ * @deprecated
170
+ */
171
+ setDeadline(deadline: number) {
172
+ // Do nothing.
173
+ },
174
+ };
175
+
176
+ module.exports = InteractionManagerStub;
@@ -480,10 +480,10 @@ class FlatList<ItemT> extends React.PureComponent<Props<ItemT>, void> {
480
480
  this._checkProps(this.props);
481
481
  }
482
482
 
483
- _listRef: ?React.ElementRef<typeof VirtualizedList>;
483
+ _listRef: ?VirtualizedList;
484
484
  _virtualizedListPairs: Array<ViewabilityConfigCallbackPair> = [];
485
485
 
486
- _captureRef = (ref: ?React.ElementRef<typeof VirtualizedList>) => {
486
+ _captureRef = (ref: ?VirtualizedList) => {
487
487
  this._listRef = ref;
488
488
  };
489
489
 
@@ -55,7 +55,7 @@ if (__DEV__) {
55
55
  if (global.RN$registerExceptionListener != null) {
56
56
  global.RN$registerExceptionListener(
57
57
  (error: ExtendedExceptionData & {preventDefault: () => mixed}) => {
58
- if (!error.isFatal) {
58
+ if (global.RN$isRuntimeReady?.() || !error.isFatal) {
59
59
  error.preventDefault();
60
60
  addException(error);
61
61
  }
@@ -37,6 +37,8 @@ const COLORS = {
37
37
  'ansi-bright-white': 'rgb(247, 247, 247)',
38
38
  };
39
39
 
40
+ const LRM = '\u200E'; // Left-to-Right Mark
41
+
40
42
  export default function Ansi({
41
43
  text,
42
44
  style,
@@ -80,25 +82,28 @@ export default function Ansi({
80
82
  };
81
83
 
82
84
  return (
83
- <View>
85
+ <View style={styles.container}>
84
86
  {parsedLines.map((items, i) => (
85
87
  <View style={styles.line} key={i}>
86
- {items.map((bundle, key) => {
87
- const textStyle =
88
- bundle.fg && COLORS[bundle.fg]
89
- ? {
90
- backgroundColor: bundle.bg && COLORS[bundle.bg],
91
- color: bundle.fg && COLORS[bundle.fg],
92
- }
93
- : {
94
- backgroundColor: bundle.bg && COLORS[bundle.bg],
95
- };
96
- return (
97
- <Text style={[style, textStyle]} key={key}>
98
- {getText(bundle.content, key)}
99
- </Text>
100
- );
101
- })}
88
+ <Text>
89
+ {LRM}
90
+ {items.map((bundle, key) => {
91
+ const textStyle =
92
+ bundle.fg && COLORS[bundle.fg]
93
+ ? {
94
+ backgroundColor: bundle.bg && COLORS[bundle.bg],
95
+ color: bundle.fg && COLORS[bundle.fg],
96
+ }
97
+ : {
98
+ backgroundColor: bundle.bg && COLORS[bundle.bg],
99
+ };
100
+ return (
101
+ <Text style={[style, textStyle]} key={key}>
102
+ {getText(bundle.content, key)}
103
+ </Text>
104
+ );
105
+ })}
106
+ </Text>
102
107
  </View>
103
108
  ))}
104
109
  </View>
@@ -106,6 +111,10 @@ export default function Ansi({
106
111
  }
107
112
 
108
113
  const styles = StyleSheet.create({
114
+ container: {
115
+ minWidth: '100%',
116
+ direction: 'ltr',
117
+ },
109
118
  line: {
110
119
  flexDirection: 'row',
111
120
  },
@@ -59,7 +59,9 @@ function LogBoxInspectorCodeFrame(props: Props): React.Node {
59
59
  <LogBoxInspectorSection heading="Source" action={<AppInfo />}>
60
60
  <View style={styles.box}>
61
61
  <View style={styles.frame}>
62
- <ScrollView horizontal>
62
+ <ScrollView
63
+ horizontal
64
+ contentContainerStyle={styles.contentContainer}>
63
65
  <AnsiHighlight style={styles.content} text={codeFrame.content} />
64
66
  </ScrollView>
65
67
  </View>
@@ -138,6 +140,9 @@ const styles = StyleSheet.create({
138
140
  paddingTop: 10,
139
141
  paddingBottom: 10,
140
142
  },
143
+ contentContainer: {
144
+ minWidth: '100%',
145
+ },
141
146
  content: {
142
147
  color: LogBoxStyle.getTextColor(1),
143
148
  fontSize: 12,
@@ -59,7 +59,9 @@ function LogBoxInspectorCodeFrame(props: Props): React.Node {
59
59
  <LogBoxInspectorSection heading="Source" action={<AppInfo />}>
60
60
  <View style={styles.box}>
61
61
  <View style={styles.frame}>
62
- <ScrollView horizontal>
62
+ <ScrollView
63
+ horizontal
64
+ contentContainerStyle={styles.contentContainer}>
63
65
  <AnsiHighlight style={styles.content} text={codeFrame.content} />
64
66
  </ScrollView>
65
67
  </View>
@@ -138,6 +140,9 @@ const styles = StyleSheet.create({
138
140
  paddingTop: 10,
139
141
  paddingBottom: 10,
140
142
  },
143
+ contentContainer: {
144
+ minWidth: '100%',
145
+ },
141
146
  content: {
142
147
  color: LogBoxStyle.getTextColor(1),
143
148
  fontSize: 12,
@@ -101,6 +101,11 @@ export interface ModalPropsAndroid {
101
101
  * Determines whether your modal should go under the system statusbar.
102
102
  */
103
103
  statusBarTranslucent?: boolean | undefined;
104
+
105
+ /**
106
+ * Determines whether your modal should go under the system navigationbar.
107
+ */
108
+ navigationBarTranslucent?: boolean | undefined;
104
109
  }
105
110
 
106
111
  export type ModalProps = ModalBaseProps &
@@ -95,6 +95,14 @@ export type Props = $ReadOnly<{|
95
95
  */
96
96
  statusBarTranslucent?: ?boolean,
97
97
 
98
+ /**
99
+ * The `navigationBarTranslucent` prop determines whether your modal should go under
100
+ * the system navigationbar.
101
+ *
102
+ * See https://reactnative.dev/docs/modal.html#navigationbartranslucent-android
103
+ */
104
+ navigationBarTranslucent?: ?boolean,
105
+
98
106
  /**
99
107
  * The `hardwareAccelerated` prop controls whether to force hardware
100
108
  * acceleration for the underlying window.
@@ -176,6 +184,14 @@ function confirmProps(props: Props) {
176
184
  `Modal with '${props.presentationStyle}' presentation style and 'transparent' value is not supported.`,
177
185
  );
178
186
  }
187
+ if (
188
+ props.navigationBarTranslucent === true &&
189
+ props.statusBarTranslucent !== true
190
+ ) {
191
+ console.warn(
192
+ 'Modal with translucent navigation bar and without translucent status bar is not supported.',
193
+ );
194
+ }
179
195
  }
180
196
  }
181
197
 
@@ -301,6 +317,7 @@ class Modal extends React.Component<Props, State> {
301
317
  onDismiss={onDismiss}
302
318
  visible={this.props.visible}
303
319
  statusBarTranslucent={this.props.statusBarTranslucent}
320
+ navigationBarTranslucent={this.props.navigationBarTranslucent}
304
321
  identifier={this._identifier}
305
322
  style={styles.modal}
306
323
  // $FlowFixMe[method-unbinding] added when improving typing for this parameters
@@ -40,8 +40,8 @@ const HermesBadge = (): Node => {
40
40
  const styles = StyleSheet.create({
41
41
  badge: {
42
42
  position: 'absolute',
43
- top: 8,
44
43
  right: 12,
44
+ bottom: 8,
45
45
  },
46
46
  badgeText: {
47
47
  fontSize: 14,