@office-iss/react-native-win32 0.0.0-canary.255 → 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 +79 -1
- package/CHANGELOG.md +28 -4
- package/Libraries/Components/TextInput/InputAccessoryView.js +10 -1
- package/Libraries/Components/View/ViewAccessibility.js +4 -4
- package/Libraries/Components/View/ViewAccessibility.win32.js +6 -6
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Core/setUpTimers.js +19 -0
- package/Libraries/Image/ImageProps.js +16 -5
- package/Libraries/Image/ImageViewNativeComponent.js +2 -1
- package/Libraries/LogBox/Data/LogBoxData.js +39 -4
- package/Libraries/LogBox/Data/LogBoxLog.js +5 -2
- package/Libraries/LogBox/Data/parseLogBoxLog.js +23 -2
- 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/Renderer/shims/ReactFabric.js +2 -2
- package/Libraries/Renderer/shims/ReactFeatureFlags.js +2 -2
- package/Libraries/Renderer/shims/ReactNative.js +2 -3
- package/Libraries/Renderer/shims/ReactNativeTypes.js +2 -2
- package/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js +2 -2
- package/Libraries/Renderer/shims/createReactNativeComponentClass.js +2 -2
- package/Libraries/Share/Share.d.ts +16 -10
- package/Libraries/Share/Share.js +14 -15
- package/Libraries/Text/Text.js +142 -121
- package/Libraries/Text/Text.win32.js +153 -130
- package/Libraries/Text/TextNativeComponent.js +6 -5
- package/Libraries/Text/TextNativeComponent.win32.js +6 -5
- package/Libraries/Text/TextOptimized.js +538 -0
- package/Libraries/Text/TextProps.js +6 -6
- package/Libraries/Text/TextProps.win32.js +6 -6
- package/Libraries/Types/CodegenTypes.js +3 -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 +7 -7
- package/package.json +19 -19
- package/src/private/specs/modules/NativeDevSettings.js +1 -0
- package/src/private/webapis/idlecallbacks/specs/NativeIdleCallbacks.js +34 -0
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
7
|
* @noformat
|
|
8
|
-
* @flow
|
|
9
8
|
* @nolint
|
|
10
|
-
* @
|
|
9
|
+
* @flow
|
|
10
|
+
* @generated SignedSource<<bb39e39880fecbf572b5f8e7c2a95c5d>>
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
'use strict';
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
7
|
* @noformat
|
|
8
|
-
* @flow strict-local
|
|
9
8
|
* @nolint
|
|
10
|
-
* @
|
|
9
|
+
* @flow strict-local
|
|
10
|
+
* @generated SignedSource<<b1b5e34e426103a69612278fd5c9f77c>>
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
'use strict';
|
|
@@ -5,11 +5,10 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
7
|
* @noformat
|
|
8
|
-
* @flow
|
|
9
8
|
* @nolint
|
|
10
|
-
* @
|
|
9
|
+
* @flow
|
|
10
|
+
* @generated SignedSource<<475c7d864efc2948c6125ddb8a38a4fc>>
|
|
11
11
|
*/
|
|
12
|
-
|
|
13
12
|
'use strict';
|
|
14
13
|
|
|
15
14
|
import type {ReactNativeType} from './ReactNativeTypes';
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
7
|
* @noformat
|
|
8
|
-
* @flow strict
|
|
9
8
|
* @nolint
|
|
10
|
-
* @
|
|
9
|
+
* @flow strict
|
|
10
|
+
* @generated SignedSource<<e7a1421518e1d99f18c5b14e85f44843>>
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
import type {ElementRef, ElementType, Element, AbstractComponent} from 'react';
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
7
|
* @noformat
|
|
8
|
-
* @flow strict-local
|
|
9
8
|
* @nolint
|
|
10
|
-
* @
|
|
9
|
+
* @flow strict-local
|
|
10
|
+
* @generated SignedSource<<69d0cc554d77cddb1c779dfbdf569505>>
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
'use strict';
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
7
|
* @noformat
|
|
8
|
-
* @flow strict-local
|
|
9
8
|
* @nolint
|
|
10
|
-
* @
|
|
9
|
+
* @flow strict-local
|
|
10
|
+
* @generated SignedSource<<62e766b69d440dab0a2d249f0cea38e0>>
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
'use strict';
|
|
@@ -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,39 +57,47 @@ 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
|
|
|
62
67
|
const [isHighlighted, setHighlighted] = useState(false);
|
|
63
68
|
|
|
64
|
-
|
|
69
|
+
const _accessibilityLabel = ariaLabel ?? accessibilityLabel;
|
|
70
|
+
|
|
71
|
+
let _accessibilityState: ?TextProps['accessibilityState'] =
|
|
72
|
+
accessibilityState;
|
|
65
73
|
if (
|
|
66
|
-
accessibilityState != null ||
|
|
67
74
|
ariaBusy != null ||
|
|
68
75
|
ariaChecked != null ||
|
|
69
76
|
ariaDisabled != null ||
|
|
70
77
|
ariaExpanded != null ||
|
|
71
78
|
ariaSelected != null
|
|
72
79
|
) {
|
|
73
|
-
_accessibilityState
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
+
if (_accessibilityState != null) {
|
|
81
|
+
_accessibilityState = {
|
|
82
|
+
busy: ariaBusy ?? _accessibilityState.busy,
|
|
83
|
+
checked: ariaChecked ?? _accessibilityState.checked,
|
|
84
|
+
disabled: ariaDisabled ?? _accessibilityState.disabled,
|
|
85
|
+
expanded: ariaExpanded ?? _accessibilityState.expanded,
|
|
86
|
+
selected: ariaSelected ?? _accessibilityState.selected,
|
|
87
|
+
};
|
|
88
|
+
} else {
|
|
89
|
+
_accessibilityState = {
|
|
90
|
+
busy: ariaBusy,
|
|
91
|
+
checked: ariaChecked,
|
|
92
|
+
disabled: ariaDisabled,
|
|
93
|
+
expanded: ariaExpanded,
|
|
94
|
+
selected: ariaSelected,
|
|
95
|
+
};
|
|
96
|
+
}
|
|
80
97
|
}
|
|
81
98
|
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
? restProps.disabled
|
|
85
|
-
: _accessibilityState?.disabled;
|
|
86
|
-
|
|
87
|
-
const nativeTextAccessibilityState =
|
|
88
|
-
_disabled !== _accessibilityState?.disabled
|
|
89
|
-
? {..._accessibilityState, disabled: _disabled}
|
|
90
|
-
: _accessibilityState;
|
|
99
|
+
const _accessibilityStateDisabled = _accessibilityState?.disabled;
|
|
100
|
+
const _disabled = disabled ?? _accessibilityStateDisabled;
|
|
91
101
|
|
|
92
102
|
const isPressable =
|
|
93
103
|
(onPress != null ||
|
|
@@ -96,41 +106,47 @@ const Text: React.AbstractComponent<
|
|
|
96
106
|
_disabled !== true;
|
|
97
107
|
|
|
98
108
|
const initialized = useLazyInitialization(isPressable);
|
|
99
|
-
const config = useMemo(
|
|
100
|
-
()
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
isPressable,
|
|
126
|
-
pressRetentionOffset,
|
|
109
|
+
const config = useMemo(() => {
|
|
110
|
+
if (!initialized) {
|
|
111
|
+
return null;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
let _onPressIn = onPressIn;
|
|
115
|
+
let _onPressOut = onPressOut;
|
|
116
|
+
|
|
117
|
+
// Updating isHighlighted causes unnecessary re-renders for platforms that don't use it
|
|
118
|
+
// in the best case, and cause issues with text selection in the worst case. Forcing
|
|
119
|
+
// the isHighlighted prop to false on all platforms except iOS.
|
|
120
|
+
if (Platform.OS === 'ios') {
|
|
121
|
+
_onPressIn = (event: PressEvent) => {
|
|
122
|
+
setHighlighted(suppressHighlighting == null || !suppressHighlighting);
|
|
123
|
+
onPressIn?.(event);
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
_onPressOut = (event: PressEvent) => {
|
|
127
|
+
setHighlighted(false);
|
|
128
|
+
onPressOut?.(event);
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
return {
|
|
133
|
+
disabled: !isPressable,
|
|
134
|
+
pressRectOffset: pressRetentionOffset,
|
|
127
135
|
onLongPress,
|
|
128
136
|
onPress,
|
|
129
|
-
onPressIn,
|
|
130
|
-
onPressOut,
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
137
|
+
onPressIn: _onPressIn,
|
|
138
|
+
onPressOut: _onPressOut,
|
|
139
|
+
};
|
|
140
|
+
}, [
|
|
141
|
+
initialized,
|
|
142
|
+
isPressable,
|
|
143
|
+
pressRetentionOffset,
|
|
144
|
+
onLongPress,
|
|
145
|
+
onPress,
|
|
146
|
+
onPressIn,
|
|
147
|
+
onPressOut,
|
|
148
|
+
suppressHighlighting,
|
|
149
|
+
]);
|
|
134
150
|
|
|
135
151
|
const eventHandlers = usePressability(config);
|
|
136
152
|
const eventHandlersForText = useMemo(
|
|
@@ -184,103 +200,108 @@ const Text: React.AbstractComponent<
|
|
|
184
200
|
);
|
|
185
201
|
|
|
186
202
|
// TODO: Move this processing to the view configuration.
|
|
187
|
-
const
|
|
188
|
-
|
|
189
|
-
? null
|
|
190
|
-
: processColor(restProps.selectionColor);
|
|
191
|
-
|
|
192
|
-
let style = restProps.style;
|
|
203
|
+
const _selectionColor =
|
|
204
|
+
selectionColor == null ? null : processColor(selectionColor);
|
|
193
205
|
|
|
206
|
+
let _style = style;
|
|
194
207
|
if (__DEV__) {
|
|
195
208
|
if (PressabilityDebug.isEnabled() && onPress != null) {
|
|
196
|
-
|
|
209
|
+
_style = [style, {color: 'magenta'}];
|
|
197
210
|
}
|
|
198
211
|
}
|
|
199
212
|
|
|
200
|
-
let
|
|
201
|
-
if (
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
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;
|
|
206
221
|
}
|
|
207
222
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
223
|
+
let _selectable = selectable;
|
|
224
|
+
const processedStyle = flattenStyle(_style);
|
|
225
|
+
if (processedStyle != null) {
|
|
226
|
+
if (typeof processedStyle.fontWeight === 'number') {
|
|
227
|
+
// $FlowFixMe[cannot-write]
|
|
228
|
+
processedStyle.fontWeight = processedStyle.fontWeight.toString();
|
|
229
|
+
}
|
|
214
230
|
|
|
215
|
-
|
|
216
|
-
|
|
231
|
+
if (processedStyle.userSelect != null) {
|
|
232
|
+
_selectable = userSelectToSelectableMap[processedStyle.userSelect];
|
|
233
|
+
// $FlowFixMe[cannot-write]
|
|
234
|
+
delete processedStyle.userSelect;
|
|
235
|
+
}
|
|
217
236
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
237
|
+
if (processedStyle.verticalAlign != null) {
|
|
238
|
+
// $FlowFixMe[cannot-write]
|
|
239
|
+
processedStyle.textAlignVertical =
|
|
240
|
+
verticalAlignToTextAlignVerticalMap[processedStyle.verticalAlign];
|
|
241
|
+
// $FlowFixMe[cannot-write]
|
|
242
|
+
delete processedStyle.verticalAlign;
|
|
243
|
+
}
|
|
222
244
|
}
|
|
223
245
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
246
|
+
const _nativeID = id ?? nativeID;
|
|
247
|
+
|
|
248
|
+
const hasTextAncestor = useContext(TextAncestor);
|
|
249
|
+
if (hasTextAncestor) {
|
|
250
|
+
return (
|
|
251
|
+
<NativeVirtualText
|
|
252
|
+
{...restProps}
|
|
253
|
+
{...eventHandlersForText}
|
|
254
|
+
accessibilityLabel={_accessibilityLabel}
|
|
255
|
+
accessibilityState={_accessibilityState}
|
|
256
|
+
isHighlighted={isHighlighted}
|
|
257
|
+
isPressable={isPressable}
|
|
258
|
+
nativeID={_nativeID}
|
|
259
|
+
numberOfLines={_numberOfLines}
|
|
260
|
+
ref={forwardedRef}
|
|
261
|
+
selectable={_selectable}
|
|
262
|
+
selectionColor={_selectionColor}
|
|
263
|
+
style={processedStyle}
|
|
264
|
+
disabled={disabled}
|
|
265
|
+
/>
|
|
266
|
+
);
|
|
231
267
|
}
|
|
232
268
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
269
|
+
// If the disabled prop and accessibilityState.disabled are out of sync but not both in
|
|
270
|
+
// falsy states we need to update the accessibilityState object to use the disabled prop.
|
|
271
|
+
if (
|
|
272
|
+
_disabled !== _accessibilityStateDisabled &&
|
|
273
|
+
((_disabled != null && _disabled !== false) ||
|
|
274
|
+
(_accessibilityStateDisabled != null &&
|
|
275
|
+
_accessibilityStateDisabled !== false))
|
|
276
|
+
) {
|
|
277
|
+
_accessibilityState = {..._accessibilityState, disabled: _disabled};
|
|
242
278
|
}
|
|
243
279
|
|
|
244
|
-
const
|
|
245
|
-
|
|
280
|
+
const _accessible = Platform.select({
|
|
281
|
+
ios: accessible !== false,
|
|
282
|
+
android:
|
|
283
|
+
accessible == null ? onPress != null || onLongPress != null : accessible,
|
|
284
|
+
default: accessible,
|
|
285
|
+
});
|
|
246
286
|
|
|
247
|
-
return
|
|
248
|
-
<NativeVirtualText
|
|
249
|
-
{...restProps}
|
|
250
|
-
{...eventHandlersForText}
|
|
251
|
-
accessibilityLabel={ariaLabel ?? accessibilityLabel}
|
|
252
|
-
accessibilityState={_accessibilityState}
|
|
253
|
-
isHighlighted={isHighlighted}
|
|
254
|
-
isPressable={isPressable}
|
|
255
|
-
nativeID={id ?? nativeID}
|
|
256
|
-
numberOfLines={numberOfLines}
|
|
257
|
-
ref={forwardedRef}
|
|
258
|
-
selectable={_selectable}
|
|
259
|
-
selectionColor={selectionColor}
|
|
260
|
-
style={style}
|
|
261
|
-
/>
|
|
262
|
-
) : (
|
|
287
|
+
return (
|
|
263
288
|
<TextAncestor.Provider value={true}>
|
|
264
289
|
<NativeText
|
|
265
290
|
{...restProps}
|
|
266
291
|
{...eventHandlersForText}
|
|
267
|
-
accessibilityLabel={
|
|
268
|
-
accessibilityState={
|
|
269
|
-
accessible={
|
|
270
|
-
accessible == null && Platform.OS === 'android'
|
|
271
|
-
? _hasOnPressOrOnLongPress
|
|
272
|
-
: _accessible
|
|
273
|
-
}
|
|
292
|
+
accessibilityLabel={_accessibilityLabel}
|
|
293
|
+
accessibilityState={_accessibilityState}
|
|
294
|
+
accessible={_accessible}
|
|
274
295
|
allowFontScaling={allowFontScaling !== false}
|
|
275
296
|
disabled={_disabled}
|
|
276
297
|
ellipsizeMode={ellipsizeMode ?? 'tail'}
|
|
277
298
|
isHighlighted={isHighlighted}
|
|
278
|
-
nativeID={
|
|
279
|
-
numberOfLines={
|
|
299
|
+
nativeID={_nativeID}
|
|
300
|
+
numberOfLines={_numberOfLines}
|
|
280
301
|
ref={forwardedRef}
|
|
281
302
|
selectable={_selectable}
|
|
282
|
-
selectionColor={
|
|
283
|
-
style={
|
|
303
|
+
selectionColor={_selectionColor}
|
|
304
|
+
style={processedStyle}
|
|
284
305
|
/>
|
|
285
306
|
</TextAncestor.Provider>
|
|
286
307
|
);
|