react-native-external-keyboard 0.2.5 → 0.2.7
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/README.md +2 -0
- package/android/src/main/java/com/externalkeyboard/events/KeyPressDownEvent.java +3 -0
- package/android/src/main/java/com/externalkeyboard/events/KeyPressUpEvent.java +3 -0
- package/ios/Helpers/RNCEKVKeyboardKeyPressHandler/RNCEKVKeyboardKeyPressHandler.mm +9 -0
- package/ios/Modules/RNCEKVA11yKeyboardModule/RNCEKVA11yKeyboardModule.mm +1 -0
- package/ios/RNCEKVExternalKeyboardView/RNCEKVExternalKeyboardView.h +6 -1
- package/ios/RNCEKVExternalKeyboardView/RNCEKVExternalKeyboardView.mm +100 -64
- package/lib/commonjs/NativeModules/A11yKeyboardModule/A11yKeyboardModule.js +2 -4
- package/lib/commonjs/NativeModules/A11yKeyboardModule/A11yKeyboardModule.js.map +1 -1
- package/lib/commonjs/components/KeyboardFocusView/KeyboardFocusView.android.js +11 -13
- package/lib/commonjs/components/KeyboardFocusView/KeyboardFocusView.android.js.map +1 -1
- package/lib/commonjs/components/KeyboardFocusView/KeyboardFocusView.ios.js +13 -15
- package/lib/commonjs/components/KeyboardFocusView/KeyboardFocusView.ios.js.map +1 -1
- package/lib/commonjs/components/KeyboardFocusView/KeyboardFocusView.js +9 -0
- package/lib/commonjs/components/KeyboardFocusView/KeyboardFocusView.js.map +1 -0
- package/lib/commonjs/components/KeyboardFocusView/hooks/useFocusStyle/useFocusStyle.js +1 -1
- package/lib/commonjs/components/KeyboardFocusView/hooks/useFocusStyle/useFocusStyle.js.map +1 -1
- package/lib/commonjs/components/Pressable/Pressable.android.js +26 -28
- package/lib/commonjs/components/Pressable/Pressable.android.js.map +1 -1
- package/lib/commonjs/components/Pressable/Pressable.ios.js +7 -8
- package/lib/commonjs/components/Pressable/Pressable.ios.js.map +1 -1
- package/lib/commonjs/components/Pressable/Pressable.js +9 -0
- package/lib/commonjs/components/Pressable/Pressable.js.map +1 -0
- package/lib/commonjs/nativeSpec/ExternalKeyboardViewNativeComponent.js +1 -2
- package/lib/commonjs/nativeSpec/ExternalKeyboardViewNativeComponent.js.map +1 -1
- package/lib/commonjs/nativeSpec/NativeKeyboardModule.js +1 -2
- package/lib/commonjs/nativeSpec/NativeKeyboardModule.js.map +1 -1
- package/lib/commonjs/services/A11yModule/A11yModule.android.js +1 -2
- package/lib/commonjs/services/A11yModule/A11yModule.android.js.map +1 -1
- package/lib/commonjs/services/A11yModule/A11yModule.ios.js +1 -2
- package/lib/commonjs/services/A11yModule/A11yModule.ios.js.map +1 -1
- package/lib/module/NativeModules/A11yKeyboardModule/A11yKeyboardModule.js +1 -2
- package/lib/module/NativeModules/A11yKeyboardModule/A11yKeyboardModule.js.map +1 -1
- package/lib/module/components/KeyboardFocusView/KeyboardFocusView.android.js +11 -12
- package/lib/module/components/KeyboardFocusView/KeyboardFocusView.android.js.map +1 -1
- package/lib/module/components/KeyboardFocusView/KeyboardFocusView.ios.js +11 -12
- package/lib/module/components/KeyboardFocusView/KeyboardFocusView.ios.js.map +1 -1
- package/lib/module/components/KeyboardFocusView/KeyboardFocusView.js +3 -0
- package/lib/module/components/KeyboardFocusView/KeyboardFocusView.js.map +1 -0
- package/lib/module/components/KeyboardFocusView/hooks/useFocusStyle/useFocusStyle.js +1 -1
- package/lib/module/components/KeyboardFocusView/hooks/useFocusStyle/useFocusStyle.js.map +1 -1
- package/lib/module/components/Pressable/Pressable.android.js +18 -19
- package/lib/module/components/Pressable/Pressable.android.js.map +1 -1
- package/lib/module/components/Pressable/Pressable.ios.js +4 -4
- package/lib/module/components/Pressable/Pressable.ios.js.map +1 -1
- package/lib/module/components/Pressable/Pressable.js +3 -0
- package/lib/module/components/Pressable/Pressable.js.map +1 -0
- package/lib/module/nativeSpec/ExternalKeyboardViewNativeComponent.js.map +1 -1
- package/lib/typescript/components/KeyboardFocusView/KeyboardFocusView.d.ts +14 -0
- package/lib/typescript/components/KeyboardFocusView/KeyboardFocusView.d.ts.map +1 -0
- package/lib/typescript/components/Pressable/Pressable.d.ts +14 -0
- package/lib/typescript/components/Pressable/Pressable.d.ts.map +1 -0
- package/lib/typescript/nativeSpec/ExternalKeyboardViewNativeComponent.d.ts +2 -0
- package/lib/typescript/nativeSpec/ExternalKeyboardViewNativeComponent.d.ts.map +1 -1
- package/package.json +4 -3
- package/src/components/KeyboardFocusView/KeyboardFocusView.tsx +8 -0
- package/src/components/Pressable/Pressable.tsx +7 -0
- package/src/nativeSpec/ExternalKeyboardViewNativeComponent.ts +2 -0
- package/ios/ExternalKeyboard.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -4
- package/ios/ExternalKeyboard.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- package/ios/ExternalKeyboard.xcodeproj/project.xcworkspace/xcuserdata/Artur_Kalach.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/ExternalKeyboard.xcodeproj/xcuserdata/Artur_Kalach.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +0 -24
- package/ios/ExternalKeyboard.xcodeproj/xcuserdata/Artur_Kalach.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
- package/lib/commonjs/components/KeyboardFocusView/KeyboardFocusView.d.js +0 -6
- package/lib/commonjs/components/KeyboardFocusView/KeyboardFocusView.d.js.map +0 -1
- package/lib/commonjs/components/Pressable/Pressable.d.js +0 -6
- package/lib/commonjs/components/Pressable/Pressable.d.js.map +0 -1
- package/lib/module/components/KeyboardFocusView/KeyboardFocusView.d.js +0 -2
- package/lib/module/components/KeyboardFocusView/KeyboardFocusView.d.js.map +0 -1
- package/lib/module/components/Pressable/Pressable.d.js +0 -2
- package/lib/module/components/Pressable/Pressable.d.js.map +0 -1
- package/src/components/KeyboardFocusView/KeyboardFocusView.d.ts +0 -7
- package/src/components/Pressable/Pressable.d.ts +0 -7
package/README.md
CHANGED
|
@@ -14,8 +14,11 @@ public class KeyPressDownEvent extends Event<KeyPressDownEvent> {
|
|
|
14
14
|
public KeyPressDownEvent(int id, int keyCode, KeyEvent keyEvent) {
|
|
15
15
|
super(id);
|
|
16
16
|
|
|
17
|
+
int unicode = keyEvent.getUnicodeChar();
|
|
17
18
|
WritableMap eventPayload = Arguments.createMap();
|
|
18
19
|
eventPayload.putInt("keyCode", keyCode);
|
|
20
|
+
eventPayload.putInt("unicode", unicode);
|
|
21
|
+
eventPayload.putString("unicodeChar", String.valueOf((char)unicode));
|
|
19
22
|
eventPayload.putBoolean("isLongPress", keyEvent.isLongPress());
|
|
20
23
|
eventPayload.putBoolean("isAltPressed", keyEvent.isAltPressed());
|
|
21
24
|
eventPayload.putBoolean("isShiftPressed", keyEvent.isShiftPressed());
|
|
@@ -14,8 +14,11 @@ public class KeyPressUpEvent extends Event<KeyPressUpEvent> {
|
|
|
14
14
|
public KeyPressUpEvent(int id, int keyCode, KeyEvent keyEvent, boolean isLongPress) {
|
|
15
15
|
super(id);
|
|
16
16
|
|
|
17
|
+
int unicode = keyEvent.getUnicodeChar();
|
|
17
18
|
WritableMap eventPayload = Arguments.createMap();
|
|
18
19
|
eventPayload.putInt("keyCode", keyCode);
|
|
20
|
+
eventPayload.putInt("unicode", unicode);
|
|
21
|
+
eventPayload.putString("unicodeChar", String.valueOf((char)unicode));
|
|
19
22
|
eventPayload.putBoolean("isLongPress", isLongPress);
|
|
20
23
|
eventPayload.putBoolean("isAltPressed", keyEvent.isAltPressed());
|
|
21
24
|
eventPayload.putBoolean("isShiftPressed", keyEvent.isShiftPressed());
|
|
@@ -26,7 +26,14 @@ static const float LONG_PRESS_DURATION = 0.5;
|
|
|
26
26
|
-(NSDictionary*) getKeyPressEventInfo:(NSSet<UIPress *> *)presses
|
|
27
27
|
withEvent:(UIPressesEvent *)event {
|
|
28
28
|
UIKey *key = presses.allObjects[0].key;
|
|
29
|
+
|
|
29
30
|
NSNumber *keyCode = @(key.keyCode);
|
|
31
|
+
unichar unicode = 0;
|
|
32
|
+
NSString *unicodeChar = @"";
|
|
33
|
+
if ([key.characters length] != 0) {
|
|
34
|
+
unicode = [key.characters characterAtIndex:0];
|
|
35
|
+
unicodeChar = [[NSString alloc] initWithCharacters:&unicode length:1];
|
|
36
|
+
}
|
|
30
37
|
NSNumber *isAltPressed = @((key.modifierFlags & UIKeyModifierAlternate) > 0);
|
|
31
38
|
NSNumber *isShiftPressed = @((key.modifierFlags & UIKeyModifierShift) > 0);
|
|
32
39
|
NSNumber *isCtrlPressed = @((key.modifierFlags & UIKeyModifierControl) > 0);
|
|
@@ -36,6 +43,8 @@ static const float LONG_PRESS_DURATION = 0.5;
|
|
|
36
43
|
return @{
|
|
37
44
|
@"keyCode": keyCode,
|
|
38
45
|
@"isLongPress": @NO,
|
|
46
|
+
@"unicode": @(unicode),
|
|
47
|
+
@"unicodeChar": unicodeChar,
|
|
39
48
|
@"isAltPressed": isAltPressed,
|
|
40
49
|
@"isShiftPressed": isShiftPressed,
|
|
41
50
|
@"isCtrlPressed": isCtrlPressed,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
#ifndef RNCEKVExternalKeyboardViewNativeComponent_h
|
|
2
2
|
#define RNCEKVExternalKeyboardViewNativeComponent_h
|
|
3
|
-
|
|
4
3
|
#import "RNCEKVKeyboardKeyPressHandler.h"
|
|
5
4
|
#import <UIKit/UIKit.h>
|
|
6
5
|
|
|
@@ -15,6 +14,12 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
15
14
|
}
|
|
16
15
|
@property BOOL canBeFocused;
|
|
17
16
|
@property UIView* myPreferredFocusedView;
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
- (void)onFocusChange:(BOOL)isFocused;
|
|
20
|
+
- (void)onKeyDownPress:(NSDictionary*)dictionary;
|
|
21
|
+
- (void)onKeyUpPress:(NSDictionary*)dictionary;
|
|
22
|
+
|
|
18
23
|
@end
|
|
19
24
|
|
|
20
25
|
NS_ASSUME_NONNULL_END
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
8
8
|
|
|
9
|
+
#include <string>
|
|
9
10
|
#import "RNCEKVFocusWrapper.h"
|
|
10
11
|
#import <react/renderer/components/RNExternalKeyboardViewSpec/ComponentDescriptors.h>
|
|
11
12
|
#import <react/renderer/components/RNExternalKeyboardViewSpec/EventEmitters.h>
|
|
@@ -14,103 +15,138 @@
|
|
|
14
15
|
|
|
15
16
|
#import "RCTFabricComponentsPlugins.h"
|
|
16
17
|
|
|
18
|
+
std::string convertNSStringToStdString(NSString * _Nullable nsString) {
|
|
19
|
+
if (nsString == nil) {
|
|
20
|
+
return "";
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const char *utf8String = [nsString UTF8String];
|
|
24
|
+
if (utf8String != NULL) {
|
|
25
|
+
return std::string(utf8String);
|
|
26
|
+
} else {
|
|
27
|
+
return "";
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
17
31
|
using namespace facebook::react;
|
|
18
32
|
|
|
19
33
|
@interface RNCEKVExternalKeyboardView () <RCTExternalKeyboardViewViewProtocol>
|
|
20
34
|
|
|
21
35
|
@end
|
|
22
36
|
|
|
23
|
-
@implementation RNCEKVExternalKeyboardView
|
|
24
|
-
RNCEKVFocusWrapper * _view;
|
|
25
|
-
}
|
|
37
|
+
@implementation RNCEKVExternalKeyboardView
|
|
26
38
|
|
|
27
39
|
+ (ComponentDescriptorProvider)componentDescriptorProvider
|
|
28
40
|
{
|
|
29
41
|
return concreteComponentDescriptorProvider<ExternalKeyboardViewComponentDescriptor>();
|
|
30
42
|
}
|
|
31
43
|
|
|
44
|
+
- (NSArray<id<UIFocusEnvironment>> *)preferredFocusEnvironments {
|
|
45
|
+
if (self.myPreferredFocusedView == nil) {
|
|
46
|
+
return @[];
|
|
47
|
+
}
|
|
48
|
+
return @[self.myPreferredFocusedView];
|
|
49
|
+
}
|
|
50
|
+
- (BOOL)canBecomeFocused {
|
|
51
|
+
return self.canBeFocused;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
- (void)onFocusChange:(BOOL) isFocused {
|
|
56
|
+
if (_eventEmitter) {
|
|
57
|
+
auto viewEventEmitter = std::static_pointer_cast<ExternalKeyboardViewEventEmitter const>(_eventEmitter);
|
|
58
|
+
facebook::react::ExternalKeyboardViewEventEmitter::OnFocusChange data = {
|
|
59
|
+
.isFocused = isFocused,
|
|
60
|
+
};
|
|
61
|
+
viewEventEmitter->onFocusChange(data);
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
- (void)onKeyDownPress:(NSDictionary*) dictionary {
|
|
66
|
+
if (_eventEmitter) {
|
|
67
|
+
auto viewEventEmitter = std::static_pointer_cast<ExternalKeyboardViewEventEmitter const>(_eventEmitter);
|
|
68
|
+
facebook::react::ExternalKeyboardViewEventEmitter::OnKeyDownPress data = {
|
|
69
|
+
.keyCode = [[dictionary valueForKey:@"keyCode"] intValue],
|
|
70
|
+
.isLongPress = [[dictionary valueForKey:@"isLongPress"] boolValue],
|
|
71
|
+
.isAltPressed = [[dictionary valueForKey:@"isAltPressed"] boolValue],
|
|
72
|
+
.isShiftPressed = [[dictionary valueForKey:@"isShiftPressed"] boolValue],
|
|
73
|
+
.isCtrlPressed = [[dictionary valueForKey:@"isCtrlPressed"] boolValue],
|
|
74
|
+
.isCapsLockOn = [[dictionary valueForKey:@"isCapsLockOn"] boolValue],
|
|
75
|
+
.hasNoModifiers = [[dictionary valueForKey:@"hasNoModifiers"] boolValue],
|
|
76
|
+
};
|
|
77
|
+
viewEventEmitter->onKeyDownPress(data);
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
- (void)onKeyUpPress:(NSDictionary*) dictionary {
|
|
83
|
+
if (_eventEmitter) {
|
|
84
|
+
auto viewEventEmitter = std::static_pointer_cast<ExternalKeyboardViewEventEmitter const>(_eventEmitter);
|
|
85
|
+
facebook::react::ExternalKeyboardViewEventEmitter::OnKeyUpPress data = {
|
|
86
|
+
.keyCode = [[dictionary valueForKey:@"keyCode"] intValue],
|
|
87
|
+
.isLongPress = [[dictionary valueForKey:@"isLongPress"] boolValue],
|
|
88
|
+
.isAltPressed = [[dictionary valueForKey:@"isAltPressed"] boolValue],
|
|
89
|
+
.isShiftPressed = [[dictionary valueForKey:@"isShiftPressed"] boolValue],
|
|
90
|
+
.isCtrlPressed = [[dictionary valueForKey:@"isCtrlPressed"] boolValue],
|
|
91
|
+
.isCapsLockOn = [[dictionary valueForKey:@"isCapsLockOn"] boolValue],
|
|
92
|
+
.hasNoModifiers = [[dictionary valueForKey:@"hasNoModifiers"] boolValue],
|
|
93
|
+
};
|
|
94
|
+
viewEventEmitter->onKeyUpPress(data);
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
- (void)didUpdateFocusInContext:(UIFocusUpdateContext *)context
|
|
100
|
+
withAnimationCoordinator:(UIFocusAnimationCoordinator *)coordinator {
|
|
101
|
+
|
|
102
|
+
if(context.nextFocusedView == self) {
|
|
103
|
+
[self onFocusChange: YES];
|
|
104
|
+
} else if (context.previouslyFocusedView == self) {
|
|
105
|
+
[self onFocusChange: NO];
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
|
|
32
110
|
- (instancetype)initWithFrame:(CGRect)frame
|
|
33
111
|
{
|
|
34
112
|
|
|
35
113
|
if (self = [super initWithFrame:frame]) {
|
|
36
114
|
static const auto defaultProps = std::make_shared<const ExternalKeyboardViewProps>();
|
|
37
115
|
_props = defaultProps;
|
|
38
|
-
|
|
39
|
-
_view = [[RNCEKVFocusWrapper alloc] init];
|
|
40
|
-
_view.onFocusChange = [self](NSDictionary* dictionary) {
|
|
41
|
-
if (_eventEmitter) {
|
|
42
|
-
auto viewEventEmitter = std::static_pointer_cast<ExternalKeyboardViewEventEmitter const>(_eventEmitter);
|
|
43
|
-
facebook::react::ExternalKeyboardViewEventEmitter::OnFocusChange data = {
|
|
44
|
-
.isFocused = [[dictionary valueForKey:@"isFocused"] boolValue],
|
|
45
|
-
};
|
|
46
|
-
viewEventEmitter->onFocusChange(data);
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
_view.onKeyDownPress = [self](NSDictionary* dictionary) {
|
|
51
|
-
if (_eventEmitter) {
|
|
52
|
-
auto viewEventEmitter = std::static_pointer_cast<ExternalKeyboardViewEventEmitter const>(_eventEmitter);
|
|
53
|
-
facebook::react::ExternalKeyboardViewEventEmitter::OnKeyDownPress data = {
|
|
54
|
-
.keyCode = [[dictionary valueForKey:@"keyCode"] intValue],
|
|
55
|
-
.isLongPress = [[dictionary valueForKey:@"isLongPress"] boolValue],
|
|
56
|
-
.isAltPressed = [[dictionary valueForKey:@"isAltPressed"] boolValue],
|
|
57
|
-
.isShiftPressed = [[dictionary valueForKey:@"isShiftPressed"] boolValue],
|
|
58
|
-
.isCtrlPressed = [[dictionary valueForKey:@"isCtrlPressed"] boolValue],
|
|
59
|
-
.isCapsLockOn = [[dictionary valueForKey:@"isCapsLockOn"] boolValue],
|
|
60
|
-
.hasNoModifiers = [[dictionary valueForKey:@"hasNoModifiers"] boolValue],
|
|
61
|
-
};
|
|
62
|
-
viewEventEmitter->onKeyDownPress(data);
|
|
63
|
-
};
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
_view.onKeyUpPress = [self](NSDictionary* dictionary) {
|
|
68
|
-
if (_eventEmitter) {
|
|
69
|
-
auto viewEventEmitter = std::static_pointer_cast<ExternalKeyboardViewEventEmitter const>(_eventEmitter);
|
|
70
|
-
facebook::react::ExternalKeyboardViewEventEmitter::OnKeyUpPress data = {
|
|
71
|
-
.keyCode = [[dictionary valueForKey:@"keyCode"] intValue],
|
|
72
|
-
.isLongPress = [[dictionary valueForKey:@"isLongPress"] boolValue],
|
|
73
|
-
.isAltPressed = [[dictionary valueForKey:@"isAltPressed"] boolValue],
|
|
74
|
-
.isShiftPressed = [[dictionary valueForKey:@"isShiftPressed"] boolValue],
|
|
75
|
-
.isCtrlPressed = [[dictionary valueForKey:@"isCtrlPressed"] boolValue],
|
|
76
|
-
.isCapsLockOn = [[dictionary valueForKey:@"isCapsLockOn"] boolValue],
|
|
77
|
-
.hasNoModifiers = [[dictionary valueForKey:@"hasNoModifiers"] boolValue],
|
|
78
|
-
};
|
|
79
|
-
viewEventEmitter->onKeyUpPress(data);
|
|
80
|
-
};
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
self.contentView = _view;
|
|
116
|
+
_keyboardKeyPressHandler = [[RNCEKVKeyboardKeyPressHandler alloc] init];
|
|
84
117
|
}
|
|
85
118
|
|
|
86
119
|
return self;
|
|
87
120
|
}
|
|
88
121
|
|
|
89
|
-
- (
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
122
|
+
- (void)pressesBegan:(NSSet<UIPress *> *)presses
|
|
123
|
+
withEvent:(UIPressesEvent *)event {
|
|
124
|
+
NSDictionary *eventInfo = [_keyboardKeyPressHandler actionDownHandler:presses withEvent:event];
|
|
125
|
+
[self onKeyDownPress: eventInfo];
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
- (void)pressesEnded:(NSSet<UIPress *> *)presses
|
|
129
|
+
withEvent:(UIPressesEvent *)event {
|
|
130
|
+
NSDictionary *eventInfo = [_keyboardKeyPressHandler actionUpHandler:presses withEvent:event];
|
|
131
|
+
[self onKeyUpPress: eventInfo];
|
|
94
132
|
}
|
|
95
133
|
|
|
96
134
|
- (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &)oldProps
|
|
97
135
|
{
|
|
98
136
|
const auto &oldViewProps = *std::static_pointer_cast<ExternalKeyboardViewProps const>(_props);
|
|
99
137
|
const auto &newViewProps = *std::static_pointer_cast<ExternalKeyboardViewProps const>(props);
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
if(_view.focusGroupIdentifier == nil) {
|
|
103
|
-
_view.focusGroupIdentifier = [NSString stringWithFormat:@"app.group.%ld", self.tag];
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
[super updateProps:props oldProps:oldProps];
|
|
108
|
-
|
|
138
|
+
[super updateProps
|
|
139
|
+
:props oldProps:oldProps];
|
|
109
140
|
|
|
110
141
|
if(oldViewProps.canBeFocused != newViewProps.canBeFocused) {
|
|
111
|
-
[
|
|
142
|
+
[self setCanBeFocused: newViewProps.canBeFocused];
|
|
112
143
|
}
|
|
113
144
|
|
|
145
|
+
if (@available(iOS 14.0, *)) {
|
|
146
|
+
if(self.focusGroupIdentifier == nil) {
|
|
147
|
+
self.focusGroupIdentifier = [NSString stringWithFormat:@"app.group.%ld", self.tag];
|
|
148
|
+
}
|
|
149
|
+
}
|
|
114
150
|
}
|
|
115
151
|
|
|
116
152
|
Class<RCTComponentViewProtocol> ExternalKeyboardViewCls(void)
|
|
@@ -18,16 +18,14 @@ const RCA11y = A11yModule || new Proxy({}, {
|
|
|
18
18
|
throw new Error(LINKING_ERROR);
|
|
19
19
|
}
|
|
20
20
|
});
|
|
21
|
-
const setKeyboardFocus =
|
|
22
|
-
let _nextTag = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
21
|
+
const setKeyboardFocus = (nativeTag, _nextTag = 0) => {
|
|
23
22
|
RCA11y.setKeyboardFocus(nativeTag, _nextTag);
|
|
24
23
|
};
|
|
25
24
|
const setPreferredKeyboardFocus = (nativeTag, nextTag) => {
|
|
26
25
|
RCA11y.setAccessibilityFocus(nativeTag, nextTag);
|
|
27
26
|
};
|
|
28
|
-
const A11yKeyboardModule = {
|
|
27
|
+
const A11yKeyboardModule = exports.A11yKeyboardModule = {
|
|
29
28
|
setKeyboardFocus,
|
|
30
29
|
setPreferredKeyboardFocus
|
|
31
30
|
};
|
|
32
|
-
exports.A11yKeyboardModule = A11yKeyboardModule;
|
|
33
31
|
//# sourceMappingURL=A11yKeyboardModule.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","LINKING_ERROR","Platform","select","ios","default","isTurboModuleEnabled","global","__turboModuleProxy","A11yModule","NativeModules","A11yKeyboardModule","RCA11y","Proxy","get","Error","setKeyboardFocus","nativeTag","_nextTag","
|
|
1
|
+
{"version":3,"names":["_reactNative","require","LINKING_ERROR","Platform","select","ios","default","isTurboModuleEnabled","global","__turboModuleProxy","A11yModule","NativeModules","A11yKeyboardModule","RCA11y","Proxy","get","Error","setKeyboardFocus","nativeTag","_nextTag","setPreferredKeyboardFocus","nextTag","setAccessibilityFocus","exports"],"sourceRoot":"../../../../src","sources":["NativeModules/A11yKeyboardModule/A11yKeyboardModule.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,MAAMC,aAAa,GAChB,0FAAyFC,qBAAQ,CAACC,MAAM,CACvG;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CACvD,CAAE,sDAAqD,GACtD,+BAA8B;;AAEjC;AACA,MAAMC,oBAAoB,GAAGC,MAAM,CAACC,kBAAkB,IAAI,IAAI;AAE9D,MAAMC,UAAU,GAAGH,oBAAoB,GACnCN,OAAO,CAAC,uCAAuC,CAAC,CAACK,OAAO,GACxDK,0BAAa,CAACC,kBAAkB;AAEpC,MAAMC,MAAM,GACVH,UAAU,IACV,IAAII,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACd,aAAa,CAAC;EAChC;AACF,CACF,CAAC;AAEH,MAAMe,gBAAgB,GAAGA,CAACC,SAAiB,EAAEC,QAAQ,GAAG,CAAC,KAAK;EAC5DN,MAAM,CAACI,gBAAgB,CAACC,SAAS,EAAEC,QAAQ,CAAC;AAC9C,CAAC;AAED,MAAMC,yBAAyB,GAAGA,CAACF,SAAiB,EAAEG,OAAe,KAAK;EACxER,MAAM,CAACS,qBAAqB,CAACJ,SAAS,EAAEG,OAAO,CAAC;AAClD,CAAC;AAEM,MAAMT,kBAAkB,GAAAW,OAAA,CAAAX,kBAAA,GAAG;EAChCK,gBAAgB;EAChBG;AACF,CAAC"}
|
|
@@ -10,18 +10,17 @@ var _useFocusStyle = require("./hooks/useFocusStyle");
|
|
|
10
10
|
var _nativeSpec = require("../../nativeSpec");
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
12
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
13
|
-
const KeyboardFocusView = /*#__PURE__*/_react.default.forwardRef((
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
} = _ref;
|
|
13
|
+
const KeyboardFocusView = exports.KeyboardFocusView = /*#__PURE__*/_react.default.forwardRef(({
|
|
14
|
+
canBeFocused = true,
|
|
15
|
+
onFocusChange,
|
|
16
|
+
focusStyle,
|
|
17
|
+
children,
|
|
18
|
+
style,
|
|
19
|
+
withView = true,
|
|
20
|
+
onKeyUpPress,
|
|
21
|
+
onKeyDownPress,
|
|
22
|
+
...props
|
|
23
|
+
}, ref) => {
|
|
25
24
|
const {
|
|
26
25
|
fStyle,
|
|
27
26
|
onFocusChangeHandler
|
|
@@ -37,5 +36,4 @@ const KeyboardFocusView = /*#__PURE__*/_react.default.forwardRef((_ref, ref) =>
|
|
|
37
36
|
accessible: true
|
|
38
37
|
}, children) : children);
|
|
39
38
|
});
|
|
40
|
-
exports.KeyboardFocusView = KeyboardFocusView;
|
|
41
39
|
//# sourceMappingURL=KeyboardFocusView.android.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_useFocusStyle","_nativeSpec","obj","__esModule","default","_extends","Object","assign","bind","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","KeyboardFocusView","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_useFocusStyle","_nativeSpec","obj","__esModule","default","_extends","Object","assign","bind","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","KeyboardFocusView","exports","React","forwardRef","canBeFocused","onFocusChange","focusStyle","children","style","withView","onKeyUpPress","onKeyDownPress","props","ref","fStyle","onFocusChangeHandler","useFocusStyle","createElement","ExternalKeyboardView","View","accessible"],"sourceRoot":"../../../../src","sources":["components/KeyboardFocusView/KeyboardFocusView.android.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,cAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAAwD,SAAAD,uBAAAK,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,SAAA,IAAAA,QAAA,GAAAC,MAAA,CAAAC,MAAA,GAAAD,MAAA,CAAAC,MAAA,CAAAC,IAAA,eAAAC,MAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAF,CAAA,UAAAG,MAAA,GAAAF,SAAA,CAAAD,CAAA,YAAAI,GAAA,IAAAD,MAAA,QAAAP,MAAA,CAAAS,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAJ,MAAA,EAAAC,GAAA,KAAAL,MAAA,CAAAK,GAAA,IAAAD,MAAA,CAAAC,GAAA,gBAAAL,MAAA,YAAAJ,QAAA,CAAAa,KAAA,OAAAP,SAAA;AAGjD,MAAMQ,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,gBAAGE,cAAK,CAACC,UAAU,CAC/C,CACE;EACEC,YAAY,GAAG,IAAI;EACnBC,aAAa;EACbC,UAAU;EACVC,QAAQ;EACRC,KAAK;EACLC,QAAQ,GAAG,IAAI;EACfC,YAAY;EACZC,cAAc;EACd,GAAGC;AACL,CAAC,EACDC,GAAG,KACA;EACH,MAAM;IAAEC,MAAM;IAAEC;EAAqB,CAAC,GAAG,IAAAC,4BAAa,EACpDV,UAAU,EACVD,aACF,CAAC;EAED,oBACE5B,MAAA,CAAAQ,OAAA,CAAAgC,aAAA,CAACnC,WAAA,CAAAoC,oBAAoB,EAAAhC,QAAA;IACnBmB,aAAa,EAAEU,oBAAqB;IACpCP,KAAK,EAAE,CAACA,KAAK,EAAEM,MAAM,CAAE;IACvBV,YAAY,EAAEA,YAAa;IAC3BS,GAAG,EAAEA,GAAI;IACTH,YAAY,EAAEA,YAAa;IAC3BC,cAAc,EAAEA;EAAe,GAC3BC,KAAK,GAERH,QAAQ,gBAAGhC,MAAA,CAAAQ,OAAA,CAAAgC,aAAA,CAACrC,YAAA,CAAAuC,IAAI;IAACC,UAAU;EAAA,GAAEb,QAAe,CAAC,GAAGA,QAC7B,CAAC;AAE3B,CACF,CAAC"}
|
|
@@ -8,26 +8,25 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
8
8
|
var _nativeSpec = require("../../nativeSpec");
|
|
9
9
|
var _services = require("../../services");
|
|
10
10
|
var _hooks = require("./hooks");
|
|
11
|
-
function _getRequireWildcardCache(
|
|
12
|
-
function _interopRequireWildcard(
|
|
11
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
12
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
13
13
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
14
|
-
const KeyboardFocusView = /*#__PURE__*/_react.default.forwardRef((
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
} = _ref;
|
|
14
|
+
const KeyboardFocusView = exports.KeyboardFocusView = /*#__PURE__*/_react.default.forwardRef(({
|
|
15
|
+
onFocusChange,
|
|
16
|
+
style,
|
|
17
|
+
focusStyle,
|
|
18
|
+
canBeFocused = true,
|
|
19
|
+
onKeyUpPress,
|
|
20
|
+
onKeyDownPress,
|
|
21
|
+
...props
|
|
22
|
+
}, ref) => {
|
|
24
23
|
const setCurrentFocusTag = (0, _react.useCallback)(e => {
|
|
25
24
|
var _e$nativeEvent;
|
|
26
|
-
_services.A11yModule.currentFocusedTag = (e === null || e === void 0
|
|
25
|
+
_services.A11yModule.currentFocusedTag = (e === null || e === void 0 || (_e$nativeEvent = e.nativeEvent) === null || _e$nativeEvent === void 0 ? void 0 : _e$nativeEvent.target) || undefined;
|
|
27
26
|
}, []);
|
|
28
27
|
const onFocus = (0, _react.useCallback)(e => {
|
|
29
28
|
setCurrentFocusTag(e);
|
|
30
|
-
onFocusChange === null || onFocusChange === void 0
|
|
29
|
+
onFocusChange === null || onFocusChange === void 0 || onFocusChange(e);
|
|
31
30
|
}, [onFocusChange, setCurrentFocusTag]);
|
|
32
31
|
const {
|
|
33
32
|
fStyle,
|
|
@@ -42,5 +41,4 @@ const KeyboardFocusView = /*#__PURE__*/_react.default.forwardRef((_ref, ref) =>
|
|
|
42
41
|
onFocusChange: onFocusChangeHandler
|
|
43
42
|
}, props));
|
|
44
43
|
});
|
|
45
|
-
exports.KeyboardFocusView = KeyboardFocusView;
|
|
46
44
|
//# sourceMappingURL=KeyboardFocusView.ios.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_nativeSpec","_services","_hooks","_getRequireWildcardCache","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_nativeSpec","_services","_hooks","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","_extends","assign","bind","target","arguments","length","source","key","apply","KeyboardFocusView","exports","React","forwardRef","onFocusChange","style","focusStyle","canBeFocused","onKeyUpPress","onKeyDownPress","props","ref","setCurrentFocusTag","useCallback","_e$nativeEvent","A11yModule","currentFocusedTag","nativeEvent","undefined","onFocus","fStyle","onFocusChangeHandler","useFocusStyle","createElement","ExternalKeyboardView"],"sourceRoot":"../../../../src","sources":["components/KeyboardFocusView/KeyboardFocusView.ios.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAD,OAAA;AAEA,IAAAE,SAAA,GAAAF,OAAA;AAEA,IAAAG,MAAA,GAAAH,OAAA;AAAwC,SAAAI,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAN,wBAAAM,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yB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
+
});
|
|
6
|
+
exports.KeyboardFocusView = void 0;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
const KeyboardFocusView = exports.KeyboardFocusView = _reactNative.View;
|
|
9
|
+
//# sourceMappingURL=KeyboardFocusView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","KeyboardFocusView","exports","View"],"sourceRoot":"../../../../src","sources":["components/KeyboardFocusView/KeyboardFocusView.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAIO,MAAMC,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAC5BE,iBAEC"}
|
|
@@ -10,7 +10,7 @@ const useFocusStyle = (focusStyle, onFocusChange) => {
|
|
|
10
10
|
const [focused, setFocusStatus] = (0, _react.useState)(false);
|
|
11
11
|
const onFocusChangeHandler = event => {
|
|
12
12
|
setFocusStatus(event.nativeEvent.isFocused);
|
|
13
|
-
onFocusChange === null || onFocusChange === void 0
|
|
13
|
+
onFocusChange === null || onFocusChange === void 0 || onFocusChange(event);
|
|
14
14
|
};
|
|
15
15
|
const fStyle = (0, _react.useMemo)(() => {
|
|
16
16
|
if (!focusStyle) return focused ? styles.defaultHighlight : undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactNative","useFocusStyle","focusStyle","onFocusChange","focused","setFocusStatus","useState","onFocusChangeHandler","event","nativeEvent","isFocused","fStyle","useMemo","styles","defaultHighlight","undefined","specificStyle","exports","StyleSheet","create","backgroundColor"],"sourceRoot":"../../../../../../src","sources":["components/KeyboardFocusView/hooks/useFocusStyle/useFocusStyle.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAGO,MAAME,aAAa,GAAGA,CAC3BC,UAAuB,EACvBC,aAA+B,KAC5B;EACH,MAAM,CAACC,OAAO,EAAEC,cAAc,CAAC,GAAG,IAAAC,eAAQ,EAAC,KAAK,CAAC;EAEjD,MAAMC,oBAAqC,GAAIC,KAAK,IAAK;IACvDH,cAAc,CAACG,KAAK,CAACC,WAAW,CAACC,SAAS,CAAC;IAC3CP,aAAa,aAAbA,aAAa,
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","useFocusStyle","focusStyle","onFocusChange","focused","setFocusStatus","useState","onFocusChangeHandler","event","nativeEvent","isFocused","fStyle","useMemo","styles","defaultHighlight","undefined","specificStyle","exports","StyleSheet","create","backgroundColor"],"sourceRoot":"../../../../../../src","sources":["components/KeyboardFocusView/hooks/useFocusStyle/useFocusStyle.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAGO,MAAME,aAAa,GAAGA,CAC3BC,UAAuB,EACvBC,aAA+B,KAC5B;EACH,MAAM,CAACC,OAAO,EAAEC,cAAc,CAAC,GAAG,IAAAC,eAAQ,EAAC,KAAK,CAAC;EAEjD,MAAMC,oBAAqC,GAAIC,KAAK,IAAK;IACvDH,cAAc,CAACG,KAAK,CAACC,WAAW,CAACC,SAAS,CAAC;IAC3CP,aAAa,aAAbA,aAAa,eAAbA,aAAa,CAAGK,KAAK,CAAC;EACxB,CAAC;EAED,MAAMG,MAAM,GAAG,IAAAC,cAAO,EAAC,MAAM;IAC3B,IAAI,CAACV,UAAU,EAAE,OAAOE,OAAO,GAAGS,MAAM,CAACC,gBAAgB,GAAGC,SAAS;IACrE,MAAMC,aAAa,GACjB,OAAOd,UAAU,KAAK,UAAU,GAAGA,UAAU,CAAC;MAAEE;IAAQ,CAAC,CAAC,GAAGF,UAAU;IACzE,OAAOE,OAAO,GAAGY,aAAa,GAAGD,SAAS;EAC5C,CAAC,EAAE,CAACX,OAAO,EAAEF,UAAU,CAAC,CAAC;EAEzB,OAAO;IACLK,oBAAoB;IACpBI;EACF,CAAC;AACH,CAAC;AAACM,OAAA,CAAAhB,aAAA,GAAAA,aAAA;AAEF,MAAMY,MAAM,GAAGK,uBAAU,CAACC,MAAM,CAAC;EAC/BL,gBAAgB,EAAE;IAAEM,eAAe,EAAE;EAAU;AACjD,CAAC,CAAC"}
|
|
@@ -9,28 +9,27 @@ var _reactNative = require("react-native");
|
|
|
9
9
|
var _KeyboardFocusView = require("../KeyboardFocusView");
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
11
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } /**
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the MIT license found in the
|
|
15
|
+
* LICENSE file in the root directory of this source tree.
|
|
16
|
+
*
|
|
17
|
+
*
|
|
18
|
+
* @format
|
|
19
|
+
*/
|
|
20
20
|
const ANDROID_SPACE_KEY_CODE = 62;
|
|
21
|
-
const Pressable = /*#__PURE__*/_react.default.forwardRef((
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
} = _ref;
|
|
21
|
+
const Pressable = exports.Pressable = /*#__PURE__*/_react.default.forwardRef(({
|
|
22
|
+
canBeFocused,
|
|
23
|
+
focusStyle,
|
|
24
|
+
style,
|
|
25
|
+
onFocusChange,
|
|
26
|
+
onPress,
|
|
27
|
+
onLongPress,
|
|
28
|
+
onKeyDownPress,
|
|
29
|
+
onPressOut,
|
|
30
|
+
onPressIn,
|
|
31
|
+
...props
|
|
32
|
+
}, ref) => {
|
|
34
33
|
const onKeyUpPressHandler = _react.default.useCallback(e => {
|
|
35
34
|
const {
|
|
36
35
|
nativeEvent: {
|
|
@@ -39,17 +38,17 @@ const Pressable = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
39
38
|
}
|
|
40
39
|
} = e;
|
|
41
40
|
if (keyCode === ANDROID_SPACE_KEY_CODE) {
|
|
42
|
-
onPressOut === null || onPressOut === void 0
|
|
41
|
+
onPressOut === null || onPressOut === void 0 || onPressOut(e);
|
|
43
42
|
if (isLongPress) {
|
|
44
|
-
onLongPress === null || onLongPress === void 0
|
|
43
|
+
onLongPress === null || onLongPress === void 0 || onLongPress(e);
|
|
45
44
|
} else {
|
|
46
|
-
onPress === null || onPress === void 0
|
|
45
|
+
onPress === null || onPress === void 0 || onPress(e);
|
|
47
46
|
}
|
|
48
47
|
}
|
|
49
48
|
}, [onLongPress, onPress, onPressOut]);
|
|
50
49
|
const onPressablePressHandler = event => {
|
|
51
50
|
if (event.nativeEvent.identifier !== undefined) {
|
|
52
|
-
onPress === null || onPress === void 0
|
|
51
|
+
onPress === null || onPress === void 0 || onPress(event);
|
|
53
52
|
}
|
|
54
53
|
};
|
|
55
54
|
const onKeyDownHandler = _react.default.useCallback(e => {
|
|
@@ -59,8 +58,8 @@ const Pressable = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
59
58
|
}
|
|
60
59
|
} = e;
|
|
61
60
|
if (keyCode === ANDROID_SPACE_KEY_CODE) {
|
|
62
|
-
onKeyDownPress === null || onKeyDownPress === void 0
|
|
63
|
-
onPressIn === null || onPressIn === void 0
|
|
61
|
+
onKeyDownPress === null || onKeyDownPress === void 0 || onKeyDownPress(e);
|
|
62
|
+
onPressIn === null || onPressIn === void 0 || onPressIn(e);
|
|
64
63
|
}
|
|
65
64
|
}, [onKeyDownPress, onPressIn]);
|
|
66
65
|
return /*#__PURE__*/_react.default.createElement(_KeyboardFocusView.KeyboardFocusView, {
|
|
@@ -79,5 +78,4 @@ const Pressable = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
79
78
|
onLongPress: onLongPress
|
|
80
79
|
}, props)));
|
|
81
80
|
});
|
|
82
|
-
exports.Pressable = Pressable;
|
|
83
81
|
//# sourceMappingURL=Pressable.android.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_KeyboardFocusView","obj","__esModule","default","_extends","Object","assign","bind","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","ANDROID_SPACE_KEY_CODE","Pressable","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_KeyboardFocusView","obj","__esModule","default","_extends","Object","assign","bind","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","ANDROID_SPACE_KEY_CODE","Pressable","exports","React","forwardRef","canBeFocused","focusStyle","style","onFocusChange","onPress","onLongPress","onKeyDownPress","onPressOut","onPressIn","props","ref","onKeyUpPressHandler","useCallback","e","nativeEvent","keyCode","isLongPress","onPressablePressHandler","event","identifier","undefined","onKeyDownHandler","createElement","KeyboardFocusView","withView","onKeyUpPress"],"sourceRoot":"../../../../src","sources":["components/Pressable/Pressable.android.tsx"],"mappings":";;;;;;AAUA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAOA,IAAAE,kBAAA,GAAAF,OAAA;AAAyD,SAAAD,uBAAAI,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,SAAA,IAAAA,QAAA,GAAAC,MAAA,CAAAC,MAAA,GAAAD,MAAA,CAAAC,MAAA,CAAAC,IAAA,eAAAC,MAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAF,CAAA,UAAAG,MAAA,GAAAF,SAAA,CAAAD,CAAA,YAAAI,GAAA,IAAAD,MAAA,QAAAP,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