@office-iss/react-native-win32 0.73.0 → 0.73.2

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 CHANGED
@@ -2,7 +2,49 @@
2
2
  "name": "@office-iss/react-native-win32",
3
3
  "entries": [
4
4
  {
5
- "date": "Fri, 08 Dec 2023 00:25:02 GMT",
5
+ "date": "Mon, 18 Mar 2024 15:15:20 GMT",
6
+ "version": "0.73.2",
7
+ "tag": "@office-iss/react-native-win32_v0.73.2",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "30809111+acoates-ms@users.noreply.github.com",
12
+ "package": "@office-iss/react-native-win32",
13
+ "commit": "1a56053a4c4912271841269db84956d6b525f795",
14
+ "comment": "TextProps from rn-win32 should include win32 properties"
15
+ },
16
+ {
17
+ "author": "30809111+acoates-ms@users.noreply.github.com",
18
+ "package": "@office-iss/react-native-win32",
19
+ "commit": "e0cd40b5f2d99ae208f1e1540426ec8275039171",
20
+ "comment": "Update react-native 0.73.4 -> 0.73.6"
21
+ }
22
+ ]
23
+ }
24
+ },
25
+ {
26
+ "date": "Fri, 09 Feb 2024 17:12:46 GMT",
27
+ "version": "0.73.1",
28
+ "tag": "@office-iss/react-native-win32_v0.73.1",
29
+ "comments": {
30
+ "patch": [
31
+ {
32
+ "author": "30809111+acoates-ms@users.noreply.github.com",
33
+ "package": "@office-iss/react-native-win32",
34
+ "commit": "226072f2a745dcfb7823be136f8b04076b7e1b4d",
35
+ "comment": "[Win32] view.focus sometimes skips setting focus"
36
+ },
37
+ {
38
+ "author": "30809111+acoates-ms@users.noreply.github.com",
39
+ "package": "@office-iss/react-native-win32",
40
+ "commit": "8f4160298ca131e01fb8c1bd6900394735a32c58",
41
+ "comment": "Update to react-native 0.73.4"
42
+ }
43
+ ]
44
+ }
45
+ },
46
+ {
47
+ "date": "Fri, 08 Dec 2023 00:26:14 GMT",
6
48
  "version": "0.73.0",
7
49
  "tag": "@office-iss/react-native-win32_v0.73.0",
8
50
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,21 +1,39 @@
1
1
  # Change Log - @office-iss/react-native-win32
2
2
 
3
- This log was last generated on Fri, 08 Dec 2023 00:25:02 GMT and should not be manually modified.
3
+ This log was last generated on Mon, 18 Mar 2024 15:15:20 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## 0.73.0
7
+ ## 0.73.2
8
8
 
9
- Fri, 08 Dec 2023 00:25:02 GMT
9
+ Mon, 18 Mar 2024 15:15:20 GMT
10
10
 
11
11
  ### Patches
12
12
 
13
- - Promote 0.73 to latest (tatianakapos@microsoft.com)
14
-
15
- ### Changes
16
-
17
- - integrate rc8 (tatianakapos@microsoft.com)
13
+ - TextProps from rn-win32 should include win32 properties (30809111+acoates-ms@users.noreply.github.com)
14
+ - Update react-native 0.73.4 -> 0.73.6 (30809111+acoates-ms@users.noreply.github.com)
18
15
 
16
+ ## 0.73.1
17
+
18
+ Fri, 09 Feb 2024 17:12:46 GMT
19
+
20
+ ### Patches
21
+
22
+ - [Win32] view.focus sometimes skips setting focus (30809111+acoates-ms@users.noreply.github.com)
23
+ - Update to react-native 0.73.4 (30809111+acoates-ms@users.noreply.github.com)
24
+
25
+ ## 0.73.0
26
+
27
+ Fri, 08 Dec 2023 00:26:14 GMT
28
+
29
+ ### Patches
30
+
31
+ - Promote 0.73 to latest (tatianakapos@microsoft.com)
32
+
33
+ ### Changes
34
+
35
+ - integrate rc8 (tatianakapos@microsoft.com)
36
+
19
37
  ## 0.73.0-preview.6
20
38
 
21
39
  Mon, 04 Dec 2023 16:15:07 GMT
@@ -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
  }
