@office-iss/react-native-win32 0.0.0-canary.272 → 0.0.0-canary.274
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.flowconfig +1 -1
- package/CHANGELOG.json +31 -1
- package/CHANGELOG.md +20 -4
- package/Libraries/Animated/AnimatedEvent.js +1 -1
- package/Libraries/Animated/animations/Animation.js +1 -1
- package/Libraries/Animated/createAnimatedComponent.js +7 -7
- package/Libraries/Animated/nodes/AnimatedColor.js +1 -1
- package/Libraries/Animated/nodes/AnimatedInterpolation.js +1 -1
- package/Libraries/Animated/nodes/AnimatedProps.js +1 -1
- package/Libraries/Animated/nodes/AnimatedTransform.js +1 -1
- package/Libraries/Animated/nodes/AnimatedValue.js +1 -1
- package/Libraries/Animated/useAnimatedProps.js +3 -3
- package/Libraries/Components/ActivityIndicator/ActivityIndicator.js +1 -1
- package/Libraries/Components/Keyboard/KeyboardAvoidingView.js +5 -0
- package/Libraries/Components/RefreshControl/__mocks__/RefreshControlMock.js +3 -2
- package/Libraries/Components/ScrollView/ScrollView.js +4 -4
- package/Libraries/Components/ScrollView/ScrollViewCommands.js +1 -1
- package/Libraries/Components/ScrollView/ScrollViewContext.js +2 -0
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +4 -4
- 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/TextInput.d.ts +4 -0
- package/Libraries/Components/TextInput/TextInput.flow.js +7 -9
- package/Libraries/Components/TextInput/TextInput.js +2 -0
- package/Libraries/Components/TextInput/TextInput.win32.js +3 -0
- 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/View/ViewNativeComponent.js +3 -88
- package/Libraries/Components/View/ViewWin32.js +1 -0
- package/Libraries/Core/ExceptionsManager.js +44 -27
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Core/__mocks__/NativeExceptionsManager.js +0 -1
- package/Libraries/Core/setUpErrorHandling.js +1 -7
- package/Libraries/Core/setUpReactDevTools.js +74 -1
- package/Libraries/Core/setUpTimers.js +21 -10
- package/Libraries/Image/Image.android.js +1 -3
- package/Libraries/Image/Image.d.ts +18 -29
- package/Libraries/Image/Image.ios.js +0 -2
- package/Libraries/Image/Image.win32.js +0 -2
- package/Libraries/Inspector/Inspector.js +1 -0
- package/Libraries/Inspector/Inspector.win32.js +1 -0
- package/Libraries/Lists/SectionListModern.js +7 -7
- package/Libraries/LogBox/Data/LogBoxData.js +2 -2
- package/Libraries/LogBox/LogBoxInspectorContainer.js +1 -1
- package/Libraries/LogBox/LogBoxNotificationContainer.js +2 -2
- package/Libraries/LogBox/UI/LogBoxInspectorHeader.js +1 -1
- package/Libraries/LogBox/UI/LogBoxInspectorHeader.win32.js +1 -1
- package/Libraries/Modal/Modal.js +5 -3
- package/Libraries/NativeComponent/BaseViewConfig.android.js +65 -0
- package/Libraries/NativeComponent/NativeComponentRegistry.js +3 -3
- package/Libraries/PermissionsAndroid/PermissionsAndroid.js +4 -4
- package/Libraries/ReactNative/AppContainer.js +1 -1
- package/Libraries/ReactNative/AppRegistry.js +1 -1
- package/Libraries/ReactNative/DisplayMode.js +1 -1
- package/Libraries/ReactNative/RendererImplementation.js +2 -2
- package/Libraries/ReactNative/getCachedComponentWithDebugName.js +1 -3
- package/Libraries/ReactNative/renderApplication.js +6 -4
- package/Libraries/ReactNative/requireNativeComponent.js +3 -1
- package/Libraries/Renderer/shims/ReactNativeTypes.js +9 -18
- package/Libraries/StyleSheet/StyleSheet.js +7 -1
- package/Libraries/StyleSheet/StyleSheet.win32.js +7 -1
- package/Libraries/StyleSheet/StyleSheetTypes.d.ts +1 -1
- package/Libraries/StyleSheet/StyleSheetTypes.js +1 -1
- package/Libraries/Utilities/FocusManager.win32.js +1 -1
- package/Libraries/Utilities/codegenNativeComponent.js +1 -1
- package/Libraries/Utilities/useMergeRefs.js +26 -7
- package/Libraries/__flowtests__/ReactNativeTypes-flowtest.js +1 -1
- package/index.js +2 -2
- package/index.win32.js +2 -2
- package/jest/setup.js +1 -0
- package/overrides.json +10 -10
- package/package.json +12 -12
- package/src/private/animated/NativeAnimatedHelper.js +4 -4
- package/src/private/animated/NativeAnimatedHelper.win32.js +4 -4
- package/src/private/animated/useAnimatedPropsMemo.js +0 -1
- package/src/private/components/SafeAreaView_INTERNAL_DO_NOT_USE.js +6 -5
- package/src/private/featureflags/ReactNativeFeatureFlags.js +31 -21
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +8 -6
- package/src/private/specs/modules/NativeExceptionsManager.js +0 -12
- package/src/private/webapis/intersectionobserver/IntersectionObserver.js +6 -0
- package/src/private/webapis/performance/EventTiming.js +1 -1
- package/src/private/webapis/performance/Performance.js +36 -15
- package/src/private/webapis/performance/PerformanceObserver.js +2 -2
- package/src/private/webapis/performance/UserTiming.js +5 -5
- package/src/private/webapis/performance/specs/NativePerformance.js +18 -2
- package/src/private/webapis/performance/specs/__mocks__/NativePerformanceMock.js +32 -12
|
@@ -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,10 @@ function reactConsoleErrorHandler(...args) {
|
|
|
170
177
|
if (!console.reportErrorsAsExceptions) {
|
|
171
178
|
return;
|
|
172
179
|
}
|
|
173
|
-
if (
|
|
180
|
+
if (
|
|
181
|
+
inExceptionHandler ||
|
|
182
|
+
(global.RN$inExceptionHandler && global.RN$inExceptionHandler())
|
|
183
|
+
) {
|
|
174
184
|
// The fundamental trick here is that are multiple entry point to logging errors:
|
|
175
185
|
// (see D19743075 for more background)
|
|
176
186
|
//
|
|
@@ -224,14 +234,21 @@ function reactConsoleErrorHandler(...args) {
|
|
|
224
234
|
error.name = 'console.error';
|
|
225
235
|
}
|
|
226
236
|
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
error,
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
237
|
+
const isFatal = false;
|
|
238
|
+
const reportToConsole = false;
|
|
239
|
+
if (
|
|
240
|
+
!global.RN$handleException ||
|
|
241
|
+
!global.RN$handleException(error, isFatal, reportToConsole)
|
|
242
|
+
) {
|
|
243
|
+
reportException(
|
|
244
|
+
/* $FlowFixMe[class-object-subtyping] added when improving typing for this
|
|
245
|
+
* parameters */
|
|
246
|
+
// $FlowFixMe[incompatible-call]
|
|
247
|
+
error,
|
|
248
|
+
isFatal,
|
|
249
|
+
reportToConsole,
|
|
250
|
+
);
|
|
251
|
+
}
|
|
235
252
|
}
|
|
236
253
|
|
|
237
254
|
/**
|
|
@@ -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);
|
|
@@ -21,13 +21,7 @@ ExceptionsManager.installConsoleErrorReporter();
|
|
|
21
21
|
if (!global.__fbDisableExceptionsManager) {
|
|
22
22
|
const handleError = (e: mixed, isFatal: boolean) => {
|
|
23
23
|
try {
|
|
24
|
-
|
|
25
|
-
if (
|
|
26
|
-
!global.RN$handleException ||
|
|
27
|
-
!global.RN$handleException(e, isFatal)
|
|
28
|
-
) {
|
|
29
|
-
ExceptionsManager.handleException(e, isFatal);
|
|
30
|
-
}
|
|
24
|
+
ExceptionsManager.handleException(e, isFatal);
|
|
31
25
|
} catch (ee) {
|
|
32
26
|
console.log('Failed to print error: ', ee.message);
|
|
33
27
|
throw e;
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
13
|
import type {Domain} from '../../src/private/debugging/setUpFuseboxReactDevToolsDispatcher';
|
|
14
|
+
import type {Spec as NativeReactDevToolsRuntimeSettingsModuleSpec} from '../../src/private/fusebox/specs/NativeReactDevToolsRuntimeSettingsModule';
|
|
14
15
|
|
|
15
16
|
if (__DEV__) {
|
|
16
17
|
// Register dispatcher on global, which can be used later by Chrome DevTools frontend
|
|
@@ -24,6 +25,8 @@ if (__DEV__) {
|
|
|
24
25
|
const reactDevToolsSettingsManager = require('../../src/private/debugging/ReactDevToolsSettingsManager');
|
|
25
26
|
const serializedHookSettings =
|
|
26
27
|
reactDevToolsSettingsManager.getGlobalHookSettings();
|
|
28
|
+
const maybeReactDevToolsRuntimeSettingsModuleModule =
|
|
29
|
+
require('../../src/private/fusebox/specs/NativeReactDevToolsRuntimeSettingsModule').default;
|
|
27
30
|
|
|
28
31
|
let hookSettings = null;
|
|
29
32
|
if (serializedHookSettings != null) {
|
|
@@ -36,8 +39,14 @@ if (__DEV__) {
|
|
|
36
39
|
);
|
|
37
40
|
}
|
|
38
41
|
}
|
|
42
|
+
|
|
43
|
+
const {
|
|
44
|
+
isProfiling: shouldStartProfilingNow,
|
|
45
|
+
profilingSettings: initialProfilingSettings,
|
|
46
|
+
} = readReloadAndProfileConfig(maybeReactDevToolsRuntimeSettingsModuleModule);
|
|
47
|
+
|
|
39
48
|
// Install hook before React is loaded.
|
|
40
|
-
initialize(hookSettings);
|
|
49
|
+
initialize(hookSettings, shouldStartProfilingNow, initialProfilingSettings);
|
|
41
50
|
|
|
42
51
|
// This should be defined in DEV, otherwise error is expected.
|
|
43
52
|
const fuseboxReactDevToolsDispatcher =
|
|
@@ -63,6 +72,14 @@ if (__DEV__) {
|
|
|
63
72
|
}
|
|
64
73
|
|
|
65
74
|
function connectToReactDevToolsInFusebox(domain: Domain) {
|
|
75
|
+
const {
|
|
76
|
+
isReloadAndProfileSupported,
|
|
77
|
+
isProfiling,
|
|
78
|
+
onReloadAndProfile,
|
|
79
|
+
onReloadAndProfileFlagsReset,
|
|
80
|
+
} = readReloadAndProfileConfig(
|
|
81
|
+
maybeReactDevToolsRuntimeSettingsModuleModule,
|
|
82
|
+
);
|
|
66
83
|
disconnect = connectWithCustomMessagingProtocol({
|
|
67
84
|
onSubscribe: listener => {
|
|
68
85
|
domain.onMessage.addEventListener(listener);
|
|
@@ -76,6 +93,10 @@ if (__DEV__) {
|
|
|
76
93
|
nativeStyleEditorValidAttributes: Object.keys(ReactNativeStyleAttributes),
|
|
77
94
|
resolveRNStyle,
|
|
78
95
|
onSettingsUpdated: handleReactDevToolsSettingsUpdate,
|
|
96
|
+
isReloadAndProfileSupported,
|
|
97
|
+
isProfiling,
|
|
98
|
+
onReloadAndProfile,
|
|
99
|
+
onReloadAndProfileFlagsReset,
|
|
79
100
|
});
|
|
80
101
|
}
|
|
81
102
|
|
|
@@ -127,6 +148,14 @@ if (__DEV__) {
|
|
|
127
148
|
isWebSocketOpen = true;
|
|
128
149
|
});
|
|
129
150
|
|
|
151
|
+
const {
|
|
152
|
+
isReloadAndProfileSupported,
|
|
153
|
+
isProfiling,
|
|
154
|
+
onReloadAndProfile,
|
|
155
|
+
onReloadAndProfileFlagsReset,
|
|
156
|
+
} = readReloadAndProfileConfig(
|
|
157
|
+
maybeReactDevToolsRuntimeSettingsModuleModule,
|
|
158
|
+
);
|
|
130
159
|
connectToDevTools({
|
|
131
160
|
isAppActive,
|
|
132
161
|
resolveRNStyle,
|
|
@@ -135,6 +164,10 @@ if (__DEV__) {
|
|
|
135
164
|
),
|
|
136
165
|
websocket: ws,
|
|
137
166
|
onSettingsUpdated: handleReactDevToolsSettingsUpdate,
|
|
167
|
+
isReloadAndProfileSupported,
|
|
168
|
+
isProfiling,
|
|
169
|
+
onReloadAndProfile,
|
|
170
|
+
onReloadAndProfileFlagsReset,
|
|
138
171
|
});
|
|
139
172
|
}
|
|
140
173
|
}
|
|
@@ -166,3 +199,43 @@ if (__DEV__) {
|
|
|
166
199
|
);
|
|
167
200
|
connectToWSBasedReactDevToolsFrontend(); // Try connecting once on load
|
|
168
201
|
}
|
|
202
|
+
|
|
203
|
+
function readReloadAndProfileConfig(
|
|
204
|
+
maybeModule: ?NativeReactDevToolsRuntimeSettingsModuleSpec,
|
|
205
|
+
) {
|
|
206
|
+
const isReloadAndProfileSupported = maybeModule != null;
|
|
207
|
+
const config = maybeModule?.getReloadAndProfileConfig();
|
|
208
|
+
const isProfiling = config?.shouldReloadAndProfile === true;
|
|
209
|
+
const profilingSettings = {
|
|
210
|
+
recordChangeDescriptions: config?.recordChangeDescriptions === true,
|
|
211
|
+
recordTimeline: false,
|
|
212
|
+
};
|
|
213
|
+
const onReloadAndProfile = (recordChangeDescriptions: boolean) => {
|
|
214
|
+
if (maybeModule == null) {
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
maybeModule.setReloadAndProfileConfig({
|
|
219
|
+
shouldReloadAndProfile: true,
|
|
220
|
+
recordChangeDescriptions,
|
|
221
|
+
});
|
|
222
|
+
};
|
|
223
|
+
const onReloadAndProfileFlagsReset = () => {
|
|
224
|
+
if (maybeModule == null) {
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
maybeModule.setReloadAndProfileConfig({
|
|
229
|
+
shouldReloadAndProfile: false,
|
|
230
|
+
recordChangeDescriptions: false,
|
|
231
|
+
});
|
|
232
|
+
};
|
|
233
|
+
|
|
234
|
+
return {
|
|
235
|
+
isReloadAndProfileSupported,
|
|
236
|
+
isProfiling,
|
|
237
|
+
profilingSettings,
|
|
238
|
+
onReloadAndProfile,
|
|
239
|
+
onReloadAndProfileFlagsReset,
|
|
240
|
+
};
|
|
241
|
+
}
|
|
@@ -21,6 +21,25 @@ if (__DEV__) {
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
const isEventLoopEnabled = (() => {
|
|
25
|
+
if (NativeReactNativeFeatureFlags == null) {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
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
|
+
}
|
|
41
|
+
})();
|
|
42
|
+
|
|
24
43
|
// In bridgeless mode, timers are host functions installed from cpp.
|
|
25
44
|
if (global.RN$Bridgeless !== true) {
|
|
26
45
|
/**
|
|
@@ -48,12 +67,7 @@ if (global.RN$Bridgeless !== true) {
|
|
|
48
67
|
defineLazyTimer('cancelAnimationFrame');
|
|
49
68
|
defineLazyTimer('requestIdleCallback');
|
|
50
69
|
defineLazyTimer('cancelIdleCallback');
|
|
51
|
-
} else if (
|
|
52
|
-
// TODO remove this condition when bridgeless == modern scheduler everywhere.
|
|
53
|
-
NativeReactNativeFeatureFlags != null &&
|
|
54
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks -- false positive due to `use` prefix
|
|
55
|
-
ReactNativeFeatureFlags.useModernRuntimeScheduler()
|
|
56
|
-
) {
|
|
70
|
+
} else if (isEventLoopEnabled) {
|
|
57
71
|
polyfillGlobal(
|
|
58
72
|
'requestIdleCallback',
|
|
59
73
|
() =>
|
|
@@ -72,10 +86,7 @@ if (global.RN$Bridgeless !== true) {
|
|
|
72
86
|
// We need to check if the native module is available before accessing the
|
|
73
87
|
// feature flag, because otherwise the API would throw an error in the legacy
|
|
74
88
|
// architecture in OSS, where the native module isn't available.
|
|
75
|
-
if (
|
|
76
|
-
NativeReactNativeFeatureFlags != null &&
|
|
77
|
-
ReactNativeFeatureFlags.enableMicrotasks()
|
|
78
|
-
) {
|
|
89
|
+
if (isEventLoopEnabled) {
|
|
79
90
|
// This is the flag that tells React to use `queueMicrotask` to batch state
|
|
80
91
|
// updates, instead of using the scheduler to schedule a regular task.
|
|
81
92
|
// We use a global variable because we don't currently have any other
|
|
@@ -166,11 +166,9 @@ let BaseImage: AbstractImageAndroid = React.forwardRef(
|
|
|
166
166
|
sources = [source];
|
|
167
167
|
}
|
|
168
168
|
|
|
169
|
-
const {height, width, ...restProps} = props;
|
|
170
|
-
|
|
171
169
|
const {onLoadStart, onLoad, onLoadEnd, onError} = props;
|
|
172
170
|
const nativeProps = {
|
|
173
|
-
...
|
|
171
|
+
...props,
|
|
174
172
|
style,
|
|
175
173
|
shouldNotifyLoadEvents: !!(onLoadStart || onLoad || onLoadEnd || onError),
|
|
176
174
|
// Both iOS and C++ sides expect to have "source" prop, whereas on Android it's "src"
|
|
@@ -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
64
|
*
|
|
65
|
-
*
|
|
65
|
+
* - `auto`: Use heuristics to pick between `resize` and `scale`.
|
|
66
66
|
*
|
|
67
|
-
*
|
|
68
|
-
* This should be used instead of scale when the image is much larger
|
|
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.
|
|
69
70
|
*
|
|
70
|
-
*
|
|
71
|
-
* and produces higher quality images. This
|
|
72
|
-
*
|
|
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.
|
|
75
|
+
*
|
|
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.
|
|
79
|
+
*
|
|
80
|
+
* More details about `resize` and `scale` can be found at http://frescolib.org/docs/resizing-rotating.html.
|
|
81
|
+
*
|
|
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
|
|
@@ -193,27 +203,6 @@ export interface ImagePropsBase
|
|
|
193
203
|
*/
|
|
194
204
|
resizeMode?: ImageResizeMode | undefined;
|
|
195
205
|
|
|
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
|
-
*
|
|
200
|
-
* - `auto`: Use heuristics to pick between `resize` and `scale`.
|
|
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
|
|
214
|
-
*/
|
|
215
|
-
resizeMethod?: 'auto' | 'resize' | 'scale' | undefined;
|
|
216
|
-
|
|
217
206
|
/**
|
|
218
207
|
* The image source (either a remote URL or a local file resource).
|
|
219
208
|
*
|
|
@@ -145,9 +145,7 @@ let BaseImage: AbstractImageIOS = React.forwardRef((props, forwardedRef) => {
|
|
|
145
145
|
'aria-disabled': ariaDisabled,
|
|
146
146
|
'aria-expanded': ariaExpanded,
|
|
147
147
|
'aria-selected': ariaSelected,
|
|
148
|
-
height,
|
|
149
148
|
src,
|
|
150
|
-
width,
|
|
151
149
|
...restProps
|
|
152
150
|
} = props;
|
|
153
151
|
|
|
@@ -164,9 +164,7 @@ let BaseImage: AbstractImageIOS = React.forwardRef((props, forwardedRef) => {
|
|
|
164
164
|
'aria-multiselectable': ariaMultiselectable, // Win32
|
|
165
165
|
'aria-required': ariaRequired, // Win32
|
|
166
166
|
'aria-selected': ariaSelected,
|
|
167
|
-
height,
|
|
168
167
|
src,
|
|
169
|
-
width,
|
|
170
168
|
...restProps
|
|
171
169
|
} = props;
|
|
172
170
|
|
|
@@ -17,6 +17,7 @@ import type {
|
|
|
17
17
|
} from '../Renderer/shims/ReactNativeTypes';
|
|
18
18
|
import type {ViewStyleProp} from '../StyleSheet/StyleSheet';
|
|
19
19
|
import type {ReactDevToolsAgent} from '../Types/ReactDevToolsTypes';
|
|
20
|
+
|
|
20
21
|
import SafeAreaView from '../../src/private/components/SafeAreaView_INTERNAL_DO_NOT_USE';
|
|
21
22
|
|
|
22
23
|
const View = require('../Components/View/View');
|
|
@@ -17,6 +17,7 @@ import type {
|
|
|
17
17
|
} from '../Renderer/shims/ReactNativeTypes';
|
|
18
18
|
import type {ViewStyleProp} from '../StyleSheet/StyleSheet';
|
|
19
19
|
import type {ReactDevToolsAgent} from '../Types/ReactDevToolsTypes';
|
|
20
|
+
|
|
20
21
|
import SafeAreaView from '../../src/private/components/SafeAreaView_INTERNAL_DO_NOT_USE';
|
|
21
22
|
|
|
22
23
|
const PressabilityDebug = require('../Pressability/PressabilityDebug');
|
|
@@ -16,7 +16,7 @@ import type {
|
|
|
16
16
|
SectionBase as _SectionBase,
|
|
17
17
|
VirtualizedSectionListProps,
|
|
18
18
|
} from '@react-native/virtualized-lists';
|
|
19
|
-
import type {
|
|
19
|
+
import type {ElementRef} from 'react';
|
|
20
20
|
|
|
21
21
|
import Platform from '../Utilities/Platform';
|
|
22
22
|
import {VirtualizedSectionList} from '@react-native/virtualized-lists';
|
|
@@ -93,7 +93,7 @@ type OptionalProps<SectionT: SectionBase<any>> = {|
|
|
|
93
93
|
removeClippedSubviews?: boolean,
|
|
94
94
|
|};
|
|
95
95
|
|
|
96
|
-
export type Props<SectionT
|
|
96
|
+
export type Props<SectionT: SectionBase<any>> = $ReadOnly<{|
|
|
97
97
|
...$Diff<
|
|
98
98
|
VirtualizedSectionListProps<SectionT>,
|
|
99
99
|
{
|
|
@@ -115,7 +115,7 @@ export type Props<SectionT> = {|
|
|
|
115
115
|
>,
|
|
116
116
|
...RequiredProps<SectionT>,
|
|
117
117
|
...OptionalProps<SectionT>,
|
|
118
|
-
|}
|
|
118
|
+
|}>;
|
|
119
119
|
|
|
120
120
|
/**
|
|
121
121
|
* A performant interface for rendering sectioned lists, supporting the most handy features:
|
|
@@ -172,10 +172,10 @@ export type Props<SectionT> = {|
|
|
|
172
172
|
* Alternatively, you can provide a custom `keyExtractor` prop.
|
|
173
173
|
*
|
|
174
174
|
*/
|
|
175
|
-
const SectionList:
|
|
176
|
-
|
|
177
|
-
any
|
|
178
|
-
>((props, ref) => {
|
|
175
|
+
const SectionList: component(
|
|
176
|
+
ref?: React.RefSetter<any>,
|
|
177
|
+
...Props<SectionBase<any>>
|
|
178
|
+
) = forwardRef<Props<SectionBase<any>>, any>((props, ref) => {
|
|
179
179
|
const propsWithDefaults = {
|
|
180
180
|
stickySectionHeadersEnabled: Platform.OS === 'ios',
|
|
181
181
|
...props,
|
|
@@ -421,7 +421,7 @@ type State = $ReadOnly<{|
|
|
|
421
421
|
selectedLogIndex: number,
|
|
422
422
|
|}>;
|
|
423
423
|
|
|
424
|
-
type SubscribedComponent = React.
|
|
424
|
+
type SubscribedComponent = React.ComponentType<
|
|
425
425
|
$ReadOnly<{|
|
|
426
426
|
logs: $ReadOnlyArray<LogBoxLog>,
|
|
427
427
|
isDisabled: boolean,
|
|
@@ -431,7 +431,7 @@ type SubscribedComponent = React.AbstractComponent<
|
|
|
431
431
|
|
|
432
432
|
export function withSubscription(
|
|
433
433
|
WrappedComponent: SubscribedComponent,
|
|
434
|
-
): React.
|
|
434
|
+
): React.ComponentType<{||}> {
|
|
435
435
|
class LogBoxStateSubscription extends React.Component<Props, State> {
|
|
436
436
|
static getDerivedStateFromError(): {hasError: boolean} {
|
|
437
437
|
return {hasError: true};
|
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
* @format
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
+
import SafeAreaView from '../../src/private/components/SafeAreaView_INTERNAL_DO_NOT_USE';
|
|
11
12
|
import View from '../Components/View/View';
|
|
12
13
|
import StyleSheet from '../StyleSheet/StyleSheet';
|
|
13
14
|
import * as LogBoxData from './Data/LogBoxData';
|
|
14
15
|
import LogBoxLog from './Data/LogBoxLog';
|
|
15
16
|
import LogBoxLogNotification from './UI/LogBoxNotification';
|
|
16
17
|
import * as React from 'react';
|
|
17
|
-
import SafeAreaView from '../../src/private/components/SafeAreaView_INTERNAL_DO_NOT_USE';
|
|
18
18
|
|
|
19
19
|
type Props = $ReadOnly<{|
|
|
20
20
|
logs: $ReadOnlyArray<LogBoxLog>,
|
|
@@ -102,4 +102,4 @@ const styles = StyleSheet.create({
|
|
|
102
102
|
|
|
103
103
|
export default (LogBoxData.withSubscription(
|
|
104
104
|
_LogBoxNotificationContainer,
|
|
105
|
-
): React.
|
|
105
|
+
): React.ComponentType<{||}>);
|
|
@@ -27,7 +27,7 @@ type Props = $ReadOnly<{
|
|
|
27
27
|
level: LogLevel,
|
|
28
28
|
}>;
|
|
29
29
|
|
|
30
|
-
const LogBoxInspectorHeaderSafeArea: React.
|
|
30
|
+
const LogBoxInspectorHeaderSafeArea: React.ComponentType<ViewProps> =
|
|
31
31
|
Platform.OS === 'android' ? View : SafeAreaView;
|
|
32
32
|
|
|
33
33
|
export default function LogBoxInspectorHeader(props: Props): React.Node {
|
|
@@ -29,7 +29,7 @@ type Props = $ReadOnly<{
|
|
|
29
29
|
level: LogLevel,
|
|
30
30
|
}>;
|
|
31
31
|
|
|
32
|
-
const LogBoxInspectorHeaderSafeArea: React.
|
|
32
|
+
const LogBoxInspectorHeaderSafeArea: React.ComponentType<ViewProps> =
|
|
33
33
|
Platform.OS === 'android' ? View : SafeAreaView;
|
|
34
34
|
|
|
35
35
|
export default function LogBoxInspectorHeader(props: Props): React.Node {
|
package/Libraries/Modal/Modal.js
CHANGED
|
@@ -224,6 +224,9 @@ class Modal extends React.Component<Props, State> {
|
|
|
224
224
|
}
|
|
225
225
|
|
|
226
226
|
componentWillUnmount() {
|
|
227
|
+
if (Platform.OS === 'ios') {
|
|
228
|
+
this.setState({isRendered: false});
|
|
229
|
+
}
|
|
227
230
|
if (this._eventSubscription) {
|
|
228
231
|
this._eventSubscription.remove();
|
|
229
232
|
}
|
|
@@ -339,8 +342,7 @@ const styles = StyleSheet.create({
|
|
|
339
342
|
},
|
|
340
343
|
});
|
|
341
344
|
|
|
342
|
-
const ExportedModal: React.
|
|
343
|
-
|
|
344
|
-
> = ModalInjection.unstable_Modal ?? Modal;
|
|
345
|
+
const ExportedModal: React.ComponentType<React.ElementConfig<typeof Modal>> =
|
|
346
|
+
ModalInjection.unstable_Modal ?? Modal;
|
|
345
347
|
|
|
346
348
|
module.exports = ExportedModal;
|
|
@@ -294,6 +294,71 @@ const validAttributesForNonEventProps = {
|
|
|
294
294
|
style: ReactNativeStyleAttributes,
|
|
295
295
|
|
|
296
296
|
experimental_layoutConformance: true,
|
|
297
|
+
|
|
298
|
+
// ReactClippingViewManager @ReactProps
|
|
299
|
+
removeClippedSubviews: true,
|
|
300
|
+
|
|
301
|
+
// ReactViewManager @ReactProps
|
|
302
|
+
accessible: true,
|
|
303
|
+
hasTVPreferredFocus: true,
|
|
304
|
+
nextFocusDown: true,
|
|
305
|
+
nextFocusForward: true,
|
|
306
|
+
nextFocusLeft: true,
|
|
307
|
+
nextFocusRight: true,
|
|
308
|
+
nextFocusUp: true,
|
|
309
|
+
|
|
310
|
+
borderRadius: true,
|
|
311
|
+
borderTopLeftRadius: true,
|
|
312
|
+
borderTopRightRadius: true,
|
|
313
|
+
borderBottomRightRadius: true,
|
|
314
|
+
borderBottomLeftRadius: true,
|
|
315
|
+
borderTopStartRadius: true,
|
|
316
|
+
borderTopEndRadius: true,
|
|
317
|
+
borderBottomStartRadius: true,
|
|
318
|
+
borderBottomEndRadius: true,
|
|
319
|
+
borderEndEndRadius: true,
|
|
320
|
+
borderEndStartRadius: true,
|
|
321
|
+
borderStartEndRadius: true,
|
|
322
|
+
borderStartStartRadius: true,
|
|
323
|
+
borderStyle: true,
|
|
324
|
+
hitSlop: true,
|
|
325
|
+
pointerEvents: true,
|
|
326
|
+
nativeBackgroundAndroid: true,
|
|
327
|
+
nativeForegroundAndroid: true,
|
|
328
|
+
needsOffscreenAlphaCompositing: true,
|
|
329
|
+
|
|
330
|
+
borderColor: {
|
|
331
|
+
process: require('../StyleSheet/processColor').default,
|
|
332
|
+
},
|
|
333
|
+
borderLeftColor: {
|
|
334
|
+
process: require('../StyleSheet/processColor').default,
|
|
335
|
+
},
|
|
336
|
+
borderRightColor: {
|
|
337
|
+
process: require('../StyleSheet/processColor').default,
|
|
338
|
+
},
|
|
339
|
+
borderTopColor: {
|
|
340
|
+
process: require('../StyleSheet/processColor').default,
|
|
341
|
+
},
|
|
342
|
+
borderBottomColor: {
|
|
343
|
+
process: require('../StyleSheet/processColor').default,
|
|
344
|
+
},
|
|
345
|
+
borderStartColor: {
|
|
346
|
+
process: require('../StyleSheet/processColor').default,
|
|
347
|
+
},
|
|
348
|
+
borderEndColor: {
|
|
349
|
+
process: require('../StyleSheet/processColor').default,
|
|
350
|
+
},
|
|
351
|
+
borderBlockColor: {
|
|
352
|
+
process: require('../StyleSheet/processColor').default,
|
|
353
|
+
},
|
|
354
|
+
borderBlockEndColor: {
|
|
355
|
+
process: require('../StyleSheet/processColor').default,
|
|
356
|
+
},
|
|
357
|
+
borderBlockStartColor: {
|
|
358
|
+
process: require('../StyleSheet/processColor').default,
|
|
359
|
+
},
|
|
360
|
+
focusable: true,
|
|
361
|
+
backfaceVisibility: true,
|
|
297
362
|
};
|
|
298
363
|
|
|
299
364
|
// Props for bubbling and direct events
|
|
@@ -48,7 +48,7 @@ export function setRuntimeConfigProvider(
|
|
|
48
48
|
* The supplied `viewConfigProvider` may or may not be invoked and utilized,
|
|
49
49
|
* depending on how `setRuntimeConfigProvider` is configured.
|
|
50
50
|
*/
|
|
51
|
-
export function get<Config>(
|
|
51
|
+
export function get<Config: {...}>(
|
|
52
52
|
name: string,
|
|
53
53
|
viewConfigProvider: () => PartialViewConfig,
|
|
54
54
|
): HostComponent<Config> {
|
|
@@ -121,10 +121,10 @@ export function get<Config>(
|
|
|
121
121
|
* that the return value of this is not `HostComponent` because the returned
|
|
122
122
|
* component instance is not guaranteed to have native methods.
|
|
123
123
|
*/
|
|
124
|
-
export function getWithFallback_DEPRECATED<Config>(
|
|
124
|
+
export function getWithFallback_DEPRECATED<Config: {...}>(
|
|
125
125
|
name: string,
|
|
126
126
|
viewConfigProvider: () => PartialViewConfig,
|
|
127
|
-
): React.
|
|
127
|
+
): React.ComponentType<Config> {
|
|
128
128
|
if (getRuntimeConfig == null) {
|
|
129
129
|
// `getRuntimeConfig == null` when static view configs are disabled
|
|
130
130
|
// If `setRuntimeConfigProvider` is not configured, use native reflection.
|