@office-iss/react-native-win32 0.72.11 → 0.72.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.
@@ -21,8 +21,7 @@ import type {
21
21
 
22
22
  import {Commands as AndroidTextInputCommands} from '../../Components/TextInput/AndroidTextInputNativeComponent';
23
23
  import {Commands as iOSTextInputCommands} from '../../Components/TextInput/RCTSingelineTextInputNativeComponent';
24
-
25
- import {UIManager} from 'react-native';
24
+ import {Commands as Win32TextInputCommands} from '../../Components/TextInput/Win32TextInputNativeComponent';
26
25
 
27
26
  const {findNodeHandle} = require('../../ReactNative/RendererProxy');
28
27
  const Platform = require('../../Utilities/Platform');
@@ -106,7 +105,16 @@ function focusTextInput(textField: ?ComponentRef) {
106
105
  return;
107
106
  }
108
107
 
109
- if (textField != null) {
108
+ // [Win32
109
+ if (Platform.OS === 'win32' && textField != null) {
110
+ // On Windows, we cannot test if the currentlyFocusedInputRef equals the
111
+ // target ref because the call to focus on the target ref may occur before
112
+ // an onBlur event for the target ref has been dispatched to JS but after
113
+ // the target ref has lost native focus.
114
+ focusInput(textField);
115
+ Win32TextInputCommands.focus(textField);
116
+ // Win32]
117
+ } else if (textField != null) {
110
118
  const fieldCanBeFocused =
111
119
  currentlyFocusedInputRef !== textField &&
112
120
  // $FlowFixMe - `currentProps` is missing in `NativeMethods`
@@ -126,11 +134,6 @@ function focusTextInput(textField: ?ComponentRef) {
126
134
  } else if (Platform.OS === 'android') {
127
135
  AndroidTextInputCommands.focus(textField);
128
136
  }
129
- // [Win32
130
- else if (Platform.OS === 'win32') {
131
- UIManager.focus(findNodeHandle(textField));
132
- }
133
- // Win32]
134
137
  }
135
138
  }
136
139
 
@@ -164,7 +167,7 @@ function blurTextInput(textField: ?ComponentRef) {
164
167
  }
165
168
  // [Win32
166
169
  else if (Platform.OS === 'win32') {
167
- UIManager.blur(findNodeHandle(textField));
170
+ Win32TextInputCommands.blur(textField);
168
171
  }
169
172
  // Win32]
170
173
  }
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @flow
3
+ * @format
4
+ */
5
+
6
+ import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes';
7
+
8
+ import requireNativeComponent from '../../ReactNative/requireNativeComponent';
9
+ import codegenNativeCommands from '../../Utilities/codegenNativeCommands';
10
+ import type {TextInputNativeCommands} from './TextInputNativeCommands';
11
+ type NativeType = HostComponent<mixed>;
12
+
13
+ type NativeCommands = TextInputNativeCommands<NativeType>;
14
+
15
+ export const Commands: NativeCommands = codegenNativeCommands<NativeCommands>({
16
+ supportedCommands: ['focus', 'blur', 'setTextAndSelection'],
17
+ });
18
+
19
+ const WindowsTextInputComponent: NativeType =
20
+ requireNativeComponent<mixed>('RCTTextInput');
21
+
22
+ export default WindowsTextInputComponent;
23
+ // [Windows]
@@ -19,6 +19,10 @@ import {
19
19
  NativeSyntheticEvent,
20
20
  TextLayoutEventData,
21
21
  } from '../Types/CoreEventTypes';
22
+ import type {
23
+ IKeyboardEvent,
24
+ IHandledKeyboardEvent,
25
+ } from '../Components/View/ViewPropTypes';
22
26
 
