react-native-macos 0.64.24 → 0.64.25
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/Libraries/Components/Pressable/Pressable.js +57 -0
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Pressability/Pressability.js +18 -16
- package/React/Base/RCTVersion.m +1 -1
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
- package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
- package/package.json +1 -1
- package/template/package.json +1 -1
|
@@ -29,6 +29,11 @@ import type {
|
|
|
29
29
|
LayoutEvent,
|
|
30
30
|
MouseEvent,
|
|
31
31
|
PressEvent,
|
|
32
|
+
// [TODO(macOS GH#774)
|
|
33
|
+
FocusEvent,
|
|
34
|
+
BlurEvent,
|
|
35
|
+
KeyEvent,
|
|
36
|
+
// ]TODO(macOS GH#774)
|
|
32
37
|
} from '../../Types/CoreEventTypes';
|
|
33
38
|
import type {DraggedTypesType} from '../View/DraggedType'; // TODO(macOS GH#774)
|
|
34
39
|
import View from '../View/View';
|
|
@@ -130,6 +135,40 @@ type Props = $ReadOnly<{|
|
|
|
130
135
|
*/
|
|
131
136
|
onPressOut?: ?(event: PressEvent) => void,
|
|
132
137
|
|
|
138
|
+
// [TODO(macOS GH#774)
|
|
139
|
+
/**
|
|
140
|
+
* Called after the element is focused.
|
|
141
|
+
*/
|
|
142
|
+
onFocus?: ?(event: FocusEvent) => mixed,
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Called after the element loses focus.
|
|
146
|
+
*/
|
|
147
|
+
onBlur?: ?(event: BlurEvent) => mixed,
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Called after a key down event is detected.
|
|
151
|
+
*/
|
|
152
|
+
onKeyDown?: ?(event: KeyEvent) => mixed,
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Called after a key up event is detected.
|
|
156
|
+
*/
|
|
157
|
+
onKeyUp?: ?(event: KeyEvent) => mixed,
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Array of keys to receive key down events for
|
|
161
|
+
* For arrow keys, add "ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown",
|
|
162
|
+
*/
|
|
163
|
+
validKeysDown?: ?Array<string>,
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Array of keys to receive key up events for
|
|
167
|
+
* For arrow keys, add "ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown",
|
|
168
|
+
*/
|
|
169
|
+
validKeysUp?: ?Array<string>,
|
|
170
|
+
// ]TODO(macOS GH#774)
|
|
171
|
+
|
|
133
172
|
/**
|
|
134
173
|
* Either view styles or a function that receives a boolean reflecting whether
|
|
135
174
|
* the component is currently pressed and returns view styles.
|
|
@@ -197,6 +236,12 @@ function Pressable(props: Props, forwardedRef): React.Node {
|
|
|
197
236
|
onPress,
|
|
198
237
|
onPressIn,
|
|
199
238
|
onPressOut,
|
|
239
|
+
// [TODO(macOS GH#774)
|
|
240
|
+
onFocus,
|
|
241
|
+
onBlur,
|
|
242
|
+
onKeyDown,
|
|
243
|
+
onKeyUp,
|
|
244
|
+
// ]TODO(macOS GH#774)
|
|
200
245
|
pressRetentionOffset,
|
|
201
246
|
style,
|
|
202
247
|
testOnly_pressed,
|
|
@@ -256,6 +301,12 @@ function Pressable(props: Props, forwardedRef): React.Node {
|
|
|
256
301
|
onPressOut(event);
|
|
257
302
|
}
|
|
258
303
|
},
|
|
304
|
+
// [TODO(macOS GH#774)
|
|
305
|
+
onFocus,
|
|
306
|
+
onBlur,
|
|
307
|
+
onKeyDown,
|
|
308
|
+
onKeyUp,
|
|
309
|
+
// ]TODO(macOS GH#774)
|
|
259
310
|
}),
|
|
260
311
|
[
|
|
261
312
|
android_disableSound,
|
|
@@ -271,6 +322,12 @@ function Pressable(props: Props, forwardedRef): React.Node {
|
|
|
271
322
|
onPress,
|
|
272
323
|
onPressIn,
|
|
273
324
|
onPressOut,
|
|
325
|
+
// [TODO(macOS GH#774)
|
|
326
|
+
onFocus,
|
|
327
|
+
onBlur,
|
|
328
|
+
onKeyDown,
|
|
329
|
+
onKeyUp,
|
|
330
|
+
// ]TODO(macOS GH#774)
|
|
274
331
|
pressRetentionOffset,
|
|
275
332
|
setPressed,
|
|
276
333
|
unstable_pressDelay,
|
|
@@ -475,21 +475,6 @@ export default class Pressability {
|
|
|
475
475
|
},
|
|
476
476
|
};
|
|
477
477
|
|
|
478
|
-
const keyEventHandlers = {
|
|
479
|
-
onKeyDown: (event: KeyEvent): void => {
|
|
480
|
-
const {onKeyDown} = this._config;
|
|
481
|
-
if (onKeyDown != null) {
|
|
482
|
-
onKeyDown(event);
|
|
483
|
-
}
|
|
484
|
-
},
|
|
485
|
-
onKeyUp: (event: KeyEvent): void => {
|
|
486
|
-
const {onKeyUp} = this._config;
|
|
487
|
-
if (onKeyUp != null) {
|
|
488
|
-
onKeyUp(event);
|
|
489
|
-
}
|
|
490
|
-
},
|
|
491
|
-
};
|
|
492
|
-
|
|
493
478
|
const responderEventHandlers = {
|
|
494
479
|
onStartShouldSetResponder: (): boolean => {
|
|
495
480
|
const {disabled} = this._config;
|
|
@@ -644,11 +629,28 @@ export default class Pressability {
|
|
|
644
629
|
},
|
|
645
630
|
};
|
|
646
631
|
|
|
632
|
+
// [TODO(macOS GH#774)
|
|
633
|
+
const keyboardEventHandlers = {
|
|
634
|
+
onKeyDown: (event: KeyEvent): void => {
|
|
635
|
+
const {onKeyDown} = this._config;
|
|
636
|
+
if (onKeyDown != null) {
|
|
637
|
+
onKeyDown(event);
|
|
638
|
+
}
|
|
639
|
+
},
|
|
640
|
+
onKeyUp: (event: KeyEvent): void => {
|
|
641
|
+
const {onKeyUp} = this._config;
|
|
642
|
+
if (onKeyUp != null) {
|
|
643
|
+
onKeyUp(event);
|
|
644
|
+
}
|
|
645
|
+
},
|
|
646
|
+
};
|
|
647
|
+
// ]TODO(macOS GH#774)
|
|
648
|
+
|
|
647
649
|
return {
|
|
648
650
|
...focusEventHandlers,
|
|
649
651
|
...responderEventHandlers,
|
|
650
652
|
...mouseEventHandlers,
|
|
651
|
-
...
|
|
653
|
+
...keyboardEventHandlers, // [TODO(macOS GH#774)]
|
|
652
654
|
};
|
|
653
655
|
}
|
|
654
656
|
|
package/React/Base/RCTVersion.m
CHANGED
package/package.json
CHANGED