react-native-macos 0.66.4 → 0.66.5
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/Libraries/Text/TextNativeComponent.js +1 -0
- package/React/Base/RCTVersion.m +1 -1
- package/React/Views/RCTView.m +0 -13
- 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 +5 -2
- package/template/package.json +1 -1
|
@@ -27,6 +27,11 @@ import type {
|
|
|
27
27
|
LayoutEvent,
|
|
28
28
|
MouseEvent,
|
|
29
29
|
PressEvent,
|
|
30
|
+
// [TODO(macOS GH#774)
|
|
31
|
+
FocusEvent,
|
|
32
|
+
BlurEvent,
|
|
33
|
+
KeyEvent,
|
|
34
|
+
// ]TODO(macOS GH#774)
|
|
30
35
|
} from '../../Types/CoreEventTypes';
|
|
31
36
|
import type {DraggedTypesType} from '../View/DraggedType'; // TODO(macOS GH#774)
|
|
32
37
|
import View from '../View/View';
|
|
@@ -134,6 +139,40 @@ type Props = $ReadOnly<{|
|
|
|
134
139
|
*/
|
|
135
140
|
onPressOut?: ?(event: PressEvent) => mixed,
|
|
136
141
|
|
|
142
|
+
// [TODO(macOS GH#774)
|
|
143
|
+
/**
|
|
144
|
+
* Called after the element is focused.
|
|
145
|
+
*/
|
|
146
|
+
onFocus?: ?(event: FocusEvent) => mixed,
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Called after the element loses focus.
|
|
150
|
+
*/
|
|
151
|
+
onBlur?: ?(event: BlurEvent) => mixed,
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Called after a key down event is detected.
|
|
155
|
+
*/
|
|
156
|
+
onKeyDown?: ?(event: KeyEvent) => mixed,
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Called after a key up event is detected.
|
|
160
|
+
*/
|
|
161
|
+
onKeyUp?: ?(event: KeyEvent) => mixed,
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Array of keys to receive key down events for
|
|
165
|
+
* For arrow keys, add "ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown",
|
|
166
|
+
*/
|
|
167
|
+
validKeysDown?: ?Array<string>,
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Array of keys to receive key up events for
|
|
171
|
+
* For arrow keys, add "ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown",
|
|
172
|
+
*/
|
|
173
|
+
validKeysUp?: ?Array<string>,
|
|
174
|
+
// ]TODO(macOS GH#774)
|
|
175
|
+
|
|
137
176
|
/**
|
|
138
177
|
* Either view styles or a function that receives a boolean reflecting whether
|
|
139
178
|
* the component is currently pressed and returns view styles.
|
|
@@ -200,6 +239,12 @@ function Pressable(props: Props, forwardedRef): React.Node {
|
|
|
200
239
|
onPress,
|
|
201
240
|
onPressIn,
|
|
202
241
|
onPressOut,
|
|
242
|
+
// [TODO(macOS GH#774)
|
|
243
|
+
onFocus,
|
|
244
|
+
onBlur,
|
|
245
|
+
onKeyDown,
|
|
246
|
+
onKeyUp,
|
|
247
|
+
// ]TODO(macOS GH#774)
|
|
203
248
|
pressRetentionOffset,
|
|
204
249
|
style,
|
|
205
250
|
testOnly_pressed,
|
|
@@ -266,6 +311,12 @@ function Pressable(props: Props, forwardedRef): React.Node {
|
|
|
266
311
|
onPressOut(event);
|
|
267
312
|
}
|
|
268
313
|
},
|
|
314
|
+
// [TODO(macOS GH#774)
|
|
315
|
+
onFocus,
|
|
316
|
+
onBlur,
|
|
317
|
+
onKeyDown,
|
|
318
|
+
onKeyUp,
|
|
319
|
+
// ]TODO(macOS GH#774)
|
|
269
320
|
}),
|
|
270
321
|
[
|
|
271
322
|
android_disableSound,
|
|
@@ -282,6 +333,12 @@ function Pressable(props: Props, forwardedRef): React.Node {
|
|
|
282
333
|
onPress,
|
|
283
334
|
onPressIn,
|
|
284
335
|
onPressOut,
|
|
336
|
+
// [TODO(macOS GH#774)
|
|
337
|
+
onFocus,
|
|
338
|
+
onBlur,
|
|
339
|
+
onKeyDown,
|
|
340
|
+
onKeyUp,
|
|
341
|
+
// ]TODO(macOS GH#774)
|
|
285
342
|
pressRetentionOffset,
|
|
286
343
|
setPressed,
|
|
287
344
|
unstable_pressDelay,
|
|
@@ -466,21 +466,6 @@ export default class Pressability {
|
|
|
466
466
|
},
|
|
467
467
|
};
|
|
468
468
|
|
|
469
|
-
const keyEventHandlers = {
|
|
470
|
-
onKeyDown: (event: KeyEvent): void => {
|
|
471
|
-
const {onKeyDown} = this._config;
|
|
472
|
-
if (onKeyDown != null) {
|
|
473
|
-
onKeyDown(event);
|
|
474
|
-
}
|
|
475
|
-
},
|
|
476
|
-
onKeyUp: (event: KeyEvent): void => {
|
|
477
|
-
const {onKeyUp} = this._config;
|
|
478
|
-
if (onKeyUp != null) {
|
|
479
|
-
onKeyUp(event);
|
|
480
|
-
}
|
|
481
|
-
},
|
|
482
|
-
};
|
|
483
|
-
|
|
484
469
|
const responderEventHandlers = {
|
|
485
470
|
onStartShouldSetResponder: (): boolean => {
|
|
486
471
|
const {disabled} = this._config;
|
|
@@ -636,11 +621,28 @@ export default class Pressability {
|
|
|
636
621
|
},
|
|
637
622
|
};
|
|
638
623
|
|
|
624
|
+
// [TODO(macOS GH#774)
|
|
625
|
+
const keyboardEventHandlers = {
|
|
626
|
+
onKeyDown: (event: KeyEvent): void => {
|
|
627
|
+
const {onKeyDown} = this._config;
|
|
628
|
+
if (onKeyDown != null) {
|
|
629
|
+
onKeyDown(event);
|
|
630
|
+
}
|
|
631
|
+
},
|
|
632
|
+
onKeyUp: (event: KeyEvent): void => {
|
|
633
|
+
const {onKeyUp} = this._config;
|
|
634
|
+
if (onKeyUp != null) {
|
|
635
|
+
onKeyUp(event);
|
|
636
|
+
}
|
|
637
|
+
},
|
|
638
|
+
};
|
|
639
|
+
// ]TODO(macOS GH#774)
|
|
640
|
+
|
|
639
641
|
return {
|
|
640
642
|
...focusEventHandlers,
|
|
641
643
|
...responderEventHandlers,
|
|
642
644
|
...mouseEventHandlers,
|
|
643
|
-
...
|
|
645
|
+
...keyboardEventHandlers, // [TODO(macOS GH#774)]
|
|
644
646
|
};
|
|
645
647
|
}
|
|
646
648
|
|
|
@@ -42,6 +42,7 @@ export const NativeText: HostComponent<NativeTextProps> = (createReactNativeComp
|
|
|
42
42
|
onInlineViewLayout: true,
|
|
43
43
|
dataDetectorType: true,
|
|
44
44
|
android_hyphenationFrequency: true,
|
|
45
|
+
tooltip: true, // [TODO(macOS GH#774)]
|
|
45
46
|
},
|
|
46
47
|
directEventTypes: {
|
|
47
48
|
topTextLayout: {
|
package/React/Base/RCTVersion.m
CHANGED
package/React/Views/RCTView.m
CHANGED
|
@@ -1393,19 +1393,6 @@ setBorderColor() setBorderColor(Top) setBorderColor(Right) setBorderColor(Bottom
|
|
|
1393
1393
|
return ([self focusable] && [NSApp isFullKeyboardAccessEnabled]) || [super acceptsFirstResponder];
|
|
1394
1394
|
}
|
|
1395
1395
|
|
|
1396
|
-
- (BOOL)performKeyEquivalent:(NSEvent *)theEvent
|
|
1397
|
-
{
|
|
1398
|
-
if (self.onClick != nil &&
|
|
1399
|
-
[self focusable] &&
|
|
1400
|
-
[[self window] firstResponder] == self) {
|
|
1401
|
-
if ([[theEvent characters] isEqualToString:@" "] || [[theEvent characters] isEqualToString:@"\r"]) {
|
|
1402
|
-
self.onClick(nil);
|
|
1403
|
-
return YES;
|
|
1404
|
-
}
|
|
1405
|
-
}
|
|
1406
|
-
return [super performKeyEquivalent:theEvent];
|
|
1407
|
-
}
|
|
1408
|
-
|
|
1409
1396
|
- (void)updateTrackingAreas
|
|
1410
1397
|
{
|
|
1411
1398
|
if (_trackingArea) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-macos",
|
|
3
|
-
"version": "0.66.
|
|
3
|
+
"version": "0.66.5",
|
|
4
4
|
"bin": "./cli.js",
|
|
5
5
|
"description": "[Microsoft Fork] A framework for building native apps using React",
|
|
6
6
|
"license": "MIT",
|
|
@@ -164,7 +164,10 @@
|
|
|
164
164
|
"shelljs": "^0.7.8",
|
|
165
165
|
"signedsource": "^1.0.0",
|
|
166
166
|
"ws": "^6.1.4",
|
|
167
|
-
"yargs": "^15.3.1"
|
|
167
|
+
"yargs": "^15.3.1",
|
|
168
|
+
"@typescript-eslint/eslint-plugin": "4.30.0",
|
|
169
|
+
"@typescript-eslint/parser": "4.30.0",
|
|
170
|
+
"typescript": "4.4.2"
|
|
168
171
|
},
|
|
169
172
|
"detox": {
|
|
170
173
|
"test-runner": "jest",
|