@office-iss/react-native-win32 0.71.0 → 0.71.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.
Files changed (79) hide show
  1. package/.flowconfig +1 -0
  2. package/CHANGELOG.json +12667 -12652
  3. package/CHANGELOG.md +23 -15
  4. package/Libraries/Components/Button/ButtonWin32.Props.d.ts +2 -2
  5. package/Libraries/Components/Button/ButtonWin32.d.ts +1 -1
  6. package/Libraries/Components/Button/ButtonWin32.js +6 -4
  7. package/Libraries/Components/Button/ButtonWin32.js.map +1 -1
  8. package/Libraries/Components/Pressable/Pressable.win32.js +0 -1
  9. package/Libraries/Components/Text/TextWin32.Props.d.ts +3 -9
  10. package/Libraries/Components/Text/TextWin32.Props.js.map +1 -1
  11. package/Libraries/Components/Text/TextWin32.d.ts +1 -1
  12. package/Libraries/Components/Text/TextWin32.js.map +1 -1
  13. package/Libraries/Components/TextInput/TextInput.Types.win32.d.ts +9 -9
  14. package/Libraries/Components/TextInput/TextInput.win32.js +1150 -154
  15. package/Libraries/Components/Touchable/Tests/TouchableWin32Test.js +4 -4
  16. package/Libraries/Components/Touchable/Tests/TouchableWin32Test.js.map +1 -1
  17. package/Libraries/Components/Touchable/TouchableNativeFeedback.win32.d.ts +119 -16
  18. package/Libraries/Components/Touchable/TouchableNativeFeedback.win32.js +99 -24
  19. package/Libraries/Components/Touchable/TouchableWin32.Props.d.ts +2 -2
  20. package/Libraries/Components/Touchable/TouchableWin32.Props.js.map +1 -1
  21. package/Libraries/Components/Touchable/TouchableWin32.Types.d.ts +9 -9
  22. package/Libraries/Components/Touchable/TouchableWin32.js +5 -6
  23. package/Libraries/Components/Touchable/TouchableWin32.js.map +1 -1
  24. package/Libraries/Components/View/ReactNativeViewAttributes.win32.js +29 -10
  25. package/Libraries/Components/View/Tests/ViewWin32Test.js +31 -51
  26. package/Libraries/Components/View/Tests/ViewWin32Test.js.map +1 -1
  27. package/Libraries/Components/View/ViewAccessibility.win32.d.ts +527 -0
  28. package/Libraries/Components/View/ViewAccessibility.win32.js +178 -0
  29. package/Libraries/Components/View/ViewPropTypes.win32.d.ts +372 -0
  30. package/Libraries/Components/View/ViewPropTypes.win32.js +23 -0
  31. package/Libraries/Components/View/ViewWin32.d.ts +30 -12
  32. package/Libraries/Components/View/ViewWin32.js +161 -71
  33. package/Libraries/Image/Image.win32.js +0 -1
  34. package/Libraries/Pressability/Pressability.win32.js +2 -2
  35. package/Libraries/Utilities/AcessibilityMapping.win32.js +156 -0
  36. package/Libraries/__tests__/ButtonWin32-test.js +1 -1
  37. package/Libraries/platform-types.d.ts +7 -13
  38. package/index.win32.js +1 -1
  39. package/jest.config.js +2 -4
  40. package/overrides.json +38 -8
  41. package/package.json +5 -5
  42. package/src/Libraries/Components/Button/ButtonWin32.tsx +8 -8
  43. package/src/Libraries/Components/Text/TextWin32.Props.ts +2 -15
  44. package/src/Libraries/Components/Text/TextWin32.tsx +6 -2
  45. package/src/Libraries/Components/Touchable/Tests/TouchableWin32Test.tsx +5 -5
  46. package/src/Libraries/Components/Touchable/TouchableNativeFeedback.win32.d.ts +119 -0
  47. package/src/Libraries/Components/Touchable/TouchableWin32.Props.tsx +1 -1
  48. package/src/Libraries/Components/Touchable/TouchableWin32.tsx +6 -7
  49. package/src/Libraries/Components/View/Tests/ViewWin32Test.tsx +28 -52
  50. package/src/Libraries/Components/View/ViewAccessibility.win32.d.ts +527 -0
  51. package/src/Libraries/Components/View/ViewPropTypes.win32.d.ts +372 -0
  52. package/src/Libraries/Components/View/ViewWin32.d.ts +30 -0
  53. package/src/Libraries/platform-types.d.ts +7 -13
  54. package/types/modules/BatchedBridge.d.ts +32 -0
  55. package/types/modules/Codegen.d.ts +74 -0
  56. package/types/modules/Devtools.d.ts +31 -0
  57. package/types/modules/LaunchScreen.d.ts +18 -0
  58. package/types/modules/globals.d.ts +577 -0
  59. package/types/private/TimerMixin.d.ts +19 -0
  60. package/types/private/Utilities.d.ts +10 -0
  61. package/types/public/DeprecatedPropertiesAlias.d.ts +205 -0
  62. package/types/public/Insets.d.ts +15 -0
  63. package/types/public/ReactNativeRenderer.d.ts +149 -0
  64. package/types/public/ReactNativeTypes.d.ts +143 -0
  65. package/Libraries/Components/TextInput/TextInput.win32.d.ts +0 -68
  66. package/Libraries/Components/TextInput/TextInput.win32.js.map +0 -1
  67. package/Libraries/Components/Touchable/TouchableNativeFeedback.Props.d.ts +0 -7
  68. package/Libraries/Components/Touchable/TouchableNativeFeedback.Props.js +0 -3
  69. package/Libraries/Components/Touchable/TouchableNativeFeedback.Props.js.map +0 -1
  70. package/Libraries/Components/Touchable/TouchableNativeFeedback.win32.js.map +0 -1
  71. package/Libraries/Components/View/ViewWin32.Props.d.ts +0 -174
  72. package/Libraries/Components/View/ViewWin32.Props.js +0 -11
  73. package/Libraries/Components/View/ViewWin32.Props.js.map +0 -1
  74. package/Libraries/Components/View/ViewWin32.js.map +0 -1
  75. package/src/Libraries/Components/TextInput/TextInput.win32.tsx +0 -217
  76. package/src/Libraries/Components/Touchable/TouchableNativeFeedback.Props.ts +0 -9
  77. package/src/Libraries/Components/Touchable/TouchableNativeFeedback.win32.tsx +0 -27
  78. package/src/Libraries/Components/View/ViewWin32.Props.ts +0 -281
  79. package/src/Libraries/Components/View/ViewWin32.tsx +0 -119
