@office-iss/react-native-win32 0.76.2 → 0.77.0-preview.2
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/.eslintignore +1 -1
- package/.flowconfig +5 -1
- package/CHANGELOG.json +179 -53
- package/CHANGELOG.md +82 -28
- package/Libraries/ActionSheetIOS/ActionSheetIOS.d.ts +1 -0
- package/Libraries/ActionSheetIOS/ActionSheetIOS.js +13 -0
- package/Libraries/Animated/AnimatedEvent.js +1 -1
- package/Libraries/Animated/AnimatedImplementation.js +2 -2
- package/Libraries/Animated/NativeAnimatedAllowlist.js +20 -9
- package/Libraries/Animated/animations/Animation.js +60 -25
- package/Libraries/Animated/animations/DecayAnimation.js +26 -38
- package/Libraries/Animated/animations/SpringAnimation.js +33 -39
- package/Libraries/Animated/animations/TimingAnimation.js +34 -42
- package/Libraries/Animated/components/AnimatedFlatList.js +1 -1
- package/Libraries/Animated/components/AnimatedSectionList.js +3 -1
- package/Libraries/Animated/createAnimatedComponent.js +60 -33
- package/Libraries/Animated/nodes/AnimatedColor.js +1 -1
- package/Libraries/Animated/nodes/AnimatedInterpolation.js +1 -1
- package/Libraries/Animated/nodes/AnimatedNode.js +39 -45
- package/Libraries/Animated/nodes/AnimatedObject.js +13 -3
- package/Libraries/Animated/nodes/AnimatedProps.js +104 -46
- package/Libraries/Animated/nodes/AnimatedStyle.js +116 -39
- package/Libraries/Animated/nodes/AnimatedTransform.js +56 -23
- package/Libraries/Animated/nodes/AnimatedValue.js +1 -1
- package/Libraries/Animated/nodes/AnimatedWithChildren.js +1 -3
- package/Libraries/Animated/useAnimatedProps.js +41 -35
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts +19 -3
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +77 -5
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.win32.js +82 -5
- package/Libraries/Components/ActivityIndicator/ActivityIndicator.js +4 -4
- package/Libraries/Components/Button.js +9 -4
- package/Libraries/Components/Button.win32.js +12 -4
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.js +3 -1
- package/Libraries/Components/Keyboard/KeyboardAvoidingView.js +7 -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 +13 -7
- package/Libraries/Components/RefreshControl/__mocks__/RefreshControlMock.js +3 -2
- package/Libraries/Components/SafeAreaView/SafeAreaView.js +4 -4
- package/Libraries/Components/SafeAreaView/SafeAreaView.win32.js +4 -4
- package/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js +0 -1
- package/Libraries/Components/ScrollView/ScrollView.js +49 -88
- 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 +8 -9
- package/Libraries/Components/Switch/Switch.js +8 -6
- 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 +2 -1
- package/Libraries/Components/TextInput/TextInput.d.ts +27 -4
- package/Libraries/Components/TextInput/TextInput.flow.js +36 -19
- package/Libraries/Components/TextInput/TextInput.js +37 -13
- package/Libraries/Components/TextInput/TextInput.win32.js +40 -15
- package/Libraries/Components/TextInput/TextInputState.js +11 -13
- package/Libraries/Components/TextInput/TextInputState.win32.js +13 -16
- package/Libraries/Components/TextInput/Win32TextInputNativeComponent.js +3 -0
- package/Libraries/Components/Touchable/BoundingDimensions.js +11 -3
- package/Libraries/Components/Touchable/Position.js +7 -2
- package/Libraries/Components/Touchable/Touchable.js +4 -0
- package/Libraries/Components/Touchable/Touchable.win32.js +4 -0
- package/Libraries/Components/Touchable/TouchableBounce.js +6 -2
- package/Libraries/Components/Touchable/TouchableHighlight.js +5 -5
- package/Libraries/Components/Touchable/TouchableOpacity.js +6 -5
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +1 -2
- package/Libraries/Components/View/ReactNativeStyleAttributes.js +6 -1
- package/Libraries/Components/View/View.js +4 -4
- package/Libraries/Components/View/View.win32.js +4 -4
- package/Libraries/Components/View/ViewNativeComponent.js +6 -98
- package/Libraries/Components/View/ViewPropTypes.d.ts +7 -0
- package/Libraries/Components/View/ViewPropTypes.js +0 -3
- package/Libraries/Components/View/ViewPropTypes.win32.js +0 -3
- package/Libraries/Components/View/ViewWin32.js +1 -0
- package/Libraries/Core/ExceptionsManager.js +50 -29
- package/Libraries/Core/ReactNativeVersion.js +3 -3
- package/Libraries/Core/__mocks__/NativeExceptionsManager.js +0 -1
- package/Libraries/Core/setUpBatchedBridge.js +1 -10
- package/Libraries/Core/setUpDeveloperTools.js +1 -5
- package/Libraries/Core/setUpErrorHandling.js +20 -18
- package/Libraries/Core/setUpReactDevTools.js +107 -8
- package/Libraries/Core/setUpSegmentFetcher.js +1 -0
- package/Libraries/Core/setUpTimers.js +21 -18
- package/Libraries/Debugging/DebuggingOverlay.js +4 -5
- package/Libraries/Image/AssetSourceResolver.js +12 -1
- package/Libraries/Image/Image.android.js +1 -5
- package/Libraries/Image/Image.d.ts +20 -29
- package/Libraries/Image/Image.ios.js +0 -2
- package/Libraries/Image/Image.win32.js +0 -2
- package/Libraries/Image/ImageBackground.js +2 -5
- package/Libraries/Image/ImageProps.js +7 -6
- 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/ImageTypes.flow.js +11 -9
- package/Libraries/Image/ImageUtils.js +6 -3
- package/Libraries/Image/ImageViewNativeComponent.js +5 -3
- package/Libraries/Inspector/Inspector.js +1 -0
- package/Libraries/Inspector/Inspector.win32.js +2 -1
- package/Libraries/Inspector/NetworkOverlay.js +4 -0
- package/Libraries/Inspector/ReactDevToolsOverlay.js +8 -14
- package/Libraries/Inspector/getInspectorDataForViewAtPoint.js +3 -5
- package/Libraries/Interaction/InteractionManager.js +6 -1
- package/Libraries/Interaction/InteractionManagerStub.js +176 -0
- package/Libraries/Interaction/TouchHistoryMath.js +22 -19
- package/Libraries/JSInspector/NetworkAgent.js +1 -1
- package/Libraries/Lists/FlatList.d.ts +1 -2
- package/Libraries/Lists/FlatList.js +2 -2
- package/Libraries/Lists/SectionListModern.js +7 -7
- package/Libraries/Lists/__flowtests__/FlatList-flowtest.js +2 -2
- package/Libraries/Lists/__flowtests__/SectionList-flowtest.js +1 -1
- package/Libraries/LogBox/Data/LogBoxData.js +3 -3
- package/Libraries/LogBox/LogBox.js +18 -5
- package/Libraries/LogBox/LogBoxInspectorContainer.js +1 -1
- package/Libraries/LogBox/LogBoxNotificationContainer.js +2 -2
- 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/LogBox/UI/LogBoxInspectorStackFrames.js +1 -1
- package/Libraries/LogBox/UI/LogBoxMessage.js +2 -2
- package/Libraries/Modal/Modal.d.ts +12 -0
- package/Libraries/Modal/Modal.js +31 -4
- package/Libraries/NativeComponent/BaseViewConfig.android.js +72 -1
- package/Libraries/NativeComponent/BaseViewConfig.ios.js +2 -1
- package/Libraries/NativeComponent/BaseViewConfig.win32.js +3 -11
- package/Libraries/NativeComponent/NativeComponentRegistry.js +3 -3
- package/Libraries/NativeComponent/StaticViewConfigValidator.js +0 -1
- package/Libraries/Network/FormData.js +11 -3
- package/Libraries/Network/XHRInterceptor.js +63 -14
- package/Libraries/Network/XMLHttpRequest.js +26 -1
- package/Libraries/NewAppScreen/components/HermesBadge.js +1 -1
- package/Libraries/PermissionsAndroid/PermissionsAndroid.d.ts +49 -2
- package/Libraries/PermissionsAndroid/PermissionsAndroid.js +4 -4
- package/Libraries/Pressability/HoverState.js +2 -0
- package/Libraries/Pressability/HoverState.win32.js +2 -0
- package/Libraries/Pressability/Pressability.js +2 -3
- package/Libraries/Pressability/Pressability.win32.js +2 -3
- package/Libraries/Pressability/usePressability.js +4 -1
- package/Libraries/ReactNative/AppContainer.js +1 -1
- package/Libraries/ReactNative/AppRegistry.js +1 -11
- package/Libraries/ReactNative/DisplayMode.js +1 -1
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent.js +2 -3
- package/Libraries/ReactNative/RendererImplementation.js +18 -17
- package/Libraries/ReactNative/getCachedComponentWithDebugName.js +1 -3
- package/Libraries/ReactNative/renderApplication.js +9 -8
- package/Libraries/ReactNative/requireNativeComponent.js +5 -2
- 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 +22 -35
- package/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js +5 -6
- 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 +13 -2
- package/Libraries/StyleSheet/StyleSheetTypes.js +24 -6
- package/Libraries/StyleSheet/processBackgroundImage.js +87 -110
- package/Libraries/StyleSheet/processTransform.js +3 -34
- package/Libraries/Text/Text.js +248 -249
- package/Libraries/Text/Text.win32.js +282 -295
- package/Libraries/Text/TextNativeComponent.js +0 -1
- package/Libraries/TurboModule/TurboModuleRegistry.js +5 -5
- package/Libraries/Types/CoreEventTypes.d.ts +3 -10
- package/Libraries/Types/CoreEventTypes.js +4 -6
- package/Libraries/Types/CoreEventTypes.win32.js +4 -6
- package/Libraries/Utilities/Appearance.js +3 -1
- 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/FocusManager.win32.js +1 -1
- package/Libraries/Utilities/HMRClient.js +3 -4
- package/Libraries/Utilities/Platform.flow.js +2 -2
- package/Libraries/Utilities/Platform.flow.win32.js +3 -2
- package/Libraries/Utilities/__mocks__/BackHandler.js +3 -8
- package/Libraries/Utilities/codegenNativeComponent.js +1 -1
- package/Libraries/Utilities/useMergeRefs.js +26 -7
- package/Libraries/WebSocket/WebSocketEvent.js +4 -1
- package/Libraries/WebSocket/WebSocketInterceptor.js +31 -13
- package/Libraries/__flowtests__/ReactNativeTypes-flowtest.js +6 -5
- package/Libraries/promiseRejectionTrackingOptions.js +1 -1
- package/index.js +10 -3
- package/index.win32.js +10 -3
- package/jest/setup.js +36 -1
- package/overrides.json +37 -37
- package/package.json +20 -20
- package/src/private/animated/NativeAnimatedHelper.js +18 -16
- package/src/private/animated/NativeAnimatedHelper.win32.js +18 -15
- package/src/private/animated/useAnimatedPropsMemo.js +356 -0
- package/src/private/components/HScrollViewNativeComponents.js +1 -27
- package/src/private/components/SafeAreaView_INTERNAL_DO_NOT_USE.js +11 -8
- package/src/private/components/VScrollViewNativeComponents.js +2 -25
- package/src/private/debugging/ReactDevToolsSettingsManager.android.js +20 -0
- package/src/private/debugging/ReactDevToolsSettingsManager.ios.js +30 -0
- package/src/private/debugging/ReactDevToolsSettingsManager.win32.js +20 -0
- package/src/private/{fusebox → debugging}/setUpFuseboxReactDevToolsDispatcher.js +6 -0
- package/src/private/devmenu/DevMenu.d.ts +20 -0
- package/src/private/devmenu/DevMenu.js +31 -0
- package/src/private/featureflags/ReactNativeFeatureFlags.js +95 -86
- package/src/private/featureflags/ReactNativeFeatureFlagsBase.js +8 -2
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +17 -19
- package/src/private/fusebox/specs/NativeReactDevToolsRuntimeSettingsModule.js +34 -0
- package/src/private/setup/setUpDOM.js +14 -6
- package/src/private/setup/setUpMutationObserver.js +5 -0
- package/src/private/specs/components/AndroidHorizontalScrollContentViewNativeComponent.js +1 -0
- package/src/private/specs/components/RCTModalHostViewNativeComponent.js +8 -0
- package/src/private/specs/modules/NativeAccessibilityInfo.js +9 -0
- package/src/private/specs/modules/NativeAccessibilityInfoWin32.js +9 -0
- package/src/private/specs/modules/NativeAccessibilityManager.js +4 -0
- package/src/private/specs/modules/NativeActionSheetManager.js +2 -0
- package/src/private/specs/modules/NativeAppearance.js +4 -10
- package/src/private/specs/modules/NativeExceptionsManager.js +0 -12
- package/src/private/specs/modules/{NativeDevToolsSettingsManager.js → NativeReactDevToolsSettingsManager.js} +3 -5
- package/src/private/webapis/dom/geometry/DOMRect.js +2 -2
- package/src/private/webapis/dom/geometry/DOMRectReadOnly.js +2 -2
- package/src/private/webapis/dom/nodes/ReactNativeElement.js +2 -3
- package/src/private/webapis/intersectionobserver/IntersectionObserver.js +102 -11
- package/src/private/webapis/intersectionobserver/IntersectionObserverEntry.js +26 -0
- package/src/private/webapis/intersectionobserver/IntersectionObserverManager.js +1 -0
- package/src/private/webapis/intersectionobserver/specs/NativeIntersectionObserver.js +1 -0
- package/src/private/webapis/intersectionobserver/specs/__mocks__/NativeIntersectionObserver.js +9 -0
- package/src/private/webapis/performance/EventTiming.js +13 -8
- package/src/private/webapis/performance/Performance.js +66 -73
- package/src/private/webapis/performance/PerformanceEntry.js +2 -5
- package/src/private/webapis/performance/PerformanceObserver.js +65 -164
- package/src/private/webapis/performance/RawPerformanceEntry.js +1 -1
- package/src/private/webapis/performance/UserTiming.js +11 -7
- package/src/private/webapis/performance/Utilities.js +18 -0
- package/src/private/webapis/performance/specs/NativePerformance.js +71 -2
- package/src/private/webapis/performance/specs/__mocks__/NativePerformanceMock.js +267 -0
- package/src-win/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts +19 -3
- package/src-win/Libraries/Components/View/ViewPropTypes.d.ts +7 -0
- package/types/index.d.ts +1 -1
- package/types/public/ReactNativeTypes.d.ts +4 -8
- package/Libraries/DevToolsSettings/DevToolsSettingsManager.android.js +0 -35
- package/Libraries/DevToolsSettings/DevToolsSettingsManager.d.ts +0 -20
- package/Libraries/DevToolsSettings/DevToolsSettingsManager.ios.js +0 -49
- package/Libraries/DevToolsSettings/DevToolsSettingsManager.win32.js +0 -35
- package/Libraries/DevToolsSettings/NativeDevToolsSettingsManager.js +0 -13
- package/Libraries/ReactNative/ReactFabricInternals.js +0 -17
- package/src/private/components/useSyncOnScroll.js +0 -48
- package/src/private/webapis/performance/specs/NativePerformanceObserver.js +0 -61
- package/src/private/webapis/performance/specs/__mocks__/NativePerformance.js +0 -67
- package/src/private/webapis/performance/specs/__mocks__/NativePerformanceObserver.js +0 -127
- package/types/experimental.d.ts +0 -59
- /package/src/private/{fusebox → debugging}/FuseboxSessionObserver.js +0 -0
|
@@ -143,6 +143,7 @@ class NetworkOverlay extends React.Component<Props, State> {
|
|
|
143
143
|
});
|
|
144
144
|
|
|
145
145
|
XHRInterceptor.setRequestHeaderCallback((header, value, xhr) => {
|
|
146
|
+
// $FlowFixMe[prop-missing]
|
|
146
147
|
const xhrIndex = this._getRequestIndexByXHRID(xhr._index);
|
|
147
148
|
if (xhrIndex === -1) {
|
|
148
149
|
return;
|
|
@@ -159,6 +160,7 @@ class NetworkOverlay extends React.Component<Props, State> {
|
|
|
159
160
|
});
|
|
160
161
|
|
|
161
162
|
XHRInterceptor.setSendCallback((data, xhr) => {
|
|
163
|
+
// $FlowFixMe[prop-missing]
|
|
162
164
|
const xhrIndex = this._getRequestIndexByXHRID(xhr._index);
|
|
163
165
|
if (xhrIndex === -1) {
|
|
164
166
|
return;
|
|
@@ -173,6 +175,7 @@ class NetworkOverlay extends React.Component<Props, State> {
|
|
|
173
175
|
|
|
174
176
|
XHRInterceptor.setHeaderReceivedCallback(
|
|
175
177
|
(type, size, responseHeaders, xhr) => {
|
|
178
|
+
// $FlowFixMe[prop-missing]
|
|
176
179
|
const xhrIndex = this._getRequestIndexByXHRID(xhr._index);
|
|
177
180
|
if (xhrIndex === -1) {
|
|
178
181
|
return;
|
|
@@ -190,6 +193,7 @@ class NetworkOverlay extends React.Component<Props, State> {
|
|
|
190
193
|
|
|
191
194
|
XHRInterceptor.setResponseCallback(
|
|
192
195
|
(status, timeout, response, responseURL, responseType, xhr) => {
|
|
196
|
+
// $FlowFixMe[prop-missing]
|
|
193
197
|
const xhrIndex = this._getRequestIndexByXHRID(xhr._index);
|
|
194
198
|
if (xhrIndex === -1) {
|
|
195
199
|
return;
|
|
@@ -20,7 +20,6 @@ import StyleSheet from '../StyleSheet/StyleSheet';
|
|
|
20
20
|
import ElementBox from './ElementBox';
|
|
21
21
|
import * as React from 'react';
|
|
22
22
|
|
|
23
|
-
const {findNodeHandle} = require('../ReactNative/RendererProxy');
|
|
24
23
|
const getInspectorDataForViewAtPoint = require('./getInspectorDataForViewAtPoint');
|
|
25
24
|
|
|
26
25
|
const {useEffect, useState, useCallback} = React;
|
|
@@ -78,20 +77,15 @@ export default function ReactDevToolsOverlay({
|
|
|
78
77
|
x,
|
|
79
78
|
y,
|
|
80
79
|
viewData => {
|
|
81
|
-
const {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
reactDevToolsAgent.selectNode(findNodeHandle(touchedViewTag));
|
|
86
|
-
if (closestInstance != null) {
|
|
87
|
-
reactDevToolsAgent.selectNode(closestInstance);
|
|
88
|
-
}
|
|
89
|
-
setInspected({
|
|
90
|
-
frame,
|
|
91
|
-
});
|
|
92
|
-
return true;
|
|
80
|
+
const {frame, closestPublicInstance} = viewData;
|
|
81
|
+
|
|
82
|
+
if (closestPublicInstance == null) {
|
|
83
|
+
return false;
|
|
93
84
|
}
|
|
94
|
-
|
|
85
|
+
|
|
86
|
+
reactDevToolsAgent.selectNode(closestPublicInstance);
|
|
87
|
+
setInspected({frame});
|
|
88
|
+
return true;
|
|
95
89
|
},
|
|
96
90
|
);
|
|
97
91
|
},
|
|
@@ -9,18 +9,16 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import type {
|
|
12
|
-
|
|
12
|
+
HostInstance,
|
|
13
13
|
TouchedViewDataAtPoint,
|
|
14
14
|
} from '../Renderer/shims/ReactNativeTypes';
|
|
15
15
|
|
|
16
16
|
const invariant = require('invariant');
|
|
17
|
-
const React = require('react');
|
|
18
17
|
|
|
19
|
-
export type HostRef = React.ElementRef<HostComponent<mixed>>;
|
|
20
18
|
export type ReactRenderer = {
|
|
21
19
|
rendererConfig: {
|
|
22
20
|
getInspectorDataForViewAtPoint: (
|
|
23
|
-
inspectedView: ?
|
|
21
|
+
inspectedView: ?HostInstance,
|
|
24
22
|
locationX: number,
|
|
25
23
|
locationY: number,
|
|
26
24
|
callback: Function,
|
|
@@ -52,7 +50,7 @@ function validateRenderers(): void {
|
|
|
52
50
|
}
|
|
53
51
|
|
|
54
52
|
module.exports = function getInspectorDataForViewAtPoint(
|
|
55
|
-
inspectedView: ?
|
|
53
|
+
inspectedView: ?HostInstance,
|
|
56
54
|
locationX: number,
|
|
57
55
|
locationY: number,
|
|
58
56
|
callback: (viewData: TouchedViewDataAtPoint) => boolean,
|
|
@@ -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;
|
|
@@ -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;
|
|
@@ -5,8 +5,11 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
7
|
* @format
|
|
8
|
+
* @flow strict-local
|
|
8
9
|
*/
|
|
9
10
|
|
|
11
|
+
// $FlowFixMe[definition-cycle]
|
|
12
|
+
// $FlowFixMe[recursive-definition]
|
|
10
13
|
const TouchHistoryMath = {
|
|
11
14
|
/**
|
|
12
15
|
* This code is optimized and not intended to look beautiful. This allows
|
|
@@ -25,11 +28,11 @@ const TouchHistoryMath = {
|
|
|
25
28
|
* @return {number} value of centroid in specified dimension.
|
|
26
29
|
*/
|
|
27
30
|
centroidDimension: function (
|
|
28
|
-
touchHistory,
|
|
29
|
-
touchesChangedAfter,
|
|
30
|
-
isXAxis,
|
|
31
|
-
ofCurrent,
|
|
32
|
-
) {
|
|
31
|
+
touchHistory: TouchHistoryMath,
|
|
32
|
+
touchesChangedAfter: number,
|
|
33
|
+
isXAxis: boolean,
|
|
34
|
+
ofCurrent: boolean,
|
|
35
|
+
): number {
|
|
33
36
|
const touchBank = touchHistory.touchBank;
|
|
34
37
|
let total = 0;
|
|
35
38
|
let count = 0;
|
|
@@ -82,9 +85,9 @@ const TouchHistoryMath = {
|
|
|
82
85
|
},
|
|
83
86
|
|
|
84
87
|
currentCentroidXOfTouchesChangedAfter: function (
|
|
85
|
-
touchHistory,
|
|
86
|
-
touchesChangedAfter,
|
|
87
|
-
) {
|
|
88
|
+
touchHistory: TouchHistoryMath,
|
|
89
|
+
touchesChangedAfter: number,
|
|
90
|
+
): number {
|
|
88
91
|
return TouchHistoryMath.centroidDimension(
|
|
89
92
|
touchHistory,
|
|
90
93
|
touchesChangedAfter,
|
|
@@ -94,9 +97,9 @@ const TouchHistoryMath = {
|
|
|
94
97
|
},
|
|
95
98
|
|
|
96
99
|
currentCentroidYOfTouchesChangedAfter: function (
|
|
97
|
-
touchHistory,
|
|
98
|
-
touchesChangedAfter,
|
|
99
|
-
) {
|
|
100
|
+
touchHistory: TouchHistoryMath,
|
|
101
|
+
touchesChangedAfter: number,
|
|
102
|
+
): number {
|
|
100
103
|
return TouchHistoryMath.centroidDimension(
|
|
101
104
|
touchHistory,
|
|
102
105
|
touchesChangedAfter,
|
|
@@ -106,9 +109,9 @@ const TouchHistoryMath = {
|
|
|
106
109
|
},
|
|
107
110
|
|
|
108
111
|
previousCentroidXOfTouchesChangedAfter: function (
|
|
109
|
-
touchHistory,
|
|
110
|
-
touchesChangedAfter,
|
|
111
|
-
) {
|
|
112
|
+
touchHistory: TouchHistoryMath,
|
|
113
|
+
touchesChangedAfter: number,
|
|
114
|
+
): number {
|
|
112
115
|
return TouchHistoryMath.centroidDimension(
|
|
113
116
|
touchHistory,
|
|
114
117
|
touchesChangedAfter,
|
|
@@ -118,9 +121,9 @@ const TouchHistoryMath = {
|
|
|
118
121
|
},
|
|
119
122
|
|
|
120
123
|
previousCentroidYOfTouchesChangedAfter: function (
|
|
121
|
-
touchHistory,
|
|
122
|
-
touchesChangedAfter,
|
|
123
|
-
) {
|
|
124
|
+
touchHistory: TouchHistoryMath,
|
|
125
|
+
touchesChangedAfter: number,
|
|
126
|
+
): number {
|
|
124
127
|
return TouchHistoryMath.centroidDimension(
|
|
125
128
|
touchHistory,
|
|
126
129
|
touchesChangedAfter,
|
|
@@ -129,7 +132,7 @@ const TouchHistoryMath = {
|
|
|
129
132
|
);
|
|
130
133
|
},
|
|
131
134
|
|
|
132
|
-
currentCentroidX: function (touchHistory) {
|
|
135
|
+
currentCentroidX: function (touchHistory: TouchHistoryMath): number {
|
|
133
136
|
return TouchHistoryMath.centroidDimension(
|
|
134
137
|
touchHistory,
|
|
135
138
|
0, // touchesChangedAfter
|
|
@@ -138,7 +141,7 @@ const TouchHistoryMath = {
|
|
|
138
141
|
);
|
|
139
142
|
},
|
|
140
143
|
|
|
141
|
-
currentCentroidY: function (touchHistory) {
|
|
144
|
+
currentCentroidY: function (touchHistory: TouchHistoryMath): number {
|
|
142
145
|
return TouchHistoryMath.centroidDimension(
|
|
143
146
|
touchHistory,
|
|
144
147
|
0, // touchesChangedAfter
|
|
@@ -235,8 +235,7 @@ export abstract class FlatListComponent<
|
|
|
235
235
|
|
|
236
236
|
getScrollableNode: () => any;
|
|
237
237
|
|
|
238
|
-
|
|
239
|
-
setNativeProps: (props: {[key: string]: any}) => void;
|
|
238
|
+
setNativeProps: (props: {[key: string]: unknown}) => void;
|
|
240
239
|
}
|
|
241
240
|
|
|
242
241
|
export class FlatList<ItemT = any> extends FlatListComponent<
|
|
@@ -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: ?
|
|
483
|
+
_listRef: ?VirtualizedList;
|
|
484
484
|
_virtualizedListPairs: Array<ViewabilityConfigCallbackPair> = [];
|
|
485
485
|
|
|
486
|
-
_captureRef = (ref: ?
|
|
486
|
+
_captureRef = (ref: ?VirtualizedList) => {
|
|
487
487
|
this._listRef = ref;
|
|
488
488
|
};
|
|
489
489
|
|
|
@@ -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,
|
|
@@ -75,7 +75,7 @@ module.exports = {
|
|
|
75
75
|
);
|
|
76
76
|
},
|
|
77
77
|
|
|
78
|
-
testBadRenderItemFunction(): $
|
|
78
|
+
testBadRenderItemFunction(): $ReadOnlyArray<React.Node> {
|
|
79
79
|
const data = [
|
|
80
80
|
{
|
|
81
81
|
title: 'foo',
|
|
@@ -105,7 +105,7 @@ module.exports = {
|
|
|
105
105
|
];
|
|
106
106
|
},
|
|
107
107
|
|
|
108
|
-
testOtherBadProps(): $
|
|
108
|
+
testOtherBadProps(): $ReadOnlyArray<React.Node> {
|
|
109
109
|
return [
|
|
110
110
|
// $FlowExpectedError - bad numColumns type "lots"
|
|
111
111
|
<FlatList renderItem={renderMyListItem} data={[]} numColumns="lots" />,
|
|
@@ -44,7 +44,7 @@ module.exports = {
|
|
|
44
44
|
return <SectionList renderItem={renderMyListItem} sections={sections} />;
|
|
45
45
|
},
|
|
46
46
|
|
|
47
|
-
testBadRenderItemFunction(): $
|
|
47
|
+
testBadRenderItemFunction(): $ReadOnlyArray<React.Node> {
|
|
48
48
|
const sections = [
|
|
49
49
|
{
|
|
50
50
|
key: 'a',
|
|
@@ -18,7 +18,7 @@ import type {
|
|
|
18
18
|
Message,
|
|
19
19
|
} from './parseLogBoxLog';
|
|
20
20
|
|
|
21
|
-
import DebuggerSessionObserver from '../../../src/private/
|
|
21
|
+
import DebuggerSessionObserver from '../../../src/private/debugging/FuseboxSessionObserver';
|
|
22
22
|
import parseErrorStack from '../../Core/Devtools/parseErrorStack';
|
|
23
23
|
import NativeDevSettings from '../../NativeModules/specs/NativeDevSettings';
|
|
24
24
|
import NativeLogBox from '../../NativeModules/specs/NativeLogBox';
|
|
@@ -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};
|
|
@@ -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 (global.RN$isRuntimeReady?.() || !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>,
|
|
@@ -102,4 +102,4 @@ const styles = StyleSheet.create({
|
|
|
102
102
|
|
|
103
103
|
export default (LogBoxData.withSubscription(
|
|
104
104
|
_LogBoxNotificationContainer,
|
|
105
|
-
): React.
|
|
105
|
+
): React.ComponentType<{||}>);
|
|
@@ -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
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
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
|
|
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,
|