@office-iss/react-native-win32 0.71.9 → 0.71.10

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 (33) hide show
  1. package/CHANGELOG.json +16 -1
  2. package/CHANGELOG.md +12 -4
  3. package/Libraries/Components/Button/ButtonWin32.js.map +1 -1
  4. package/Libraries/Components/Text/TextWin32.Props.d.ts +1 -1
  5. package/Libraries/Components/Text/TextWin32.Props.js.map +1 -1
  6. package/Libraries/Components/Touchable/Tests/TouchableWin32Test.js.map +1 -1
  7. package/Libraries/Components/Touchable/TouchableNativeFeedback.d.ts +5 -0
  8. package/Libraries/Components/Touchable/TouchableWin32.Props.d.ts +1 -1
  9. package/Libraries/Components/Touchable/TouchableWin32.Props.js.map +1 -1
  10. package/Libraries/Components/Touchable/TouchableWin32.js.map +1 -1
  11. package/Libraries/Components/View/ViewAccessibility.d.ts +157 -3
  12. package/Libraries/Components/View/ViewPropTypes.d.ts +146 -6
  13. package/Libraries/Components/View/ViewWin32.d.ts +1 -1
  14. package/Libraries/platform-types.d.ts +4 -4
  15. package/overrides.json +3 -7
  16. package/package.json +1 -1
  17. package/src/Libraries/Components/Button/ButtonWin32.tsx +1 -1
  18. package/src/Libraries/Components/Text/TextWin32.Props.ts +1 -1
  19. package/src/Libraries/Components/Touchable/Tests/TouchableWin32Test.tsx +1 -1
  20. package/src/Libraries/Components/Touchable/TouchableWin32.Props.tsx +1 -1
  21. package/src/Libraries/Components/Touchable/TouchableWin32.tsx +1 -1
  22. package/src/Libraries/Components/View/ViewWin32.d.ts +1 -1
  23. package/src/Libraries/platform-types.d.ts +4 -4
  24. package/Libraries/Components/View/Tests/ViewWin32Test.d.ts +0 -8
  25. package/Libraries/Components/View/Tests/ViewWin32Test.js +0 -233
  26. package/Libraries/Components/View/Tests/ViewWin32Test.js.map +0 -1
  27. package/src/Libraries/Components/Touchable/TouchableNativeFeedback.win32.d.ts +0 -119
  28. package/src/Libraries/Components/View/Tests/ViewWin32Test.tsx +0 -333
  29. package/src/Libraries/Components/View/ViewAccessibility.win32.d.ts +0 -527
  30. package/src/Libraries/Components/View/ViewPropTypes.win32.d.ts +0 -385
  31. /package/{Libraries/Components/Touchable/TouchableNativeFeedback.win32.d.ts → src/Libraries/Components/Touchable/TouchableNativeFeedback.d.ts} +0 -0
  32. /package/{Libraries/Components/View/ViewAccessibility.win32.d.ts → src/Libraries/Components/View/ViewAccessibility.d.ts} +0 -0
  33. /package/{Libraries/Components/View/ViewPropTypes.win32.d.ts → src/Libraries/Components/View/ViewPropTypes.d.ts} +0 -0
