@office-iss/react-native-win32 0.71.11 → 0.71.13
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/CHANGELOG.json +31 -1
- package/CHANGELOG.md +20 -4
- package/Libraries/Components/TextInput/TextInput.d.ts +121 -86
- package/Libraries/Components/TextInput/TextInput.flow.js +121 -135
- package/Libraries/Components/TextInput/TextInput.js +165 -154
- package/Libraries/Components/TextInput/TextInput.win32.js +121 -137
- package/Libraries/Components/View/View.js +34 -16
- package/Libraries/Components/View/View.win32.js +34 -16
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Image/Image.android.js +1 -1
- package/Libraries/Lists/VirtualizedList.js +3 -0
- package/Libraries/LogBox/Data/parseLogBoxLog.js +50 -20
- package/Libraries/Pressability/Pressability.win32.js +28 -6
- package/Libraries/StyleSheet/StyleSheetTypes.d.ts +1 -0
- package/Libraries/Text/Text.js +49 -41
- package/flow-typed/npm/ansi-regex_v5.x.x.js +14 -0
- package/overrides.json +7 -7
- package/package.json +7 -7
|
@@ -57,7 +57,6 @@ const View: React.AbstractComponent<
|
|
|
57
57
|
nativeID,
|
|
58
58
|
pointerEvents,
|
|
59
59
|
role,
|
|
60
|
-
style,
|
|
61
60
|
tabIndex,
|
|
62
61
|
...otherProps
|
|
63
62
|
}: ViewProps,
|
|
@@ -66,23 +65,42 @@ const View: React.AbstractComponent<
|
|
|
66
65
|
const _accessibilityLabelledBy =
|
|
67
66
|
ariaLabelledBy?.split(/\s*,\s*/g) ?? accessibilityLabelledBy;
|
|
68
67
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
68
|
+
let _accessibilityState;
|
|
69
|
+
if (
|
|
70
|
+
accessibilityState != null ||
|
|
71
|
+
ariaBusy != null ||
|
|
72
|
+
ariaChecked != null ||
|
|
73
|
+
ariaDisabled != null ||
|
|
74
|
+
ariaExpanded != null ||
|
|
75
|
+
ariaSelected != null
|
|
76
|
+
) {
|
|
77
|
+
_accessibilityState = {
|
|
78
|
+
busy: ariaBusy ?? accessibilityState?.busy,
|
|
79
|
+
checked: ariaChecked ?? accessibilityState?.checked,
|
|
80
|
+
disabled: ariaDisabled ?? accessibilityState?.disabled,
|
|
81
|
+
expanded: ariaExpanded ?? accessibilityState?.expanded,
|
|
82
|
+
selected: ariaSelected ?? accessibilityState?.selected,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
let _accessibilityValue;
|
|
86
|
+
if (
|
|
87
|
+
accessibilityValue != null ||
|
|
88
|
+
ariaValueMax != null ||
|
|
89
|
+
ariaValueMin != null ||
|
|
90
|
+
ariaValueNow != null ||
|
|
91
|
+
ariaValueText != null
|
|
92
|
+
) {
|
|
93
|
+
_accessibilityValue = {
|
|
94
|
+
max: ariaValueMax ?? accessibilityValue?.max,
|
|
95
|
+
min: ariaValueMin ?? accessibilityValue?.min,
|
|
96
|
+
now: ariaValueNow ?? accessibilityValue?.now,
|
|
97
|
+
text: ariaValueText ?? accessibilityValue?.text,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
76
100
|
|
|
77
|
-
|
|
78
|
-
max: ariaValueMax ?? accessibilityValue?.max,
|
|
79
|
-
min: ariaValueMin ?? accessibilityValue?.min,
|
|
80
|
-
now: ariaValueNow ?? accessibilityValue?.now,
|
|
81
|
-
text: ariaValueText ?? accessibilityValue?.text,
|
|
82
|
-
};
|
|
101
|
+
let style = flattenStyle(otherProps.style);
|
|
83
102
|
|
|
84
|
-
const
|
|
85
|
-
const newPointerEvents = flattenedStyle?.pointerEvents || pointerEvents;
|
|
103
|
+
const newPointerEvents = style?.pointerEvents || pointerEvents;
|
|
86
104
|
|
|
87
105
|
return (
|
|
88
106
|
<TextAncestor.Provider value={false}>
|
|
@@ -61,7 +61,6 @@ const View: React.AbstractComponent<
|
|
|
61
61
|
nativeID,
|
|
62
62
|
pointerEvents,
|
|
63
63
|
role,
|
|
64
|
-
style,
|
|
65
64
|
tabIndex,
|
|
66
65
|
...otherProps
|
|
67
66
|
}: ViewProps,
|
|
@@ -70,23 +69,42 @@ const View: React.AbstractComponent<
|
|
|
70
69
|
const _accessibilityLabelledBy =
|
|
71
70
|
ariaLabelledBy?.split(/\s*,\s*/g) ?? accessibilityLabelledBy;
|
|
72
71
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
72
|
+
let _accessibilityState;
|
|
73
|
+
if (
|
|
74
|
+
accessibilityState != null ||
|
|
75
|
+
ariaBusy != null ||
|
|
76
|
+
ariaChecked != null ||
|
|
77
|
+
ariaDisabled != null ||
|
|
78
|
+
ariaExpanded != null ||
|
|
79
|
+
ariaSelected != null
|
|
80
|
+
) {
|
|
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
|
+
}
|
|
89
|
+
let _accessibilityValue;
|
|
90
|
+
if (
|
|
91
|
+
accessibilityValue != null ||
|
|
92
|
+
ariaValueMax != null ||
|
|
93
|
+
ariaValueMin != null ||
|
|
94
|
+
ariaValueNow != null ||
|
|
95
|
+
ariaValueText != null
|
|
96
|
+
) {
|
|
97
|
+
_accessibilityValue = {
|
|
98
|
+
max: ariaValueMax ?? accessibilityValue?.max,
|
|
99
|
+
min: ariaValueMin ?? accessibilityValue?.min,
|
|
100
|
+
now: ariaValueNow ?? accessibilityValue?.now,
|
|
101
|
+
text: ariaValueText ?? accessibilityValue?.text,
|
|
102
|
+
};
|
|
103
|
+
}
|
|
80
104
|
|
|
81
|
-
|
|
82
|
-
max: ariaValueMax ?? accessibilityValue?.max,
|
|
83
|
-
min: ariaValueMin ?? accessibilityValue?.min,
|
|
84
|
-
now: ariaValueNow ?? accessibilityValue?.now,
|
|
85
|
-
text: ariaValueText ?? accessibilityValue?.text,
|
|
86
|
-
};
|
|
105
|
+
let style = flattenStyle(otherProps.style);
|
|
87
106
|
|
|
88
|
-
const
|
|
89
|
-
const newPointerEvents = flattenedStyle?.pointerEvents || pointerEvents;
|
|
107
|
+
const newPointerEvents = style?.pointerEvents || pointerEvents;
|
|
90
108
|
|
|
91
109
|
const _keyDown = (event: KeyEvent) => {
|
|
92
110
|
if (otherProps.keyDownEvents && event.isPropagationStopped() !== true) {
|
|
@@ -158,13 +158,13 @@ const BaseImage = (props: ImagePropsType, forwardedRef) => {
|
|
|
158
158
|
const {width = props.width, height = props.height, uri} = source;
|
|
159
159
|
style = flattenStyle([{width, height}, styles.base, props.style]);
|
|
160
160
|
sources = [source];
|
|
161
|
-
|
|
162
161
|
if (uri === '') {
|
|
163
162
|
console.warn('source.uri should not be an empty string');
|
|
164
163
|
}
|
|
165
164
|
}
|
|
166
165
|
|
|
167
166
|
const {height, width, ...restProps} = props;
|
|
167
|
+
|
|
168
168
|
const {onLoadStart, onLoad, onLoadEnd, onError} = props;
|
|
169
169
|
const nativeProps = {
|
|
170
170
|
...restProps,
|
|
@@ -157,6 +157,9 @@ export default class VirtualizedList extends StateSafePureComponent<
|
|
|
157
157
|
scrollToEnd(params?: ?{animated?: ?boolean, ...}) {
|
|
158
158
|
const animated = params ? params.animated : true;
|
|
159
159
|
const veryLast = this.props.getItemCount(this.props.data) - 1;
|
|
160
|
+
if (veryLast < 0) {
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
160
163
|
const frame = this.__getFrameMetricsApprox(veryLast, this.props);
|
|
161
164
|
const offset = Math.max(
|
|
162
165
|
0,
|
|
@@ -14,12 +14,38 @@ import type {LogBoxLogData} from './LogBoxLog';
|
|
|
14
14
|
import parseErrorStack from '../../Core/Devtools/parseErrorStack';
|
|
15
15
|
import UTFSequence from '../../UTFSequence';
|
|
16
16
|
import stringifySafe from '../../Utilities/stringifySafe';
|
|
17
|
+
import ansiRegex from 'ansi-regex';
|
|
18
|
+
|
|
19
|
+
const ANSI_REGEX = ansiRegex().source;
|
|
17
20
|
|
|
18
21
|
const BABEL_TRANSFORM_ERROR_FORMAT =
|
|
19
22
|
/^(?:TransformError )?(?:SyntaxError: |ReferenceError: )(.*): (.*) \((\d+):(\d+)\)\n\n([\s\S]+)/;
|
|
23
|
+
|
|
24
|
+
// https://github.com/babel/babel/blob/33dbb85e9e9fe36915273080ecc42aee62ed0ade/packages/babel-code-frame/src/index.ts#L183-L184
|
|
25
|
+
const BABEL_CODE_FRAME_MARKER_PATTERN = new RegExp(
|
|
26
|
+
[
|
|
27
|
+
// Beginning of a line (per 'm' flag)
|
|
28
|
+
'^',
|
|
29
|
+
// Optional ANSI escapes for colors
|
|
30
|
+
`(?:${ANSI_REGEX})*`,
|
|
31
|
+
// Marker
|
|
32
|
+
'>',
|
|
33
|
+
// Optional ANSI escapes for colors
|
|
34
|
+
`(?:${ANSI_REGEX})*`,
|
|
35
|
+
// Left padding for line number
|
|
36
|
+
' +',
|
|
37
|
+
// Line number
|
|
38
|
+
'[0-9]+',
|
|
39
|
+
// Gutter
|
|
40
|
+
' \\|',
|
|
41
|
+
].join(''),
|
|
42
|
+
'm',
|
|
43
|
+
);
|
|
44
|
+
|
|
20
45
|
const BABEL_CODE_FRAME_ERROR_FORMAT =
|
|
21
46
|
// eslint-disable-next-line no-control-regex
|
|
22
47
|
/^(?:TransformError )?(?:.*):? (?:.*?)(\/.*): ([\s\S]+?)\n([ >]{2}[\d\s]+ \|[\s\S]+|\u{001b}[\s\S]+)/u;
|
|
48
|
+
|
|
23
49
|
const METRO_ERROR_FORMAT =
|
|
24
50
|
/^(?:InternalError Metro has encountered an error:) (.*): (.*) \((\d+):(\d+)\)\n\n([\s\S]+)/u;
|
|
25
51
|
|
|
@@ -241,27 +267,31 @@ export function parseLogBoxException(
|
|
|
241
267
|
};
|
|
242
268
|
}
|
|
243
269
|
|
|
244
|
-
|
|
270
|
+
// Perform a cheap match first before trying to parse the full message, which
|
|
271
|
+
// can get expensive for arbitrary input.
|
|
272
|
+
if (BABEL_CODE_FRAME_MARKER_PATTERN.test(message)) {
|
|
273
|
+
const babelCodeFrameError = message.match(BABEL_CODE_FRAME_ERROR_FORMAT);
|
|
245
274
|
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
275
|
+
if (babelCodeFrameError) {
|
|
276
|
+
// Codeframe errors are thrown from any use of buildCodeFrameError.
|
|
277
|
+
const [fileName, content, codeFrame] = babelCodeFrameError.slice(1);
|
|
278
|
+
return {
|
|
279
|
+
level: 'syntax',
|
|
280
|
+
stack: [],
|
|
281
|
+
isComponentError: false,
|
|
282
|
+
componentStack: [],
|
|
283
|
+
codeFrame: {
|
|
284
|
+
fileName,
|
|
285
|
+
location: null, // We are not given the location.
|
|
286
|
+
content: codeFrame,
|
|
287
|
+
},
|
|
288
|
+
message: {
|
|
289
|
+
content,
|
|
290
|
+
substitutions: [],
|
|
291
|
+
},
|
|
292
|
+
category: `${fileName}-${1}-${1}`,
|
|
293
|
+
};
|
|
294
|
+
}
|
|
265
295
|
}
|
|
266
296
|
|
|
267
297
|
if (message.match(/^TransformError /)) {
|
|
@@ -427,6 +427,7 @@ export default class Pressability {
|
|
|
427
427
|
|}>;
|
|
428
428
|
_touchActivateTime: ?number;
|
|
429
429
|
_touchState: TouchState = 'NOT_RESPONDER';
|
|
430
|
+
_isKeyDown: boolean = false;
|
|
430
431
|
|
|
431
432
|
constructor(config: PressabilityConfig) {
|
|
432
433
|
this.configure(config);
|
|
@@ -468,6 +469,7 @@ export default class Pressability {
|
|
|
468
469
|
if (onBlur != null) {
|
|
469
470
|
onBlur(event);
|
|
470
471
|
}
|
|
472
|
+
this._isKeyDown = false;
|
|
471
473
|
},
|
|
472
474
|
onFocus: (event: FocusEvent): void => {
|
|
473
475
|
const {onFocus} = this._config;
|
|
@@ -596,7 +598,8 @@ export default class Pressability {
|
|
|
596
598
|
(event.nativeEvent.code === 'Space' ||
|
|
597
599
|
event.nativeEvent.code === 'Enter' ||
|
|
598
600
|
event.nativeEvent.code === 'GamepadA') &&
|
|
599
|
-
event.defaultPrevented !== true
|
|
601
|
+
event.defaultPrevented !== true &&
|
|
602
|
+
this._isKeyDown
|
|
600
603
|
) {
|
|
601
604
|
const {onPressOut, onPress} = this._config;
|
|
602
605
|
// $FlowFixMe: PressEvents don't mesh with keyboarding APIs. Keep legacy behavior of passing KeyEvents instead
|
|
@@ -604,6 +607,8 @@ export default class Pressability {
|
|
|
604
607
|
// $FlowFixMe: PressEvents don't mesh with keyboarding APIs. Keep legacy behavior of passing KeyEvents instead
|
|
605
608
|
onPress && onPress(event);
|
|
606
609
|
}
|
|
610
|
+
// Native windows app clears the key pressed state when another key press interrupts the current
|
|
611
|
+
this._isKeyDown = false;
|
|
607
612
|
},
|
|
608
613
|
onKeyDown: (event: KeyEvent): void => {
|
|
609
614
|
const {onKeyDown} = this._config;
|
|
@@ -616,6 +621,7 @@ export default class Pressability {
|
|
|
616
621
|
event.defaultPrevented !== true
|
|
617
622
|
) {
|
|
618
623
|
const {onPressIn} = this._config;
|
|
624
|
+
this._isKeyDown = true;
|
|
619
625
|
// $FlowFixMe: PressEvents don't mesh with keyboarding APIs. Keep legacy behavior of passing KeyEvents instead
|
|
620
626
|
onPressIn && onPressIn(event);
|
|
621
627
|
}
|
|
@@ -780,6 +786,12 @@ export default class Pressability {
|
|
|
780
786
|
}
|
|
781
787
|
}
|
|
782
788
|
|
|
789
|
+
// [Win32]
|
|
790
|
+
// $FlowFixMe - button typing
|
|
791
|
+
_isDefaultPressButton(button): boolean {
|
|
792
|
+
return !button; // Treat 0 or undefined as default press
|
|
793
|
+
}
|
|
794
|
+
|
|
783
795
|
/**
|
|
784
796
|
* Performs a transition between touchable states and identify any activations
|
|
785
797
|
* or deactivations (and callback invocations).
|
|
@@ -808,7 +820,10 @@ export default class Pressability {
|
|
|
808
820
|
|
|
809
821
|
if (isPressInSignal(prevState) && signal === 'LONG_PRESS_DETECTED') {
|
|
810
822
|
const {onLongPress} = this._config;
|
|
811
|
-
if (
|
|
823
|
+
if (
|
|
824
|
+
onLongPress != null &&
|
|
825
|
+
this._isDefaultPressButton(getTouchFromPressEvent(event).button)
|
|
826
|
+
) {
|
|
812
827
|
onLongPress(event);
|
|
813
828
|
}
|
|
814
829
|
}
|
|
@@ -829,7 +844,11 @@ export default class Pressability {
|
|
|
829
844
|
this._deactivate(event);
|
|
830
845
|
}
|
|
831
846
|
const {onLongPress, onPress, android_disableSound} = this._config;
|
|
832
|
-
|
|
847
|
+
|
|
848
|
+
if (
|
|
849
|
+
onPress != null &&
|
|
850
|
+
this._isDefaultPressButton(getTouchFromPressEvent(event).button)
|
|
851
|
+
) {
|
|
833
852
|
const isPressCanceledByLongPress =
|
|
834
853
|
onLongPress != null &&
|
|
835
854
|
prevState === 'RESPONDER_ACTIVE_LONG_PRESS_IN' &&
|
|
@@ -848,17 +867,20 @@ export default class Pressability {
|
|
|
848
867
|
|
|
849
868
|
_activate(event: PressEvent): void {
|
|
850
869
|
const {onPressIn} = this._config;
|
|
851
|
-
const {pageX, pageY} = getTouchFromPressEvent(event);
|
|
870
|
+
const {pageX, pageY, button} = getTouchFromPressEvent(event);
|
|
852
871
|
this._touchActivatePosition = {pageX, pageY};
|
|
853
872
|
this._touchActivateTime = Date.now();
|
|
854
|
-
if (onPressIn != null) {
|
|
873
|
+
if (onPressIn != null && this._isDefaultPressButton(button)) {
|
|
855
874
|
onPressIn(event);
|
|
856
875
|
}
|
|
857
876
|
}
|
|
858
877
|
|
|
859
878
|
_deactivate(event: PressEvent): void {
|
|
860
879
|
const {onPressOut} = this._config;
|
|
861
|
-
if (
|
|
880
|
+
if (
|
|
881
|
+
onPressOut != null &&
|
|
882
|
+
this._isDefaultPressButton(getTouchFromPressEvent(event).button)
|
|
883
|
+
) {
|
|
862
884
|
const minPressDuration = normalizeDelay(
|
|
863
885
|
this._config.minPressDuration,
|
|
864
886
|
0,
|
package/Libraries/Text/Text.js
CHANGED
|
@@ -9,17 +9,16 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import type {PressEvent} from '../Types/CoreEventTypes';
|
|
12
|
+
import type {TextProps} from './TextProps';
|
|
12
13
|
|
|
13
14
|
import * as PressabilityDebug from '../Pressability/PressabilityDebug';
|
|
14
15
|
import usePressability from '../Pressability/usePressability';
|
|
15
16
|
import flattenStyle from '../StyleSheet/flattenStyle';
|
|
16
17
|
import processColor from '../StyleSheet/processColor';
|
|
17
|
-
import StyleSheet from '../StyleSheet/StyleSheet';
|
|
18
18
|
import {getAccessibilityRoleFromRole} from '../Utilities/AcessibilityMapping';
|
|
19
19
|
import Platform from '../Utilities/Platform';
|
|
20
20
|
import TextAncestor from './TextAncestor';
|
|
21
21
|
import {NativeText, NativeVirtualText} from './TextNativeComponent';
|
|
22
|
-
import {type TextProps} from './TextProps';
|
|
23
22
|
import * as React from 'react';
|
|
24
23
|
import {useContext, useMemo, useState} from 'react';
|
|
25
24
|
|
|
@@ -36,6 +35,7 @@ const Text: React.AbstractComponent<
|
|
|
36
35
|
accessible,
|
|
37
36
|
accessibilityLabel,
|
|
38
37
|
accessibilityRole,
|
|
38
|
+
accessibilityState,
|
|
39
39
|
allowFontScaling,
|
|
40
40
|
'aria-busy': ariaBusy,
|
|
41
41
|
'aria-checked': ariaChecked,
|
|
@@ -64,13 +64,23 @@ const Text: React.AbstractComponent<
|
|
|
64
64
|
|
|
65
65
|
const [isHighlighted, setHighlighted] = useState(false);
|
|
66
66
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
67
|
+
let _accessibilityState;
|
|
68
|
+
if (
|
|
69
|
+
accessibilityState != null ||
|
|
70
|
+
ariaBusy != null ||
|
|
71
|
+
ariaChecked != null ||
|
|
72
|
+
ariaDisabled != null ||
|
|
73
|
+
ariaExpanded != null ||
|
|
74
|
+
ariaSelected != null
|
|
75
|
+
) {
|
|
76
|
+
_accessibilityState = {
|
|
77
|
+
busy: ariaBusy ?? accessibilityState?.busy,
|
|
78
|
+
checked: ariaChecked ?? accessibilityState?.checked,
|
|
79
|
+
disabled: ariaDisabled ?? accessibilityState?.disabled,
|
|
80
|
+
expanded: ariaExpanded ?? accessibilityState?.expanded,
|
|
81
|
+
selected: ariaSelected ?? accessibilityState?.selected,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
74
84
|
|
|
75
85
|
const _disabled =
|
|
76
86
|
restProps.disabled != null
|
|
@@ -174,25 +184,11 @@ const Text: React.AbstractComponent<
|
|
|
174
184
|
? null
|
|
175
185
|
: processColor(restProps.selectionColor);
|
|
176
186
|
|
|
177
|
-
let style =
|
|
178
|
-
|
|
179
|
-
let _selectable = restProps.selectable;
|
|
180
|
-
if (style?.userSelect != null) {
|
|
181
|
-
_selectable = userSelectToSelectableMap[style.userSelect];
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
if (style?.verticalAlign != null) {
|
|
185
|
-
style = StyleSheet.compose(style, {
|
|
186
|
-
textAlignVertical:
|
|
187
|
-
verticalAlignToTextAlignVerticalMap[style.verticalAlign],
|
|
188
|
-
});
|
|
189
|
-
}
|
|
187
|
+
let style = restProps.style;
|
|
190
188
|
|
|
191
189
|
if (__DEV__) {
|
|
192
190
|
if (PressabilityDebug.isEnabled() && onPress != null) {
|
|
193
|
-
style =
|
|
194
|
-
color: 'magenta',
|
|
195
|
-
});
|
|
191
|
+
style = [restProps.style, {color: 'magenta'}];
|
|
196
192
|
}
|
|
197
193
|
}
|
|
198
194
|
|
|
@@ -211,10 +207,22 @@ const Text: React.AbstractComponent<
|
|
|
211
207
|
default: accessible,
|
|
212
208
|
});
|
|
213
209
|
|
|
214
|
-
|
|
210
|
+
style = flattenStyle(style);
|
|
211
|
+
|
|
212
|
+
if (typeof style?.fontWeight === 'number') {
|
|
213
|
+
style.fontWeight = style?.fontWeight.toString();
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
let _selectable = restProps.selectable;
|
|
217
|
+
if (style?.userSelect != null) {
|
|
218
|
+
_selectable = userSelectToSelectableMap[style.userSelect];
|
|
219
|
+
delete style.userSelect;
|
|
220
|
+
}
|
|
215
221
|
|
|
216
|
-
if (
|
|
217
|
-
|
|
222
|
+
if (style?.verticalAlign != null) {
|
|
223
|
+
style.textAlignVertical =
|
|
224
|
+
verticalAlignToTextAlignVerticalMap[style.verticalAlign];
|
|
225
|
+
delete style.verticalAlign;
|
|
218
226
|
}
|
|
219
227
|
|
|
220
228
|
const _hasOnPressOrOnLongPress =
|
|
@@ -223,46 +231,46 @@ const Text: React.AbstractComponent<
|
|
|
223
231
|
return hasTextAncestor ? (
|
|
224
232
|
<NativeVirtualText
|
|
225
233
|
{...restProps}
|
|
226
|
-
accessibilityState={_accessibilityState}
|
|
227
234
|
{...eventHandlersForText}
|
|
228
235
|
accessibilityLabel={ariaLabel ?? accessibilityLabel}
|
|
229
236
|
accessibilityRole={
|
|
230
237
|
role ? getAccessibilityRoleFromRole(role) : accessibilityRole
|
|
231
238
|
}
|
|
239
|
+
accessibilityState={_accessibilityState}
|
|
232
240
|
isHighlighted={isHighlighted}
|
|
233
241
|
isPressable={isPressable}
|
|
234
|
-
selectable={_selectable}
|
|
235
242
|
nativeID={id ?? nativeID}
|
|
236
243
|
numberOfLines={numberOfLines}
|
|
237
|
-
selectionColor={selectionColor}
|
|
238
|
-
style={flattenedStyle}
|
|
239
244
|
ref={forwardedRef}
|
|
245
|
+
selectable={_selectable}
|
|
246
|
+
selectionColor={selectionColor}
|
|
247
|
+
style={style}
|
|
240
248
|
/>
|
|
241
249
|
) : (
|
|
242
250
|
<TextAncestor.Provider value={true}>
|
|
243
251
|
<NativeText
|
|
244
252
|
{...restProps}
|
|
245
253
|
{...eventHandlersForText}
|
|
246
|
-
|
|
247
|
-
|
|
254
|
+
accessibilityLabel={ariaLabel ?? accessibilityLabel}
|
|
255
|
+
accessibilityRole={
|
|
256
|
+
role ? getAccessibilityRoleFromRole(role) : accessibilityRole
|
|
257
|
+
}
|
|
258
|
+
accessibilityState={nativeTextAccessibilityState}
|
|
248
259
|
accessible={
|
|
249
260
|
accessible == null && Platform.OS === 'android'
|
|
250
261
|
? _hasOnPressOrOnLongPress
|
|
251
262
|
: _accessible
|
|
252
263
|
}
|
|
253
|
-
accessibilityLabel={ariaLabel ?? accessibilityLabel}
|
|
254
|
-
accessibilityState={nativeTextAccessibilityState}
|
|
255
|
-
accessibilityRole={
|
|
256
|
-
role ? getAccessibilityRoleFromRole(role) : accessibilityRole
|
|
257
|
-
}
|
|
258
264
|
allowFontScaling={allowFontScaling !== false}
|
|
265
|
+
disabled={_disabled}
|
|
259
266
|
ellipsizeMode={ellipsizeMode ?? 'tail'}
|
|
260
267
|
isHighlighted={isHighlighted}
|
|
261
268
|
nativeID={id ?? nativeID}
|
|
262
269
|
numberOfLines={numberOfLines}
|
|
263
|
-
selectionColor={selectionColor}
|
|
264
|
-
style={flattenedStyle}
|
|
265
270
|
ref={forwardedRef}
|
|
271
|
+
selectable={_selectable}
|
|
272
|
+
selectionColor={selectionColor}
|
|
273
|
+
style={style}
|
|
266
274
|
/>
|
|
267
275
|
</TextAncestor.Provider>
|
|
268
276
|
);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @flow strict
|
|
3
|
+
* @format
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
declare module 'ansi-regex' {
|
|
7
|
+
declare export type Options = {
|
|
8
|
+
/**
|
|
9
|
+
* Match only the first ANSI escape.
|
|
10
|
+
*/
|
|
11
|
+
+onlyFirst?: boolean,
|
|
12
|
+
};
|
|
13
|
+
declare export default function ansiRegex(options?: Options): RegExp;
|
|
14
|
+
}
|
package/overrides.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"**/__snapshots__/**",
|
|
8
8
|
"src/rntypes/**"
|
|
9
9
|
],
|
|
10
|
-
"baseVersion": "0.71.
|
|
10
|
+
"baseVersion": "0.71.12",
|
|
11
11
|
"overrides": [
|
|
12
12
|
{
|
|
13
13
|
"type": "derived",
|
|
@@ -113,11 +113,7 @@
|
|
|
113
113
|
"type": "derived",
|
|
114
114
|
"file": "src/Libraries/Components/TextInput/TextInput.win32.js",
|
|
115
115
|
"baseFile": "Libraries/Components/TextInput/TextInput.js",
|
|
116
|
-
"baseHash": "
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
"type": "platform",
|
|
120
|
-
"file": "src/Libraries/Components/TextInput/Win32TextInputNativeComponent.js"
|
|
116
|
+
"baseHash": "e5845da364f14fff72c9580123c41279eb493db4"
|
|
121
117
|
},
|
|
122
118
|
{
|
|
123
119
|
"type": "patch",
|
|
@@ -125,6 +121,10 @@
|
|
|
125
121
|
"baseFile": "Libraries/Components/TextInput/TextInputState.js",
|
|
126
122
|
"baseHash": "60655baaca427e1c7c1b8884833b848335c4033b"
|
|
127
123
|
},
|
|
124
|
+
{
|
|
125
|
+
"type": "platform",
|
|
126
|
+
"file": "src/Libraries/Components/TextInput/Win32TextInputNativeComponent.js"
|
|
127
|
+
},
|
|
128
128
|
{
|
|
129
129
|
"type": "copy",
|
|
130
130
|
"file": "src/Libraries/Components/ToastAndroid/ToastAndroid.win32.js",
|
|
@@ -177,7 +177,7 @@
|
|
|
177
177
|
"type": "patch",
|
|
178
178
|
"file": "src/Libraries/Components/View/View.win32.js",
|
|
179
179
|
"baseFile": "Libraries/Components/View/View.js",
|
|
180
|
-
"baseHash": "
|
|
180
|
+
"baseHash": "7945214eb22374ea322b95d12cf8d68a4cf321e4"
|
|
181
181
|
},
|
|
182
182
|
{
|
|
183
183
|
"type": "derived",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@office-iss/react-native-win32",
|
|
3
|
-
"version": "0.71.
|
|
3
|
+
"version": "0.71.13",
|
|
4
4
|
"description": "Implementation of react native on top of Office's Win32 platform.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./index.win32.js",
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@babel/runtime": "^7.0.0",
|
|
23
23
|
"@jest/create-cache-key-function": "^29.2.1",
|
|
24
|
-
"@react-native-community/cli": "10.2.
|
|
24
|
+
"@react-native-community/cli": "10.2.4",
|
|
25
25
|
"@react-native-community/cli-platform-android": "10.2.0",
|
|
26
|
-
"@react-native-community/cli-platform-ios": "10.2.
|
|
26
|
+
"@react-native-community/cli-platform-ios": "10.2.4",
|
|
27
27
|
"@react-native/assets": "1.0.0",
|
|
28
28
|
"@react-native/normalize-color": "2.1.0",
|
|
29
29
|
"@react-native/polyfills": "2.0.0",
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
"invariant": "^2.2.4",
|
|
37
37
|
"jest-environment-node": "^29.2.1",
|
|
38
38
|
"memoize-one": "^5.0.0",
|
|
39
|
-
"metro-react-native-babel-transformer": "0.73.
|
|
40
|
-
"metro-runtime": "0.73.
|
|
41
|
-
"metro-source-map": "0.73.
|
|
39
|
+
"metro-react-native-babel-transformer": "0.73.10",
|
|
40
|
+
"metro-runtime": "0.73.10",
|
|
41
|
+
"metro-source-map": "0.73.10",
|
|
42
42
|
"mkdirp": "^0.5.1",
|
|
43
43
|
"nullthrows": "^1.1.1",
|
|
44
44
|
"pretty-format": "^26.5.2",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"just-scripts": "^1.3.3",
|
|
74
74
|
"prettier": "^2.4.1",
|
|
75
75
|
"react": "18.2.0",
|
|
76
|
-
"react-native": "0.71.
|
|
76
|
+
"react-native": "0.71.12",
|
|
77
77
|
"react-native-platform-override": "^1.8.3",
|
|
78
78
|
"typescript": "^4.9.5"
|
|
79
79
|
},
|