react-native-external-keyboard 0.2.4 → 0.2.6
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/{FocusWrapper/FocusWrapper.h → RNCEKVFocusWrapper/RNCEKVFocusWrapper.h} +5 -5
- package/ios/Helpers/{FocusWrapper/FocusWrapper.mm → RNCEKVFocusWrapper/RNCEKVFocusWrapper.mm} +3 -3
- package/ios/Helpers/{KeyboardKeyPressHandler/KeyboardKeyPressHandler.h → RNCEKVKeyboardKeyPressHandler/RNCEKVKeyboardKeyPressHandler.h} +3 -3
- package/ios/Helpers/{KeyboardKeyPressHandler/KeyboardKeyPressHandler.mm → RNCEKVKeyboardKeyPressHandler/RNCEKVKeyboardKeyPressHandler.mm} +11 -2
- package/ios/Modules/{A11yKeyboardModule/A11yKeyboardModule.h → RNCEKVA11yKeyboardModule/RNCEKVA11yKeyboardModule.h} +3 -3
- package/ios/Modules/{A11yKeyboardModule/A11yKeyboardModule.mm → RNCEKVA11yKeyboardModule/RNCEKVA11yKeyboardModule.mm} +8 -7
- package/ios/{ExternalKeyboardView/ExternalKeyboardView.h → RNCEKVExternalKeyboardView/RNCEKVExternalKeyboardView.h} +7 -7
- package/ios/{ExternalKeyboardView/ExternalKeyboardView.mm → RNCEKVExternalKeyboardView/RNCEKVExternalKeyboardView.mm} +31 -10
- package/ios/ViewManagers/RNCEKVExternalKeyboardViewManager/RNCEKVExternalKeyboardViewManager.h +16 -0
- package/ios/ViewManagers/{ExternalKeyboardViewManager/ExternalKeyboardViewManager.mm → RNCEKVExternalKeyboardViewManager/RNCEKVExternalKeyboardViewManager.mm} +5 -5
- 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/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/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/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/nativeSpec/ExternalKeyboardViewNativeComponent.js.map +1 -1
- package/lib/typescript/nativeSpec/ExternalKeyboardViewNativeComponent.d.ts +2 -0
- package/lib/typescript/nativeSpec/ExternalKeyboardViewNativeComponent.d.ts.map +1 -1
- package/package.json +2 -1
- package/src/nativeSpec/ExternalKeyboardViewNativeComponent.ts +2 -0
- package/ios/ViewManagers/ExternalKeyboardViewManager/ExternalKeyboardViewManager.h +0 -16
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());
|
|
@@ -6,18 +6,18 @@
|
|
|
6
6
|
// Copyright © 2023 Facebook. All rights reserved.
|
|
7
7
|
//
|
|
8
8
|
|
|
9
|
-
#ifndef
|
|
10
|
-
#define
|
|
9
|
+
#ifndef RNCEKVFocusWrapper_h
|
|
10
|
+
#define RNCEKVFocusWrapper_h
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
#import <UIKit/UIKit.h>
|
|
14
14
|
#import <UIKit/UIAccessibilityContainer.h>
|
|
15
15
|
#import <React/RCTView.h>
|
|
16
16
|
|
|
17
|
-
#import "
|
|
17
|
+
#import "RNCEKVKeyboardKeyPressHandler.h"
|
|
18
18
|
|
|
19
|
-
@interface
|
|
20
|
-
|
|
19
|
+
@interface RNCEKVFocusWrapper : RCTView {
|
|
20
|
+
RNCEKVKeyboardKeyPressHandler* _keyboardKeyPressHandler;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
@property BOOL canBeFocused;
|
package/ios/Helpers/{FocusWrapper/FocusWrapper.mm → RNCEKVFocusWrapper/RNCEKVFocusWrapper.mm}
RENAMED
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
// Copyright © 2023 Facebook. All rights reserved.
|
|
7
7
|
//
|
|
8
8
|
|
|
9
|
-
#import "
|
|
9
|
+
#import "RNCEKVFocusWrapper.h"
|
|
10
10
|
|
|
11
|
-
@implementation
|
|
11
|
+
@implementation RNCEKVFocusWrapper
|
|
12
12
|
|
|
13
13
|
- (instancetype)init {
|
|
14
14
|
self = [super init];
|
|
15
15
|
if (self) {
|
|
16
|
-
_keyboardKeyPressHandler = [[
|
|
16
|
+
_keyboardKeyPressHandler = [[RNCEKVKeyboardKeyPressHandler alloc] init];
|
|
17
17
|
}
|
|
18
18
|
return self;
|
|
19
19
|
}
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
// Copyright © 2023 Facebook. All rights reserved.
|
|
7
7
|
//
|
|
8
8
|
|
|
9
|
-
#ifndef
|
|
10
|
-
#define
|
|
9
|
+
#ifndef RNCEKVKeyboardKeyPressHandler_h
|
|
10
|
+
#define RNCEKVKeyboardKeyPressHandler_h
|
|
11
11
|
|
|
12
|
-
@interface
|
|
12
|
+
@interface RNCEKVKeyboardKeyPressHandler:NSObject {
|
|
13
13
|
NSMutableDictionary* _keyPressedTimestamps;
|
|
14
14
|
}
|
|
15
15
|
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
|
|
9
9
|
#import <Foundation/Foundation.h>
|
|
10
10
|
#import "UIKit/UIResponder.h"
|
|
11
|
-
#import "
|
|
11
|
+
#import "RNCEKVKeyboardKeyPressHandler.h"
|
|
12
12
|
#import <UIKit/UIKit.h>
|
|
13
13
|
|
|
14
|
-
@implementation
|
|
14
|
+
@implementation RNCEKVKeyboardKeyPressHandler
|
|
15
15
|
|
|
16
16
|
static const float LONG_PRESS_DURATION = 0.5;
|
|
17
17
|
|
|
@@ -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,
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
// Copyright © 2023 Facebook. All rights reserved.
|
|
7
7
|
//
|
|
8
8
|
|
|
9
|
-
#ifndef
|
|
10
|
-
#define
|
|
9
|
+
#ifndef RNCEKVA11yKeyboardModule_h
|
|
10
|
+
#define RNCEKVA11yKeyboardModule_h
|
|
11
11
|
|
|
12
12
|
#import <React/RCTBridgeModule.h>
|
|
13
13
|
#import <React/RCTEventEmitter.h>
|
|
14
14
|
|
|
15
|
-
@interface
|
|
15
|
+
@interface RNCEKVA11yKeyboardModule : RCTEventEmitter <RCTBridgeModule>
|
|
16
16
|
|
|
17
17
|
@end
|
|
18
18
|
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
#import <UIKit/UIKit.h>
|
|
13
13
|
|
|
14
14
|
#import <React/RCTUIManager.h>
|
|
15
|
-
#import "
|
|
16
|
-
#import "
|
|
15
|
+
#import "RNCEKVA11yKeyboardModule.h"
|
|
16
|
+
#import "RNCEKVExternalKeyboardView.h"
|
|
17
17
|
#import <React/RCTUIManager.h>
|
|
18
18
|
|
|
19
19
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
@@ -22,7 +22,7 @@ using namespace facebook::react;
|
|
|
22
22
|
|
|
23
23
|
#endif
|
|
24
24
|
|
|
25
|
-
@implementation
|
|
25
|
+
@implementation RNCEKVA11yKeyboardModule
|
|
26
26
|
|
|
27
27
|
- (NSArray<NSString *> *)supportedEvents
|
|
28
28
|
{
|
|
@@ -34,6 +34,7 @@ using namespace facebook::react;
|
|
|
34
34
|
return self;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
|
|
37
38
|
+ (BOOL)requiresMainQueueSetup
|
|
38
39
|
{
|
|
39
40
|
return YES;
|
|
@@ -49,8 +50,8 @@ RCT_EXPORT_METHOD(
|
|
|
49
50
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
50
51
|
UIView *field = [self.bridge.uiManager viewForReactTag:itemId];
|
|
51
52
|
UIView *nextFocusElement = [self.bridge.uiManager viewForReactTag:nextElementId];
|
|
52
|
-
if(field != nil && nextFocusElement != nil && [field isKindOfClass: [
|
|
53
|
-
|
|
53
|
+
if(field != nil && nextFocusElement != nil && [field isKindOfClass: [RNCEKVExternalKeyboardView class]]) {
|
|
54
|
+
RNCEKVExternalKeyboardView *v = (RNCEKVExternalKeyboardView *)field;
|
|
54
55
|
v.myPreferredFocusedView = nextFocusElement;
|
|
55
56
|
[v setNeedsFocusUpdate];
|
|
56
57
|
[v updateFocusIfNeeded];
|
|
@@ -65,8 +66,8 @@ RCT_EXPORT_METHOD(
|
|
|
65
66
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
66
67
|
UIView *field = [self.bridge.uiManager viewForReactTag:itemId];
|
|
67
68
|
UIView *nextFocusElement = [self.bridge.uiManager viewForReactTag:nextElementId];
|
|
68
|
-
if(field != nil && nextFocusElement != nil && [field isKindOfClass: [
|
|
69
|
-
|
|
69
|
+
if(field != nil && nextFocusElement != nil && [field isKindOfClass: [RNCEKVExternalKeyboardView class]]) {
|
|
70
|
+
RNCEKVExternalKeyboardView *v = (RNCEKVExternalKeyboardView *)field;
|
|
70
71
|
v.myPreferredFocusedView = nextFocusElement;
|
|
71
72
|
[v setNeedsFocusUpdate];
|
|
72
73
|
[v updateFocusIfNeeded];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
#ifndef
|
|
2
|
-
#define
|
|
1
|
+
#ifndef RNCEKVExternalKeyboardViewNativeComponent_h
|
|
2
|
+
#define RNCEKVExternalKeyboardViewNativeComponent_h
|
|
3
3
|
|
|
4
|
-
#import "
|
|
4
|
+
#import "RNCEKVKeyboardKeyPressHandler.h"
|
|
5
5
|
#import <UIKit/UIKit.h>
|
|
6
6
|
|
|
7
7
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
|
|
11
11
|
NS_ASSUME_NONNULL_BEGIN
|
|
12
12
|
|
|
13
|
-
@interface
|
|
14
|
-
|
|
13
|
+
@interface RNCEKVExternalKeyboardView : RCTViewComponentView{
|
|
14
|
+
RNCEKVKeyboardKeyPressHandler* _keyboardKeyPressHandler;
|
|
15
15
|
}
|
|
16
16
|
@property BOOL canBeFocused;
|
|
17
17
|
@property UIView* myPreferredFocusedView;
|
|
@@ -24,8 +24,8 @@ NS_ASSUME_NONNULL_END
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
#import <React/RCTView.h>
|
|
27
|
-
@interface
|
|
28
|
-
|
|
27
|
+
@interface RNCEKVExternalKeyboardView : RCTView {
|
|
28
|
+
RNCEKVKeyboardKeyPressHandler* _keyboardKeyPressHandler;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
@property BOOL canBeFocused;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
#import "
|
|
1
|
+
#import "RNCEKVExternalKeyboardView.h"
|
|
2
2
|
#import <UIKit/UIKit.h>
|
|
3
3
|
#import <React/RCTViewManager.h>
|
|
4
4
|
#import <React/RCTLog.h>
|
|
5
|
-
#import "
|
|
5
|
+
#import "RNCEKVKeyboardKeyPressHandler.h"
|
|
6
6
|
|
|
7
7
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
8
8
|
|
|
9
|
-
#
|
|
9
|
+
#include <string>
|
|
10
|
+
#import "RNCEKVFocusWrapper.h"
|
|
10
11
|
#import <react/renderer/components/RNExternalKeyboardViewSpec/ComponentDescriptors.h>
|
|
11
12
|
#import <react/renderer/components/RNExternalKeyboardViewSpec/EventEmitters.h>
|
|
12
13
|
#import <react/renderer/components/RNExternalKeyboardViewSpec/Props.h>
|
|
@@ -14,14 +15,27 @@
|
|
|
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
|
-
@interface
|
|
33
|
+
@interface RNCEKVExternalKeyboardView () <RCTExternalKeyboardViewViewProtocol>
|
|
20
34
|
|
|
21
35
|
@end
|
|
22
36
|
|
|
23
|
-
@implementation
|
|
24
|
-
|
|
37
|
+
@implementation RNCEKVExternalKeyboardView {
|
|
38
|
+
RNCEKVFocusWrapper * _view;
|
|
25
39
|
}
|
|
26
40
|
|
|
27
41
|
+ (ComponentDescriptorProvider)componentDescriptorProvider
|
|
@@ -36,7 +50,7 @@ using namespace facebook::react;
|
|
|
36
50
|
static const auto defaultProps = std::make_shared<const ExternalKeyboardViewProps>();
|
|
37
51
|
_props = defaultProps;
|
|
38
52
|
|
|
39
|
-
_view = [[
|
|
53
|
+
_view = [[RNCEKVFocusWrapper alloc] init];
|
|
40
54
|
_view.onFocusChange = [self](NSDictionary* dictionary) {
|
|
41
55
|
if (_eventEmitter) {
|
|
42
56
|
auto viewEventEmitter = std::static_pointer_cast<ExternalKeyboardViewEventEmitter const>(_eventEmitter);
|
|
@@ -50,9 +64,13 @@ using namespace facebook::react;
|
|
|
50
64
|
_view.onKeyDownPress = [self](NSDictionary* dictionary) {
|
|
51
65
|
if (_eventEmitter) {
|
|
52
66
|
auto viewEventEmitter = std::static_pointer_cast<ExternalKeyboardViewEventEmitter const>(_eventEmitter);
|
|
67
|
+
|
|
68
|
+
std::string unicodeChar = convertNSStringToStdString([dictionary valueForKey:@"unicodeChar"]);
|
|
53
69
|
facebook::react::ExternalKeyboardViewEventEmitter::OnKeyDownPress data = {
|
|
54
70
|
.keyCode = [[dictionary valueForKey:@"keyCode"] intValue],
|
|
55
71
|
.isLongPress = [[dictionary valueForKey:@"isLongPress"] boolValue],
|
|
72
|
+
.unicode = [[dictionary valueForKey:@"unicode"] intValue],
|
|
73
|
+
.unicodeChar = unicodeChar,
|
|
56
74
|
.isAltPressed = [[dictionary valueForKey:@"isAltPressed"] boolValue],
|
|
57
75
|
.isShiftPressed = [[dictionary valueForKey:@"isShiftPressed"] boolValue],
|
|
58
76
|
.isCtrlPressed = [[dictionary valueForKey:@"isCtrlPressed"] boolValue],
|
|
@@ -67,8 +85,11 @@ using namespace facebook::react;
|
|
|
67
85
|
_view.onKeyUpPress = [self](NSDictionary* dictionary) {
|
|
68
86
|
if (_eventEmitter) {
|
|
69
87
|
auto viewEventEmitter = std::static_pointer_cast<ExternalKeyboardViewEventEmitter const>(_eventEmitter);
|
|
88
|
+
std::string unicodeChar = convertNSStringToStdString([dictionary valueForKey:@"unicodeChar"]);
|
|
70
89
|
facebook::react::ExternalKeyboardViewEventEmitter::OnKeyUpPress data = {
|
|
71
90
|
.keyCode = [[dictionary valueForKey:@"keyCode"] intValue],
|
|
91
|
+
.unicode = [[dictionary valueForKey:@"unicode"] intValue],
|
|
92
|
+
.unicodeChar = unicodeChar,
|
|
72
93
|
.isLongPress = [[dictionary valueForKey:@"isLongPress"] boolValue],
|
|
73
94
|
.isAltPressed = [[dictionary valueForKey:@"isAltPressed"] boolValue],
|
|
74
95
|
.isShiftPressed = [[dictionary valueForKey:@"isShiftPressed"] boolValue],
|
|
@@ -115,18 +136,18 @@ using namespace facebook::react;
|
|
|
115
136
|
|
|
116
137
|
Class<RCTComponentViewProtocol> ExternalKeyboardViewCls(void)
|
|
117
138
|
{
|
|
118
|
-
return
|
|
139
|
+
return RNCEKVExternalKeyboardView.class;
|
|
119
140
|
}
|
|
120
141
|
|
|
121
142
|
@end
|
|
122
143
|
#else
|
|
123
144
|
|
|
124
|
-
@implementation
|
|
145
|
+
@implementation RNCEKVExternalKeyboardView
|
|
125
146
|
|
|
126
147
|
- (instancetype)initWithFrame:(CGRect)frame
|
|
127
148
|
{
|
|
128
149
|
if (self = [super initWithFrame:frame]) {
|
|
129
|
-
_keyboardKeyPressHandler = [[
|
|
150
|
+
_keyboardKeyPressHandler = [[RNCEKVKeyboardKeyPressHandler alloc] init];
|
|
130
151
|
}
|
|
131
152
|
|
|
132
153
|
return self;
|
package/ios/ViewManagers/RNCEKVExternalKeyboardViewManager/RNCEKVExternalKeyboardViewManager.h
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//
|
|
2
|
+
// RNCEKVExternalKeyboardViewManager.h
|
|
3
|
+
// RNCEKVExternalKeyboard
|
|
4
|
+
//
|
|
5
|
+
// Created by Artur Kalach on 17.07.2023.
|
|
6
|
+
// Copyright © 2023 Facebook. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#ifndef RNCEKVExternalKeyboardViewManager_h
|
|
10
|
+
#define RNCEKVExternalKeyboardViewManager_h
|
|
11
|
+
|
|
12
|
+
#import <React/RCTViewManager.h>
|
|
13
|
+
@interface RNCEKVExternalKeyboardViewManager : RCTViewManager
|
|
14
|
+
@end
|
|
15
|
+
|
|
16
|
+
#endif /* RNCEKVExternalKeyboardViewManager_h */
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
#import <React/RCTViewManager.h>
|
|
2
2
|
#import <React/RCTUIManager.h>
|
|
3
|
-
#import "
|
|
4
|
-
#import "
|
|
3
|
+
#import "RNCEKVExternalKeyboardViewManager.h"
|
|
4
|
+
#import "RNCEKVExternalKeyboardView.h"
|
|
5
5
|
#import "RCTBridge.h"
|
|
6
6
|
#import "Utils.h"
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
@implementation
|
|
9
|
+
@implementation RNCEKVExternalKeyboardViewManager
|
|
10
10
|
|
|
11
11
|
RCT_EXPORT_MODULE(ExternalKeyboardView)
|
|
12
12
|
|
|
13
13
|
- (UIView *)view
|
|
14
14
|
{
|
|
15
|
-
return [[
|
|
15
|
+
return [[RNCEKVExternalKeyboardView alloc] init];
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
RCT_EXPORT_VIEW_PROPERTY(onFocusChange, RCTBubblingEventBlock)
|
|
@@ -20,7 +20,7 @@ RCT_EXPORT_VIEW_PROPERTY(onKeyUpPress, RCTBubblingEventBlock)
|
|
|
20
20
|
RCT_EXPORT_VIEW_PROPERTY(onKeyDownPress, RCTBubblingEventBlock)
|
|
21
21
|
RCT_EXPORT_VIEW_PROPERTY(myPreferredFocusedView, UIView)
|
|
22
22
|
|
|
23
|
-
RCT_CUSTOM_VIEW_PROPERTY(canBeFocused, BOOL,
|
|
23
|
+
RCT_CUSTOM_VIEW_PROPERTY(canBeFocused, BOOL, RNCEKVExternalKeyboardView)
|
|
24
24
|
{
|
|
25
25
|
BOOL value = json ? [RCTConvert BOOL:json] : YES;
|
|
26
26
|
[view setCanBeFocused: value];
|
|
@@ -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":"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"}
|
|
@@ -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"}
|