@@ -1,233 +0,0 @@
1
- 'use strict';
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.examples = exports.description = exports.displayName = exports.title = void 0;
7
- const react_1 = __importDefault(require("react"));
8
- const react_native_1 = require("react-native");
9
- const react_native_win32_1 = require("@office-iss/react-native-win32");
10
- const styles = react_native_1.StyleSheet.create({
11
- border: {
12
- borderStyle: 'dotted',
13
- borderColor: 'black',
14
- },
15
- keyComponentRoot: {
16
- borderWidth: 2,
17
- flexDirection: 'row',
18
- marginVertical: 5,
19
- backgroundColor: 'whitesmoke',
20
- justifyContent: 'space-around',
21
- },
22
- keyEnterVisualizer: {
23
- margin: 5,
24
- alignItems: 'center',
25
- minWidth: 100,
26
- minHeight: 30,
27
- },
28
- blackbox: { height: 30, width: 30, borderColor: 'black', borderWidth: 3 },
29
- });
30
- function FocusMoverTestComponent() {
31
- const [hasFocus, setHasFocus] = react_1.default.useState(false);
32
- const labelId = react_1.default.useId();
33
- const ref = react_1.default.useRef(null);
34
- const onBtnPress = () => {
35
- if (ref.current) {
36
- ref.current.focus();
37
- }
38
- };
39
- return (react_1.default.createElement(react_native_win32_1.ViewWin32, null,
40
- react_1.default.createElement(react_native_win32_1.ViewWin32, { nativeID: labelId, accessibilityLabel: "separate label for test", accessibilityItemType: "Comment" }),
41
- react_1.default.createElement(react_native_win32_1.ViewWin32, { style: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-around', marginVertical: 5 } },
42
- react_1.default.createElement(react_native_1.TouchableHighlight, { onPress: onBtnPress },
43
- react_1.default.createElement(react_native_win32_1.ViewWin32, { accessibilityLabelledBy: labelId, style: styles.blackbox })),
44
- react_1.default.createElement(react_native_win32_1.ViewWin32, { ref: ref, focusable: true, style: hasFocus ? { backgroundColor: '#aee8fcff' } : { backgroundColor: '#00000000' }, onFocus: () => setHasFocus(true), onBlur: () => setHasFocus(false), enableFocusRing: false },
45
- react_1.default.createElement(react_native_1.Text, null, hasFocus ? 'Focus: Yes' : 'Focus: No')))));
46
- }
47
- const handledNativeKeyboardEvents = [
48
- { key: 'ArrowDown' },
49
- { key: 'ArrowUp' },
50
- { key: 'ArrowLeft' },
51
- { key: 'ArrowRight' },
52
- { key: 'Tab' },
53
- ];
54
- class KeyboardTestComponent extends react_1.default.Component {
55
- constructor(props) {
56
- super(props);
57
- this._onFocus = () => {
58
- this.setState({
59
- hasFocus: true,
60
- });
61
- };
62
- this._onBlur = () => {
63
- this.setState({
64
- hasFocus: false,
65
- });
66
- };
67
- this._onKeyUp = (ev) => {
68
- this.setState({ lastKeyUp: ev.nativeEvent.key, lastKeyDown: null });
69
- };
70
- this._onKeyDown = (ev) => {
71
- this.setState({ lastKeyDown: ev.nativeEvent.key, lastKeyUp: null });
72
- };
73
- this.state = {
74
- hasFocus: false,
75
- lastKeyDown: null,
76
- lastKeyUp: null,
77
- };
78
- }
79
- render() {
80
- return (react_1.default.createElement(react_native_win32_1.ViewWin32, { keyDownEvents: handledNativeKeyboardEvents, keyUpEvents: handledNativeKeyboardEvents },
81
- react_1.default.createElement(react_native_win32_1.ViewWin32, { style: this.state.hasFocus ? [styles.keyComponentRoot, styles.border] : styles.keyComponentRoot, focusable: true, onKeyUp: this._onKeyUp, onKeyDown: this._onKeyDown, onFocus: this._onFocus, onBlur: this._onBlur, enableFocusRing: false },
82
- react_1.default.createElement(react_native_win32_1.ViewWin32, { style: styles.keyEnterVisualizer },
83
- react_1.default.createElement(react_native_1.Text, null, "OnKeyDown"),
84
- react_1.default.createElement(react_native_1.Text, null, "----"),
85
- react_1.default.createElement(react_native_1.Text, null, this.state.lastKeyDown !== null ? this.state.lastKeyDown : ' ')),
86
- react_1.default.createElement(react_native_win32_1.ViewWin32, { style: styles.keyEnterVisualizer },
87
- react_1.default.createElement(react_native_1.Text, null, "OnKeyUp"),
88
- react_1.default.createElement(react_native_1.Text, null, "----"),
89
- react_1.default.createElement(react_native_1.Text, null, this.state.lastKeyUp !== null ? this.state.lastKeyUp : ' ')))));
90
- }
91
- }
92
- class HoverTestComponent extends react_1.default.Component {
93
- constructor(props) {
94
- super(props);
95
- this._onMouseLeave = () => {
96
- this.setState({ hasFocus: false });
97
- };
98
- this._onMouseEnter = () => {
99
- this.setState({ hasFocus: true });
100
- };
101
- this.state = {
102
- hasFocus: false,
103
- };
104
- }
105
- render() {
106
- return (react_1.default.createElement(react_native_win32_1.ViewWin32, { onMouseEnter: this._onMouseEnter, onMouseLeave: this._onMouseLeave, style: this.state.hasFocus ? [styles.blackbox, { backgroundColor: this.props.color }] : styles.blackbox }));
107
- }
108
- }
109
- class HoverExample extends react_1.default.Component {
110
- render() {
111
- return (react_1.default.createElement(react_native_win32_1.ViewWin32, { style: { flexDirection: 'row', marginHorizontal: 75, justifyContent: 'space-around' } },
112
- react_1.default.createElement(HoverTestComponent, { color: "red" }),
113
- react_1.default.createElement(HoverTestComponent, { color: "orange" }),
114
- react_1.default.createElement(HoverTestComponent, { color: "yellow" }),
115
- react_1.default.createElement(HoverTestComponent, { color: "green" }),
116
- react_1.default.createElement(HoverTestComponent, { color: "blue" }),
117
- react_1.default.createElement(HoverTestComponent, { color: "indigo" }),
118
- react_1.default.createElement(HoverTestComponent, { color: "violet" })));
119
- }
120
- }
121
- const ToolTipExample = () => {
122
- return (react_1.default.createElement(react_native_win32_1.ViewWin32, { style: {
123
- backgroundColor: 'red',
124
- height: 100,
125
- width: 100,
126
- }, tooltip: "Example tooltip", cursor: "pointer" }));
127
- };
128
- const CursorTestComponent = (props) => {
129
- return (react_1.default.createElement(react_native_win32_1.ViewWin32, { style: { flexDirection: 'column' } },
130
- react_1.default.createElement(react_native_1.Text, null, props.cursor),
131
- react_1.default.createElement(react_native_win32_1.ViewWin32, { cursor: props.cursor, style: styles.blackbox })));
132
- };
133
- const CursorExample = () => {
134
- return (react_1.default.createElement(react_native_win32_1.ViewWin32, { style: { flexDirection: 'row', justifyContent: 'space-around' } },
135
- react_1.default.createElement(CursorTestComponent, { cursor: 'auto' }),
136
- react_1.default.createElement(CursorTestComponent, { cursor: 'default' }),
137
- react_1.default.createElement(CursorTestComponent, { cursor: 'help' }),
138
- react_1.default.createElement(CursorTestComponent, { cursor: 'nesw-resize' }),
139
- react_1.default.createElement(CursorTestComponent, { cursor: 'not-allowed' }),
140
- react_1.default.createElement(CursorTestComponent, { cursor: 'ns-resize' }),
141
- react_1.default.createElement(CursorTestComponent, { cursor: 'nwse-resize' }),
142
- react_1.default.createElement(CursorTestComponent, { cursor: 'pointer' }),
143
- react_1.default.createElement(CursorTestComponent, { cursor: 'wait' }),
144
- react_1.default.createElement(CursorTestComponent, { cursor: 'move' }),
145
- react_1.default.createElement(CursorTestComponent, { cursor: 'text' }),
146
- react_1.default.createElement(CursorTestComponent, { cursor: 'we-resize' })));
147
- };
148
- class EnableFocusRingExample extends react_1.default.Component {
149
- constructor(props) {
150
- super(props);
151
- this._onFocus = () => {
152
- this.setState({
153
- hasFocus: true,
154
- });
155
- };
156
- this._onBlur = () => {
157
- this.setState({
158
- hasFocus: false,
159
- });
160
- };
161
- this.state = {
162
- hasFocus: false,
163
- };
164
- }
165
- render() {
166
- return (react_1.default.createElement(react_native_win32_1.ViewWin32, { style: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-around', marginVertical: 5 } },
167
- react_1.default.createElement(react_native_win32_1.ViewWin32, { style: {
168
- backgroundColor: 'pink',
169
- height: 100,
170
- width: 100,
171
- }, enableFocusRing: true, focusable: true },
172
- react_1.default.createElement(react_native_1.Text, null, "enableFocusRing set to true")),
173
- react_1.default.createElement(react_native_win32_1.ViewWin32, { style: {
174
- backgroundColor: 'pink',
175
- height: 100,
176
- width: 100,
177
- }, enableFocusRing: false, focusable: true, onFocus: this._onFocus, onBlur: this._onBlur },
178
- react_1.default.createElement(react_1.default.Fragment, null,
179
- react_1.default.createElement(react_native_1.Text, null, "enableFocusRing set to false"),
180
- react_1.default.createElement(react_native_1.Text, null, this.state.hasFocus ? 'Focus: Yes' : 'Focus: No')))));
181
- }
182
- }
183
- exports.title = 'ViewWin32';
184
- exports.displayName = 'ViewWin32 Example';
185
- exports.description = 'All the stock View props plus Win32 specific ones';
186
- exports.examples = [
187
- {
188
- title: 'focus() method example',
189
- description: 'Each of these black boxes moves focus to the ViewWin32 on the right',
190
- render() {
191
- return (react_1.default.createElement(react_native_win32_1.ViewWin32, null,
192
- react_1.default.createElement(FocusMoverTestComponent, null),
193
- react_1.default.createElement(FocusMoverTestComponent, null),
194
- react_1.default.createElement(FocusMoverTestComponent, null)));
195
- },
196
- },
197
- {
198
- title: 'KeyboardEvents example',
199
- description: 'Native keyboarding has been prevented',
200
- render() {
201
- return react_1.default.createElement(KeyboardTestComponent, null);
202
- },
203
- },
204
- {
205
- title: 'Hover example',
206
- description: 'Hover a rainbow',
207
- render() {
208
- return react_1.default.createElement(HoverExample, null);
209
- },
210
- },
211
- {
212
- title: 'Tooltip example',
213
- description: 'Displays a tooltip on hover',
214
- render() {
215
- return react_1.default.createElement(ToolTipExample, null);
216
- },
217
- },
218
- {
219
- title: 'Cursor example',
220
- description: 'Each of these boxes should display a different cursor',
221
- render() {
222
- return react_1.default.createElement(CursorExample, null);
223
- },
224
- },
225
- {
226
- title: 'EnableFocusRing example',
227
- description: 'Displays focus visuals that are driven by native',
228
- render() {
229
- return react_1.default.createElement(EnableFocusRingExample, null);
230
- },
231
- },
232
- ];
233
- //# sourceMappingURL=ViewWin32Test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ViewWin32Test.js","sourceRoot":"","sources":["../../../../src/Libraries/Components/View/Tests/ViewWin32Test.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;AACb,kDAAyB;AACzB,+CAAoE;AACpE,uEAA0G;AAE1G,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,MAAM,EAAE;QACN,WAAW,EAAE,QAAQ;QACrB,WAAW,EAAE,OAAO;KACrB;IACD,gBAAgB,EAAE;QAChB,WAAW,EAAE,CAAC;QACd,aAAa,EAAE,KAAK;QACpB,cAAc,EAAE,CAAC;QACjB,eAAe,EAAE,YAAY;QAC7B,cAAc,EAAE,cAAc;KAC/B;IACD,kBAAkB,EAAE;QAClB,MAAM,EAAE,CAAC;QACT,UAAU,EAAE,QAAQ;QACpB,QAAQ,EAAE,GAAG;QACb,SAAS,EAAE,EAAE;KACd;IACD,QAAQ,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC,EAAE;CAC1E,CAAC,CAAC;AAMH,SAAS,uBAAuB;IAC9B,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,eAAK,CAAC,QAAQ,CAAU,KAAK,CAAC,CAAC;IAE/D,MAAM,OAAO,GAAG,eAAK,CAAC,KAAK,EAAE,CAAC;IAE9B,MAAM,GAAG,GAAG,eAAK,CAAC,MAAM,CAAY,IAAI,CAAC,CAAC;IAC1C,MAAM,UAAU,GAAG,GAAG,EAAE;QACtB,IAAI,GAAG,CAAC,OAAO,EAAE;YACf,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;SACrB;IACH,CAAC,CAAC;IAEF,OAAO,CACL,8BAAC,8BAAS;QACR,8BAAC,8BAAS,IAAC,QAAQ,EAAE,OAAO,EAAE,kBAAkB,E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C,YAAY,OAAG,CAAC;QAC1B,CAAC;KACF;IACD;QACE,KAAK,EAAE,iBAAiB;QACxB,WAAW,EAAE,6BAA6B;QAC1C,MAAM;YACJ,OAAO,8BAAC,cAAc,OAAG,CAAC;QAC5B,CAAC;KACF;IACD;QACE,KAAK,EAAE,gBAAgB;QACvB,WAAW,EAAE,uDAAuD;QACpE,MAAM;YACJ,OAAO,8BAAC,aAAa,OAAG,CAAC;QAC3B,CAAC;KACF;IACD;QACE,KAAK,EAAE,yBAAyB;QAChC,WAAW,EAAE,kDAAkD;QAC/D,MAAM;YACJ,OAAO,8BAAC,sBAAsB,OAAG,CAAC;QACpC,CAAC;KACF;CACF,CAAC","sourcesContent":["'use strict';\nimport React from 'react'\nimport { StyleSheet, Text, TouchableHighlight } from 'react-native';\nimport { Cursor, IKeyboardEvent, IHandledKeyboardEvent, ViewWin32 } from '@office-iss/react-native-win32';\n\nconst styles = StyleSheet.create({\n border: {\n borderStyle: 'dotted',\n borderColor: 'black',\n },\n keyComponentRoot: {\n borderWidth: 2,\n flexDirection: 'row',\n marginVertical: 5,\n backgroundColor: 'whitesmoke',\n justifyContent: 'space-around',\n },\n keyEnterVisualizer: {\n margin: 5,\n alignItems: 'center',\n minWidth: 100,\n minHeight: 30,\n },\n blackbox: { height: 30, width: 30, borderColor: 'black', borderWidth: 3 },\n});\n\ninterface IFocusableComponentState {\n hasFocus: boolean;\n}\n\nfunction FocusMoverTestComponent() {\n const [hasFocus, setHasFocus] = React.useState<boolean>(false);\n\n const labelId = React.useId();\n\n const ref = React.useRef<ViewWin32>(null);\n const onBtnPress = () => {\n if (ref.current) {\n ref.current.focus();\n }\n };\n\n return (\n <ViewWin32>\n <ViewWin32 nativeID={labelId} accessibilityLabel=\"separate label for test\" accessibilityItemType=\"Comment\" />\n <ViewWin32 style={{ flexDirection: 'row', alignItems: 'center', justifyContent: 'space-around', marginVertical: 5 }}>\n <TouchableHighlight onPress={onBtnPress}>\n <ViewWin32 accessibilityLabelledBy={labelId} style={styles.blackbox} />\n </TouchableHighlight>\n <ViewWin32\n ref={ref}\n focusable\n style={hasFocus ? { backgroundColor: '#aee8fcff' } : { backgroundColor: '#00000000' }}\n onFocus={() => setHasFocus(true)}\n onBlur={() => setHasFocus(false)}\n enableFocusRing={false}\n >\n <Text>{hasFocus ? 'Focus: Yes' : 'Focus: No'}</Text>\n </ViewWin32>\n </ViewWin32>\n </ViewWin32>\n );\n}\n\ninterface IKeyboardableComponentState {\n lastKeyDown: string;\n lastKeyUp: string;\n}\n\nconst handledNativeKeyboardEvents: IHandledKeyboardEvent[] = [\n { key: 'ArrowDown' },\n { key: 'ArrowUp' },\n { key: 'ArrowLeft' },\n { key: 'ArrowRight' },\n { key: 'Tab' },\n];\n\nclass KeyboardTestComponent extends React.Component<{}, IFocusableComponentState & IKeyboardableComponentState> {\n public constructor(props) {\n super(props);\n this.state = {\n hasFocus: false,\n lastKeyDown: null,\n lastKeyUp: null,\n };\n }\n\n public render() {\n return (\n <ViewWin32 keyDownEvents={handledNativeKeyboardEvents} keyUpEvents={handledNativeKeyboardEvents}>\n <ViewWin32\n style={this.state.hasFocus ? [styles.keyComponentRoot, styles.border] : styles.keyComponentRoot}\n focusable\n onKeyUp={this._onKeyUp}\n onKeyDown={this._onKeyDown}\n onFocus={this._onFocus}\n onBlur={this._onBlur}\n enableFocusRing={false}\n >\n <ViewWin32 style={styles.keyEnterVisualizer}>\n <Text>OnKeyDown</Text>\n <Text>----</Text>\n <Text>{this.state.lastKeyDown !== null ? this.state.lastKeyDown : ' '}</Text>\n </ViewWin32>\n <ViewWin32 style={styles.keyEnterVisualizer}>\n <Text>OnKeyUp</Text>\n <Text>----</Text>\n <Text>{this.state.lastKeyUp !== null ? this.state.lastKeyUp : ' '}</Text>\n </ViewWin32>\n </ViewWin32>\n </ViewWin32>\n );\n }\n\n private readonly _onFocus = () => {\n this.setState({\n hasFocus: true,\n });\n };\n\n private readonly _onBlur = () => {\n this.setState({\n hasFocus: false,\n });\n };\n\n private readonly _onKeyUp = (ev: IKeyboardEvent) => {\n this.setState({ lastKeyUp: ev.nativeEvent.key, lastKeyDown: null });\n };\n\n private readonly _onKeyDown = (ev: IKeyboardEvent) => {\n this.setState({ lastKeyDown: ev.nativeEvent.key, lastKeyUp: null });\n };\n}\n\ninterface IHoverComponentProps {\n color: string;\n}\nclass HoverTestComponent extends React.Component<IHoverComponentProps, IFocusableComponentState> {\n public constructor(props) {\n super(props);\n this.state = {\n hasFocus: false,\n };\n }\n\n public render() {\n return (\n <ViewWin32\n onMouseEnter={this._onMouseEnter}\n onMouseLeave={this._onMouseLeave}\n style={this.state.hasFocus ? [styles.blackbox, { backgroundColor: this.props.color }] : styles.blackbox}\n />\n );\n }\n private readonly _onMouseLeave = () => {\n this.setState({ hasFocus: false });\n };\n private readonly _onMouseEnter = () => {\n this.setState({ hasFocus: true });\n };\n}\n\nclass HoverExample extends React.Component {\n public render() {\n return (\n <ViewWin32 style={{ flexDirection: 'row', marginHorizontal: 75, justifyContent: 'space-around' }}>\n <HoverTestComponent color=\"red\" />\n <HoverTestComponent color=\"orange\" />\n <HoverTestComponent color=\"yellow\" />\n <HoverTestComponent color=\"green\" />\n <HoverTestComponent color=\"blue\" />\n <HoverTestComponent color=\"indigo\" />\n <HoverTestComponent color=\"violet\" />\n </ViewWin32>\n );\n }\n}\n\nconst ToolTipExample: React.FunctionComponent<{}> = () => {\n return (\n <ViewWin32\n style={{\n backgroundColor: 'red',\n height: 100,\n width: 100,\n }}\n tooltip=\"Example tooltip\"\n cursor=\"pointer\"\n />\n );\n};\n\ninterface ICursorTestComponentProps {\n cursor: Cursor\n}\n\nconst CursorTestComponent: React.FunctionComponent<ICursorTestComponentProps> = (props) => {\n return (\n <ViewWin32 style={{flexDirection: 'column'}}>\n <Text>{props.cursor}</Text>\n <ViewWin32 cursor={props.cursor} style={styles.blackbox} />\n </ViewWin32>\n )\n}\n\nconst CursorExample: React.FunctionComponent = () => {\n return (\n <ViewWin32 style={{ flexDirection: 'row', justifyContent: 'space-around' }}>\n <CursorTestComponent cursor='auto' />\n <CursorTestComponent cursor='default' />\n <CursorTestComponent cursor='help' />\n <CursorTestComponent cursor='nesw-resize' />\n <CursorTestComponent cursor='not-allowed' />\n <CursorTestComponent cursor='ns-resize' />\n <CursorTestComponent cursor='nwse-resize' />\n <CursorTestComponent cursor='pointer' />\n <CursorTestComponent cursor='wait' />\n <CursorTestComponent cursor='move' />\n <CursorTestComponent cursor='text' />\n <CursorTestComponent cursor='we-resize' />\n </ViewWin32>\n );\n}\nclass EnableFocusRingExample extends React.Component<{}, IFocusableComponentState> {\n public constructor(props) {\n super(props);\n this.state = {\n hasFocus: false,\n };\n }\n \n public render() {\n return (\n <ViewWin32 style={{ flexDirection: 'row', alignItems: 'center', justifyContent: 'space-around', marginVertical: 5 }}>\n <ViewWin32\n style={{\n backgroundColor: 'pink',\n height: 100,\n width: 100,\n }}\n enableFocusRing={true}\n focusable\n >\n <Text>enableFocusRing set to true</Text>\n </ViewWin32>\n <ViewWin32\n style={{\n backgroundColor: 'pink',\n height: 100,\n width: 100,\n }}\n enableFocusRing={false}\n focusable\n onFocus={this._onFocus}\n onBlur={this._onBlur}\n >\n <>\n <Text>enableFocusRing set to false</Text>\n <Text>{this.state.hasFocus ? 'Focus: Yes' : 'Focus: No'}</Text>\n </>\n </ViewWin32>\n </ViewWin32>\n );\n }\n\n private readonly _onFocus = () => {\n this.setState({\n hasFocus: true,\n });\n };\n\n private readonly _onBlur = () => {\n this.setState({\n hasFocus: false,\n });\n };\n}\n\n\nexport const title = 'ViewWin32';\nexport const displayName = 'ViewWin32 Example';\nexport const description = 'All the stock View props plus Win32 specific ones';\nexport const examples = [\n {\n title: 'focus() method example',\n description: 'Each of these black boxes moves focus to the ViewWin32 on the right',\n render(): JSX.Element {\n return (\n <ViewWin32>\n <FocusMoverTestComponent />\n <FocusMoverTestComponent />\n <FocusMoverTestComponent />\n </ViewWin32>\n );\n },\n },\n {\n title: 'KeyboardEvents example',\n description: 'Native keyboarding has been prevented',\n render(): JSX.Element {\n return <KeyboardTestComponent />;\n },\n },\n {\n title: 'Hover example',\n description: 'Hover a rainbow',\n render(): JSX.Element {\n return <HoverExample />;\n },\n },\n {\n title: 'Tooltip example',\n description: 'Displays a tooltip on hover',\n render(): JSX.Element {\n return <ToolTipExample />;\n },\n },\n {\n title: 'Cursor example',\n description: 'Each of these boxes should display a different cursor',\n render(): JSX.Element {\n return <CursorExample />;\n },\n },\n {\n title: 'EnableFocusRing example',\n description: 'Displays focus visuals that are driven by native',\n render(): JSX.Element {\n return <EnableFocusRingExample />;\n },\n },\n];\n"]}
@@ -1,119 +0,0 @@
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;