@@ -596,7 +596,7 @@ export default class Pressability {
596
596
  (event.nativeEvent.code === 'Space' ||
597
597
  event.nativeEvent.code === 'Enter' ||
598
598
  event.nativeEvent.code === 'GamepadA') &&
599
- event.defaultPrevented != true
599
+ event.defaultPrevented !== true
600
600
  ) {
601
601
  const {onPressOut, onPress} = this._config;
602
602
  // $FlowFixMe: PressEvents don't mesh with keyboarding APIs. Keep legacy behavior of passing KeyEvents instead
@@ -613,7 +613,7 @@ export default class Pressability {
613
613
  (event.nativeEvent.code === 'Space' ||
614
614
  event.nativeEvent.code === 'Enter' ||
615
615
  event.nativeEvent.code === 'GamepadA') &&
616
- event.defaultPrevented != true
616
+ event.defaultPrevented !== true
617
617
  ) {
618
618
  const {onPressIn} = this._config;
619
619
  // $FlowFixMe: PressEvents don't mesh with keyboarding APIs. Keep legacy behavior of passing KeyEvents instead
@@ -0,0 +1,156 @@
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
+ * @flow strict-local
8
+ * @format
9
+ */
10
+
11
+ 'use strict';
12
+
13
+ import type {
14
+ AccessibilityRole,
15
+ Role,
16
+ } from '../Components/View/ViewAccessibility';
17
+
18
+ // Map role values to AccessibilityRole values
19
+ export function getAccessibilityRoleFromRole(role: Role): ?AccessibilityRole {
20
+ switch (role) {
21
+ case 'alert':
22
+ return 'alert';
23
+ case 'alertdialog':
24
+ return 'alertdialog'; // Win32
25
+ case 'application':
26
+ return 'application'; // Win32
27
+ case 'article':
28
+ return undefined;
29
+ case 'banner':
30
+ return undefined;
31
+ case 'button':
32
+ return 'button';
33
+ case 'cell':
34
+ return undefined;
35
+ case 'checkbox':
36
+ return 'checkbox';
37
+ case 'columnheader':
38
+ return undefined;
39
+ case 'combobox':
40
+ return 'combobox';
41
+ case 'complementary':
42
+ return undefined;
43
+ case 'contentinfo':
44
+ return undefined;
45
+ case 'definition':
46
+ return undefined;
47
+ case 'dialog':
48
+ return 'dialog'; // Win32
49
+ case 'directory':
50
+ return undefined;
51
+ case 'document':
52
+ return undefined;
53
+ case 'feed':
54
+ return undefined;
55
+ case 'figure':
56
+ return undefined;
57
+ case 'form':
58
+ return undefined;
59
+ case 'grid':
60
+ return 'grid';
61
+ case 'group':
62
+ return 'group'; // Win32
63
+ case 'heading':
64
+ return 'header';
65
+ case 'img':
66
+ return 'image';
67
+ case 'link':
68
+ return 'link';
69
+ case 'list':
70
+ return 'list';
71
+ case 'listitem':
72
+ return 'listitem'; // Win32
73
+ case 'log':
74
+ return undefined;
75
+ case 'main':
76
+ return undefined;
77
+ case 'marquee':
78
+ return undefined;
79
+ case 'math':
80
+ return undefined;
81
+ case 'menu':
82
+ return 'menu';
83
+ case 'menubar':
84
+ return 'menubar';
85
+ case 'menuitem':
86
+ return 'menuitem';
87
+ case 'meter':
88
+ return undefined;
89
+ case 'navigation':
90
+ return undefined;
91
+ case 'none':
92
+ return 'none';
93
+ case 'note':
94
+ return undefined;
95
+ case 'option':
96
+ return undefined;
97
+ case 'presentation':
98
+ return 'presentation'; // Win32
99
+ case 'progressbar':
100
+ return 'progressbar';
101
+ case 'radio':
102
+ return 'radio';
103
+ case 'radiogroup':
104
+ return 'radiogroup';
105
+ case 'region':
106
+ return undefined;
107
+ case 'row':
108
+ return undefined;
109
+ case 'rowgroup':
110
+ return undefined;
111
+ case 'rowheader':
112
+ return undefined;
113
+ case 'scrollbar':
114
+ return 'scrollbar';
115
+ case 'searchbox':
116
+ return 'search';
117
+ case 'separator':
118
+ return undefined;
119
+ case 'slider':
120
+ return 'adjustable';
121
+ case 'spinbutton':
122
+ return 'spinbutton';
123
+ case 'status':
124
+ return undefined;
125
+ case 'summary':
126
+ return 'summary';
127
+ case 'switch':
128
+ return 'switch';
129
+ case 'tab':
130
+ return 'tab';
131
+ case 'table':
132
+ return undefined;
133
+ case 'tablist':
134
+ return 'tablist';
135
+ case 'tabpanel':
136
+ return 'tabpanel'; // Win32
137
+ case 'term':
138
+ return undefined;
139
+ case 'textbox': // Win32
140
+ return 'textbox'; // Win32
141
+ case 'timer':
142
+ return 'timer';
143
+ case 'toolbar':
144
+ return 'toolbar';
145
+ case 'tooltip':
146
+ return undefined;
147
+ case 'tree':
148
+ return 'tree'; // Win32
149
+ case 'treegrid':
150
+ return undefined;
151
+ case 'treeitem':
152
+ return 'treeitem'; // Win32
153
+ }
154
+
155
+ return undefined;
156
+ }
@@ -4,7 +4,7 @@
4
4
  const React = require('react');
5
5
  const ReactTestRenderer = require('react-test-renderer');
6
6
 
7
- const {ButtonWin32} = require('../Components/Button/ButtonWin32');
7
+ const {ButtonWin32} = require('@office-iss/react-native-win32');
8
8
 
9
9
  describe('ButtonWin32', () => {
10
10
  it('renders native component', () => {
@@ -5,19 +5,13 @@
5
5
  * need to also be added to index.win32.js
6
6
  */
7
7
 
8
- export type {
9
- AccessibilityActionInfo,
10
- AccessibilityActionName,
11
- AccessibilityState
12
- } from './Components/View/ViewWin32.Props';
13
- export * from './Components/View/ViewWin32.Props';
14
- export * from './Components/View/ViewWin32';
15
- export * from './Components/Text/TextWin32.Props';
16
- export * from './Components/Text/TextWin32';
17
- export * from './Components/Button/ButtonWin32.Props';
18
- export * from './Components/Button/ButtonWin32';
19
- export * from './StyleSheet/PlatformColorValueTypesWin32';
20
- export * from './Components/Touchable/TouchableWin32.Props';
8
+ export {ViewWin32} from './Components/View/ViewWin32';
9
+ export {TextWin32TextStyle, ITextWin32Props } from './Components/Text/TextWin32.Props';
10
+ export {TextWin32} from './Components/Text/TextWin32';
11
+ export {IButtonWin32Props, IButtonWin32Style} from './Components/Button/ButtonWin32.Props';
12
+ export {ButtonWin32} from './Components/Button/ButtonWin32';
13
+ export {GradientColorStop, GradientColorValueWin32, ColorGradientWin32} from './StyleSheet/PlatformColorValueTypesWin32';
14
+ export {ITouchableWin32Props} from './Components/Touchable/TouchableWin32.Props';
21
15
  export * from './Components/Touchable/TouchableWin32.Types';
22
16
  export * from './Components/Touchable/TouchableWin32';
23
17
  export * from './PersonaCoin/PersonaCoin';
package/index.win32.js CHANGED
@@ -466,7 +466,7 @@ module.exports = {
466
466
  .ColorGradientWin32;
467
467
  },
468
468
  get ViewWin32(): any {
469
- return require('./Libraries/Components/View/ViewWin32').ViewWin32;
469
+ return require('./Libraries/Components/View/ViewWin32');
470
470
  },
471
471
  get TextWin32(): any {
472
472
  return require('./Libraries/Components/Text/TextWin32').TextWin32;
package/jest.config.js CHANGED
@@ -1,5 +1,4 @@
1
- module.exports = {
2
- preset: '@rnx-kit/jest-preset',
1
+ module.exports = require('@rnx-kit/jest-preset')("win32", {
3
2
  verbose: true,
4
3
  snapshotResolver: './jest-snapshot-resolver.js',
5
4
  transform: {
@@ -7,7 +6,6 @@ module.exports = {
7
6
  '<rootDir>/jest/assetFileTransformer.js',
8
7
  },
9
8
  transformIgnorePatterns: ['jest-runner'],
10
- setupFiles: ['./jest/setup.js'],
11
9
  fakeTimers: {
12
10
  enableGlobally: true,
13
11
  legacyFakeTimers: true,
@@ -36,4 +34,4 @@ module.exports = {
36
34
  '/vendor/',
37
35
  '<rootDir>/Libraries/react-native/',
38
36
  ],
39
- };
37
+ });
package/overrides.json CHANGED
@@ -119,7 +119,7 @@
119
119
  },
120
120
  {
121
121
  "type": "derived",
122
- "file": "src/Libraries/Components/TextInput/TextInput.win32.tsx",
122
+ "file": "src/Libraries/Components/TextInput/TextInput.win32.js",
123
123
  "baseFile": "Libraries/Components/TextInput/TextInput.js",
124
124
  "baseHash": "5de06cf785aabebe8a0bb7331389a5320d7f38c0"
125
125
  },
@@ -148,12 +148,16 @@
148
148
  "issue": 0
149
149
  },
150
150
  {
151
- "type": "platform",
152
- "file": "src/Libraries/Components/Touchable/TouchableNativeFeedback.Props.ts"
151
+ "type": "derived",
152
+ "file": "src/Libraries/Components/Touchable/TouchableNativeFeedback.win32.d.ts",
153
+ "baseFile": "Libraries/Components/Touchable/TouchableNativeFeedback.d.ts",
154
+ "baseHash": "b38a2d4fb0c6a08c3ada7748fffded9949c97c2a"
153
155
  },
154
156
  {
155
- "type": "platform",
156
- "file": "src/Libraries/Components/Touchable/TouchableNativeFeedback.win32.tsx"
157
+ "type": "derived",
158
+ "file": "src/Libraries/Components/Touchable/TouchableNativeFeedback.win32.js",
159
+ "baseFile": "Libraries/Components/Touchable/TouchableNativeFeedback.js",
160
+ "baseHash": "1fa12a85dc06cdb1093dbe2b54cf3569312b7cc4"
157
161
  },
158
162
  {
159
163
  "type": "platform",
@@ -183,6 +187,24 @@
183
187
  "baseFile": "Libraries/Components/View/View.js",
184
188
  "baseHash": "91864d8f5518fa50da710f545ecdf5727248c45a"
185
189
  },
190
+ {
191
+ "type": "derived",
192
+ "file": "src/Libraries/Components/View/ViewAccessibility.win32.d.ts",
193
+ "baseFile": "Libraries/Components/View/ViewAccessibility.d.ts",
194
+ "baseHash": "fb6095450277c96f033749633af10b42a184e07c"
195
+ },
196
+ {
197
+ "type": "derived",
198
+ "file": "src/Libraries/Components/View/ViewAccessibility.win32.js",
199
+ "baseFile": "Libraries/Components/View/ViewAccessibility.js",
200
+ "baseHash": "b8dca610ae67781f86534eab2373f2a3eb29fca3"
201
+ },
202
+ {
203
+ "type": "derived",
204
+ "file": "src/Libraries/Components/View/ViewPropTypes.win32.d.ts",
205
+ "baseFile": "Libraries/Components/View/ViewPropTypes.d.ts",
206
+ "baseHash": "567b5fd7cc602357daa075d728220ffca0f6c2ac"
207
+ },
186
208
  {
187
209
  "type": "patch",
188
210
  "file": "src/Libraries/Components/View/ViewPropTypes.win32.js",
@@ -191,12 +213,14 @@
191
213
  "issue": 6240
192
214
  },
193
215
  {
194
- "type": "platform",
195
- "file": "src/Libraries/Components/View/ViewWin32.Props.ts"
216
+ "type": "derived",
217
+ "file": "src/Libraries/Components/View/ViewWin32.d.ts",
218
+ "baseFile": "Libraries/Components/View/View.d.ts",
219
+ "baseHash": "c71957187cbae0b40995198a2d7a18d5cae6d662"
196
220
  },
197
221
  {
198
222
  "type": "platform",
199
- "file": "src/Libraries/Components/View/ViewWin32.tsx"
223
+ "file": "src/Libraries/Components/View/ViewWin32.js"
200
224
  },
201
225
  {
202
226
  "type": "patch",
@@ -395,6 +419,12 @@
395
419
  "baseHash": "7fe2b87cf49f4674d731d07f0883bab2f5cfc356",
396
420
  "issue": 6240
397
421
  },
422
+ {
423
+ "type": "derived",
424
+ "file": "src/Libraries/Utilities/AcessibilityMapping.win32.js",
425
+ "baseFile": "Libraries/Utilities/AcessibilityMapping.js",
426
+ "baseHash": "7a662ddd93c6cd0a7193e3002120aeb196991340"
427
+ },
398
428
  {
399
429
  "type": "copy",
400
430
  "file": "src/Libraries/Utilities/BackHandler.win32.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@office-iss/react-native-win32",
3
- "version": "0.71.0",
3
+ "version": "0.71.2",
4
4
  "description": "Implementation of react native on top of Office's Win32 platform.",
5
5
  "license": "MIT",
6
6
  "main": "./index.win32.js",
@@ -12,9 +12,9 @@
12
12
  "flow-check": "flow check",
13
13
  "lint:fix": "rnw-scripts lint:fix",
14
14
  "lint": "rnw-scripts lint",
15
- "run-win32-dev-web": "npx @office-iss/rex-win32@0.66.15-devmain.15226.10000 --bundle js/RNTesterApp --component RNTesterApp --basePath ./dist/win32/dev --jsEngine v8 --useDevMain --useWebDebugger",
16
- "run-win32-devmain": "npx @office-iss/rex-win32@0.66.15-devmain.15226.10000 --bundle js/RNTesterApp --component RNTesterApp --basePath ./dist/win32/dev --jsEngine v8 --useDevMain",
17
- "run-win32": "npx @office-iss/rex-win32@0.66.15-devmain.15226.10000 --bundle js/RNTesterApp --component RNTesterApp --basePath ./dist/win32/dev --jsEngine v8 --useWebDebugger",
15
+ "run-win32-dev-web": "npx @office-iss/rex-win32@0.68.26-devmain.16206.10000 --bundle js/RNTesterApp --component RNTesterApp --basePath ./dist/win32/dev --jsEngine v8 --useDevMain --useWebDebugger",
16
+ "run-win32-devmain": "npx @office-iss/rex-win32@0.68.26-devmain.16206.10000 --bundle js/RNTesterApp --component RNTesterApp --basePath ./dist/win32/dev --jsEngine v8 --useDevMain",
17
+ "run-win32": "npx @office-iss/rex-win32@0.68.26-devmain.16206.10000 --bundle js/RNTesterApp --component RNTesterApp --basePath ./dist/win32/dev --jsEngine v8 --useWebDebugger",
18
18
  "start": "react-native start --projectRoot ../react-native-win32-tester",
19
19
  "test": "jest",
20
20
  "validate-overrides": "react-native-platform-override validate"
@@ -78,7 +78,7 @@
78
78
  "react": "18.2.0",
79
79
  "react-native": "0.71.0",
80
80
  "react-native-platform-override": "^1.8.3",
81
- "typescript": "^4.4.4"
81
+ "typescript": "^4.9.5"
82
82
  },
83
83
  "peerDependencies": {
84
84
  "react": "18.2.0",
@@ -1,10 +1,8 @@
1
1
  import React from 'react'
2
2
  import RN = require('react-native');
3
- import { ViewWin32 } from '../View/ViewWin32';
4
- import { IViewWin32Props } from '../View/ViewWin32.Props';
5
- import { TextWin32 } from '../Text/TextWin32';
6
- import { ITextWin32Props } from '../Text/TextWin32.Props';
7
- import { IButtonWin32Props } from './ButtonWin32.Props';
3
+ import type { IViewWin32Props } from '../View/ViewPropTypes.win32';
4
+ import type { ITextWin32Props } from '../Text/TextWin32.Props';
5
+ import type { IButtonWin32Props } from './ButtonWin32.Props';
8
6
 
9
7
  const enum SelectState {
10
8
  NotSelected,
@@ -35,6 +33,7 @@ export class ButtonWin32 extends React.Component<IButtonWin32Props, IButtonWin32
35
33
  onBlur: this._onBlur,
36
34
  onMouseEnter: this.props.onMouseEnter,
37
35
  onMouseLeave: this.props.onMouseLeave,
36
+ // @ts-ignore
38
37
  onTouchStart: this.props.onTouchStart,
39
38
  onTouchEnd: this._onTouchEnd,
40
39
  testID: this.props.testID,
@@ -49,9 +48,10 @@ export class ButtonWin32 extends React.Component<IButtonWin32Props, IButtonWin32
49
48
  }
50
49
 
51
50
  return (
52
- <ViewWin32 {...viewProps}>
53
- <TextWin32 {...textProps}>{this.props.title}</TextWin32>
54
- </ViewWin32>
51
+ // @ts-ignore
52
+ <RN.ViewWin32 {...viewProps}>
53
+ <RN.TextWin32 {...textProps}>{this.props.title}</RN.TextWin32>
54
+ </RN.ViewWin32>
55
55
  );
56
56
  }
57
57
 
@@ -1,18 +1,5 @@
1
1
  import RN = require('react-native');
2
- import { SharedAccessibilityPropsIOSandWin32, OmittedAccessibilityPropsWin32, BasePropsWin32, IKeyboardEvent, IHandledKeyboardEvent } from '../View/ViewWin32.Props';
3
-
4
- // removes from interface T the members of interface K
5
- type Omit<T, K> = Pick<T, Exclude<keyof T, keyof K>>;
6
-
7
- export type TextWin32OmitTypes = Omit<RN.TextPropsAndroid, SharedTextPropsAndroidandWin32> &
8
- RN.TextPropsIOS &
9
- RN.AccessibilityPropsAndroid &
10
- Omit<RN.AccessibilityPropsIOS, SharedAccessibilityPropsIOSandWin32> &
11
- OmittedAccessibilityPropsWin32;
12
-
13
- export type SharedTextPropsAndroidandWin32 = {
14
- selectable?: boolean;
15
- };
2
+ import type { IKeyboardEvent, IHandledKeyboardEvent } from '../View/ViewPropTypes.win32';
16
3
 
17
4
  /**
18
5
  * Role-based text style names.
@@ -31,7 +18,7 @@ export type TextWin32TextStyle =
31
18
  | 'ExtraLargeStandard'
32
19
  | 'HugeStandard';
33
20
 
34
- export interface ITextWin32Props extends Omit<RN.TextProps, TextWin32OmitTypes>, BasePropsWin32 {
21
+ export interface ITextWin32Props extends RN.TextProps {
35
22
  onKeyDown?: (args: IKeyboardEvent) => void;
36
23
  onKeyDownCapture?: (args: IKeyboardEvent) => void;
37
24
  onKeyUp?: (args: IKeyboardEvent) => void;
@@ -1,7 +1,11 @@
1
1
  import React from 'react'
2
2
  import RN = require('react-native');
3
- import { ITextWin32Props } from './TextWin32.Props';
4
- import { UseFrom } from '../View/ViewWin32.Props';
3
+ import type { ITextWin32Props } from './TextWin32.Props';
4
+
5
+ /**
6
+ * All of TOrigin except Key from TUse
7
+ */
8
+ type UseFrom<TOrigin, TUse, Key extends keyof TUse> = Pick<TOrigin, Exclude<keyof TOrigin, Key>> & Pick<TUse, Key>;
5
9
 
6
10
  /**
7
11
  * React-native <Text> control with additional Win32-specific functionality.
@@ -5,7 +5,7 @@ import {NativeSyntheticEvent, StyleSheet, Text, ViewStyle } from 'react-native';
5
5
  import {Insets} from 'react-native/types/public/Insets';
6
6
  import { TextWin32 } from '../../Text/TextWin32';
7
7
  import { ViewWin32 } from '../../View/ViewWin32';
8
- import { IViewWin32Props, IKeyboardEvent } from '../../View/ViewWin32.Props';
8
+ import { IViewWin32Props, IKeyboardEvent } from '../../View/ViewPropTypes.win32';
9
9
  import { TouchableWin32 } from '../TouchableWin32';
10
10
  import { IPressEvent, IRenderChild } from '../TouchableWin32.Types';
11
11
  import { ITouchableWin32State } from '../TouchableWin32.Props';
@@ -263,12 +263,12 @@ class TouchableWin32HighlightComponent extends React.Component<ITouchableWin32Hi
263
263
  private readonly _touchableHandleKeyPressDown = (ev: IKeyboardEvent) => {
264
264
  this.props.onKeyPressDown && this.props.onKeyPressDown(ev);
265
265
  }
266
- private readonly _mouseEnter = (): void => {
267
- this.props.onMouseEnter && this.props.onMouseEnter();
266
+ private readonly _mouseEnter = (mouseEvent): void => {
267
+ this.props.onMouseEnter && this.props.onMouseEnter(mouseEvent);
268
268
  this.setState({ isMouseIn: true });
269
269
  };
270
- private readonly _mouseLeave = (): void => {
271
- this.props.onMouseLeave && this.props.onMouseLeave();
270
+ private readonly _mouseLeave = (mouseEvent): void => {
271
+ this.props.onMouseLeave && this.props.onMouseLeave(mouseEvent);
272
272
  this.setState({ isMouseIn: false });
273
273
  };
274
274
  private readonly _onFocus = (ev: NativeSyntheticEvent<{}>): void => {
@@ -0,0 +1,119 @@
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 {ColorValue} from '../../StyleSheet/StyleSheet';
13
+ import {TouchableMixin} from './Touchable';
14
+
15
+ import type {TVProps} from './TouchableOpacity';
16
+ import {TouchableWithoutFeedbackProps} from './TouchableWithoutFeedback';
17
+
18
+ interface BaseBackgroundPropType {
19
+ type: string;
20
+ rippleRadius?: number | null | undefined;
21
+ }
22
+
23
+ interface RippleBackgroundPropType extends BaseBackgroundPropType {
24
+ type: 'RippleAndroid';
25
+ borderless: boolean;
26
+ color?: number | null | undefined;
27
+ }
28
+
29
+ interface ThemeAttributeBackgroundPropType extends BaseBackgroundPropType {
30
+ type: 'ThemeAttrAndroid';
31
+ attribute: string;
32
+ }
33
+
34
+ type BackgroundPropType =
35
+ | RippleBackgroundPropType
36
+ | ThemeAttributeBackgroundPropType;
37
+
38
+ /**
39
+ * @see https://reactnative.dev/docs/touchablenativefeedback#props
40
+ */
41
+ export interface TouchableNativeFeedbackProps
42
+ extends TouchableWithoutFeedbackProps,
43
+ TVProps {
44
+ /**
45
+ * Determines the type of background drawable that's going to be used to display feedback.
46
+ * It takes an object with type property and extra data depending on the type.
47
+ * It's recommended to use one of the following static methods to generate that dictionary:
48
+ * 1) TouchableNativeFeedback.SelectableBackground() - will create object that represents android theme's
49
+ * default background for selectable elements (?android:attr/selectableItemBackground)
50
+ * 2) TouchableNativeFeedback.SelectableBackgroundBorderless() - will create object that represent android
51
+ * theme's default background for borderless selectable elements
52
+ * (?android:attr/selectableItemBackgroundBorderless). Available on android API level 21+
53
+ * 3) TouchableNativeFeedback.Ripple(color, borderless) - will create object that represents ripple drawable
54
+ * with specified color (as a string). If property borderless evaluates to true the ripple will render
55
+ * outside of the view bounds (see native actionbar buttons as an example of that behavior). This background
56
+ * type is available on Android API level 21+
57
+ */
58
+ background?: BackgroundPropType | undefined;
59
+ useForeground?: boolean | undefined;
60
+
61
+ tooltip?: string; // Win32
62
+ }
63
+
64
+ /**
65
+ * A wrapper for making views respond properly to touches (Android only).
66
+ * On Android this component uses native state drawable to display touch feedback.
67
+ * At the moment it only supports having a single View instance as a child node,
68
+ * as it's implemented by replacing that View with another instance of RCTView node with some additional properties set.
69
+ *
70
+ * Background drawable of native feedback touchable can be customized with background property.
71
+ *
72
+ * @see https://reactnative.dev/docs/touchablenativefeedback#content
73
+ */
74
+ declare class TouchableNativeFeedbackComponent extends React.Component<TouchableNativeFeedbackProps> {}
75
+ declare const TouchableNativeFeedbackBase: Constructor<TouchableMixin> &
76
+ typeof TouchableNativeFeedbackComponent;
77
+ export class TouchableNativeFeedback extends TouchableNativeFeedbackBase {
78
+ /**
79
+ * Creates an object that represents android theme's default background for
80
+ * selectable elements (?android:attr/selectableItemBackground).
81
+ *
82
+ * @param rippleRadius The radius of ripple effect
83
+ */
84
+ static SelectableBackground(
85
+ rippleRadius?: number | null,
86
+ ): ThemeAttributeBackgroundPropType;
87
+
88
+ /**
89
+ * Creates an object that represent android theme's default background for borderless
90
+ * selectable elements (?android:attr/selectableItemBackgroundBorderless).
91
+ * Available on android API level 21+.
92
+ *
93
+ * @param rippleRadius The radius of ripple effect
94
+ */
95
+ static SelectableBackgroundBorderless(
96
+ rippleRadius?: number | null,
97
+ ): ThemeAttributeBackgroundPropType;
98
+
99
+ /**
100
+ * Creates an object that represents ripple drawable with specified color (as a
101
+ * string). If property `borderless` evaluates to true the ripple will
102
+ * render outside of the view bounds (see native actionbar buttons as an
103
+ * example of that behavior). This background type is available on Android
104
+ * API level 21+.
105
+ *
106
+ * @param color The ripple color
107
+ * @param borderless If the ripple can render outside it's bounds
108
+ * @param rippleRadius The radius of ripple effect
109
+ */
110
+ static Ripple(
111
+ color: ColorValue,
112
+ borderless: boolean,
113
+ rippleRadius?: number | null,
114
+ ): RippleBackgroundPropType;
115
+ static canUseNativeForeground(): boolean;
116
+ }
117
+
118
+ // For backcompat
119
+ export type ITouchableNativeFeedbackProps = TouchableNativeFeedbackProps;
@@ -2,7 +2,7 @@ import {ViewStyle} from 'react-native';
2
2
  import {Insets} from 'react-native/types/public/Insets';
3
3
 
4
4
  import { IPressEvent, IRenderChild, IRenderStyle } from './TouchableWin32.Types';
5
- import { IViewWin32Props, IKeyboardEvent } from '../View/ViewWin32.Props';
5
+ import { IViewWin32Props, IKeyboardEvent } from '../View/ViewPropTypes.win32';
6
6
 
7
7
  export interface ITouchableWin32State {
8
8
  isPressed: boolean;
@@ -11,7 +11,7 @@
11
11
  'use strict';
12
12
 
13
13
  import React from 'react'
14
- import { NativeSyntheticEvent, StyleProp, UIManager, ViewStyle } from 'react-native';
14
+ import { NativeSyntheticEvent, StyleProp, UIManager, ViewStyle, ViewWin32 } from 'react-native';
15
15
 
16
16
  import { ITouchableWin32Props, ITouchableWin32State } from './TouchableWin32.Props';
17
17
  import {
@@ -25,8 +25,7 @@ import {
25
25
  IStateConditions,
26
26
  ITransitions,
27
27
  } from './TouchableWin32.Types';
28
- import { ViewWin32 } from '../View/ViewWin32';
29
- import { IKeyboardEvent } from '../View/ViewWin32.Props';
28
+ import { IKeyboardEvent } from '../View/ViewPropTypes.win32';
30
29
 
31
30
  const BoundingDimensions = require('./BoundingDimensions');
32
31
  const Position = require('./Position');
@@ -568,14 +567,14 @@ export class TouchableWin32 extends React.Component<ITouchableWin32Props, IInter
568
567
  }
569
568
  };
570
569
 
571
- private readonly _onMouseEnter = () => {
570
+ private readonly _onMouseEnter = (mouseEvent) => {
572
571
  this.setState({ isHovered: true });
573
- this.props.onMouseEnter && this.props.onMouseEnter();
572
+ this.props.onMouseEnter && this.props.onMouseEnter(mouseEvent);
574
573
  };
575
574
 
576
- private readonly _onMouseLeave = () => {
575
+ private readonly _onMouseLeave = (mouseEvent) => {
577
576
  this.setState({ isHovered: false });
578
- this.props.onMouseLeave && this.props.onMouseLeave();
577
+ this.props.onMouseLeave && this.props.onMouseLeave(mouseEvent);
579
578
  };
580
579
 
581
580
  private readonly _onFocus = (ev: NativeSyntheticEvent<{}>) => {