@office-iss/react-native-win32 0.0.0-canary.274 → 0.0.0-canary.275
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.flowconfig +5 -1
- package/CHANGELOG.json +16 -1
- package/CHANGELOG.md +12 -4
- package/Libraries/ActionSheetIOS/ActionSheetIOS.d.ts +1 -0
- package/Libraries/ActionSheetIOS/ActionSheetIOS.js +13 -0
- package/Libraries/Animated/animations/Animation.js +1 -5
- package/Libraries/Animated/components/AnimatedFlatList.js +1 -1
- package/Libraries/Animated/components/AnimatedSectionList.js +3 -1
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +16 -2
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.win32.js +21 -2
- package/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js +0 -1
- package/Libraries/Components/ScrollView/ScrollView.js +35 -74
- package/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +0 -2
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +0 -1
- package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +1 -0
- package/Libraries/Components/TextInput/TextInput.flow.js +6 -0
- package/Libraries/Components/TextInput/TextInput.js +7 -1
- package/Libraries/Components/TextInput/TextInput.win32.js +7 -1
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +1 -2
- package/Libraries/Components/View/ViewPropTypes.d.ts +7 -0
- package/Libraries/Core/ExceptionsManager.js +1 -4
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Core/setUpErrorHandling.js +20 -18
- package/Libraries/Core/setUpTimers.js +4 -12
- package/Libraries/Image/Image.d.ts +2 -0
- package/Libraries/Image/ImageProps.js +2 -1
- package/Libraries/Image/ImageResizeMode.d.ts +8 -1
- package/Libraries/Image/ImageResizeMode.js +4 -1
- package/Libraries/Image/ImageSource.d.ts +0 -2
- package/Libraries/Image/ImageSource.js +0 -2
- package/Libraries/Image/ImageUtils.js +6 -3
- package/Libraries/Inspector/Inspector.win32.js +1 -1
- package/Libraries/Interaction/InteractionManager.js +6 -1
- package/Libraries/Interaction/InteractionManagerStub.js +176 -0
- package/Libraries/Lists/FlatList.js +2 -2
- package/Libraries/LogBox/LogBox.js +1 -1
- package/Libraries/LogBox/UI/AnsiHighlight.js +26 -17
- package/Libraries/LogBox/UI/LogBoxInspectorCodeFrame.js +6 -1
- package/Libraries/LogBox/UI/LogBoxInspectorCodeFrame.win32.js +6 -1
- package/Libraries/Modal/Modal.d.ts +5 -0
- package/Libraries/Modal/Modal.js +17 -0
- package/Libraries/PermissionsAndroid/PermissionsAndroid.d.ts +49 -2
- package/Libraries/Pressability/usePressability.js +4 -1
- package/Libraries/ReactNative/AppRegistry.js +0 -6
- package/Libraries/ReactNative/RendererImplementation.js +12 -12
- package/Libraries/ReactNative/renderApplication.js +3 -4
- package/Libraries/ReactNative/requireNativeComponent.js +2 -1
- package/Libraries/Renderer/implementations/ReactFabric-dev.js +26149 -15434
- package/Libraries/Renderer/implementations/ReactFabric-prod.js +1630 -2675
- package/Libraries/Renderer/implementations/ReactFabric-profiling.js +1691 -2954
- package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +27069 -16192
- package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +1657 -2714
- package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +1733 -2980
- package/Libraries/Renderer/shims/ReactFabric.js +3 -3
- package/Libraries/Renderer/shims/ReactFeatureFlags.js +2 -2
- package/Libraries/Renderer/shims/ReactNative.js +3 -3
- package/Libraries/Renderer/shims/createReactNativeComponentClass.js +2 -2
- package/Libraries/StyleSheet/StyleSheetTypes.d.ts +7 -1
- package/Libraries/StyleSheet/StyleSheetTypes.js +5 -4
- package/Libraries/Utilities/BackHandler.android.js +6 -18
- package/Libraries/Utilities/BackHandler.d.ts +0 -4
- package/Libraries/Utilities/BackHandler.ios.js +0 -7
- package/Libraries/Utilities/BackHandler.win32.js +6 -18
- package/Libraries/Utilities/__mocks__/BackHandler.js +3 -8
- package/overrides.json +8 -8
- package/package.json +13 -13
- package/src/private/components/HScrollViewNativeComponents.js +1 -26
- package/src/private/components/VScrollViewNativeComponents.js +2 -24
- package/src/private/featureflags/ReactNativeFeatureFlags.js +18 -38
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +2 -6
- package/src/private/specs/components/RCTModalHostViewNativeComponent.js +8 -0
- package/src/private/specs/modules/NativeAccessibilityInfo.js +6 -0
- package/src/private/specs/modules/NativeAccessibilityInfoWin32.js +6 -0
- package/src/private/specs/modules/NativeActionSheetManager.js +2 -0
- package/src-win/Libraries/Components/View/ViewPropTypes.d.ts +7 -0
- package/Libraries/ReactNative/ReactFabricInternals.js +0 -17
- package/src/private/components/useSyncOnScroll.js +0 -48
- package/types/experimental.d.ts +0 -59
|
@@ -26,18 +26,10 @@ const isEventLoopEnabled = (() => {
|
|
|
26
26
|
return false;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
ReactNativeFeatureFlags.enableMicrotasks()
|
|
34
|
-
);
|
|
35
|
-
} else {
|
|
36
|
-
return (
|
|
37
|
-
ReactNativeFeatureFlags.enableBridgelessArchitecture() &&
|
|
38
|
-
!ReactNativeFeatureFlags.disableEventLoopOnBridgeless()
|
|
39
|
-
);
|
|
40
|
-
}
|
|
29
|
+
return (
|
|
30
|
+
ReactNativeFeatureFlags.enableBridgelessArchitecture() &&
|
|
31
|
+
!ReactNativeFeatureFlags.disableEventLoopOnBridgeless()
|
|
32
|
+
);
|
|
41
33
|
})();
|
|
42
34
|
|
|
43
35
|
// In bridgeless mode, timers are host functions installed from cpp.
|
|
@@ -200,6 +200,8 @@ export interface ImagePropsBase
|
|
|
200
200
|
* 'center': Scale the image down so that it is completely visible,
|
|
201
201
|
* if bigger than the area of the view.
|
|
202
202
|
* The image will not be scaled up.
|
|
203
|
+
*
|
|
204
|
+
* 'none': Do not resize the image. The image will be displayed at its intrinsic size.
|
|
203
205
|
*/
|
|
204
206
|
resizeMode?: ImageResizeMode | undefined;
|
|
205
207
|
|
|
@@ -19,6 +19,7 @@ import type {
|
|
|
19
19
|
} from '../StyleSheet/StyleSheet';
|
|
20
20
|
import type {LayoutEvent, SyntheticEvent} from '../Types/CoreEventTypes';
|
|
21
21
|
import typeof Image from './Image';
|
|
22
|
+
import type {ImageResizeMode} from './ImageResizeMode';
|
|
22
23
|
import type {ImageSource} from './ImageSource';
|
|
23
24
|
import type {ElementRef, Node, RefSetter} from 'react';
|
|
24
25
|
|
|
@@ -234,7 +235,7 @@ export type ImageProps = $ReadOnly<{|
|
|
|
234
235
|
*
|
|
235
236
|
* See https://reactnative.dev/docs/image#resizemode
|
|
236
237
|
*/
|
|
237
|
-
resizeMode?: ?
|
|
238
|
+
resizeMode?: ?ImageResizeMode,
|
|
238
239
|
|
|
239
240
|
/**
|
|
240
241
|
* A unique identifier for this element to be used in UI Automation
|
|
@@ -12,7 +12,8 @@ export type ImageResizeMode =
|
|
|
12
12
|
| 'contain'
|
|
13
13
|
| 'stretch'
|
|
14
14
|
| 'repeat'
|
|
15
|
-
| 'center'
|
|
15
|
+
| 'center'
|
|
16
|
+
| 'none';
|
|
16
17
|
|
|
17
18
|
/**
|
|
18
19
|
* @see ImageResizeMode.js
|
|
@@ -46,4 +47,10 @@ export interface ImageResizeModeStatic {
|
|
|
46
47
|
* image will keep it's size and aspect ratio.
|
|
47
48
|
*/
|
|
48
49
|
repeat: ImageResizeMode;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* none - The image will be displayed at its intrinsic size, which means the
|
|
53
|
+
* image will not be scaled up or down.
|
|
54
|
+
*/
|
|
55
|
+
none: ImageResizeMode;
|
|
49
56
|
}
|
|
@@ -33,4 +33,7 @@ export type ImageResizeMode =
|
|
|
33
33
|
|
|
34
34
|
// Resize by stretching it to fill the entire frame of the view without
|
|
35
35
|
// clipping. This may change the aspect ratio of the image, distorting it.
|
|
36
|
-
| 'stretch'
|
|
36
|
+
| 'stretch'
|
|
37
|
+
|
|
38
|
+
// The image will not be resized at all.
|
|
39
|
+
| 'none';
|
|
@@ -50,8 +50,6 @@ export interface ImageURISource {
|
|
|
50
50
|
* its age or expiration date. If there is no existing data in the cache corresponding
|
|
51
51
|
* to a URL load request, no attempt is made to load the data from the originating source,
|
|
52
52
|
* and the load is considered to have failed.
|
|
53
|
-
*
|
|
54
|
-
* @platform ios
|
|
55
53
|
*/
|
|
56
54
|
cache?: 'default' | 'reload' | 'force-cache' | 'only-if-cached' | undefined;
|
|
57
55
|
/**
|
|
@@ -65,8 +65,6 @@ export interface ImageURISource {
|
|
|
65
65
|
* its age or expiration date. If there is no existing data in the cache corresponding
|
|
66
66
|
* to a URL load request, no attempt is made to load the data from the originating source,
|
|
67
67
|
* and the load is considered to have failed.
|
|
68
|
-
*
|
|
69
|
-
* @platform ios
|
|
70
68
|
*/
|
|
71
69
|
+cache?: ?('default' | 'reload' | 'force-cache' | 'only-if-cached');
|
|
72
70
|
|
|
@@ -8,15 +8,18 @@
|
|
|
8
8
|
* @format
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
type
|
|
11
|
+
import type {ImageResizeMode} from './ImageResizeMode';
|
|
12
12
|
|
|
13
|
-
const objectFitMap: {[string]:
|
|
13
|
+
const objectFitMap: {[string]: ImageResizeMode} = {
|
|
14
14
|
contain: 'contain',
|
|
15
15
|
cover: 'cover',
|
|
16
16
|
fill: 'stretch',
|
|
17
17
|
'scale-down': 'contain',
|
|
18
|
+
none: 'none',
|
|
18
19
|
};
|
|
19
20
|
|
|
20
|
-
export function convertObjectFitToResizeMode(
|
|
21
|
+
export function convertObjectFitToResizeMode(
|
|
22
|
+
objectFit: ?string,
|
|
23
|
+
): ?ImageResizeMode {
|
|
21
24
|
return objectFit != null ? objectFitMap[objectFit] : undefined;
|
|
22
25
|
}
|
|
@@ -21,7 +21,7 @@ import type {ReactDevToolsAgent} from '../Types/ReactDevToolsTypes';
|
|
|
21
21
|
import SafeAreaView from '../../src/private/components/SafeAreaView_INTERNAL_DO_NOT_USE';
|
|
22
22
|
|
|
23
23
|
const PressabilityDebug = require('../Pressability/PressabilityDebug');
|
|
24
|
-
const ReactNative = require('../Renderer/shims/ReactNative');
|
|
24
|
+
const ReactNative = require('../Renderer/shims/ReactNative').default;
|
|
25
25
|
const {findNodeHandle} = require('../ReactNative/RendererProxy');
|
|
26
26
|
const StyleSheet = require('../StyleSheet/StyleSheet');
|
|
27
27
|
const Platform = require('../Utilities/Platform');
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
import type {Task} from './TaskQueue';
|
|
12
12
|
|
|
13
|
+
import * as ReactNativeFeatureFlags from '../../src/private/featureflags/ReactNativeFeatureFlags';
|
|
13
14
|
import EventEmitter from '../vendor/emitter/EventEmitter';
|
|
14
15
|
|
|
15
16
|
const BatchedBridge = require('../BatchedBridge/BatchedBridge');
|
|
@@ -208,4 +209,8 @@ function _processUpdate() {
|
|
|
208
209
|
_deleteInteractionSet.clear();
|
|
209
210
|
}
|
|
210
211
|
|
|
211
|
-
module.exports =
|
|
212
|
+
module.exports = (
|
|
213
|
+
ReactNativeFeatureFlags.disableInteractionManager()
|
|
214
|
+
? require('./InteractionManagerStub')
|
|
215
|
+
: InteractionManager
|
|
216
|
+
) as typeof InteractionManager;
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @flow strict
|
|
8
|
+
* @format
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import type {EventSubscription} from '../vendor/emitter/EventEmitter';
|
|
12
|
+
|
|
13
|
+
const invariant = require('invariant');
|
|
14
|
+
|
|
15
|
+
export type Handle = number;
|
|
16
|
+
|
|
17
|
+
type Task =
|
|
18
|
+
| {
|
|
19
|
+
name: string,
|
|
20
|
+
run: () => void,
|
|
21
|
+
}
|
|
22
|
+
| {
|
|
23
|
+
name: string,
|
|
24
|
+
gen: () => Promise<void>,
|
|
25
|
+
}
|
|
26
|
+
| (() => void);
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* InteractionManager allows long-running work to be scheduled after any
|
|
30
|
+
* interactions/animations have completed. In particular, this allows JavaScript
|
|
31
|
+
* animations to run smoothly.
|
|
32
|
+
*
|
|
33
|
+
* Applications can schedule tasks to run after interactions with the following:
|
|
34
|
+
*
|
|
35
|
+
* ```
|
|
36
|
+
* InteractionManager.runAfterInteractions(() => {
|
|
37
|
+
* // ...long-running synchronous task...
|
|
38
|
+
* });
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* Compare this to other scheduling alternatives:
|
|
42
|
+
*
|
|
43
|
+
* - requestAnimationFrame(): for code that animates a view over time.
|
|
44
|
+
* - setImmediate/setTimeout(): run code later, note this may delay animations.
|
|
45
|
+
* - runAfterInteractions(): run code later, without delaying active animations.
|
|
46
|
+
*
|
|
47
|
+
* The touch handling system considers one or more active touches to be an
|
|
48
|
+
* 'interaction' and will delay `runAfterInteractions()` callbacks until all
|
|
49
|
+
* touches have ended or been cancelled.
|
|
50
|
+
*
|
|
51
|
+
* InteractionManager also allows applications to register animations by
|
|
52
|
+
* creating an interaction 'handle' on animation start, and clearing it upon
|
|
53
|
+
* completion:
|
|
54
|
+
*
|
|
55
|
+
* ```
|
|
56
|
+
* var handle = InteractionManager.createInteractionHandle();
|
|
57
|
+
* // run animation... (`runAfterInteractions` tasks are queued)
|
|
58
|
+
* // later, on animation completion:
|
|
59
|
+
* InteractionManager.clearInteractionHandle(handle);
|
|
60
|
+
* // queued tasks run if all handles were cleared
|
|
61
|
+
* ```
|
|
62
|
+
*
|
|
63
|
+
* `runAfterInteractions` takes either a plain callback function, or a
|
|
64
|
+
* `PromiseTask` object with a `gen` method that returns a `Promise`. If a
|
|
65
|
+
* `PromiseTask` is supplied, then it is fully resolved (including asynchronous
|
|
66
|
+
* dependencies that also schedule more tasks via `runAfterInteractions`) before
|
|
67
|
+
* starting on the next task that might have been queued up synchronously
|
|
68
|
+
* earlier.
|
|
69
|
+
*
|
|
70
|
+
* By default, queued tasks are executed together in a loop in one
|
|
71
|
+
* `setImmediate` batch. If `setDeadline` is called with a positive number, then
|
|
72
|
+
* tasks will only be executed until the deadline (in terms of js event loop run
|
|
73
|
+
* time) approaches, at which point execution will yield via setTimeout,
|
|
74
|
+
* allowing events such as touches to start interactions and block queued tasks
|
|
75
|
+
* from executing, making apps more responsive.
|
|
76
|
+
*
|
|
77
|
+
* @deprecated
|
|
78
|
+
*/
|
|
79
|
+
const InteractionManagerStub = {
|
|
80
|
+
Events: {
|
|
81
|
+
interactionStart: 'interactionStart',
|
|
82
|
+
interactionComplete: 'interactionComplete',
|
|
83
|
+
},
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Schedule a function to run after all interactions have completed. Returns a cancellable
|
|
87
|
+
* "promise".
|
|
88
|
+
*
|
|
89
|
+
* @deprecated
|
|
90
|
+
*/
|
|
91
|
+
runAfterInteractions(task: ?Task): {
|
|
92
|
+
then: <U>(
|
|
93
|
+
onFulfill?: ?(void) => ?(Promise<U> | U),
|
|
94
|
+
onReject?: ?(error: mixed) => ?(Promise<U> | U),
|
|
95
|
+
) => Promise<U>,
|
|
96
|
+
cancel: () => void,
|
|
97
|
+
...
|
|
98
|
+
} {
|
|
99
|
+
let immediateID: ?$FlowIssue;
|
|
100
|
+
const promise = new Promise((resolve, reject) => {
|
|
101
|
+
immediateID = setImmediate(() => {
|
|
102
|
+
if (typeof task === 'object' && task !== null) {
|
|
103
|
+
if (typeof task.gen === 'function') {
|
|
104
|
+
task.gen().then(resolve, reject);
|
|
105
|
+
} else if (typeof task.run === 'function') {
|
|
106
|
+
try {
|
|
107
|
+
task.run();
|
|
108
|
+
resolve();
|
|
109
|
+
} catch (error) {
|
|
110
|
+
reject(error);
|
|
111
|
+
}
|
|
112
|
+
} else {
|
|
113
|
+
reject(new TypeError(`Task "${task.name}" missing gen or run.`));
|
|
114
|
+
}
|
|
115
|
+
} else if (typeof task === 'function') {
|
|
116
|
+
try {
|
|
117
|
+
task();
|
|
118
|
+
resolve();
|
|
119
|
+
} catch (error) {
|
|
120
|
+
reject(error);
|
|
121
|
+
}
|
|
122
|
+
} else {
|
|
123
|
+
reject(new TypeError('Invalid task of type: ' + typeof task));
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
return {
|
|
129
|
+
// $FlowFixMe[method-unbinding] added when improving typing for this parameters
|
|
130
|
+
then: promise.then.bind(promise),
|
|
131
|
+
cancel() {
|
|
132
|
+
clearImmediate(immediateID);
|
|
133
|
+
},
|
|
134
|
+
};
|
|
135
|
+
},
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Notify manager that an interaction has started.
|
|
139
|
+
*
|
|
140
|
+
* @deprecated
|
|
141
|
+
*/
|
|
142
|
+
createInteractionHandle(): Handle {
|
|
143
|
+
return -1;
|
|
144
|
+
},
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Notify manager that an interaction has completed.
|
|
148
|
+
*
|
|
149
|
+
* @deprecated
|
|
150
|
+
*/
|
|
151
|
+
clearInteractionHandle(handle: Handle) {
|
|
152
|
+
invariant(!!handle, 'InteractionManager: Must provide a handle to clear.');
|
|
153
|
+
},
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* @deprecated
|
|
157
|
+
*/
|
|
158
|
+
addListener(): EventSubscription {
|
|
159
|
+
return {
|
|
160
|
+
remove() {},
|
|
161
|
+
};
|
|
162
|
+
},
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* A positive number will use setTimeout to schedule any tasks after the
|
|
166
|
+
* eventLoopRunningTime hits the deadline value, otherwise all tasks will be
|
|
167
|
+
* executed in one setImmediate batch (default).
|
|
168
|
+
*
|
|
169
|
+
* @deprecated
|
|
170
|
+
*/
|
|
171
|
+
setDeadline(deadline: number) {
|
|
172
|
+
// Do nothing.
|
|
173
|
+
},
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
module.exports = InteractionManagerStub;
|
|
@@ -480,10 +480,10 @@ class FlatList<ItemT> extends React.PureComponent<Props<ItemT>, void> {
|
|
|
480
480
|
this._checkProps(this.props);
|
|
481
481
|
}
|
|
482
482
|
|
|
483
|
-
_listRef: ?
|
|
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
|
|
|
@@ -55,7 +55,7 @@ if (__DEV__) {
|
|
|
55
55
|
if (global.RN$registerExceptionListener != null) {
|
|
56
56
|
global.RN$registerExceptionListener(
|
|
57
57
|
(error: ExtendedExceptionData & {preventDefault: () => mixed}) => {
|
|
58
|
-
if (!error.isFatal) {
|
|
58
|
+
if (global.RN$isRuntimeReady?.() || !error.isFatal) {
|
|
59
59
|
error.preventDefault();
|
|
60
60
|
addException(error);
|
|
61
61
|
}
|
|
@@ -37,6 +37,8 @@ const COLORS = {
|
|
|
37
37
|
'ansi-bright-white': 'rgb(247, 247, 247)',
|
|
38
38
|
};
|
|
39
39
|
|
|
40
|
+
const LRM = '\u200E'; // Left-to-Right Mark
|
|
41
|
+
|
|
40
42
|
export default function Ansi({
|
|
41
43
|
text,
|
|
42
44
|
style,
|
|
@@ -80,25 +82,28 @@ export default function Ansi({
|
|
|
80
82
|
};
|
|
81
83
|
|
|
82
84
|
return (
|
|
83
|
-
<View>
|
|
85
|
+
<View style={styles.container}>
|
|
84
86
|
{parsedLines.map((items, i) => (
|
|
85
87
|
<View style={styles.line} key={i}>
|
|
86
|
-
|
|
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,
|
|
@@ -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,
|
|
@@ -101,6 +101,11 @@ export interface ModalPropsAndroid {
|
|
|
101
101
|
* Determines whether your modal should go under the system statusbar.
|
|
102
102
|
*/
|
|
103
103
|
statusBarTranslucent?: boolean | undefined;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Determines whether your modal should go under the system navigationbar.
|
|
107
|
+
*/
|
|
108
|
+
navigationBarTranslucent?: boolean | undefined;
|
|
104
109
|
}
|
|
105
110
|
|
|
106
111
|
export type ModalProps = ModalBaseProps &
|
package/Libraries/Modal/Modal.js
CHANGED
|
@@ -95,6 +95,14 @@ export type Props = $ReadOnly<{|
|
|
|
95
95
|
*/
|
|
96
96
|
statusBarTranslucent?: ?boolean,
|
|
97
97
|
|
|
98
|
+
/**
|
|
99
|
+
* The `navigationBarTranslucent` prop determines whether your modal should go under
|
|
100
|
+
* the system navigationbar.
|
|
101
|
+
*
|
|
102
|
+
* See https://reactnative.dev/docs/modal.html#navigationbartranslucent-android
|
|
103
|
+
*/
|
|
104
|
+
navigationBarTranslucent?: ?boolean,
|
|
105
|
+
|
|
98
106
|
/**
|
|
99
107
|
* The `hardwareAccelerated` prop controls whether to force hardware
|
|
100
108
|
* acceleration for the underlying window.
|
|
@@ -176,6 +184,14 @@ function confirmProps(props: Props) {
|
|
|
176
184
|
`Modal with '${props.presentationStyle}' presentation style and 'transparent' value is not supported.`,
|
|
177
185
|
);
|
|
178
186
|
}
|
|
187
|
+
if (
|
|
188
|
+
props.navigationBarTranslucent === true &&
|
|
189
|
+
props.statusBarTranslucent !== true
|
|
190
|
+
) {
|
|
191
|
+
console.warn(
|
|
192
|
+
'Modal with translucent navigation bar and without translucent status bar is not supported.',
|
|
193
|
+
);
|
|
194
|
+
}
|
|
179
195
|
}
|
|
180
196
|
}
|
|
181
197
|
|
|
@@ -301,6 +317,7 @@ class Modal extends React.Component<Props, State> {
|
|
|
301
317
|
onDismiss={onDismiss}
|
|
302
318
|
visible={this.props.visible}
|
|
303
319
|
statusBarTranslucent={this.props.statusBarTranslucent}
|
|
320
|
+
navigationBarTranslucent={this.props.navigationBarTranslucent}
|
|
304
321
|
identifier={this._identifier}
|
|
305
322
|
style={styles.modal}
|
|
306
323
|
// $FlowFixMe[method-unbinding] added when improving typing for this parameters
|
|
@@ -66,11 +66,58 @@ export interface PermissionsAndroidStatic {
|
|
|
66
66
|
/**
|
|
67
67
|
* A list of permission results that are returned
|
|
68
68
|
*/
|
|
69
|
-
RESULTS: {
|
|
69
|
+
RESULTS: {
|
|
70
|
+
[key in 'GRANTED' | 'DENIED' | 'NEVER_ASK_AGAIN']: PermissionStatus;
|
|
71
|
+
};
|
|
70
72
|
/**
|
|
71
73
|
* A list of specified "dangerous" permissions that require prompting the user
|
|
72
74
|
*/
|
|
73
|
-
PERMISSIONS: {
|
|
75
|
+
PERMISSIONS: {
|
|
76
|
+
[key in
|
|
77
|
+
| 'READ_CALENDAR'
|
|
78
|
+
| 'WRITE_CALENDAR'
|
|
79
|
+
| 'CAMERA'
|
|
80
|
+
| 'READ_CONTACTS'
|
|
81
|
+
| 'WRITE_CONTACTS'
|
|
82
|
+
| 'GET_ACCOUNTS'
|
|
83
|
+
| 'ACCESS_FINE_LOCATION'
|
|
84
|
+
| 'ACCESS_COARSE_LOCATION'
|
|
85
|
+
| 'ACCESS_BACKGROUND_LOCATION'
|
|
86
|
+
| 'RECORD_AUDIO'
|
|
87
|
+
| 'READ_PHONE_STATE'
|
|
88
|
+
| 'CALL_PHONE'
|
|
89
|
+
| 'READ_CALL_LOG'
|
|
90
|
+
| 'WRITE_CALL_LOG'
|
|
91
|
+
| 'ADD_VOICEMAIL'
|
|
92
|
+
| 'READ_VOICEMAIL'
|
|
93
|
+
| 'WRITE_VOICEMAIL'
|
|
94
|
+
| 'USE_SIP'
|
|
95
|
+
| 'PROCESS_OUTGOING_CALLS'
|
|
96
|
+
| 'BODY_SENSORS'
|
|
97
|
+
| 'BODY_SENSORS_BACKGROUND'
|
|
98
|
+
| 'SEND_SMS'
|
|
99
|
+
| 'RECEIVE_SMS'
|
|
100
|
+
| 'READ_SMS'
|
|
101
|
+
| 'RECEIVE_WAP_PUSH'
|
|
102
|
+
| 'RECEIVE_MMS'
|
|
103
|
+
| 'READ_EXTERNAL_STORAGE'
|
|
104
|
+
| 'READ_MEDIA_IMAGES'
|
|
105
|
+
| 'READ_MEDIA_VIDEO'
|
|
106
|
+
| 'READ_MEDIA_AUDIO'
|
|
107
|
+
| 'READ_MEDIA_VISUAL_USER_SELECTED'
|
|
108
|
+
| 'WRITE_EXTERNAL_STORAGE'
|
|
109
|
+
| 'BLUETOOTH_CONNECT'
|
|
110
|
+
| 'BLUETOOTH_SCAN'
|
|
111
|
+
| 'BLUETOOTH_ADVERTISE'
|
|
112
|
+
| 'ACCESS_MEDIA_LOCATION'
|
|
113
|
+
| 'ACCEPT_HANDOVER'
|
|
114
|
+
| 'ACTIVITY_RECOGNITION'
|
|
115
|
+
| 'ANSWER_PHONE_CALLS'
|
|
116
|
+
| 'READ_PHONE_NUMBERS'
|
|
117
|
+
| 'UWB_RANGING'
|
|
118
|
+
| 'POST_NOTIFICATIONS'
|
|
119
|
+
| 'NEARBY_WIFI_DEVICES']: Permission;
|
|
120
|
+
};
|
|
74
121
|
new (): PermissionsAndroidStatic;
|
|
75
122
|
/**
|
|
76
123
|
* @deprecated Use check instead
|
|
@@ -14,6 +14,9 @@ import Pressability, {
|
|
|
14
14
|
} from './Pressability';
|
|
15
15
|
import {useEffect, useRef} from 'react';
|
|
16
16
|
|
|
17
|
+
declare function usePressability(config: PressabilityConfig): EventHandlers;
|
|
18
|
+
declare function usePressability(config: null | void): null | EventHandlers;
|
|
19
|
+
|
|
17
20
|
/**
|
|
18
21
|
* Creates a persistent instance of `Pressability` that automatically configures
|
|
19
22
|
* itself and resets. Accepts null `config` to support lazy initialization. Once
|
|
@@ -28,7 +31,7 @@ import {useEffect, useRef} from 'react';
|
|
|
28
31
|
*/
|
|
29
32
|
export default function usePressability(
|
|
30
33
|
config: ?PressabilityConfig,
|
|
31
|
-
):
|
|
34
|
+
): null | EventHandlers {
|
|
32
35
|
const pressabilityRef = useRef<?Pressability>(null);
|
|
33
36
|
if (config != null && pressabilityRef.current == null) {
|
|
34
37
|
pressabilityRef.current = new Pressability(config);
|
|
@@ -46,7 +46,6 @@ type AppParameters = {
|
|
|
46
46
|
initialProps: $ReadOnly<{[string]: mixed, ...}>,
|
|
47
47
|
rootTag: RootTag,
|
|
48
48
|
fabric?: boolean,
|
|
49
|
-
concurrentRoot?: boolean,
|
|
50
49
|
};
|
|
51
50
|
export type Runnable = (
|
|
52
51
|
appParameters: AppParameters,
|
|
@@ -120,10 +119,6 @@ const AppRegistry = {
|
|
|
120
119
|
): string {
|
|
121
120
|
const scopedPerformanceLogger = createPerformanceLogger();
|
|
122
121
|
runnables[appKey] = (appParameters, displayMode) => {
|
|
123
|
-
const concurrentRootEnabled = Boolean(
|
|
124
|
-
appParameters.initialProps?.concurrentRoot ||
|
|
125
|
-
appParameters.concurrentRoot,
|
|
126
|
-
);
|
|
127
122
|
renderApplication(
|
|
128
123
|
componentProviderInstrumentationHook(
|
|
129
124
|
componentProvider,
|
|
@@ -138,7 +133,6 @@ const AppRegistry = {
|
|
|
138
133
|
appKey === 'LogBox', // is logbox
|
|
139
134
|
appKey,
|
|
140
135
|
displayMode,
|
|
141
|
-
concurrentRootEnabled,
|
|
142
136
|
);
|
|
143
137
|
};
|
|
144
138
|
if (section) {
|