@@ -203,6 +203,10 @@ class TouchableBounce extends React.Component<Props, State> {
203
203
  this.state.pressability.configure(this._createPressabilityConfig());
204
204
  }
205
205
 
206
+ componentDidMount(): mixed {
207
+ this.state.pressability.configure(this._createPressabilityConfig());
208
+ }
209
+
206
210
  componentWillUnmount(): void {
207
211
  this.state.pressability.reset();
208
212
  }
@@ -363,6 +363,7 @@ class TouchableHighlight extends React.Component<Props, State> {
363
363
 
364
364
  componentDidMount(): void {
365
365
  this._isMounted = true;
366
+ this.state.pressability.configure(this._createPressabilityConfig());
366
367
  }
367
368
 
368
369
  componentDidUpdate(prevProps: Props, prevState: State) {
@@ -339,6 +339,10 @@ class TouchableNativeFeedback extends React.Component<Props, State> {
339
339
  this.state.pressability.configure(this._createPressabilityConfig());
340
340
  }
341
341
 
342
+ componentDidMount(): mixed {
343
+ this.state.pressability.configure(this._createPressabilityConfig());
344
+ }
345
+
342
346
  componentWillUnmount(): void {
343
347
  this.state.pressability.reset();
344
348
  }
@@ -314,6 +314,10 @@ class TouchableOpacity extends React.Component<Props, State> {
314
314
  }
315
315
  }
316
316
 
317
+ componentDidMount(): void {
318
+ this.state.pressability.configure(this._createPressabilityConfig());
319
+ }
320
+
317
321
  componentWillUnmount(): void {
318
322
  this.state.pressability.reset();
319
323
  }
@@ -189,6 +189,10 @@ class TouchableWithoutFeedback extends React.Component<Props, State> {
189
189
  this.state.pressability.configure(createPressabilityConfig(this.props));
190
190
  }
191
191
 
192
+ componentDidMount(): mixed {
193
+ this.state.pressability.configure(createPressabilityConfig(this.props));
194
+ }
195
+
192
196
  componentWillUnmount(): void {
193
197
  this.state.pressability.reset();
194
198
  }
@@ -12,6 +12,6 @@
12
12
  exports.version = {
13
13
  major: 0,
14
14
  minor: 73,
15
- patch: 0,
15
+ patch: 6,
16
16
  prerelease: null,
17
17
  };
@@ -192,7 +192,7 @@ export function parseComponentStack(message: string): ComponentStack {
192
192
  if (!s) {
193
193
  return null;
194
194
  }
195
- const match = s.match(/(.*) \(at (.*\.js):([\d]+)\)/);
195
+ const match = s.match(/(.*) \(at (.*\.(?:js|jsx|ts|tsx)):([\d]+)\)/);
196
196
  if (!match) {
197
197
  return null;
198
198
  }
@@ -101,10 +101,96 @@ export interface TextPropsAndroid {
101
101
  android_hyphenationFrequency?: 'normal' | 'none' | 'full' | undefined;
102
102
  }
103
103
 
104
+ import type {
105
+ IKeyboardEvent,
106
+ IHandledKeyboardEvent,
107
+ } from '../Components/View/ViewPropTypes';
108
+
109
+ /**
110
+ * Role-based text style names.
111
+ */
112
+ export type TextWin32TextStyle =
113
+ | 'None'
114
+ | 'SmallStandard'
115
+ | 'SmallSecondary'
116
+ | 'MediumStandard'
117
+ | 'MediumSecondary'
118
+ | 'MediumApp'
119
+ | 'MediumBold'
120
+ | 'MediumBoldApp'
121
+ | 'LargeStandard'
122
+ | 'LargePlusStandard'
123
+ | 'ExtraLargeStandard'
124
+ | 'HugeStandard';
125
+
126
+ export interface TextPropsWin32 {
127
+ onKeyDown?: (args: IKeyboardEvent) => void;
128
+ onKeyDownCapture?: (args: IKeyboardEvent) => void;
129
+ onKeyUp?: (args: IKeyboardEvent) => void;
130
+ onKeyUpCapture?: (args: IKeyboardEvent) => void;
131
+
132
+ keyDownEvents?: IHandledKeyboardEvent[];
133
+ keyUpEvents?: IHandledKeyboardEvent[];
134
+
135
+ /** Enables a focusable label with copyability but without character selectability (property:selectable) */
136
+ focusable?: boolean;
137
+
138
+ /**
139
+ * The onBlur event occurs when an element loses focus. The opposite of onBlur is onFocus. Note that in React
140
+ * Native, unlike in the web, the onBlur event bubbles (similar to onFocusOut in the web).
141
+ *
142
+ * `ev.target === ev.currentTarget` when the focus is being lost from this component.
143
+ * `ev.target !== ev.currentTarget` when the focus is being lost from a descendant.
144
+ */
145
+ onBlur?: (ev: NativeSyntheticEvent<{}>) => void;
146
+ /**
147
+ * The onBlur event occurs when an element loses focus. The opposite of onBlur is onFocus. Note that in React
148
+ * Native, unlike in the web, the onBlur event bubbles (similar to onFocusOut in the web).
149
+ *
150
+ * `ev.target === ev.currentTarget` when the focus is being lost from this component.
151
+ * `ev.target !== ev.currentTarget` when the focus is being lost from a descendant.
152
+ */
153
+ onBlurCapture?: (ev: NativeSyntheticEvent<{}>) => void;
154
+ /**
155
+ * The onFocus event occurs when an element gets focus. The opposite of onFocus is onBlur. Note that in React
156
+ * Native, unlike in the web, the onFocus event bubbles (similar to onFocusIn in the web).
157
+ *
158
+ * `ev.target === ev.currentTarget` when the focus is being lost from this component.
159
+ * `ev.target !== ev.currentTarget` when the focus is being lost from a descendant.
160
+ */
161
+ onFocus?: (ev: NativeSyntheticEvent<{}>) => void;
162
+ /**
163
+ * The onFocus event occurs when an element gets focus. The opposite of onFocus is onBlur. Note that in React
164
+ * Native, unlike in the web, the onFocus event bubbles (similar to onFocusIn in the web).
165
+ *
166
+ * `ev.target === ev.currentTarget` when the focus is being lost from this component.
167
+ * `ev.target !== ev.currentTarget` when the focus is being lost from a descendant.
168
+ */
169
+ onFocusCapture?: (ev: NativeSyntheticEvent<{}>) => void;
170
+
171
+ /**
172
+ * Role-based styling of the text control. The styles applied include
173
+ * font face, size, weight and color. These styles take precedence over
174
+ * the `style` property.
175
+ *
176
+ * @remarks
177
+ * The default value is `MediumStandard`.
178
+ *
179
+ * When set to `None`, role-based styling is disabled.
180
+ *
181
+ * @deprecated Use `style` instead.
182
+ */
183
+ textStyle?: TextWin32TextStyle;
184
+
185
+ /** Tooltip displayed on mouse hover of this element */
186
+ tooltip?: string;
187
+ }
188
+
104
189
  // https://reactnative.dev/docs/text#props
105
190
  export interface TextProps
106
191
  extends TextPropsIOS,
107
192
  TextPropsAndroid,
193
+ TextPropsWin32,
108
194
  AccessibilityProps {
109
195
  /**
110
196
  * Specifies whether fonts should scale to respect Text Size accessibility settings.
@@ -11,7 +11,7 @@ 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
16
  export {TextWin32TextStyle } from './Components/Text/TextWin32.Props';
17
17
  export {TextWin32} from './Components/Text/TextWin32';
@@ -34,6 +34,11 @@ let rejectionTrackingOptions: $NonMaybeType<Parameters<enable>[0]> = {
34
34
  ? rejection
35
35
  : JSON.stringify((rejection: $FlowFixMe));
36
36
  }
37
+ // It could although this object is not a standard error, it still has stack information to unwind
38
+ // $FlowFixMe ignore types just check if stack is there
39
+ if (rejection.stack && typeof rejection.stack === 'string') {
40
+ stack = rejection.stack;
41
+ }
37
42
  }
38
43
 
39
44
  const warning = `Possible unhandled promise rejection (id: ${id}):\n${
package/babel.config.js CHANGED
@@ -1,3 +1,3 @@
1
1
  module.exports = {
2
- extends: "@rnw-scripts/babel-react-native-config",
3
- };
2
+ presets: ["module:@rnw-scripts/babel-react-native-config"],
3
+ };
package/overrides.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "**/__snapshots__/**",
8
8
  "src/rntypes/**"
9
9
  ],
10
- "baseVersion": "0.73.0",
10
+ "baseVersion": "0.73.6",
11
11
  "overrides": [
12
12
  {
13
13
  "type": "derived",
@@ -159,7 +159,7 @@
159
159
  "type": "derived",
160
160
  "file": "src/Libraries/Components/Touchable/TouchableNativeFeedback.win32.js",
161
161
  "baseFile": "packages/react-native/Libraries/Components/Touchable/TouchableNativeFeedback.js",
162
- "baseHash": "fa5b3198efddd86eca7965aa90104408ed53fbbf"
162
+ "baseHash": "62e575c73930d12ae9b878c6913bb2c3751d935e"
163
163
  },
164
164
  {
165
165
  "type": "platform",
@@ -425,6 +425,12 @@
425
425
  "baseFile": "packages/react-native/Libraries/StyleSheet/StyleSheet.js",
426
426
  "baseHash": "e73098e3a22f8f74328e0a9f387839bb03322bb6"
427
427
  },
428
+ {
429
+ "type": "derived",
430
+ "file": "src/Libraries/Text/Text.d.ts",
431
+ "baseFile": "packages/react-native/Libraries/Text/Text.d.ts",
432
+ "baseHash": "4b523469a5c8dcfe53749d1739ccf77c0106375e"
433
+ },
428
434
  {
429
435
  "type": "derived",
430
436
  "file": "src/Libraries/Text/Text.win32.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@office-iss/react-native-win32",
3
- "version": "0.73.0",
3
+ "version": "0.73.2",
4
4
  "description": "Implementation of react native on top of Office's Win32 platform.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -26,23 +26,23 @@
26
26
  "dependencies": {
27
27
  "@babel/runtime": "^7.0.0",
28
28
  "@jest/create-cache-key-function": "^29.6.3",
29
- "@react-native-community/cli": "12.1.1",
30
- "@react-native-community/cli-platform-android": "12.1.1",
31
- "@react-native-community/cli-platform-ios": "12.1.1",
32
- "@react-native/assets": "1.0.0",
33
- "@react-native/assets-registry": "^0.73.1",
34
- "@react-native/codegen": "^0.73.2",
35
- "@react-native/community-cli-plugin": "^0.73.10",
36
- "@react-native/gradle-plugin": "^0.73.4",
37
- "@react-native/js-polyfills": "^0.73.1",
29
+ "@react-native-community/cli": "12.3.6",
30
+ "@react-native-community/cli-platform-android": "12.3.6",
31
+ "@react-native-community/cli-platform-ios": "12.3.6",
32
+ "@react-native/assets-registry": "0.73.1",
33
+ "@react-native/codegen": "0.73.3",
34
+ "@react-native/community-cli-plugin": "0.73.17",
35
+ "@react-native/gradle-plugin": "0.73.4",
36
+ "@react-native/js-polyfills": "0.73.1",
38
37
  "@react-native/metro-config": "^0.73.0",
39
- "@react-native/normalize-colors": "^0.73.2",
40
- "@react-native/virtualized-lists": "^0.73.3",
38
+ "@react-native/normalize-colors": "0.73.2",
39
+ "@react-native/virtualized-lists": "0.73.4",
41
40
  "abort-controller": "^3.0.0",
42
41
  "anser": "^1.4.9",
43
42
  "ansi-regex": "^5.0.0",
44
43
  "art": "^0.10.0",
45
44
  "base64-js": "^1.5.1",
45
+ "chalk": "^4.0.0",
46
46
  "deprecated-react-native-prop-types": "^5.0.0",
47
47
  "event-target-shim": "^5.0.1",
48
48
  "flow-enums-runtime": "^0.0.6",
@@ -50,8 +50,8 @@
50
50
  "jest-environment-node": "^29.6.3",
51
51
  "jsc-android": "^250231.0.0",
52
52
  "memoize-one": "^5.0.0",
53
- "metro-runtime": "^0.80.0",
54
- "metro-source-map": "^0.80.0",
53
+ "metro-runtime": "^0.80.3",
54
+ "metro-source-map": "^0.80.3",
55
55
  "mkdirp": "^0.5.1",
56
56
  "nullthrows": "^1.1.1",
57
57
  "pretty-format": "^26.5.2",
@@ -85,7 +85,7 @@
85
85
  "just-scripts": "^1.3.3",
86
86
  "prettier": "^2.4.1",
87
87
  "react": "18.2.0",
88
- "react-native": "0.73.0",
88
+ "react-native": "0.73.6",
89
89
  "react-native-platform-override": "^1.9.16",
90
90
  "typescript": "^4.9.5"
91
91
  },
@@ -0,0 +1,305 @@
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
+
23
+ export interface TextPropsIOS {
24
+ /**
25
+ * Specifies whether font should be scaled down automatically to fit given style constraints.
26
+ */
27
+ adjustsFontSizeToFit?: boolean | undefined;
28
+
29
+ /**
30
+ * The Dynamic Type scale ramp to apply to this element on iOS.
31
+ */
32
+ dynamicTypeRamp?:
33
+ | 'caption2'
34
+ | 'caption1'
35
+ | 'footnote'
36
+ | 'subheadline'
37
+ | 'callout'
38
+ | 'body'
39
+ | 'headline'
40
+ | 'title3'
41
+ | 'title2'
42
+ | 'title1'
43
+ | 'largeTitle'
44
+ | undefined;
45
+
46
+ /**
47
+ * When `true`, no visual change is made when text is pressed down. By
48
+ * default, a gray oval highlights the text on press down.
49
+ */
50
+ suppressHighlighting?: boolean | undefined;
51
+
52
+ /**
53
+ * Set line break strategy on iOS.
54
+ */
55
+ lineBreakStrategyIOS?:
56
+ | 'none'
57
+ | 'standard'
58
+ | 'hangul-word'
59
+ | 'push-out'
60
+ | undefined;
61
+ }
62
+
63
+ export interface TextPropsAndroid {
64
+ /**
65
+ * Specifies the disabled state of the text view for testing purposes.
66
+ */
67
+ disabled?: boolean | undefined;
68
+
69
+ /**
70
+ * Lets the user select text, to use the native copy and paste functionality.
71
+ */
72
+ selectable?: boolean | undefined;
73
+
74
+ /**
75
+ * The highlight color of the text.
76
+ */
77
+ selectionColor?: ColorValue | undefined;
78
+
79
+ /**
80
+ * Set text break strategy on Android API Level 23+
81
+ * default is `highQuality`.
82
+ */
83
+ textBreakStrategy?: 'simple' | 'highQuality' | 'balanced' | undefined;
84
+
85
+ /**
86
+ * Determines the types of data converted to clickable URLs in the text element.
87
+ * By default no data types are detected.
88
+ */
89
+ dataDetectorType?:
90
+ | null
91
+ | 'phoneNumber'
92
+ | 'link'
93
+ | 'email'
94
+ | 'none'
95
+ | 'all'
96
+ | undefined;
97
+
98
+ /**
99
+ * Hyphenation strategy
100
+ */
101
+ android_hyphenationFrequency?: 'normal' | 'none' | 'full' | undefined;
102
+ }
103
+
104
+ import type {
105
+ IKeyboardEvent,
106
+ IHandledKeyboardEvent,
107
+ } from '../Components/View/ViewPropTypes';
108
+
109
+ /**
110
+ * Role-based text style names.
111
+ */
112
+ export type TextWin32TextStyle =
113
+ | 'None'
114
+ | 'SmallStandard'
115
+ | 'SmallSecondary'
116
+ | 'MediumStandard'
117
+ | 'MediumSecondary'
118
+ | 'MediumApp'
119
+ | 'MediumBold'
120
+ | 'MediumBoldApp'
121
+ | 'LargeStandard'
122
+ | 'LargePlusStandard'
123
+ | 'ExtraLargeStandard'
124
+ | 'HugeStandard';
125
+
126
+ export interface TextPropsWin32 {
127
+ onKeyDown?: (args: IKeyboardEvent) => void;
128
+ onKeyDownCapture?: (args: IKeyboardEvent) => void;
129
+ onKeyUp?: (args: IKeyboardEvent) => void;
130
+ onKeyUpCapture?: (args: IKeyboardEvent) => void;
131
+
132
+ keyDownEvents?: IHandledKeyboardEvent[];
133
+ keyUpEvents?: IHandledKeyboardEvent[];
134
+
135
+ /** Enables a focusable label with copyability but without character selectability (property:selectable) */
136
+ focusable?: boolean;
137
+
138
+ /**
139
+ * The onBlur event occurs when an element loses focus. The opposite of onBlur is onFocus. Note that in React
140
+ * Native, unlike in the web, the onBlur event bubbles (similar to onFocusOut in the web).
141
+ *
142
+ * `ev.target === ev.currentTarget` when the focus is being lost from this component.
143
+ * `ev.target !== ev.currentTarget` when the focus is being lost from a descendant.
144
+ */
145
+ onBlur?: (ev: NativeSyntheticEvent<{}>) => void;
146
+ /**
147
+ * The onBlur event occurs when an element loses focus. The opposite of onBlur is onFocus. Note that in React
148
+ * Native, unlike in the web, the onBlur event bubbles (similar to onFocusOut in the web).
149
+ *
150
+ * `ev.target === ev.currentTarget` when the focus is being lost from this component.
151
+ * `ev.target !== ev.currentTarget` when the focus is being lost from a descendant.
152
+ */
153
+ onBlurCapture?: (ev: NativeSyntheticEvent<{}>) => void;
154
+ /**
155
+ * The onFocus event occurs when an element gets focus. The opposite of onFocus is onBlur. Note that in React
156
+ * Native, unlike in the web, the onFocus event bubbles (similar to onFocusIn in the web).
157
+ *
158
+ * `ev.target === ev.currentTarget` when the focus is being lost from this component.
159
+ * `ev.target !== ev.currentTarget` when the focus is being lost from a descendant.
160
+ */
161
+ onFocus?: (ev: NativeSyntheticEvent<{}>) => void;
162
+ /**
163
+ * The onFocus event occurs when an element gets focus. The opposite of onFocus is onBlur. Note that in React
164
+ * Native, unlike in the web, the onFocus event bubbles (similar to onFocusIn in the web).
165
+ *
166
+ * `ev.target === ev.currentTarget` when the focus is being lost from this component.
167
+ * `ev.target !== ev.currentTarget` when the focus is being lost from a descendant.
168
+ */
169
+ onFocusCapture?: (ev: NativeSyntheticEvent<{}>) => void;
170
+
171
+ /**
172
+ * Role-based styling of the text control. The styles applied include
173
+ * font face, size, weight and color. These styles take precedence over
174
+ * the `style` property.
175
+ *
176
+ * @remarks
177
+ * The default value is `MediumStandard`.
178
+ *
179
+ * When set to `None`, role-based styling is disabled.
180
+ *
181
+ * @deprecated Use `style` instead.
182
+ */
183
+ textStyle?: TextWin32TextStyle;
184
+
185
+ /** Tooltip displayed on mouse hover of this element */
186
+ tooltip?: string;
187
+ }
188
+
189
+ // https://reactnative.dev/docs/text#props
190
+ export interface TextProps
191
+ extends TextPropsIOS,
192
+ TextPropsAndroid,
193
+ TextPropsWin32,
194
+ AccessibilityProps {
195
+ /**
196
+ * Specifies whether fonts should scale to respect Text Size accessibility settings.
197
+ * The default is `true`.
198
+ */
199
+ allowFontScaling?: boolean | undefined;
200
+
201
+ children?: React.ReactNode | undefined;
202
+
203
+ /**
204
+ * This can be one of the following values:
205
+ *
206
+ * - `head` - The line is displayed so that the end fits in the container and the missing text
207
+ * at the beginning of the line is indicated by an ellipsis glyph. e.g., "...wxyz"
208
+ * - `middle` - The line is displayed so that the beginning and end fit in the container and the
209
+ * missing text in the middle is indicated by an ellipsis glyph. "ab...yz"
210
+ * - `tail` - The line is displayed so that the beginning fits in the container and the
211
+ * missing text at the end of the line is indicated by an ellipsis glyph. e.g., "abcd..."
212
+ * - `clip` - Lines are not drawn past the edge of the text container.
213
+ *
214
+ * The default is `tail`.
215
+ *
216
+ * `numberOfLines` must be set in conjunction with this prop.
217
+ *
218
+ * > `clip` is working only for iOS
219
+ */
220
+ ellipsizeMode?: 'head' | 'middle' | 'tail' | 'clip' | undefined;
221
+
222
+ /**
223
+ * Used to reference react managed views from native code.
224
+ */
225
+ id?: string | undefined;
226
+
227
+ /**
228
+ * Line Break mode. Works only with numberOfLines.
229
+ * clip is working only for iOS
230
+ */
231
+ lineBreakMode?: 'head' | 'middle' | 'tail' | 'clip' | undefined;
232
+
233
+ /**
234
+ * Used to truncate the text with an ellipsis after computing the text
235
+ * layout, including line wrapping, such that the total number of lines
236
+ * does not exceed this number.
237
+ *
238
+ * This prop is commonly used with `ellipsizeMode`.
239
+ */
240
+ numberOfLines?: number | undefined;
241
+
242
+ /**
243
+ * Invoked on mount and layout changes with
244
+ *
245
+ * {nativeEvent: { layout: {x, y, width, height}}}.
246
+ */
247
+ onLayout?: ((event: LayoutChangeEvent) => void) | undefined;
248
+
249
+ /**
250
+ * Invoked on Text layout
251
+ */
252
+ onTextLayout?:
253
+ | ((event: NativeSyntheticEvent<TextLayoutEventData>) => void)
254
+ | undefined;
255
+
256
+ /**
257
+ * This function is called on press.
258
+ * Text intrinsically supports press handling with a default highlight state (which can be disabled with suppressHighlighting).
259
+ */
260
+ onPress?: ((event: GestureResponderEvent) => void) | undefined;
261
+
262
+ onPressIn?: ((event: GestureResponderEvent) => void) | undefined;
263
+ onPressOut?: ((event: GestureResponderEvent) => void) | undefined;
264
+
265
+ /**
266
+ * This function is called on long press.
267
+ * e.g., `onLongPress={this.increaseSize}>``
268
+ */
269
+ onLongPress?: ((event: GestureResponderEvent) => void) | undefined;
270
+
271
+ /**
272
+ * @see https://reactnative.dev/docs/text#style
273
+ */
274
+ style?: StyleProp<TextStyle> | undefined;
275
+
276
+ /**
277
+ * Used to locate this view in end-to-end tests.
278
+ */
279
+ testID?: string | undefined;
280
+
281
+ /**
282
+ * Used to reference react managed views from native code.
283
+ */
284
+ nativeID?: string | undefined;
285
+
286
+ /**
287
+ * Specifies largest possible scale a font can reach when allowFontScaling is enabled. Possible values:
288
+ * - null/undefined (default): inherit from the parent node or the global default (0)
289
+ * - 0: no max, ignore parent/global default
290
+ * - >= 1: sets the maxFontSizeMultiplier of this node to this value
291
+ */
292
+ maxFontSizeMultiplier?: number | null | undefined;
293
+
294
+ /**
295
+ * Specifies smallest possible scale a font can reach when adjustsFontSizeToFit is enabled. (values 0.01-1.0).
296
+ */
297
+ minimumFontScale?: number | undefined;
298
+ }
299
+
300
+ /**
301
+ * A React component for displaying text which supports nesting, styling, and touch handling.
302
+ */
303
+ declare class TextComponent extends React.Component<TextProps> {}
304
+ declare const TextBase: Constructor<NativeMethods> & typeof TextComponent;
305
+ export class Text extends TextBase {}
@@ -11,7 +11,7 @@ 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
16
  export {TextWin32TextStyle } from './Components/Text/TextWin32.Props';
17
17
  export {TextWin32} from './Components/Text/TextWin32';