@office-iss/react-native-win32 0.0.0-canary.256 → 0.0.0-canary.257
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 +40 -1
- package/CHANGELOG.md +20 -8
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Core/setUpTimers.js +19 -0
- package/Libraries/LogBox/Data/LogBoxData.js +39 -4
- package/Libraries/LogBox/Data/LogBoxLog.js +5 -2
- package/Libraries/LogBox/Data/parseLogBoxLog.js +22 -1
- package/Libraries/LogBox/LogBox.js +29 -12
- package/Libraries/LogBox/LogBoxNotificationContainer.js +4 -0
- package/Libraries/LogBox/UI/LogBoxInspector.js +8 -70
- package/Libraries/LogBox/UI/LogBoxInspectorBody.js +87 -0
- package/Libraries/LogBox/UI/LogBoxInspectorFooter.js +6 -42
- package/Libraries/LogBox/UI/LogBoxInspectorFooterButton.js +58 -0
- package/Libraries/LogBox/UI/LogBoxInspectorHeader.js +5 -66
- package/Libraries/LogBox/UI/LogBoxInspectorHeader.win32.js +7 -72
- package/Libraries/LogBox/UI/LogBoxInspectorHeaderButton.js +76 -0
- package/Libraries/LogBox/UI/LogBoxNotification.js +13 -152
- package/Libraries/LogBox/UI/LogBoxNotificationCountBadge.js +63 -0
- package/Libraries/LogBox/UI/LogBoxNotificationDismissButton.js +67 -0
- package/Libraries/LogBox/UI/LogBoxNotificationMessage.js +57 -0
- package/Libraries/Renderer/implementations/ReactFabric-dev.js +15690 -26405
- package/Libraries/Renderer/implementations/ReactFabric-prod.js +2675 -1630
- package/Libraries/Renderer/implementations/ReactFabric-profiling.js +2945 -1682
- package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +16141 -27018
- package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +2723 -1666
- package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +2984 -1737
- package/Libraries/Share/Share.d.ts +16 -10
- package/Libraries/Share/Share.js +14 -15
- package/Libraries/Text/Text.js +25 -20
- package/Libraries/Text/Text.win32.js +25 -20
- package/Libraries/Text/TextNativeComponent.js +1 -1
- package/Libraries/Text/TextNativeComponent.win32.js +1 -1
- package/Libraries/Text/TextOptimized.js +538 -0
- package/Libraries/Utilities/ReactNativeTestTools.js +7 -24
- package/Libraries/__tests__/ButtonWin32-test.js +7 -6
- package/Libraries/promiseRejectionTrackingOptions.js +1 -0
- package/jest/renderer.js +25 -14
- package/jest/setup.js +5 -0
- package/overrides.json +5 -5
- package/package.json +19 -19
- package/src/private/specs/modules/NativeDevSettings.js +1 -0
- package/src/private/webapis/idlecallbacks/specs/NativeIdleCallbacks.js +34 -0
|
@@ -12,11 +12,13 @@ import {ColorValue} from '../StyleSheet/StyleSheet';
|
|
|
12
12
|
export type ShareContent =
|
|
13
13
|
| {
|
|
14
14
|
title?: string | undefined;
|
|
15
|
-
|
|
15
|
+
url: string;
|
|
16
|
+
message?: string | undefined;
|
|
16
17
|
}
|
|
17
18
|
| {
|
|
18
19
|
title?: string | undefined;
|
|
19
|
-
url
|
|
20
|
+
url?: string | undefined;
|
|
21
|
+
message: string;
|
|
20
22
|
};
|
|
21
23
|
|
|
22
24
|
export type ShareOptions = {
|
|
@@ -40,29 +42,33 @@ export interface ShareStatic {
|
|
|
40
42
|
* If the user dismissed the dialog, the Promise will still be resolved with action being `Share.dismissedAction`
|
|
41
43
|
* and all the other keys being undefined.
|
|
42
44
|
*
|
|
43
|
-
* In Android, Returns a Promise which always
|
|
45
|
+
* In Android, Returns a Promise which always resolves with action being `Share.sharedAction`.
|
|
44
46
|
*
|
|
45
47
|
* ### Content
|
|
46
48
|
*
|
|
49
|
+
* #### iOS
|
|
50
|
+
*
|
|
51
|
+
* - `url` - a URL to share
|
|
47
52
|
* - `message` - a message to share
|
|
48
|
-
* - `title` - title of the message
|
|
49
53
|
*
|
|
50
|
-
*
|
|
54
|
+
* At least one of `URL` or `message` is required.
|
|
51
55
|
*
|
|
52
|
-
*
|
|
56
|
+
* #### Android
|
|
53
57
|
*
|
|
54
|
-
*
|
|
58
|
+
* - `title` - title of the message (optional)
|
|
59
|
+
* - `message` - a message to share (often will include a URL).
|
|
55
60
|
*
|
|
56
61
|
* ### Options
|
|
57
62
|
*
|
|
58
63
|
* #### iOS
|
|
59
64
|
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
65
|
+
* - `subject` - a subject to share via email
|
|
66
|
+
* - `excludedActivityTypes`
|
|
67
|
+
* - `tintColor`
|
|
62
68
|
*
|
|
63
69
|
* #### Android
|
|
64
70
|
*
|
|
65
|
-
*
|
|
71
|
+
* - `dialogTitle`
|
|
66
72
|
*
|
|
67
73
|
*/
|
|
68
74
|
share(content: ShareContent, options?: ShareOptions): Promise<ShareAction>;
|
package/Libraries/Share/Share.js
CHANGED
|
@@ -15,24 +15,23 @@ const processColor = require('../StyleSheet/processColor').default;
|
|
|
15
15
|
const Platform = require('../Utilities/Platform');
|
|
16
16
|
const invariant = require('invariant');
|
|
17
17
|
|
|
18
|
-
type
|
|
18
|
+
export type ShareContent =
|
|
19
19
|
| {
|
|
20
20
|
title?: string,
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
url: string,
|
|
22
|
+
message?: string,
|
|
23
23
|
}
|
|
24
24
|
| {
|
|
25
25
|
title?: string,
|
|
26
|
-
url
|
|
27
|
-
|
|
26
|
+
url?: string,
|
|
27
|
+
message: string,
|
|
28
28
|
};
|
|
29
|
-
type
|
|
29
|
+
export type ShareOptions = {
|
|
30
30
|
dialogTitle?: string,
|
|
31
31
|
excludedActivityTypes?: Array<string>,
|
|
32
32
|
tintColor?: string,
|
|
33
33
|
subject?: string,
|
|
34
34
|
anchor?: number,
|
|
35
|
-
...
|
|
36
35
|
};
|
|
37
36
|
|
|
38
37
|
class Share {
|
|
@@ -43,21 +42,21 @@ class Share {
|
|
|
43
42
|
* If the user dismissed the dialog, the Promise will still be resolved with action being `Share.dismissedAction`
|
|
44
43
|
* and all the other keys being undefined.
|
|
45
44
|
*
|
|
46
|
-
* In Android, Returns a Promise which always
|
|
45
|
+
* In Android, Returns a Promise which always resolves with action being `Share.sharedAction`.
|
|
47
46
|
*
|
|
48
47
|
* ### Content
|
|
49
48
|
*
|
|
50
|
-
* - `message` - a message to share
|
|
51
|
-
*
|
|
52
49
|
* #### iOS
|
|
53
50
|
*
|
|
54
51
|
* - `url` - a URL to share
|
|
52
|
+
* - `message` - a message to share
|
|
55
53
|
*
|
|
56
|
-
* At least one of URL
|
|
54
|
+
* At least one of `URL` or `message` is required.
|
|
57
55
|
*
|
|
58
56
|
* #### Android
|
|
59
57
|
*
|
|
60
|
-
* - `title` - title of the message
|
|
58
|
+
* - `title` - title of the message (optional)
|
|
59
|
+
* - `message` - a message to share (often will include a URL).
|
|
61
60
|
*
|
|
62
61
|
* ### Options
|
|
63
62
|
*
|
|
@@ -73,8 +72,8 @@ class Share {
|
|
|
73
72
|
*
|
|
74
73
|
*/
|
|
75
74
|
static share(
|
|
76
|
-
content:
|
|
77
|
-
options:
|
|
75
|
+
content: ShareContent,
|
|
76
|
+
options: ShareOptions = {},
|
|
78
77
|
): Promise<{action: string, activityType: ?string}> {
|
|
79
78
|
invariant(
|
|
80
79
|
typeof content === 'object' && content !== null,
|
|
@@ -82,7 +81,7 @@ class Share {
|
|
|
82
81
|
);
|
|
83
82
|
invariant(
|
|
84
83
|
typeof content.url === 'string' || typeof content.message === 'string',
|
|
85
|
-
'At least one of URL
|
|
84
|
+
'At least one of URL or message is required',
|
|
86
85
|
);
|
|
87
86
|
invariant(
|
|
88
87
|
typeof options === 'object' && options !== null,
|
package/Libraries/Text/Text.js
CHANGED
|
@@ -42,8 +42,10 @@ const Text: React.AbstractComponent<
|
|
|
42
42
|
'aria-label': ariaLabel,
|
|
43
43
|
'aria-selected': ariaSelected,
|
|
44
44
|
ellipsizeMode,
|
|
45
|
+
disabled,
|
|
45
46
|
id,
|
|
46
47
|
nativeID,
|
|
48
|
+
numberOfLines,
|
|
47
49
|
onLongPress,
|
|
48
50
|
onPress,
|
|
49
51
|
onPressIn,
|
|
@@ -55,7 +57,10 @@ const Text: React.AbstractComponent<
|
|
|
55
57
|
onResponderTerminationRequest,
|
|
56
58
|
onStartShouldSetResponder,
|
|
57
59
|
pressRetentionOffset,
|
|
60
|
+
selectable,
|
|
61
|
+
selectionColor,
|
|
58
62
|
suppressHighlighting,
|
|
63
|
+
style,
|
|
59
64
|
...restProps
|
|
60
65
|
} = props;
|
|
61
66
|
|
|
@@ -92,7 +97,7 @@ const Text: React.AbstractComponent<
|
|
|
92
97
|
}
|
|
93
98
|
|
|
94
99
|
const _accessibilityStateDisabled = _accessibilityState?.disabled;
|
|
95
|
-
const _disabled =
|
|
100
|
+
const _disabled = disabled ?? _accessibilityStateDisabled;
|
|
96
101
|
|
|
97
102
|
const isPressable =
|
|
98
103
|
(onPress != null ||
|
|
@@ -195,29 +200,28 @@ const Text: React.AbstractComponent<
|
|
|
195
200
|
);
|
|
196
201
|
|
|
197
202
|
// TODO: Move this processing to the view configuration.
|
|
198
|
-
const
|
|
199
|
-
|
|
200
|
-
? null
|
|
201
|
-
: processColor(restProps.selectionColor);
|
|
203
|
+
const _selectionColor =
|
|
204
|
+
selectionColor == null ? null : processColor(selectionColor);
|
|
202
205
|
|
|
203
|
-
let
|
|
206
|
+
let _style = style;
|
|
204
207
|
if (__DEV__) {
|
|
205
208
|
if (PressabilityDebug.isEnabled() && onPress != null) {
|
|
206
|
-
|
|
209
|
+
_style = [style, {color: 'magenta'}];
|
|
207
210
|
}
|
|
208
211
|
}
|
|
209
212
|
|
|
210
|
-
let
|
|
211
|
-
if (
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
213
|
+
let _numberOfLines = numberOfLines;
|
|
214
|
+
if (_numberOfLines != null && !(_numberOfLines >= 0)) {
|
|
215
|
+
if (__DEV__) {
|
|
216
|
+
console.error(
|
|
217
|
+
`'numberOfLines' in <Text> must be a non-negative number, received: ${_numberOfLines}. The value will be set to 0.`,
|
|
218
|
+
);
|
|
219
|
+
}
|
|
220
|
+
_numberOfLines = 0;
|
|
216
221
|
}
|
|
217
222
|
|
|
218
|
-
let _selectable =
|
|
219
|
-
|
|
220
|
-
const processedStyle = flattenStyle(style);
|
|
223
|
+
let _selectable = selectable;
|
|
224
|
+
const processedStyle = flattenStyle(_style);
|
|
221
225
|
if (processedStyle != null) {
|
|
222
226
|
if (typeof processedStyle.fontWeight === 'number') {
|
|
223
227
|
// $FlowFixMe[cannot-write]
|
|
@@ -252,11 +256,12 @@ const Text: React.AbstractComponent<
|
|
|
252
256
|
isHighlighted={isHighlighted}
|
|
253
257
|
isPressable={isPressable}
|
|
254
258
|
nativeID={_nativeID}
|
|
255
|
-
numberOfLines={
|
|
259
|
+
numberOfLines={_numberOfLines}
|
|
256
260
|
ref={forwardedRef}
|
|
257
261
|
selectable={_selectable}
|
|
258
|
-
selectionColor={
|
|
262
|
+
selectionColor={_selectionColor}
|
|
259
263
|
style={processedStyle}
|
|
264
|
+
disabled={disabled}
|
|
260
265
|
/>
|
|
261
266
|
);
|
|
262
267
|
}
|
|
@@ -292,10 +297,10 @@ const Text: React.AbstractComponent<
|
|
|
292
297
|
ellipsizeMode={ellipsizeMode ?? 'tail'}
|
|
293
298
|
isHighlighted={isHighlighted}
|
|
294
299
|
nativeID={_nativeID}
|
|
295
|
-
numberOfLines={
|
|
300
|
+
numberOfLines={_numberOfLines}
|
|
296
301
|
ref={forwardedRef}
|
|
297
302
|
selectable={_selectable}
|
|
298
|
-
selectionColor={
|
|
303
|
+
selectionColor={_selectionColor}
|
|
299
304
|
style={processedStyle}
|
|
300
305
|
/>
|
|
301
306
|
</TextAncestor.Provider>
|
|
@@ -56,8 +56,10 @@ const Text: React.AbstractComponent<
|
|
|
56
56
|
'aria-selected': ariaSelected,
|
|
57
57
|
'aria-setsize': ariaSetsize, // Win32
|
|
58
58
|
ellipsizeMode,
|
|
59
|
+
disabled,
|
|
59
60
|
id,
|
|
60
61
|
nativeID,
|
|
62
|
+
numberOfLines,
|
|
61
63
|
onLongPress,
|
|
62
64
|
onPress,
|
|
63
65
|
onPressIn,
|
|
@@ -69,7 +71,10 @@ const Text: React.AbstractComponent<
|
|
|
69
71
|
onResponderTerminationRequest,
|
|
70
72
|
onStartShouldSetResponder,
|
|
71
73
|
pressRetentionOffset,
|
|
74
|
+
selectable,
|
|
75
|
+
selectionColor,
|
|
72
76
|
suppressHighlighting,
|
|
77
|
+
style,
|
|
73
78
|
...restProps
|
|
74
79
|
} = props;
|
|
75
80
|
|
|
@@ -113,7 +118,7 @@ const Text: React.AbstractComponent<
|
|
|
113
118
|
}
|
|
114
119
|
|
|
115
120
|
const _accessibilityStateDisabled = _accessibilityState?.disabled;
|
|
116
|
-
const _disabled =
|
|
121
|
+
const _disabled = disabled ?? _accessibilityStateDisabled;
|
|
117
122
|
|
|
118
123
|
const isPressable =
|
|
119
124
|
(onPress != null ||
|
|
@@ -216,29 +221,28 @@ const Text: React.AbstractComponent<
|
|
|
216
221
|
);
|
|
217
222
|
|
|
218
223
|
// TODO: Move this processing to the view configuration.
|
|
219
|
-
const
|
|
220
|
-
|
|
221
|
-
? null
|
|
222
|
-
: processColor(restProps.selectionColor);
|
|
224
|
+
const _selectionColor =
|
|
225
|
+
selectionColor == null ? null : processColor(selectionColor);
|
|
223
226
|
|
|
224
|
-
let
|
|
227
|
+
let _style = style;
|
|
225
228
|
if (__DEV__) {
|
|
226
229
|
if (PressabilityDebug.isEnabled() && onPress != null) {
|
|
227
|
-
|
|
230
|
+
_style = [style, {color: 'magenta'}];
|
|
228
231
|
}
|
|
229
232
|
}
|
|
230
233
|
|
|
231
|
-
let
|
|
232
|
-
if (
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
234
|
+
let _numberOfLines = numberOfLines;
|
|
235
|
+
if (_numberOfLines != null && !(_numberOfLines >= 0)) {
|
|
236
|
+
if (__DEV__) {
|
|
237
|
+
console.error(
|
|
238
|
+
`'numberOfLines' in <Text> must be a non-negative number, received: ${_numberOfLines}. The value will be set to 0.`,
|
|
239
|
+
);
|
|
240
|
+
}
|
|
241
|
+
_numberOfLines = 0;
|
|
237
242
|
}
|
|
238
243
|
|
|
239
|
-
let _selectable =
|
|
240
|
-
|
|
241
|
-
const processedStyle = flattenStyle(style);
|
|
244
|
+
let _selectable = selectable;
|
|
245
|
+
const processedStyle = flattenStyle(_style);
|
|
242
246
|
if (processedStyle != null) {
|
|
243
247
|
if (typeof processedStyle.fontWeight === 'number') {
|
|
244
248
|
// $FlowFixMe[cannot-write]
|
|
@@ -279,11 +283,12 @@ const Text: React.AbstractComponent<
|
|
|
279
283
|
isHighlighted={isHighlighted}
|
|
280
284
|
isPressable={isPressable}
|
|
281
285
|
nativeID={_nativeID}
|
|
282
|
-
numberOfLines={
|
|
286
|
+
numberOfLines={_numberOfLines}
|
|
283
287
|
ref={forwardedRef}
|
|
284
288
|
selectable={_selectable}
|
|
285
|
-
selectionColor={
|
|
289
|
+
selectionColor={_selectionColor}
|
|
286
290
|
style={processedStyle}
|
|
291
|
+
disabled={disabled}
|
|
287
292
|
/>
|
|
288
293
|
);
|
|
289
294
|
}
|
|
@@ -325,10 +330,10 @@ const Text: React.AbstractComponent<
|
|
|
325
330
|
ellipsizeMode={ellipsizeMode ?? 'tail'}
|
|
326
331
|
isHighlighted={isHighlighted}
|
|
327
332
|
nativeID={_nativeID}
|
|
328
|
-
numberOfLines={
|
|
333
|
+
numberOfLines={_numberOfLines}
|
|
329
334
|
ref={forwardedRef}
|
|
330
335
|
selectable={_selectable}
|
|
331
|
-
selectionColor={
|
|
336
|
+
selectionColor={_selectionColor}
|
|
332
337
|
style={processedStyle}
|
|
333
338
|
/>
|
|
334
339
|
</TextAncestor.Provider>
|
|
@@ -17,7 +17,7 @@ import {createViewConfig} from '../NativeComponent/ViewConfig';
|
|
|
17
17
|
import UIManager from '../ReactNative/UIManager';
|
|
18
18
|
import createReactNativeComponentClass from '../Renderer/shims/createReactNativeComponentClass';
|
|
19
19
|
|
|
20
|
-
type NativeTextProps = $ReadOnly<{
|
|
20
|
+
export type NativeTextProps = $ReadOnly<{
|
|
21
21
|
...TextProps,
|
|
22
22
|
isHighlighted?: ?boolean,
|
|
23
23
|
selectionColor?: ?ProcessedColorValue,
|
|
@@ -17,7 +17,7 @@ import {createViewConfig} from '../NativeComponent/ViewConfig';
|
|
|
17
17
|
import UIManager from '../ReactNative/UIManager';
|
|
18
18
|
import createReactNativeComponentClass from '../Renderer/shims/createReactNativeComponentClass';
|
|
19
19
|
|
|
20
|
-
type NativeTextProps = $ReadOnly<{
|
|
20
|
+
export type NativeTextProps = $ReadOnly<{
|
|
21
21
|
...TextProps,
|
|
22
22
|
isHighlighted?: ?boolean,
|
|
23
23
|
selectionColor?: ?ProcessedColorValue,
|