@office-iss/react-native-win32 0.0.0-canary.273 → 0.0.0-canary.275
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 +5 -1
- package/CHANGELOG.json +31 -1
- package/CHANGELOG.md +20 -4
- package/Libraries/ActionSheetIOS/ActionSheetIOS.d.ts +1 -0
- package/Libraries/ActionSheetIOS/ActionSheetIOS.js +13 -0
- package/Libraries/Animated/animations/Animation.js +1 -5
- package/Libraries/Animated/components/AnimatedFlatList.js +1 -1
- package/Libraries/Animated/components/AnimatedSectionList.js +3 -1
- package/Libraries/Animated/createAnimatedComponent.js +7 -7
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +16 -2
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.win32.js +21 -2
- package/Libraries/Components/ActivityIndicator/ActivityIndicator.js +1 -1
- package/Libraries/Components/RefreshControl/__mocks__/RefreshControlMock.js +3 -2
- package/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js +0 -1
- package/Libraries/Components/ScrollView/ScrollView.js +39 -78
- package/Libraries/Components/ScrollView/ScrollViewCommands.js +1 -1
- package/Libraries/Components/ScrollView/ScrollViewContext.js +2 -0
- package/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +0 -2
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +2 -3
- package/Libraries/Components/TextInput/InputAccessoryView.js +1 -1
- package/Libraries/Components/TextInput/RCTMultilineTextInputNativeComponent.js +4 -4
- package/Libraries/Components/TextInput/RCTSingelineTextInputNativeComponent.js +6 -4
- package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +1 -0
- package/Libraries/Components/TextInput/TextInput.flow.js +11 -9
- package/Libraries/Components/TextInput/TextInput.js +7 -1
- package/Libraries/Components/TextInput/TextInput.win32.js +8 -1
- package/Libraries/Components/TextInput/Win32TextInputNativeComponent.js +3 -0
- package/Libraries/Components/Touchable/TouchableBounce.js +1 -0
- package/Libraries/Components/Touchable/TouchableOpacity.js +1 -0
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +1 -2
- package/Libraries/Components/View/ViewPropTypes.d.ts +7 -0
- package/Libraries/Components/View/ViewWin32.js +1 -0
- package/Libraries/Core/ExceptionsManager.js +41 -27
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Core/__mocks__/NativeExceptionsManager.js +0 -1
- package/Libraries/Core/setUpErrorHandling.js +18 -22
- package/Libraries/Core/setUpTimers.js +4 -12
- package/Libraries/Image/Image.d.ts +20 -29
- package/Libraries/Image/ImageProps.js +2 -1
- package/Libraries/Image/ImageResizeMode.d.ts +8 -1
- package/Libraries/Image/ImageResizeMode.js +4 -1
- package/Libraries/Image/ImageSource.d.ts +0 -2
- package/Libraries/Image/ImageSource.js +0 -2
- package/Libraries/Image/ImageUtils.js +6 -3
- package/Libraries/Inspector/Inspector.win32.js +1 -1
- package/Libraries/Interaction/InteractionManager.js +6 -1
- package/Libraries/Interaction/InteractionManagerStub.js +176 -0
- package/Libraries/Lists/FlatList.js +2 -2
- package/Libraries/Lists/SectionListModern.js +7 -7
- package/Libraries/LogBox/Data/LogBoxData.js +2 -2
- package/Libraries/LogBox/LogBox.js +1 -1
- package/Libraries/LogBox/LogBoxInspectorContainer.js +1 -1
- package/Libraries/LogBox/LogBoxNotificationContainer.js +1 -1
- package/Libraries/LogBox/UI/AnsiHighlight.js +26 -17
- package/Libraries/LogBox/UI/LogBoxInspectorCodeFrame.js +6 -1
- package/Libraries/LogBox/UI/LogBoxInspectorCodeFrame.win32.js +6 -1
- package/Libraries/LogBox/UI/LogBoxInspectorHeader.js +1 -1
- package/Libraries/LogBox/UI/LogBoxInspectorHeader.win32.js +1 -1
- package/Libraries/Modal/Modal.d.ts +5 -0
- package/Libraries/Modal/Modal.js +19 -3
- package/Libraries/NativeComponent/NativeComponentRegistry.js +3 -3
- package/Libraries/PermissionsAndroid/PermissionsAndroid.d.ts +49 -2
- package/Libraries/PermissionsAndroid/PermissionsAndroid.js +4 -4
- package/Libraries/Pressability/usePressability.js +4 -1
- package/Libraries/ReactNative/AppContainer.js +1 -1
- package/Libraries/ReactNative/AppRegistry.js +0 -6
- package/Libraries/ReactNative/DisplayMode.js +1 -1
- package/Libraries/ReactNative/RendererImplementation.js +14 -14
- package/Libraries/ReactNative/getCachedComponentWithDebugName.js +1 -3
- package/Libraries/ReactNative/renderApplication.js +9 -8
- package/Libraries/ReactNative/requireNativeComponent.js +5 -2
- package/Libraries/Renderer/implementations/ReactFabric-dev.js +26149 -15434
- package/Libraries/Renderer/implementations/ReactFabric-prod.js +1630 -2675
- package/Libraries/Renderer/implementations/ReactFabric-profiling.js +1691 -2954
- package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +27069 -16192
- package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +1657 -2714
- package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +1733 -2980
- package/Libraries/Renderer/shims/ReactFabric.js +3 -3
- package/Libraries/Renderer/shims/ReactFeatureFlags.js +2 -2
- package/Libraries/Renderer/shims/ReactNative.js +3 -3
- package/Libraries/Renderer/shims/ReactNativeTypes.js +9 -10
- package/Libraries/Renderer/shims/createReactNativeComponentClass.js +2 -2
- package/Libraries/StyleSheet/StyleSheet.js +7 -1
- package/Libraries/StyleSheet/StyleSheet.win32.js +7 -1
- package/Libraries/StyleSheet/StyleSheetTypes.d.ts +7 -1
- package/Libraries/StyleSheet/StyleSheetTypes.js +5 -4
- package/Libraries/Utilities/BackHandler.android.js +6 -18
- package/Libraries/Utilities/BackHandler.d.ts +0 -4
- package/Libraries/Utilities/BackHandler.ios.js +0 -7
- package/Libraries/Utilities/BackHandler.win32.js +6 -18
- package/Libraries/Utilities/__mocks__/BackHandler.js +3 -8
- package/Libraries/Utilities/codegenNativeComponent.js +1 -1
- package/Libraries/__flowtests__/ReactNativeTypes-flowtest.js +1 -1
- package/index.js +1 -1
- package/index.win32.js +1 -1
- package/overrides.json +11 -11
- package/package.json +13 -13
- package/src/private/components/HScrollViewNativeComponents.js +1 -26
- package/src/private/components/SafeAreaView_INTERNAL_DO_NOT_USE.js +4 -4
- package/src/private/components/VScrollViewNativeComponents.js +2 -24
- package/src/private/featureflags/ReactNativeFeatureFlags.js +36 -46
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +7 -9
- package/src/private/specs/components/RCTModalHostViewNativeComponent.js +8 -0
- package/src/private/specs/modules/NativeAccessibilityInfo.js +6 -0
- package/src/private/specs/modules/NativeAccessibilityInfoWin32.js +6 -0
- package/src/private/specs/modules/NativeActionSheetManager.js +2 -0
- package/src/private/specs/modules/NativeExceptionsManager.js +0 -12
- package/src/private/webapis/intersectionobserver/IntersectionObserver.js +6 -0
- package/src/private/webapis/performance/Performance.js +1 -1
- package/src/private/webapis/performance/UserTiming.js +5 -5
- package/src-win/Libraries/Components/View/ViewPropTypes.d.ts +7 -0
- package/Libraries/ReactNative/ReactFabricInternals.js +0 -17
- package/src/private/components/useSyncOnScroll.js +0 -48
- package/types/experimental.d.ts +0 -59
|
@@ -18,7 +18,7 @@ import * as NativeComponentRegistry from '../../NativeComponent/NativeComponentR
|
|
|
18
18
|
import codegenNativeCommands from '../../Utilities/codegenNativeCommands';
|
|
19
19
|
import RCTTextInputViewConfig from './RCTTextInputViewConfig';
|
|
20
20
|
|
|
21
|
-
type NativeType = HostComponent<
|
|
21
|
+
type NativeType = HostComponent<{...}>;
|
|
22
22
|
|
|
23
23
|
type NativeCommands = TextInputNativeCommands<NativeType>;
|
|
24
24
|
|
|
@@ -31,11 +31,13 @@ export const __INTERNAL_VIEW_CONFIG: PartialViewConfig = {
|
|
|
31
31
|
...RCTTextInputViewConfig,
|
|
32
32
|
};
|
|
33
33
|
|
|
34
|
-
const SinglelineTextInputNativeComponent: HostComponent<
|
|
35
|
-
NativeComponentRegistry.get<
|
|
34
|
+
const SinglelineTextInputNativeComponent: HostComponent<{...}> =
|
|
35
|
+
NativeComponentRegistry.get<{...}>(
|
|
36
36
|
'RCTSinglelineTextInputView',
|
|
37
37
|
() => __INTERNAL_VIEW_CONFIG,
|
|
38
38
|
);
|
|
39
39
|
|
|
40
40
|
// flowlint-next-line unclear-type:off
|
|
41
|
-
export default ((SinglelineTextInputNativeComponent: any): HostComponent<
|
|
41
|
+
export default ((SinglelineTextInputNativeComponent: any): HostComponent<{
|
|
42
|
+
...
|
|
43
|
+
}>);
|
|
@@ -266,6 +266,12 @@ type IOSProps = $ReadOnly<{|
|
|
|
266
266
|
*/
|
|
267
267
|
inputAccessoryViewID?: ?string,
|
|
268
268
|
|
|
269
|
+
/**
|
|
270
|
+
* An optional label that overrides the default input accessory view button label.
|
|
271
|
+
* @platform ios
|
|
272
|
+
*/
|
|
273
|
+
inputAccessoryViewButtonLabel?: ?string,
|
|
274
|
+
|
|
269
275
|
/**
|
|
270
276
|
* Determines the color of the keyboard.
|
|
271
277
|
* @platform ios
|
|
@@ -1086,7 +1092,10 @@ type ImperativeMethods = $ReadOnly<{|
|
|
|
1086
1092
|
* or control this param programmatically with native code.
|
|
1087
1093
|
*
|
|
1088
1094
|
*/
|
|
1089
|
-
type InternalTextInput = (
|
|
1095
|
+
type InternalTextInput = component(
|
|
1096
|
+
ref: React.RefSetter<$ReadOnly<{...HostInstance, ...ImperativeMethods}>>,
|
|
1097
|
+
...Props
|
|
1098
|
+
);
|
|
1090
1099
|
|
|
1091
1100
|
export type TextInputComponentStatics = $ReadOnly<{|
|
|
1092
1101
|
State: $ReadOnly<{|
|
|
@@ -1097,11 +1106,4 @@ export type TextInputComponentStatics = $ReadOnly<{|
|
|
|
1097
1106
|
|}>,
|
|
1098
1107
|
|}>;
|
|
1099
1108
|
|
|
1100
|
-
export type TextInputType =
|
|
1101
|
-
React.ElementConfig<InternalTextInput>,
|
|
1102
|
-
$ReadOnly<{|
|
|
1103
|
-
...HostInstance,
|
|
1104
|
-
...ImperativeMethods,
|
|
1105
|
-
|}>,
|
|
1106
|
-
> &
|
|
1107
|
-
TextInputComponentStatics;
|
|
1109
|
+
export type TextInputType = InternalTextInput & TextInputComponentStatics;
|
|
@@ -310,6 +310,12 @@ type IOSProps = $ReadOnly<{|
|
|
|
310
310
|
*/
|
|
311
311
|
inputAccessoryViewID?: ?string,
|
|
312
312
|
|
|
313
|
+
/**
|
|
314
|
+
* An optional label that overrides the default input accessory view button label.
|
|
315
|
+
* @platform ios
|
|
316
|
+
*/
|
|
317
|
+
inputAccessoryViewButtonLabel?: ?string,
|
|
318
|
+
|
|
313
319
|
/**
|
|
314
320
|
* Determines the color of the keyboard.
|
|
315
321
|
* @platform ios
|
|
@@ -1533,7 +1539,7 @@ function InternalTextInput(props: Props): React.Node {
|
|
|
1533
1539
|
|
|
1534
1540
|
// TextInput handles onBlur and onFocus events
|
|
1535
1541
|
// so omitting onBlur and onFocus pressability handlers here.
|
|
1536
|
-
const {onBlur, onFocus, ...eventHandlers} = usePressability(config)
|
|
1542
|
+
const {onBlur, onFocus, ...eventHandlers} = usePressability(config);
|
|
1537
1543
|
|
|
1538
1544
|
let _accessibilityState;
|
|
1539
1545
|
if (
|
|
@@ -321,6 +321,12 @@ type IOSProps = $ReadOnly<{|
|
|
|
321
321
|
*/
|
|
322
322
|
inputAccessoryViewID?: ?string,
|
|
323
323
|
|
|
324
|
+
/**
|
|
325
|
+
* An optional label that overrides the default input accessory view button label.
|
|
326
|
+
* @platform ios
|
|
327
|
+
*/
|
|
328
|
+
inputAccessoryViewButtonLabel?: ?string,
|
|
329
|
+
|
|
324
330
|
/**
|
|
325
331
|
* Determines the color of the keyboard.
|
|
326
332
|
* @platform ios
|
|
@@ -1368,6 +1374,7 @@ function InternalTextInput(props: Props): React.Node {
|
|
|
1368
1374
|
mostRecentEventCount,
|
|
1369
1375
|
selection,
|
|
1370
1376
|
text,
|
|
1377
|
+
// $FlowFixMe[incompatible-call]
|
|
1371
1378
|
viewCommands,
|
|
1372
1379
|
});
|
|
1373
1380
|
|
|
@@ -1589,7 +1596,7 @@ function InternalTextInput(props: Props): React.Node {
|
|
|
1589
1596
|
|
|
1590
1597
|
// TextInput handles onBlur and onFocus events
|
|
1591
1598
|
// so omitting onBlur and onFocus pressability handlers here.
|
|
1592
|
-
const {onBlur, onFocus, ...eventHandlers} = usePressability(config)
|
|
1599
|
+
const {onBlur, onFocus, ...eventHandlers} = usePressability(config);
|
|
1593
1600
|
const eventPhase = Object.freeze({Capturing: 1, Bubbling: 3});
|
|
1594
1601
|
const _keyDown = (event: KeyEvent) => {
|
|
1595
1602
|
if (props.keyDownEvents && event.isPropagationStopped() !== true) {
|
|
@@ -8,6 +8,8 @@ import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes';
|
|
|
8
8
|
import requireNativeComponent from '../../ReactNative/requireNativeComponent';
|
|
9
9
|
import codegenNativeCommands from '../../Utilities/codegenNativeCommands';
|
|
10
10
|
import type {TextInputNativeCommands} from './TextInputNativeCommands';
|
|
11
|
+
|
|
12
|
+
// $FlowFixMe[incompatible-type-arg]
|
|
11
13
|
type NativeType = HostComponent<mixed>;
|
|
12
14
|
|
|
13
15
|
type NativeCommands = TextInputNativeCommands<NativeType>;
|
|
@@ -17,6 +19,7 @@ export const Commands: NativeCommands = codegenNativeCommands<NativeCommands>({
|
|
|
17
19
|
});
|
|
18
20
|
|
|
19
21
|
const WindowsTextInputComponent: NativeType =
|
|
22
|
+
// $FlowFixMe[incompatible-call]
|
|
20
23
|
requireNativeComponent<mixed>('RCTTextInput');
|
|
21
24
|
|
|
22
25
|
export default WindowsTextInputComponent;
|
|
@@ -189,6 +189,7 @@ class TouchableBounce extends React.Component<Props, State> {
|
|
|
189
189
|
this.props.onPress !== undefined &&
|
|
190
190
|
!this.props.disabled
|
|
191
191
|
}
|
|
192
|
+
// $FlowFixMe[prop-missing]
|
|
192
193
|
ref={this.props.hostRef}
|
|
193
194
|
{...eventHandlersWithoutBlurAndFocus}>
|
|
194
195
|
{this.props.children}
|
|
@@ -291,6 +291,7 @@ class TouchableOpacity extends React.Component<Props, State> {
|
|
|
291
291
|
this.props.onPress !== undefined &&
|
|
292
292
|
!this.props.disabled
|
|
293
293
|
}
|
|
294
|
+
// $FlowFixMe[prop-missing]
|
|
294
295
|
ref={this.props.hostRef}
|
|
295
296
|
{...eventHandlersWithoutBlurAndFocus}>
|
|
296
297
|
{this.props.children}
|
|
@@ -195,8 +195,7 @@ module.exports = function TouchableWithoutFeedback(props: Props): React.Node {
|
|
|
195
195
|
|
|
196
196
|
// BACKWARD-COMPATIBILITY: Focus and blur events were never supported before
|
|
197
197
|
// adopting `Pressability`, so preserve that behavior.
|
|
198
|
-
const {onBlur, onFocus, ...eventHandlersWithoutBlurAndFocus} =
|
|
199
|
-
eventHandlers || {};
|
|
198
|
+
const {onBlur, onFocus, ...eventHandlersWithoutBlurAndFocus} = eventHandlers;
|
|
200
199
|
|
|
201
200
|
const elementProps: {[string]: mixed, ...} = {
|
|
202
201
|
...eventHandlersWithoutBlurAndFocus,
|
|
@@ -343,6 +343,13 @@ export interface ViewProps
|
|
|
343
343
|
* Used to reference react managed views from native code.
|
|
344
344
|
*/
|
|
345
345
|
nativeID?: string | undefined;
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* Contols whether this view, and its transitive children, are laid in a way
|
|
349
|
+
* consistent with web browsers ('strict'), or consistent with existing
|
|
350
|
+
* React Native code which may rely on incorrect behavior ('classic').
|
|
351
|
+
*/
|
|
352
|
+
experimental_layoutConformance?: 'strict' | 'classic' | undefined;
|
|
346
353
|
}
|
|
347
354
|
|
|
348
355
|
// For backwards compat.... // Win32
|
|
@@ -141,24 +141,31 @@ let inExceptionHandler = false;
|
|
|
141
141
|
* Logs exceptions to the (native) console and displays them
|
|
142
142
|
*/
|
|
143
143
|
function handleException(e: mixed, isFatal: boolean) {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
144
|
+
// TODO(T196834299): We should really use a c++ turbomodule for this
|
|
145
|
+
const reportToConsole = true;
|
|
146
|
+
if (
|
|
147
|
+
!global.RN$handleException ||
|
|
148
|
+
!global.RN$handleException(e, isFatal, reportToConsole)
|
|
149
|
+
) {
|
|
150
|
+
let error: Error;
|
|
151
|
+
if (e instanceof Error) {
|
|
152
|
+
error = e;
|
|
153
|
+
} else {
|
|
154
|
+
// Workaround for reporting errors caused by `throw 'some string'`
|
|
155
|
+
// Unfortunately there is no way to figure out the stacktrace in this
|
|
156
|
+
// case, so if you ended up here trying to trace an error, look for
|
|
157
|
+
// `throw '<error message>'` somewhere in your codebase.
|
|
158
|
+
error = new SyntheticError(e);
|
|
159
|
+
}
|
|
160
|
+
try {
|
|
161
|
+
inExceptionHandler = true;
|
|
162
|
+
/* $FlowFixMe[class-object-subtyping] added when improving typing for this
|
|
163
|
+
* parameters */
|
|
164
|
+
// $FlowFixMe[incompatible-call]
|
|
165
|
+
reportException(error, isFatal, reportToConsole);
|
|
166
|
+
} finally {
|
|
167
|
+
inExceptionHandler = false;
|
|
168
|
+
}
|
|
162
169
|
}
|
|
163
170
|
}
|
|
164
171
|
|
|
@@ -170,7 +177,7 @@ function reactConsoleErrorHandler(...args) {
|
|
|
170
177
|
if (!console.reportErrorsAsExceptions) {
|
|
171
178
|
return;
|
|
172
179
|
}
|
|
173
|
-
if (inExceptionHandler) {
|
|
180
|
+
if (inExceptionHandler || global.RN$inExceptionHandler?.()) {
|
|
174
181
|
// The fundamental trick here is that are multiple entry point to logging errors:
|
|
175
182
|
// (see D19743075 for more background)
|
|
176
183
|
//
|
|
@@ -224,14 +231,21 @@ function reactConsoleErrorHandler(...args) {
|
|
|
224
231
|
error.name = 'console.error';
|
|
225
232
|
}
|
|
226
233
|
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
error,
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
234
|
+
const isFatal = false;
|
|
235
|
+
const reportToConsole = false;
|
|
236
|
+
if (
|
|
237
|
+
!global.RN$handleException ||
|
|
238
|
+
!global.RN$handleException(error, isFatal, reportToConsole)
|
|
239
|
+
) {
|
|
240
|
+
reportException(
|
|
241
|
+
/* $FlowFixMe[class-object-subtyping] added when improving typing for this
|
|
242
|
+
* parameters */
|
|
243
|
+
// $FlowFixMe[incompatible-call]
|
|
244
|
+
error,
|
|
245
|
+
isFatal,
|
|
246
|
+
reportToConsole,
|
|
247
|
+
);
|
|
248
|
+
}
|
|
235
249
|
}
|
|
236
250
|
|
|
237
251
|
/**
|
|
@@ -14,7 +14,6 @@ import typeof NativeExceptionsManager from '../NativeExceptionsManager';
|
|
|
14
14
|
export default ({
|
|
15
15
|
reportFatalException: jest.fn(),
|
|
16
16
|
reportSoftException: jest.fn(),
|
|
17
|
-
updateExceptionMessage: jest.fn(),
|
|
18
17
|
dismissRedbox: jest.fn(),
|
|
19
18
|
reportException: jest.fn(),
|
|
20
19
|
}: NativeExceptionsManager);
|
|
@@ -10,30 +10,26 @@
|
|
|
10
10
|
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
ExceptionsManager
|
|
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
|
-
|
|
23
|
-
|
|
24
|
-
// TODO(T196834299): We should really use a c++ turbomodule for this
|
|
25
|
-
if (
|
|
26
|
-
!global.RN$handleException ||
|
|
27
|
-
!global.RN$handleException(e, isFatal)
|
|
28
|
-
) {
|
|
21
|
+
// Set up error handler
|
|
22
|
+
if (!global.__fbDisableExceptionsManager) {
|
|
23
|
+
const handleError = (e: mixed, isFatal: boolean) => {
|
|
24
|
+
try {
|
|
29
25
|
ExceptionsManager.handleException(e, isFatal);
|
|
26
|
+
} catch (ee) {
|
|
27
|
+
console.log('Failed to print error: ', ee.message);
|
|
28
|
+
throw e;
|
|
30
29
|
}
|
|
31
|
-
}
|
|
32
|
-
console.log('Failed to print error: ', ee.message);
|
|
33
|
-
throw e;
|
|
34
|
-
}
|
|
35
|
-
};
|
|
30
|
+
};
|
|
36
31
|
|
|
37
|
-
|
|
38
|
-
|
|
32
|
+
const ErrorUtils = require('../vendor/core/ErrorUtils');
|
|
33
|
+
ErrorUtils.setGlobalHandler(handleError);
|
|
34
|
+
}
|
|
39
35
|
}
|
|
@@ -26,18 +26,10 @@ const isEventLoopEnabled = (() => {
|
|
|
26
26
|
return false;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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.
|
|
@@ -60,18 +60,28 @@ export interface ImagePropsIOS {
|
|
|
60
60
|
interface ImagePropsAndroid {
|
|
61
61
|
/**
|
|
62
62
|
* The mechanism that should be used to resize the image when the image's dimensions
|
|
63
|
-
* differ from the image view's dimensions. Defaults to auto
|
|
63
|
+
* differ from the image view's dimensions. Defaults to `auto`.
|
|
64
|
+
*
|
|
65
|
+
* - `auto`: Use heuristics to pick between `resize` and `scale`.
|
|
66
|
+
*
|
|
67
|
+
* - `resize`: A software operation which changes the encoded image in memory before it
|
|
68
|
+
* gets decoded. This should be used instead of `scale` when the image is much larger
|
|
69
|
+
* than the view.
|
|
70
|
+
*
|
|
71
|
+
* - `scale`: The image gets drawn downscaled or upscaled. Compared to `resize`, `scale` is
|
|
72
|
+
* faster (usually hardware accelerated) and produces higher quality images. This
|
|
73
|
+
* should be used if the image is smaller than the view. It should also be used if the
|
|
74
|
+
* image is slightly bigger than the view.
|
|
64
75
|
*
|
|
65
|
-
*
|
|
76
|
+
* - `none`: No sampling is performed and the image is displayed in its full resolution. This
|
|
77
|
+
* should only be used in rare circumstances because it is considered unsafe as Android will
|
|
78
|
+
* throw a runtime exception when trying to render images that consume too much memory.
|
|
66
79
|
*
|
|
67
|
-
*
|
|
68
|
-
* This should be used instead of scale when the image is much larger than the view.
|
|
80
|
+
* More details about `resize` and `scale` can be found at http://frescolib.org/docs/resizing-rotating.html.
|
|
69
81
|
*
|
|
70
|
-
*
|
|
71
|
-
* and produces higher quality images. This should be used if the image is smaller than the view.
|
|
72
|
-
* It should also be used if the image is slightly bigger than the view.
|
|
82
|
+
* @platform android
|
|
73
83
|
*/
|
|
74
|
-
resizeMethod?: 'auto' | 'resize' | 'scale' | undefined;
|
|
84
|
+
resizeMethod?: 'auto' | 'resize' | 'scale' | 'none' | undefined;
|
|
75
85
|
|
|
76
86
|
/**
|
|
77
87
|
* Duration of fade in animation in ms. Defaults to 300
|
|
@@ -190,29 +200,10 @@ export interface ImagePropsBase
|
|
|
190
200
|
* 'center': Scale the image down so that it is completely visible,
|
|
191
201
|
* if bigger than the area of the view.
|
|
192
202
|
* The image will not be scaled up.
|
|
193
|
-
*/
|
|
194
|
-
resizeMode?: ImageResizeMode | undefined;
|
|
195
|
-
|
|
196
|
-
/**
|
|
197
|
-
* The mechanism that should be used to resize the image when the image's dimensions
|
|
198
|
-
* differ from the image view's dimensions. Defaults to `auto`.
|
|
199
203
|
*
|
|
200
|
-
*
|
|
201
|
-
*
|
|
202
|
-
* - `resize`: A software operation which changes the encoded image in memory before it
|
|
203
|
-
* gets decoded. This should be used instead of `scale` when the image is much larger
|
|
204
|
-
* than the view.
|
|
205
|
-
*
|
|
206
|
-
* - `scale`: The image gets drawn downscaled or upscaled. Compared to `resize`, `scale` is
|
|
207
|
-
* faster (usually hardware accelerated) and produces higher quality images. This
|
|
208
|
-
* should be used if the image is smaller than the view. It should also be used if the
|
|
209
|
-
* image is slightly bigger than the view.
|
|
210
|
-
*
|
|
211
|
-
* More details about `resize` and `scale` can be found at http://frescolib.org/docs/resizing-rotating.html.
|
|
212
|
-
*
|
|
213
|
-
* @platform android
|
|
204
|
+
* 'none': Do not resize the image. The image will be displayed at its intrinsic size.
|
|
214
205
|
*/
|
|
215
|
-
|
|
206
|
+
resizeMode?: ImageResizeMode | undefined;
|
|
216
207
|
|
|
217
208
|
/**
|
|
218
209
|
* The image source (either a remote URL or a local file resource).
|
|
@@ -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?: ?
|
|
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
|
|
11
|
+
import type {ImageResizeMode} from './ImageResizeMode';
|
|
12
12
|
|
|
13
|
-
const objectFitMap: {[string]:
|
|
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(
|
|
21
|
+
export function convertObjectFitToResizeMode(
|
|
22
|
+
objectFit: ?string,
|
|
23
|
+
): ?ImageResizeMode {
|
|
21
24
|
return objectFit != null ? objectFitMap[objectFit] : undefined;
|
|
22
25
|
}
|
|
@@ -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 =
|
|
212
|
+
module.exports = (
|
|
213
|
+
ReactNativeFeatureFlags.disableInteractionManager()
|
|
214
|
+
? require('./InteractionManagerStub')
|
|
215
|
+
: InteractionManager
|
|
216
|
+
) as typeof InteractionManager;
|