react-native-external-keyboard 0.2.4 → 0.2.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/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} +2 -2
- package/ios/Modules/{A11yKeyboardModule/A11yKeyboardModule.h → RNCEKVA11yKeyboardModule/RNCEKVA11yKeyboardModule.h} +3 -3
- package/ios/Modules/{A11yKeyboardModule/A11yKeyboardModule.mm → RNCEKVA11yKeyboardModule/RNCEKVA11yKeyboardModule.mm} +7 -7
- package/ios/{ExternalKeyboardView/ExternalKeyboardView.h → RNCEKVExternalKeyboardView/RNCEKVExternalKeyboardView.h} +7 -7
- package/ios/{ExternalKeyboardView/ExternalKeyboardView.mm → RNCEKVExternalKeyboardView/RNCEKVExternalKeyboardView.mm} +10 -10
- package/ios/ViewManagers/RNCEKVExternalKeyboardViewManager/RNCEKVExternalKeyboardViewManager.h +16 -0
- package/ios/ViewManagers/{ExternalKeyboardViewManager/ExternalKeyboardViewManager.mm → RNCEKVExternalKeyboardViewManager/RNCEKVExternalKeyboardViewManager.mm} +5 -5
- package/package.json +1 -1
- package/ios/ViewManagers/ExternalKeyboardViewManager/ExternalKeyboardViewManager.h +0 -16
|
@@ -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
|
|
|
@@ -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
|
{
|
|
@@ -49,8 +49,8 @@ RCT_EXPORT_METHOD(
|
|
|
49
49
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
50
50
|
UIView *field = [self.bridge.uiManager viewForReactTag:itemId];
|
|
51
51
|
UIView *nextFocusElement = [self.bridge.uiManager viewForReactTag:nextElementId];
|
|
52
|
-
if(field != nil && nextFocusElement != nil && [field isKindOfClass: [
|
|
53
|
-
|
|
52
|
+
if(field != nil && nextFocusElement != nil && [field isKindOfClass: [RNCEKVExternalKeyboardView class]]) {
|
|
53
|
+
RNCEKVExternalKeyboardView *v = (RNCEKVExternalKeyboardView *)field;
|
|
54
54
|
v.myPreferredFocusedView = nextFocusElement;
|
|
55
55
|
[v setNeedsFocusUpdate];
|
|
56
56
|
[v updateFocusIfNeeded];
|
|
@@ -65,8 +65,8 @@ RCT_EXPORT_METHOD(
|
|
|
65
65
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
66
66
|
UIView *field = [self.bridge.uiManager viewForReactTag:itemId];
|
|
67
67
|
UIView *nextFocusElement = [self.bridge.uiManager viewForReactTag:nextElementId];
|
|
68
|
-
if(field != nil && nextFocusElement != nil && [field isKindOfClass: [
|
|
69
|
-
|
|
68
|
+
if(field != nil && nextFocusElement != nil && [field isKindOfClass: [RNCEKVExternalKeyboardView class]]) {
|
|
69
|
+
RNCEKVExternalKeyboardView *v = (RNCEKVExternalKeyboardView *)field;
|
|
70
70
|
v.myPreferredFocusedView = nextFocusElement;
|
|
71
71
|
[v setNeedsFocusUpdate];
|
|
72
72
|
[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,12 @@
|
|
|
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
|
-
#import "
|
|
9
|
+
#import "RNCEKVFocusWrapper.h"
|
|
10
10
|
#import <react/renderer/components/RNExternalKeyboardViewSpec/ComponentDescriptors.h>
|
|
11
11
|
#import <react/renderer/components/RNExternalKeyboardViewSpec/EventEmitters.h>
|
|
12
12
|
#import <react/renderer/components/RNExternalKeyboardViewSpec/Props.h>
|
|
@@ -16,12 +16,12 @@
|
|
|
16
16
|
|
|
17
17
|
using namespace facebook::react;
|
|
18
18
|
|
|
19
|
-
@interface
|
|
19
|
+
@interface RNCEKVExternalKeyboardView () <RCTExternalKeyboardViewViewProtocol>
|
|
20
20
|
|
|
21
21
|
@end
|
|
22
22
|
|
|
23
|
-
@implementation
|
|
24
|
-
|
|
23
|
+
@implementation RNCEKVExternalKeyboardView {
|
|
24
|
+
RNCEKVFocusWrapper * _view;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
+ (ComponentDescriptorProvider)componentDescriptorProvider
|
|
@@ -36,7 +36,7 @@ using namespace facebook::react;
|
|
|
36
36
|
static const auto defaultProps = std::make_shared<const ExternalKeyboardViewProps>();
|
|
37
37
|
_props = defaultProps;
|
|
38
38
|
|
|
39
|
-
_view = [[
|
|
39
|
+
_view = [[RNCEKVFocusWrapper alloc] init];
|
|
40
40
|
_view.onFocusChange = [self](NSDictionary* dictionary) {
|
|
41
41
|
if (_eventEmitter) {
|
|
42
42
|
auto viewEventEmitter = std::static_pointer_cast<ExternalKeyboardViewEventEmitter const>(_eventEmitter);
|
|
@@ -115,18 +115,18 @@ using namespace facebook::react;
|
|
|
115
115
|
|
|
116
116
|
Class<RCTComponentViewProtocol> ExternalKeyboardViewCls(void)
|
|
117
117
|
{
|
|
118
|
-
return
|
|
118
|
+
return RNCEKVExternalKeyboardView.class;
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
@end
|
|
122
122
|
#else
|
|
123
123
|
|
|
124
|
-
@implementation
|
|
124
|
+
@implementation RNCEKVExternalKeyboardView
|
|
125
125
|
|
|
126
126
|
- (instancetype)initWithFrame:(CGRect)frame
|
|
127
127
|
{
|
|
128
128
|
if (self = [super initWithFrame:frame]) {
|
|
129
|
-
_keyboardKeyPressHandler = [[
|
|
129
|
+
_keyboardKeyPressHandler = [[RNCEKVKeyboardKeyPressHandler alloc] init];
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
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];
|
package/package.json
CHANGED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// ExternalKeyboardViewManager.h
|
|
3
|
-
// ExternalKeyboard
|
|
4
|
-
//
|
|
5
|
-
// Created by Artur Kalach on 17.07.2023.
|
|
6
|
-
// Copyright © 2023 Facebook. All rights reserved.
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
#ifndef ExternalKeyboardViewManager_h
|
|
10
|
-
#define ExternalKeyboardViewManager_h
|
|
11
|
-
|
|
12
|
-
#import <React/RCTViewManager.h>
|
|
13
|
-
@interface ExternalKeyboardViewManager : RCTViewManager
|
|
14
|
-
@end
|
|
15
|
-
|
|
16
|
-
#endif /* ExternalKeyboardViewManager_h */
|