@office-iss/react-native-win32 0.0.0-canary.271 → 0.0.0-canary.273
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/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 +4 -4
- package/Libraries/Components/Button.js +3 -0
- package/Libraries/Components/Button.win32.js +3 -0
- package/Libraries/Components/Keyboard/KeyboardAvoidingView.js +5 -0
- package/Libraries/Components/Pressable/Pressable.js +4 -4
- package/Libraries/Components/Pressable/Pressable.win32.js +4 -4
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js +9 -6
- package/Libraries/Components/SafeAreaView/SafeAreaView.js +4 -4
- package/Libraries/Components/SafeAreaView/SafeAreaView.win32.js +4 -4
- package/Libraries/Components/ScrollView/ScrollView.js +5 -5
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +6 -6
- package/Libraries/Components/TextInput/TextInput.d.ts +4 -0
- package/Libraries/Components/TextInput/TextInput.flow.js +2 -0
- package/Libraries/Components/TextInput/TextInput.js +6 -4
- package/Libraries/Components/TextInput/TextInput.win32.js +6 -4
- package/Libraries/Components/Touchable/TouchableBounce.js +4 -1
- package/Libraries/Components/Touchable/TouchableHighlight.js +4 -4
- package/Libraries/Components/Touchable/TouchableOpacity.js +4 -4
- package/Libraries/Components/View/View.js +4 -4
- package/Libraries/Components/View/View.win32.js +4 -4
- package/Libraries/Components/View/ViewNativeComponent.js +3 -88
- package/Libraries/Core/ExceptionsManager.js +3 -2
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Core/setUpReactDevTools.js +74 -1
- package/Libraries/Core/setUpTimers.js +21 -10
- package/Libraries/Debugging/DebuggingOverlay.js +4 -5
- package/Libraries/Image/Image.android.js +1 -3
- package/Libraries/Image/Image.ios.js +0 -2
- package/Libraries/Image/Image.win32.js +0 -2
- package/Libraries/Image/ImageProps.js +4 -4
- package/Libraries/Image/ImageTypes.flow.js +11 -9
- package/Libraries/Inspector/Inspector.js +1 -0
- package/Libraries/Inspector/Inspector.win32.js +1 -0
- package/Libraries/LogBox/LogBox.js +18 -5
- package/Libraries/LogBox/LogBoxNotificationContainer.js +1 -1
- package/Libraries/Modal/Modal.js +3 -0
- package/Libraries/NativeComponent/BaseViewConfig.android.js +65 -0
- package/Libraries/ReactNative/AppRegistry.js +1 -1
- package/Libraries/Renderer/shims/ReactNativeTypes.js +1 -9
- package/Libraries/StyleSheet/StyleSheetTypes.d.ts +1 -1
- package/Libraries/StyleSheet/StyleSheetTypes.js +1 -1
- package/Libraries/Text/Text.js +1 -4
- package/Libraries/Text/Text.win32.js +1 -4
- package/Libraries/Utilities/FocusManager.win32.js +1 -1
- package/Libraries/Utilities/Platform.flow.win32.js +1 -0
- package/Libraries/Utilities/useMergeRefs.js +26 -7
- package/Libraries/promiseRejectionTrackingOptions.js +1 -1
- package/index.js +1 -1
- package/index.win32.js +1 -1
- package/jest/setup.js +1 -0
- package/overrides.json +13 -14
- package/package.json +14 -14
- 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 +2 -1
- package/src/private/components/VScrollViewNativeComponents.js +4 -5
- package/src/private/featureflags/ReactNativeFeatureFlags.js +12 -12
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +3 -3
- package/src/private/fusebox/specs/NativeReactDevToolsRuntimeSettingsModule.js +34 -0
- package/src/private/specs/modules/NativeAppearance.js +4 -10
- 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/specs/NativePerformance.js +18 -2
- package/src/private/webapis/performance/specs/__mocks__/NativePerformanceMock.js +32 -12
|
@@ -22,10 +22,11 @@ type ExceptionDecorator = ExceptionData => ExceptionData;
|
|
|
22
22
|
let userExceptionDecorator: ?ExceptionDecorator;
|
|
23
23
|
let inUserExceptionDecorator = false;
|
|
24
24
|
|
|
25
|
-
// This
|
|
25
|
+
// This string is used to decorate an ExtendedError with extra data in select usecases.
|
|
26
26
|
// Note that data passed using this method should be strictly contained,
|
|
27
27
|
// as data that's not serializable/too large may cause issues with passing the error to the native code.
|
|
28
|
-
|
|
28
|
+
// TODO(T204185517): We should use a Symbol for this, but jsi through jsc doesn't support it yet.
|
|
29
|
+
const decoratedExtraDataKey = 'RN$ErrorExtraDataKey';
|
|
29
30
|
|
|
30
31
|
/**
|
|
31
32
|
* Allows the app to add information to the exception report before it is sent
|
|
@@ -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
|
|
@@ -102,10 +102,9 @@ const styles = StyleSheet.create({
|
|
|
102
102
|
},
|
|
103
103
|
});
|
|
104
104
|
|
|
105
|
-
const DebuggingOverlayWithForwardedRef:
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
> = React.forwardRef(DebuggingOverlay);
|
|
105
|
+
const DebuggingOverlayWithForwardedRef: component(
|
|
106
|
+
ref: React.RefSetter<DebuggingOverlayHandle>,
|
|
107
|
+
...props: {}
|
|
108
|
+
) = React.forwardRef(DebuggingOverlay);
|
|
110
109
|
|
|
111
110
|
export default DebuggingOverlayWithForwardedRef;
|
|
@@ -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"
|
|
@@ -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
|
|
|
@@ -20,7 +20,7 @@ import type {
|
|
|
20
20
|
import type {LayoutEvent, SyntheticEvent} from '../Types/CoreEventTypes';
|
|
21
21
|
import typeof Image from './Image';
|
|
22
22
|
import type {ImageSource} from './ImageSource';
|
|
23
|
-
import type {Node,
|
|
23
|
+
import type {ElementRef, Node, RefSetter} from 'react';
|
|
24
24
|
|
|
25
25
|
export type ImageLoadEvent = SyntheticEvent<
|
|
26
26
|
$ReadOnly<{|
|
|
@@ -77,7 +77,7 @@ type AndroidImageProps = $ReadOnly<{|
|
|
|
77
77
|
resizeMultiplier?: ?number,
|
|
78
78
|
|}>;
|
|
79
79
|
|
|
80
|
-
export type ImageProps = {|
|
|
80
|
+
export type ImageProps = $ReadOnly<{|
|
|
81
81
|
...$Diff<ViewProps, $ReadOnly<{|style: ?ViewStyleProp|}>>,
|
|
82
82
|
...IOSImageProps,
|
|
83
83
|
...AndroidImageProps,
|
|
@@ -266,7 +266,7 @@ export type ImageProps = {|
|
|
|
266
266
|
*/
|
|
267
267
|
srcSet?: ?string,
|
|
268
268
|
children?: empty,
|
|
269
|
-
|}
|
|
269
|
+
|}>;
|
|
270
270
|
|
|
271
271
|
export type ImageBackgroundProps = $ReadOnly<{|
|
|
272
272
|
...ImageProps,
|
|
@@ -291,5 +291,5 @@ export type ImageBackgroundProps = $ReadOnly<{|
|
|
|
291
291
|
*
|
|
292
292
|
* See https://reactnative.dev/docs/imagebackground#imageref
|
|
293
293
|
*/
|
|
294
|
-
imageRef?:
|
|
294
|
+
imageRef?: RefSetter<ElementRef<Image>>,
|
|
295
295
|
|}>;
|
|
@@ -56,18 +56,20 @@ type ImageComponentStaticsAndroid = $ReadOnly<{
|
|
|
56
56
|
abortPrefetch(requestId: number): void,
|
|
57
57
|
}>;
|
|
58
58
|
|
|
59
|
-
export type AbstractImageAndroid =
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
59
|
+
export type AbstractImageAndroid = component(
|
|
60
|
+
ref: React.RefSetter<
|
|
61
|
+
| React.ElementRef<TextInlineImageNativeComponent>
|
|
62
|
+
| React.ElementRef<ImageViewNativeComponent>,
|
|
63
|
+
>,
|
|
64
|
+
...props: ImagePropsType
|
|
65
|
+
);
|
|
64
66
|
|
|
65
67
|
export type ImageAndroid = AbstractImageAndroid & ImageComponentStaticsAndroid;
|
|
66
68
|
|
|
67
|
-
export type AbstractImageIOS =
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
export type AbstractImageIOS = component(
|
|
70
|
+
ref: React.RefSetter<React.ElementRef<ImageViewNativeComponent>>,
|
|
71
|
+
...props: ImagePropsType
|
|
72
|
+
);
|
|
71
73
|
|
|
72
74
|
export type ImageIOS = AbstractImageIOS & ImageComponentStaticsIOS;
|
|
73
75
|
|
|
@@ -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');
|
|
@@ -52,6 +52,17 @@ if (__DEV__) {
|
|
|
52
52
|
|
|
53
53
|
isLogBoxInstalled = true;
|
|
54
54
|
|
|
55
|
+
if (global.RN$registerExceptionListener != null) {
|
|
56
|
+
global.RN$registerExceptionListener(
|
|
57
|
+
(error: ExtendedExceptionData & {preventDefault: () => mixed}) => {
|
|
58
|
+
if (!error.isFatal) {
|
|
59
|
+
error.preventDefault();
|
|
60
|
+
addException(error);
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
55
66
|
// Trigger lazy initialization of module.
|
|
56
67
|
require('../NativeModules/specs/NativeLogBox');
|
|
57
68
|
|
|
@@ -122,13 +133,15 @@ if (__DEV__) {
|
|
|
122
133
|
}
|
|
123
134
|
},
|
|
124
135
|
|
|
125
|
-
addException
|
|
126
|
-
if (isLogBoxInstalled) {
|
|
127
|
-
LogBoxData.addException(error);
|
|
128
|
-
}
|
|
129
|
-
},
|
|
136
|
+
addException,
|
|
130
137
|
};
|
|
131
138
|
|
|
139
|
+
function addException(error: ExtendedExceptionData): void {
|
|
140
|
+
if (isLogBoxInstalled) {
|
|
141
|
+
LogBoxData.addException(error);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
132
145
|
const isRCTLogAdviceWarning = (...args: Array<mixed>) => {
|
|
133
146
|
// RCTLogAdvice is a native logging function designed to show users
|
|
134
147
|
// a message in the console, but not show it to them in Logbox.
|
|
@@ -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>,
|
package/Libraries/Modal/Modal.js
CHANGED
|
@@ -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
|
|
@@ -13,8 +13,8 @@ import type {RootTag} from '../Types/RootTagTypes';
|
|
|
13
13
|
import type {IPerformanceLogger} from '../Utilities/createPerformanceLogger';
|
|
14
14
|
import type {DisplayModeType} from './DisplayMode';
|
|
15
15
|
|
|
16
|
-
import registerCallableModule from '../Core/registerCallableModule';
|
|
17
16
|
import BugReporting from '../BugReporting/BugReporting';
|
|
17
|
+
import registerCallableModule from '../Core/registerCallableModule';
|
|
18
18
|
import createPerformanceLogger from '../Utilities/createPerformanceLogger';
|
|
19
19
|
import infoLog from '../Utilities/infoLog';
|
|
20
20
|
import SceneTracker from '../Utilities/SceneTracker';
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @noformat
|
|
8
8
|
* @nolint
|
|
9
9
|
* @flow strict
|
|
10
|
-
* @generated SignedSource<<
|
|
10
|
+
* @generated SignedSource<<448b89d0a61a392d9c1eb921f7d51d37>>
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
import type {
|
|
@@ -140,13 +140,6 @@ declare const ensureNativeMethodsAreSynced: NativeMethods;
|
|
|
140
140
|
export type HostInstance = NativeMethods;
|
|
141
141
|
export type HostComponent<Config> = AbstractComponent<Config, HostInstance>;
|
|
142
142
|
|
|
143
|
-
type SecretInternalsType = {
|
|
144
|
-
computeComponentStackForErrorReporting(tag: number): string,
|
|
145
|
-
// TODO (bvaughn) Decide which additional types to expose here?
|
|
146
|
-
// And how much information to fill in for the above types.
|
|
147
|
-
...
|
|
148
|
-
};
|
|
149
|
-
|
|
150
143
|
type InspectorDataProps = $ReadOnly<{
|
|
151
144
|
[propName: string]: string,
|
|
152
145
|
...
|
|
@@ -234,7 +227,6 @@ export type ReactNativeType = {
|
|
|
234
227
|
unmountComponentAtNode(containerTag: number): void,
|
|
235
228
|
unmountComponentAtNodeAndRemoveContainer(containerTag: number): void,
|
|
236
229
|
+unstable_batchedUpdates: <T>(fn: (T) => void, bookkeeping: T) => void,
|
|
237
|
-
+__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: SecretInternalsType,
|
|
238
230
|
...
|
|
239
231
|
};
|
|
240
232
|
|
|
@@ -56,7 +56,7 @@ export interface FlexStyle {
|
|
|
56
56
|
borderWidth?: number | undefined;
|
|
57
57
|
bottom?: DimensionValue | undefined;
|
|
58
58
|
boxSizing?: 'border-box' | 'content-box' | undefined;
|
|
59
|
-
display?: 'none' | 'flex' | undefined;
|
|
59
|
+
display?: 'none' | 'flex' | 'contents' | undefined;
|
|
60
60
|
end?: DimensionValue | undefined;
|
|
61
61
|
flex?: number | undefined;
|
|
62
62
|
flexBasis?: DimensionValue | undefined;
|
|
@@ -58,7 +58,7 @@ type ____LayoutStyle_Internal = $ReadOnly<{
|
|
|
58
58
|
* It works similarly to `display` in CSS, but only support 'flex' and 'none'.
|
|
59
59
|
* 'flex' is the default.
|
|
60
60
|
*/
|
|
61
|
-
display?: 'none' | 'flex',
|
|
61
|
+
display?: 'none' | 'flex' | 'contents',
|
|
62
62
|
|
|
63
63
|
/** `width` sets the width of this component.
|
|
64
64
|
*
|
package/Libraries/Text/Text.js
CHANGED
|
@@ -115,7 +115,7 @@ const Text: component(
|
|
|
115
115
|
|
|
116
116
|
// TODO: Move this processing to the view configuration.
|
|
117
117
|
const _selectionColor =
|
|
118
|
-
selectionColor
|
|
118
|
+
selectionColor != null ? processColor(selectionColor) : undefined;
|
|
119
119
|
|
|
120
120
|
let _style = style;
|
|
121
121
|
if (__DEV__) {
|
|
@@ -208,8 +208,6 @@ const Text: component(
|
|
|
208
208
|
{...restProps}
|
|
209
209
|
accessibilityLabel={_accessibilityLabel}
|
|
210
210
|
accessibilityState={_accessibilityState}
|
|
211
|
-
isHighlighted={false}
|
|
212
|
-
isPressable={false}
|
|
213
211
|
nativeID={_nativeID}
|
|
214
212
|
numberOfLines={_numberOfLines}
|
|
215
213
|
ref={forwardedRef}
|
|
@@ -288,7 +286,6 @@ const Text: component(
|
|
|
288
286
|
allowFontScaling={allowFontScaling !== false}
|
|
289
287
|
disabled={_disabled}
|
|
290
288
|
ellipsizeMode={ellipsizeMode ?? 'tail'}
|
|
291
|
-
isHighlighted={false}
|
|
292
289
|
nativeID={_nativeID}
|
|
293
290
|
numberOfLines={_numberOfLines}
|
|
294
291
|
ref={forwardedRef}
|
|
@@ -143,7 +143,7 @@ const Text: component(
|
|
|
143
143
|
|
|
144
144
|
// TODO: Move this processing to the view configuration.
|
|
145
145
|
const _selectionColor =
|
|
146
|
-
selectionColor
|
|
146
|
+
selectionColor != null ? processColor(selectionColor) : undefined;
|
|
147
147
|
|
|
148
148
|
let _style = style;
|
|
149
149
|
if (__DEV__) {
|
|
@@ -248,8 +248,6 @@ const Text: component(
|
|
|
248
248
|
accessibilityLevel={_accessibilityLevel} // Win32
|
|
249
249
|
accessibilityPositionInSet={_accessibilityPositionInSet} // Win32
|
|
250
250
|
accessibilitySetSize={_accessibilitySetSize} // Win32
|
|
251
|
-
isHighlighted={false}
|
|
252
|
-
isPressable={false}
|
|
253
251
|
nativeID={_nativeID}
|
|
254
252
|
numberOfLines={_numberOfLines}
|
|
255
253
|
ref={forwardedRef}
|
|
@@ -328,7 +326,6 @@ const Text: component(
|
|
|
328
326
|
allowFontScaling={allowFontScaling !== false}
|
|
329
327
|
disabled={_disabled}
|
|
330
328
|
ellipsizeMode={ellipsizeMode ?? 'tail'}
|
|
331
|
-
isHighlighted={false}
|
|
332
329
|
nativeID={_nativeID}
|
|
333
330
|
numberOfLines={_numberOfLines}
|
|
334
331
|
ref={forwardedRef}
|
|
@@ -18,7 +18,7 @@ class FocusManager {
|
|
|
18
18
|
// This function takes in a ref to a React Component and a bool value. If setWindowFocus = true, call aggressive focus.
|
|
19
19
|
// Else, call polite focus
|
|
20
20
|
|
|
21
|
-
static focus(ref: React.
|
|
21
|
+
static focus(ref: React.RefObject<any>, setWindowFocus: boolean) {
|
|
22
22
|
if (ref) {
|
|
23
23
|
if (setWindowFocus) {
|
|
24
24
|
UIManager.dispatchViewManagerCommand(
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* @format
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
+
import useRefEffect from './useRefEffect';
|
|
11
12
|
import * as React from 'react';
|
|
12
13
|
import {useCallback} from 'react';
|
|
13
14
|
|
|
@@ -22,19 +23,37 @@ import {useCallback} from 'react';
|
|
|
22
23
|
*/
|
|
23
24
|
export default function useMergeRefs<Instance>(
|
|
24
25
|
...refs: $ReadOnlyArray<?React.RefSetter<Instance>>
|
|
25
|
-
):
|
|
26
|
-
|
|
27
|
-
(current: Instance
|
|
28
|
-
|
|
29
|
-
if (ref
|
|
26
|
+
): React.RefSetter<Instance> {
|
|
27
|
+
const refEffect = useCallback(
|
|
28
|
+
(current: Instance) => {
|
|
29
|
+
const cleanups: $ReadOnlyArray<void | (() => void)> = refs.map(ref => {
|
|
30
|
+
if (ref == null) {
|
|
31
|
+
return undefined;
|
|
32
|
+
} else {
|
|
30
33
|
if (typeof ref === 'function') {
|
|
31
|
-
ref
|
|
34
|
+
// $FlowIssue[incompatible-type] - Flow does not understand ref cleanup.
|
|
35
|
+
const cleanup: void | (() => void) = ref(current);
|
|
36
|
+
return typeof cleanup === 'function'
|
|
37
|
+
? cleanup
|
|
38
|
+
: () => {
|
|
39
|
+
ref(null);
|
|
40
|
+
};
|
|
32
41
|
} else {
|
|
33
42
|
ref.current = current;
|
|
43
|
+
return () => {
|
|
44
|
+
ref.current = null;
|
|
45
|
+
};
|
|
34
46
|
}
|
|
35
47
|
}
|
|
36
|
-
}
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
return () => {
|
|
51
|
+
for (const cleanup of cleanups) {
|
|
52
|
+
cleanup?.();
|
|
53
|
+
}
|
|
54
|
+
};
|
|
37
55
|
},
|
|
38
56
|
[...refs], // eslint-disable-line react-hooks/exhaustive-deps
|
|
39
57
|
);
|
|
58
|
+
return useRefEffect(refEffect);
|
|
40
59
|
}
|