23
27
  export interface TextPropsIOS {
24
28
  /**
@@ -43,11 +47,6 @@ export interface TextPropsIOS {
43
47
  | 'largeTitle'
44
48
  | undefined;
45
49
 
46
- /**
47
- * Specifies smallest possible scale a font can reach when adjustsFontSizeToFit is enabled. (values 0.01-1.0).
48
- */
49
- minimumFontScale?: number | undefined;
50
-
51
50
  /**
52
51
  * When `true`, no visual change is made when text is pressed down. By
53
52
  * default, a gray oval highlights the text on press down.
@@ -106,10 +105,91 @@ export interface TextPropsAndroid {
106
105
  android_hyphenationFrequency?: 'normal' | 'none' | 'full' | undefined;
107
106
  }
108
107
 
108
+ /**
109
+ * Role-based text style names.
110
+ */
111
+ export type TextWin32TextStyle =
112
+ | 'None'
113
+ | 'SmallStandard'
114
+ | 'SmallSecondary'
115
+ | 'MediumStandard'
116
+ | 'MediumSecondary'
117
+ | 'MediumApp'
118
+ | 'MediumBold'
119
+ | 'MediumBoldApp'
120
+ | 'LargeStandard'
121
+ | 'LargePlusStandard'
122
+ | 'ExtraLargeStandard'
123
+ | 'HugeStandard';
124
+
125
+ export interface TextPropsWin32 {
126
+ onKeyDown?: (args: IKeyboardEvent) => void;
127
+ onKeyDownCapture?: (args: IKeyboardEvent) => void;
128
+ onKeyUp?: (args: IKeyboardEvent) => void;
129
+ onKeyUpCapture?: (args: IKeyboardEvent) => void;
130
+
131
+ keyDownEvents?: IHandledKeyboardEvent[];
132
+ keyUpEvents?: IHandledKeyboardEvent[];
133
+
134
+ /** Enables a focusable label with copyability but without character selectability (property:selectable) */
135
+ focusable?: boolean;
136
+
137
+ /**
138
+ * The onBlur event occurs when an element loses focus. The opposite of onBlur is onFocus. Note that in React
139
+ * Native, unlike in the web, the onBlur event bubbles (similar to onFocusOut in the web).
140
+ *
141
+ * `ev.target === ev.currentTarget` when the focus is being lost from this component.
142
+ * `ev.target !== ev.currentTarget` when the focus is being lost from a descendant.
143
+ */
144
+ onBlur?: (ev: NativeSyntheticEvent<{}>) => void;
145
+ /**
146
+ * The onBlur event occurs when an element loses focus. The opposite of onBlur is onFocus. Note that in React
147
+ * Native, unlike in the web, the onBlur event bubbles (similar to onFocusOut in the web).
148
+ *
149
+ * `ev.target === ev.currentTarget` when the focus is being lost from this component.
150
+ * `ev.target !== ev.currentTarget` when the focus is being lost from a descendant.
151
+ */
152
+ onBlurCapture?: (ev: NativeSyntheticEvent<{}>) => void;
153
+ /**
154
+ * The onFocus event occurs when an element gets focus. The opposite of onFocus is onBlur. Note that in React
155
+ * Native, unlike in the web, the onFocus event bubbles (similar to onFocusIn in the web).
156
+ *
157
+ * `ev.target === ev.currentTarget` when the focus is being lost from this component.
158
+ * `ev.target !== ev.currentTarget` when the focus is being lost from a descendant.
159
+ */
160
+ onFocus?: (ev: NativeSyntheticEvent<{}>) => void;
161
+ /**
162
+ * The onFocus event occurs when an element gets focus. The opposite of onFocus is onBlur. Note that in React
163
+ * Native, unlike in the web, the onFocus event bubbles (similar to onFocusIn in the web).
164
+ *
165
+ * `ev.target === ev.currentTarget` when the focus is being lost from this component.
166
+ * `ev.target !== ev.currentTarget` when the focus is being lost from a descendant.
167
+ */
168
+ onFocusCapture?: (ev: NativeSyntheticEvent<{}>) => void;
169
+
170
+ /**
171
+ * Role-based styling of the text control. The styles applied include
172
+ * font face, size, weight and color. These styles take precedence over
173
+ * the `style` property.
174
+ *
175
+ * @remarks
176
+ * The default value is `MediumStandard`.
177
+ *
178
+ * When set to `None`, role-based styling is disabled.
179
+ *
180
+ * @deprecated Use `style` instead.
181
+ */
182
+ textStyle?: TextWin32TextStyle;
183
+
184
+ /** Tooltip displayed on mouse hover of this element */
185
+ tooltip?: string;
186
+ }
187
+
109
188
  // https://reactnative.dev/docs/text#props
110
189
  export interface TextProps
111
190
  extends TextPropsIOS,
112
191
  TextPropsAndroid,
192
+ TextPropsWin32,
113
193
  AccessibilityProps {
114
194
  /**
115
195
  * Specifies whether fonts should scale to respect Text Size accessibility settings.
@@ -11,9 +11,9 @@ export { AccessibilityPropsWin32 } from '@office-iss/react-native-win32/Librarie
11
11
  export type IViewWin32Props = IViewWin32PropsOnly & AccessibilityPropsWin32;
12
12
  export {ViewWin32} from './Components/View/ViewWin32';
13
13
  export {IKeyboardEvent, IHandledKeyboardEvent, EventPhase} from './Components/View/ViewPropTypes';
14
- import {ITextWin32Props as ITextWin32PropsOnly} from './Components/Text/TextWin32.Props';
14
+ import {TextPropsWin32 as ITextWin32PropsOnly} from './Text/Text';
15
15
  export type ITextWin32Props = ITextWin32PropsOnly & AccessibilityPropsWin32;
16
- export {TextWin32TextStyle } from './Components/Text/TextWin32.Props';
16
+ export {TextWin32TextStyle } from './Text/Text';
17
17
  export {TextWin32} from './Components/Text/TextWin32';
18
18
  export {IButtonWin32Props, IButtonWin32Style} from './Components/Button/ButtonWin32.Props';
19
19
  export {ButtonWin32} from './Components/Button/ButtonWin32';
package/overrides.json CHANGED
@@ -114,10 +114,6 @@
114
114
  "baseFile": "packages/react-native/Libraries/Components/ScrollView/ScrollView.js",
115
115
  "baseHash": "7d162bb43bce3f9da78b7c304530b3f804d21658"
116
116
  },
117
- {
118
- "type": "platform",
119
- "file": "src/Libraries/Components/Text/TextWin32.Props.ts"
120
- },
121
117
  {
122
118
  "type": "platform",
123
119
  "file": "src/Libraries/Components/Text/TextWin32.tsx"
@@ -142,6 +138,10 @@
142
138
  "baseFile": "packages/react-native/Libraries/Components/TextInput/TextInputState.js",
143
139
  "baseHash": "60655baaca427e1c7c1b8884833b848335c4033b"
144
140
  },
141
+ {
142
+ "type": "platform",
143
+ "file": "src/Libraries/Components/TextInput/Win32TextInputNativeComponent.js"
144
+ },
145
145
  {
146
146
  "type": "copy",
147
147
  "file": "src/Libraries/Components/ToastAndroid/ToastAndroid.win32.js",
@@ -442,6 +442,12 @@
442
442
  "baseFile": "packages/react-native/Libraries/StyleSheet/StyleSheet.js",
443
443
  "baseHash": "b279b836217a0870546010c935fb53e6a889f0dd"
444
444
  },
445
+ {
446
+ "type": "derived",
447
+ "file": "src/Libraries/Text/Text.d.ts",
448
+ "baseFile": "packages/react-native/Libraries/Text/Text.d.ts",
449
+ "baseHash": "9e85e4822b99786481f22d4bac2fd0f24be40d78"
450
+ },
445
451
  {
446
452
  "type": "derived",
447
453
  "file": "src/Libraries/Text/TextNativeComponent.win32.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@office-iss/react-native-win32",
3
- "version": "0.72.11",
3
+ "version": "0.72.13",
4
4
  "description": "Implementation of react native on top of Office's Win32 platform.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,7 +1,7 @@
1
1
  import React from 'react'
2
2
  import RN = require('react-native');
3
3
  import type { IViewWin32Props } from '../View/ViewPropTypes';
4
- import type { ITextWin32Props } from '../Text/TextWin32.Props';
4
+ import type { TextProps } from '../../Text/Text';
5
5
  import type { IButtonWin32Props } from './ButtonWin32.Props';
6
6
 
7
7
  const enum SelectState {
@@ -40,7 +40,7 @@ export class ButtonWin32 extends React.Component<IButtonWin32Props, IButtonWin32
40
40
  style: this.props.style as RN.StyleProp<RN.ViewStyle>,
41
41
  };
42
42
 
43
- const textProps: ITextWin32Props = {
43
+ const textProps: TextProps = {
44
44
  textStyle: 'None',
45
45
  };
46
46
  if (this.props.color) {
@@ -1,6 +1,6 @@
1
1
  import React from 'react'
2
2
  import RN = require('react-native');
3
- import type { ITextWin32Props } from './TextWin32.Props';
3
+ import type { TextProps } from '../../Text/Text';
4
4
 
5
5
  /**
6
6
  * All of TOrigin except Key from TUse
@@ -11,11 +11,11 @@ type UseFrom<TOrigin, TUse, Key extends keyof TUse> = Pick<TOrigin, Exclude<keyo
11
11
  * React-native <Text> control with additional Win32-specific functionality.
12
12
  */
13
13
 
14
- type InnerViewProps = UseFrom<ITextWin32Props, RN.TextProps, 'accessibilityRole'> &
15
- UseFrom<ITextWin32Props, RN.TextProps, 'accessibilityState'> &
16
- UseFrom<ITextWin32Props, RN.TextProps, 'accessibilityActions'>;
17
- export class TextWin32 extends React.Component<ITextWin32Props, {}> {
18
- constructor(props: ITextWin32Props) {
14
+ type InnerViewProps = UseFrom<TextProps, RN.TextProps, 'accessibilityRole'> &
15
+ UseFrom<TextProps, RN.TextProps, 'accessibilityState'> &
16
+ UseFrom<TextProps, RN.TextProps, 'accessibilityActions'>;
17
+ export class TextWin32 extends React.Component<TextProps, {}> {
18
+ constructor(props: TextProps) {
19
19
  super(props);
20
20
  }
21
21
 
@@ -0,0 +1,299 @@
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
+ * @format
8
+ */
9
+
10
+ import type * as React from 'react';
11
+ import {Constructor} from '../../types/private/Utilities';
12
+ import {AccessibilityProps} from '../Components/View/ViewAccessibility';
13
+ import {NativeMethods} from '../../types/public/ReactNativeTypes';
14
+ import {ColorValue, StyleProp} from '../StyleSheet/StyleSheet';
15
+ import {TextStyle} from '../StyleSheet/StyleSheetTypes';
16
+ import {
17
+ GestureResponderEvent,
18
+ LayoutChangeEvent,
19
+ NativeSyntheticEvent,
20
+ TextLayoutEventData,
21
+ } from '../Types/CoreEventTypes';
22
+ import type {
23
+ IKeyboardEvent,
24
+ IHandledKeyboardEvent,
25
+ } from '../Components/View/ViewPropTypes';
26
+
27
+ export interface TextPropsIOS {
28
+ /**
29
+ * Specifies whether font should be scaled down automatically to fit given style constraints.
30
+ */
31
+ adjustsFontSizeToFit?: boolean | undefined;
32
+
33
+ /**
34
+ * The Dynamic Type scale ramp to apply to this element on iOS.
35
+ */
36
+ dynamicTypeRamp?:
37
+ | 'caption2'
38
+ | 'caption1'
39
+ | 'footnote'
40
+ | 'subheadline'
41
+ | 'callout'
42
+ | 'body'
43
+ | 'headline'
44
+ | 'title3'
45
+ | 'title2'
46
+ | 'title1'
47
+ | 'largeTitle'
48
+ | undefined;
49
+
50
+ /**
51
+ * When `true`, no visual change is made when text is pressed down. By
52
+ * default, a gray oval highlights the text on press down.
53
+ */
54
+ suppressHighlighting?: boolean | undefined;
55
+
56
+ /**
57
+ * Set line break strategy on iOS.
58
+ */
59
+ lineBreakStrategyIOS?:
60
+ | 'none'
61
+ | 'standard'
62
+ | 'hangul-word'
63
+ | 'push-out'
64
+ | undefined;
65
+ }
66
+
67
+ export interface TextPropsAndroid {
68
+ /**
69
+ * Specifies the disabled state of the text view for testing purposes.
70
+ */
71
+ disabled?: boolean | undefined;
72
+
73
+ /**
74
+ * Lets the user select text, to use the native copy and paste functionality.
75
+ */
76
+ selectable?: boolean | undefined;
77
+
78
+ /**
79
+ * The highlight color of the text.
80
+ */
81
+ selectionColor?: ColorValue | undefined;
82
+
83
+ /**
84
+ * Set text break strategy on Android API Level 23+
85
+ * default is `highQuality`.
86
+ */
87
+ textBreakStrategy?: 'simple' | 'highQuality' | 'balanced' | undefined;
88
+
89
+ /**
90
+ * Determines the types of data converted to clickable URLs in the text element.
91
+ * By default no data types are detected.
92
+ */
93
+ dataDetectorType?:
94
+ | null
95
+ | 'phoneNumber'
96
+ | 'link'
97
+ | 'email'
98
+ | 'none'
99
+ | 'all'
100
+ | undefined;
101
+
102
+ /**
103
+ * Hyphenation strategy
104
+ */
105
+ android_hyphenationFrequency?: 'normal' | 'none' | 'full' | undefined;
106
+ }
107
+
108
+ /**
109
+ * Role-based text style names.
110
+ */
111
+ export type TextWin32TextStyle =
112
+ | 'None'
113
+ | 'SmallStandard'
114
+ | 'SmallSecondary'
115
+ | 'MediumStandard'
116
+ | 'MediumSecondary'
117
+ | 'MediumApp'
118
+ | 'MediumBold'
119
+ | 'MediumBoldApp'
120
+ | 'LargeStandard'
121
+ | 'LargePlusStandard'
122
+ | 'ExtraLargeStandard'
123
+ | 'HugeStandard';
124
+
125
+ export interface TextPropsWin32 {
126
+ onKeyDown?: (args: IKeyboardEvent) => void;
127
+ onKeyDownCapture?: (args: IKeyboardEvent) => void;
128
+ onKeyUp?: (args: IKeyboardEvent) => void;
129
+ onKeyUpCapture?: (args: IKeyboardEvent) => void;
130
+
131
+ keyDownEvents?: IHandledKeyboardEvent[];
132
+ keyUpEvents?: IHandledKeyboardEvent[];
133
+
134
+ /** Enables a focusable label with copyability but without character selectability (property:selectable) */
135
+ focusable?: boolean;
136
+
137
+ /**
138
+ * The onBlur event occurs when an element loses focus. The opposite of onBlur is onFocus. Note that in React
139
+ * Native, unlike in the web, the onBlur event bubbles (similar to onFocusOut in the web).
140
+ *
141
+ * `ev.target === ev.currentTarget` when the focus is being lost from this component.
142
+ * `ev.target !== ev.currentTarget` when the focus is being lost from a descendant.
143
+ */
144
+ onBlur?: (ev: NativeSyntheticEvent<{}>) => void;
145
+ /**
146
+ * The onBlur event occurs when an element loses focus. The opposite of onBlur is onFocus. Note that in React
147
+ * Native, unlike in the web, the onBlur event bubbles (similar to onFocusOut in the web).
148
+ *
149
+ * `ev.target === ev.currentTarget` when the focus is being lost from this component.
150
+ * `ev.target !== ev.currentTarget` when the focus is being lost from a descendant.
151
+ */
152
+ onBlurCapture?: (ev: NativeSyntheticEvent<{}>) => void;
153
+ /**
154
+ * The onFocus event occurs when an element gets focus. The opposite of onFocus is onBlur. Note that in React
155
+ * Native, unlike in the web, the onFocus event bubbles (similar to onFocusIn in the web).
156
+ *
157
+ * `ev.target === ev.currentTarget` when the focus is being lost from this component.
158
+ * `ev.target !== ev.currentTarget` when the focus is being lost from a descendant.
159
+ */
160
+ onFocus?: (ev: NativeSyntheticEvent<{}>) => void;
161
+ /**
162
+ * The onFocus event occurs when an element gets focus. The opposite of onFocus is onBlur. Note that in React
163
+ * Native, unlike in the web, the onFocus event bubbles (similar to onFocusIn in the web).
164
+ *
165
+ * `ev.target === ev.currentTarget` when the focus is being lost from this component.
166
+ * `ev.target !== ev.currentTarget` when the focus is being lost from a descendant.
167
+ */
168
+ onFocusCapture?: (ev: NativeSyntheticEvent<{}>) => void;
169
+
170
+ /**
171
+ * Role-based styling of the text control. The styles applied include
172
+ * font face, size, weight and color. These styles take precedence over
173
+ * the `style` property.
174
+ *
175
+ * @remarks
176
+ * The default value is `MediumStandard`.
177
+ *
178
+ * When set to `None`, role-based styling is disabled.
179
+ *
180
+ * @deprecated Use `style` instead.
181
+ */
182
+ textStyle?: TextWin32TextStyle;
183
+
184
+ /** Tooltip displayed on mouse hover of this element */
185
+ tooltip?: string;
186
+ }
187
+
188
+ // https://reactnative.dev/docs/text#props
189
+ export interface TextProps
190
+ extends TextPropsIOS,
191
+ TextPropsAndroid,
192
+ TextPropsWin32,
193
+ AccessibilityProps {
194
+ /**
195
+ * Specifies whether fonts should scale to respect Text Size accessibility settings.
196
+ * The default is `true`.
197
+ */
198
+ allowFontScaling?: boolean | undefined;
199
+
200
+ children?: React.ReactNode | undefined;
201
+
202
+ /**
203
+ * This can be one of the following values:
204
+ *
205
+ * - `head` - The line is displayed so that the end fits in the container and the missing text
206
+ * at the beginning of the line is indicated by an ellipsis glyph. e.g., "...wxyz"
207
+ * - `middle` - The line is displayed so that the beginning and end fit in the container and the
208
+ * missing text in the middle is indicated by an ellipsis glyph. "ab...yz"
209
+ * - `tail` - The line is displayed so that the beginning fits in the container and the
210
+ * missing text at the end of the line is indicated by an ellipsis glyph. e.g., "abcd..."
211
+ * - `clip` - Lines are not drawn past the edge of the text container.
212
+ *
213
+ * The default is `tail`.
214
+ *
215
+ * `numberOfLines` must be set in conjunction with this prop.
216
+ *
217
+ * > `clip` is working only for iOS
218
+ */
219
+ ellipsizeMode?: 'head' | 'middle' | 'tail' | 'clip' | undefined;
220
+
221
+ /**
222
+ * Used to reference react managed views from native code.
223
+ */
224
+ id?: string | undefined;
225
+
226
+ /**
227
+ * Line Break mode. Works only with numberOfLines.
228
+ * clip is working only for iOS
229
+ */
230
+ lineBreakMode?: 'head' | 'middle' | 'tail' | 'clip' | undefined;
231
+
232
+ /**
233
+ * Used to truncate the text with an ellipsis after computing the text
234
+ * layout, including line wrapping, such that the total number of lines
235
+ * does not exceed this number.
236
+ *
237
+ * This prop is commonly used with `ellipsizeMode`.
238
+ */
239
+ numberOfLines?: number | undefined;
240
+
241
+ /**
242
+ * Invoked on mount and layout changes with
243
+ *
244
+ * {nativeEvent: { layout: {x, y, width, height}}}.
245
+ */
246
+ onLayout?: ((event: LayoutChangeEvent) => void) | undefined;
247
+
248
+ /**
249
+ * Invoked on Text layout
250
+ */
251
+ onTextLayout?:
252
+ | ((event: NativeSyntheticEvent<TextLayoutEventData>) => void)
253
+ | undefined;
254
+
255
+ /**
256
+ * This function is called on press.
257
+ * Text intrinsically supports press handling with a default highlight state (which can be disabled with suppressHighlighting).
258
+ */
259
+ onPress?: ((event: GestureResponderEvent) => void) | undefined;
260
+
261
+ onPressIn?: ((event: GestureResponderEvent) => void) | undefined;
262
+ onPressOut?: ((event: GestureResponderEvent) => void) | undefined;
263
+
264
+ /**
265
+ * This function is called on long press.
266
+ * e.g., `onLongPress={this.increaseSize}>``
267
+ */
268
+ onLongPress?: ((event: GestureResponderEvent) => void) | undefined;
269
+
270
+ /**
271
+ * @see https://reactnative.dev/docs/text#style
272
+ */
273
+ style?: StyleProp<TextStyle> | undefined;
274
+
275
+ /**
276
+ * Used to locate this view in end-to-end tests.
277
+ */
278
+ testID?: string | undefined;
279
+
280
+ /**
281
+ * Used to reference react managed views from native code.
282
+ */
283
+ nativeID?: string | undefined;
284
+
285
+ /**
286
+ * Specifies largest possible scale a font can reach when allowFontScaling is enabled. Possible values:
287
+ * - null/undefined (default): inherit from the parent node or the global default (0)
288
+ * - 0: no max, ignore parent/global default
289
+ * - >= 1: sets the maxFontSizeMultiplier of this node to this value
290
+ */
291
+ maxFontSizeMultiplier?: number | null | undefined;
292
+ }
293
+
294
+ /**
295
+ * A React component for displaying text which supports nesting, styling, and touch handling.
296
+ */
297
+ declare class TextComponent extends React.Component<TextProps> {}
298
+ declare const TextBase: Constructor<NativeMethods> & typeof TextComponent;
299
+ export class Text extends TextBase {}
@@ -11,9 +11,9 @@ export { AccessibilityPropsWin32 } from '@office-iss/react-native-win32/Librarie
11
11
  export type IViewWin32Props = IViewWin32PropsOnly & AccessibilityPropsWin32;
12
12
  export {ViewWin32} from './Components/View/ViewWin32';
13
13
  export {IKeyboardEvent, IHandledKeyboardEvent, EventPhase} from './Components/View/ViewPropTypes';
14
- import {ITextWin32Props as ITextWin32PropsOnly} from './Components/Text/TextWin32.Props';
14
+ import {TextPropsWin32 as ITextWin32PropsOnly} from './Text/Text';
15
15
  export type ITextWin32Props = ITextWin32PropsOnly & AccessibilityPropsWin32;
16
- export {TextWin32TextStyle } from './Components/Text/TextWin32.Props';
16
+ export {TextWin32TextStyle } from './Text/Text';
17
17
  export {TextWin32} from './Components/Text/TextWin32';
18
18
  export {IButtonWin32Props, IButtonWin32Style} from './Components/Button/ButtonWin32.Props';
19
19
  export {ButtonWin32} from './Components/Button/ButtonWin32';
@@ -1,63 +0,0 @@
1
- import RN = require('react-native');
2
- import type { IKeyboardEvent, IHandledKeyboardEvent } from '../View/ViewPropTypes';
3
- /**
4
- * Role-based text style names.
5
- */
6
- export type TextWin32TextStyle = 'None' | 'SmallStandard' | 'SmallSecondary' | 'MediumStandard' | 'MediumSecondary' | 'MediumApp' | 'MediumBold' | 'MediumBoldApp' | 'LargeStandard' | 'LargePlusStandard' | 'ExtraLargeStandard' | 'HugeStandard';
7
- export interface ITextWin32Props extends RN.TextProps {
8
- onKeyDown?: (args: IKeyboardEvent) => void;
9
- onKeyDownCapture?: (args: IKeyboardEvent) => void;
10
- onKeyUp?: (args: IKeyboardEvent) => void;
11
- onKeyUpCapture?: (args: IKeyboardEvent) => void;
12
- keyDownEvents?: IHandledKeyboardEvent[];
13
- keyUpEvents?: IHandledKeyboardEvent[];
14
- /** Enables a focusable label with copyability but without character selectability (property:selectable) */
15
- focusable?: boolean;
16
- /**
17
- * The onBlur event occurs when an element loses focus. The opposite of onBlur is onFocus. Note that in React
18
- * Native, unlike in the web, the onBlur event bubbles (similar to onFocusOut in the web).
19
- *
20
- * `ev.target === ev.currentTarget` when the focus is being lost from this component.
21
- * `ev.target !== ev.currentTarget` when the focus is being lost from a descendant.
22
- */
23
- onBlur?: (ev: RN.NativeSyntheticEvent<{}>) => void;
24
- /**
25
- * The onBlur event occurs when an element loses focus. The opposite of onBlur is onFocus. Note that in React
26
- * Native, unlike in the web, the onBlur event bubbles (similar to onFocusOut in the web).
27
- *
28
- * `ev.target === ev.currentTarget` when the focus is being lost from this component.
29
- * `ev.target !== ev.currentTarget` when the focus is being lost from a descendant.
30
- */
31
- onBlurCapture?: (ev: RN.NativeSyntheticEvent<{}>) => void;
32
- /**
33
- * The onFocus event occurs when an element gets focus. The opposite of onFocus is onBlur. Note that in React
34
- * Native, unlike in the web, the onFocus event bubbles (similar to onFocusIn in the web).
35
- *
36
- * `ev.target === ev.currentTarget` when the focus is being lost from this component.
37
- * `ev.target !== ev.currentTarget` when the focus is being lost from a descendant.
38
- */
39
- onFocus?: (ev: RN.NativeSyntheticEvent<{}>) => void;
40
- /**
41
- * The onFocus event occurs when an element gets focus. The opposite of onFocus is onBlur. Note that in React
42
- * Native, unlike in the web, the onFocus event bubbles (similar to onFocusIn in the web).
43
- *
44
- * `ev.target === ev.currentTarget` when the focus is being lost from this component.
45
- * `ev.target !== ev.currentTarget` when the focus is being lost from a descendant.
46
- */
47
- onFocusCapture?: (ev: RN.NativeSyntheticEvent<{}>) => void;
48
- /**
49
- * Role-based styling of the text control. The styles applied include
50
- * font face, size, weight and color. These styles take precedence over
51
- * the `style` property.
52
- *
53
- * @remarks
54
- * The default value is `MediumStandard`.
55
- *
56
- * When set to `None`, role-based styling is disabled.
57
- *
58
- * @deprecated Use `style` instead.
59
- */
60
- textStyle?: TextWin32TextStyle;
61
- /** Tooltip displayed on mouse hover of this element */
62
- tooltip?: string;
63
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=TextWin32.Props.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TextWin32.Props.js","sourceRoot":"","sources":["../../../src/Libraries/Components/Text/TextWin32.Props.ts"],"names":[],"mappings":"","sourcesContent":["import RN = require('react-native');\nimport type { IKeyboardEvent, IHandledKeyboardEvent } from '../View/ViewPropTypes';\n\n/**\n * Role-based text style names.\n */\nexport type TextWin32TextStyle =\n | 'None'\n | 'SmallStandard'\n | 'SmallSecondary'\n | 'MediumStandard'\n | 'MediumSecondary'\n | 'MediumApp'\n | 'MediumBold'\n | 'MediumBoldApp'\n | 'LargeStandard'\n | 'LargePlusStandard'\n | 'ExtraLargeStandard'\n | 'HugeStandard';\n\nexport interface ITextWin32Props extends RN.TextProps {\n onKeyDown?: (args: IKeyboardEvent) => void;\n onKeyDownCapture?: (args: IKeyboardEvent) => void;\n onKeyUp?: (args: IKeyboardEvent) => void;\n onKeyUpCapture?: (args: IKeyboardEvent) => void;\n\n keyDownEvents?: IHandledKeyboardEvent[];\n keyUpEvents?: IHandledKeyboardEvent[];\n\n /** Enables a focusable label with copyability but without character selectability (property:selectable) */\n focusable?: boolean;\n\n /**\n * The onBlur event occurs when an element loses focus. The opposite of onBlur is onFocus. Note that in React\n * Native, unlike in the web, the onBlur event bubbles (similar to onFocusOut in the web).\n *\n * `ev.target === ev.currentTarget` when the focus is being lost from this component.\n * `ev.target !== ev.currentTarget` when the focus is being lost from a descendant.\n */\n onBlur?: (ev: RN.NativeSyntheticEvent<{}>) => void;\n /**\n * The onBlur event occurs when an element loses focus. The opposite of onBlur is onFocus. Note that in React\n * Native, unlike in the web, the onBlur event bubbles (similar to onFocusOut in the web).\n *\n * `ev.target === ev.currentTarget` when the focus is being lost from this component.\n * `ev.target !== ev.currentTarget` when the focus is being lost from a descendant.\n */\n onBlurCapture?: (ev: RN.NativeSyntheticEvent<{}>) => void;\n /**\n * The onFocus event occurs when an element gets focus. The opposite of onFocus is onBlur. Note that in React\n * Native, unlike in the web, the onFocus event bubbles (similar to onFocusIn in the web).\n *\n * `ev.target === ev.currentTarget` when the focus is being lost from this component.\n * `ev.target !== ev.currentTarget` when the focus is being lost from a descendant.\n */\n onFocus?: (ev: RN.NativeSyntheticEvent<{}>) => void;\n /**\n * The onFocus event occurs when an element gets focus. The opposite of onFocus is onBlur. Note that in React\n * Native, unlike in the web, the onFocus event bubbles (similar to onFocusIn in the web).\n *\n * `ev.target === ev.currentTarget` when the focus is being lost from this component.\n * `ev.target !== ev.currentTarget` when the focus is being lost from a descendant.\n */\n onFocusCapture?: (ev: RN.NativeSyntheticEvent<{}>) => void;\n \n /**\n * Role-based styling of the text control. The styles applied include\n * font face, size, weight and color. These styles take precedence over\n * the `style` property.\n *\n * @remarks\n * The default value is `MediumStandard`.\n *\n * When set to `None`, role-based styling is disabled.\n *\n * @deprecated Use `style` instead.\n */\n textStyle?: TextWin32TextStyle;\n\n /** Tooltip displayed on mouse hover of this element */\n tooltip?: string;\n}\n"]}