react-native-external-keyboard 0.2.3 → 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/README.md +87 -20
- 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/lib/commonjs/components/Pressable/Pressable.android.js +9 -2
- package/lib/commonjs/components/Pressable/Pressable.android.js.map +1 -1
- package/lib/module/components/Pressable/Pressable.android.js +9 -2
- package/lib/module/components/Pressable/Pressable.android.js.map +1 -1
- package/lib/typescript/components/Pressable/Pressable.android.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/Pressable/Pressable.android.tsx +8 -2
- package/ios/ViewManagers/ExternalKeyboardViewManager/ExternalKeyboardViewManager.h +0 -16
package/README.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
### react-native-external-keyboard
|
|
3
3
|
|
|
4
4
|
React Native library for extended external keyboard support.
|
|
5
|
+
The `new` and `old` architectures are compatible!
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
| iOS | Android |
|
|
9
|
+
| ------------- | -------------- |
|
|
10
|
+
| <img src="/.github/images/ios_example.gif" height="500" />| <img src="/.github/images/android_example.gif" height="500" />|
|
|
5
11
|
|
|
6
12
|
|
|
7
13
|
|
|
@@ -26,7 +32,7 @@ cd ios && pod install && cd ..
|
|
|
26
32
|
### Pressable
|
|
27
33
|
Updated pressable component with handling long press events on a keyboard
|
|
28
34
|
```js
|
|
29
|
-
import { Pressable
|
|
35
|
+
import { Pressable } from "react-native-external-keyboard";
|
|
30
36
|
|
|
31
37
|
// ...
|
|
32
38
|
|
|
@@ -41,6 +47,18 @@ import { Pressable, } from "react-native-external-keyboard";
|
|
|
41
47
|
</Pressable>
|
|
42
48
|
```
|
|
43
49
|
|
|
50
|
+
You can pass the default ReactNative `PressableProps` and some extra:
|
|
51
|
+
|
|
52
|
+
| Props | Description | Type |
|
|
53
|
+
| ------------- | ------------- | ---- |
|
|
54
|
+
| canBeFocused?: | Boolean property whether component can be focused by keyboard | `boolean \| undefined` default `true` |
|
|
55
|
+
| onFocusChange?: | Callback for focus change handling | `(e:NativeSyntheticEvent<{ isFocused: boolean; }>) => void \| undefined` |
|
|
56
|
+
| focusStyle?: | Style for selected by keyboard component | `((state: { focused: boolean}) => StyleProp<ViewStyle> | StyleProp<ViewStyle> \| undefined` |
|
|
57
|
+
| onPress?: | Default `onPress` or `keyboard` handled `onPress` | `(e: GestureResponderEvent \| OnKeyPress) => void; \| undefined` |
|
|
58
|
+
| onLongPress?: | Default `onLongPress` or `keyboard` handled `onLongPress` | `(e: GestureResponderEvent \| OnKeyPress) => void; \| undefined`|
|
|
59
|
+
| withView?: | Android only prop, it is used for wrapping children in `<View accessible/>` | `boolean \| undefined` default `true` |
|
|
60
|
+
|
|
61
|
+
|
|
44
62
|
### KeyboardFocusView
|
|
45
63
|
The KeyboardFocusView component is core component for keyboard handling, it is used for force focusing and handling `onFocusChange` event
|
|
46
64
|
```js
|
|
@@ -55,8 +73,50 @@ import { KeyboardFocusView } from "react-native-external-keyboard";
|
|
|
55
73
|
</KeyboardFocusView>
|
|
56
74
|
```
|
|
57
75
|
|
|
58
|
-
|
|
76
|
+
You can pass the default ReactNative view props and some extra:
|
|
77
|
+
| Props | Description | Type |
|
|
78
|
+
| ------------- | ------------- | ---- |
|
|
79
|
+
| canBeFocused?: | Boolean property whether component can be focused by keyboard | `boolean \| undefined` default `true` |
|
|
80
|
+
| onFocusChange?: | Callback for focus change handling | `(e:NativeSyntheticEvent<{ isFocused: boolean; }>) => void` |
|
|
81
|
+
| onKeyUpPress?: | Callback for handling key up event | `(e: OnKeyPress) => void` |
|
|
82
|
+
| onKeyDownPress?: | Callback for handling key down event | `(e: OnKeyPress) => void`|
|
|
83
|
+
| focusStyle?: | Style for selected by keyboard component | `((state: { focused: boolean}) => StyleProp<ViewStyle> \| StyleProp<ViewStyle>` |
|
|
84
|
+
|
|
85
|
+
### ExternalKeyboardView
|
|
86
|
+
It is a bare `Native` component. It is better to use `KeyboardFocusView` if you don't need your own specific implementation.
|
|
87
|
+
|
|
88
|
+
Important: If you use `KeyboardFocusView` on Android, you need to use a children component with the `accessible` prop.
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
```js
|
|
92
|
+
import { ExternalKeyboardView } from 'react-native-external-keyboard';
|
|
93
|
+
// ...
|
|
94
|
+
<ExternalKeyboardView
|
|
95
|
+
onKeyDownPress={...}
|
|
96
|
+
onKeyUpPress={...}
|
|
97
|
+
canBeFocused
|
|
98
|
+
>
|
|
99
|
+
<View accessible>
|
|
100
|
+
<Text>Content</Text>
|
|
101
|
+
</View>
|
|
102
|
+
</ExternalKeyboardView>
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
| Props | Description | Type |
|
|
106
|
+
| ------------- | ------------- | ---- |
|
|
107
|
+
| canBeFocused?: | Boolean property whether component can be focused by keyboard | `boolean \| undefined` default `true` |
|
|
108
|
+
| onFocusChange?: | Callback for focus change handling | `(e:NativeSyntheticEvent<{ isFocused: boolean; }>) => void` |
|
|
109
|
+
| onKeyUpPress?: | Callback for handling key up event | `(e: OnKeyPress) => void` |
|
|
110
|
+
| onKeyDownPress?: | Callback for handling key down event | `(e: OnKeyPress) => void`|
|
|
111
|
+
|
|
112
|
+
### A11yModule
|
|
59
113
|
|
|
114
|
+
The `A11yModule` API is used to move the `keyboard focus` to a target component.
|
|
115
|
+
Component's `ref` is needed to move keyboard focus. On iOS keyboard focus will work properly only with `KeyboardFocusView` or `Pressable` (from library one), because iOS has specific work around for moving keyboard focus.
|
|
116
|
+
|
|
117
|
+
```js
|
|
118
|
+
A11yModule.setKeyboardFocus(ref)
|
|
119
|
+
```
|
|
60
120
|
|
|
61
121
|
```js
|
|
62
122
|
import {
|
|
@@ -75,26 +135,21 @@ import {
|
|
|
75
135
|
</KeyboardFocusView>
|
|
76
136
|
```
|
|
77
137
|
|
|
78
|
-
|
|
79
|
-
|
|
138
|
+
```ts
|
|
139
|
+
export interface IA11yModule {
|
|
140
|
+
currentFocusedTag?: number;
|
|
80
141
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
```js
|
|
85
|
-
import { ExternalKeyboardView } from 'react-native-external-keyboard';
|
|
86
|
-
// ...
|
|
87
|
-
<ExternalKeyboardView
|
|
88
|
-
onKeyDownPress={...}
|
|
89
|
-
onKeyUpPress={...}
|
|
90
|
-
canBeFocused
|
|
91
|
-
>
|
|
92
|
-
<View accessible>
|
|
93
|
-
<Text>Content</Text>
|
|
94
|
-
</View>
|
|
95
|
-
</ExternalKeyboardView>
|
|
142
|
+
setPreferredKeyboardFocus: (nativeTag: number, nextTag: number) => void;
|
|
143
|
+
setKeyboardFocus: (ref: RefObjType) => void;
|
|
144
|
+
}
|
|
96
145
|
```
|
|
97
146
|
|
|
147
|
+
| Props | Description | Type |
|
|
148
|
+
| ------------- | ------------- | ---- |
|
|
149
|
+
| currentFocusedTag?: | iOS only, it is used for the keyboard focus moving feature | `number` |
|
|
150
|
+
| setPreferredKeyboardFocus: | iOS only, you can define default focus redirect from a component to a target | `(nativeTag: number, nextTag: number) => void;` |
|
|
151
|
+
| setKeyboardFocus: | Move focus to the target by ref | `(ref: RefObjType) => void` |
|
|
152
|
+
|
|
98
153
|
# Important
|
|
99
154
|
## iOS
|
|
100
155
|
New versions of iOS have specific `commands` for `physical keyboards`. If you can't handle a `long press event` on iOS, it may be that the `space` key is bound to an `Activate` command. Clearing the `Activate` command will help with handling of the `long press` event. There is no known way to handle this (if you have any ideas, please share).
|
|
@@ -102,7 +157,19 @@ New versions of iOS have specific `commands` for `physical keyboards`. If you ca
|
|
|
102
157
|
User can change `Commands` in:
|
|
103
158
|
`Settings` -> `Accessibility` -> `Keyboards` -> `Full Keyboard Access` -> `Commands`
|
|
104
159
|
|
|
105
|
-
|
|
160
|
+
# API
|
|
161
|
+
|
|
162
|
+
```ts
|
|
163
|
+
export type OnKeyPress = NativeSyntheticEvent<{
|
|
164
|
+
keyCode: number;
|
|
165
|
+
isLongPress: boolean;
|
|
166
|
+
isAltPressed: boolean;
|
|
167
|
+
isShiftPressed: boolean;
|
|
168
|
+
isCtrlPressed: boolean;
|
|
169
|
+
isCapsLockOn: boolean;
|
|
170
|
+
hasNoModifiers: boolean;
|
|
171
|
+
}>;
|
|
172
|
+
```
|
|
106
173
|
|
|
107
174
|
## License
|
|
108
175
|
|
|
@@ -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];
|
|
@@ -53,8 +53,15 @@ const Pressable = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
55
|
const onKeyDownHandler = _react.default.useCallback(e => {
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
const {
|
|
57
|
+
nativeEvent: {
|
|
58
|
+
keyCode
|
|
59
|
+
}
|
|
60
|
+
} = e;
|
|
61
|
+
if (keyCode === ANDROID_SPACE_KEY_CODE) {
|
|
62
|
+
onKeyDownPress === null || onKeyDownPress === void 0 ? void 0 : onKeyDownPress(e);
|
|
63
|
+
onPressIn === null || onPressIn === void 0 ? void 0 : onPressIn(e);
|
|
64
|
+
}
|
|
58
65
|
}, [onKeyDownPress, onPressIn]);
|
|
59
66
|
return /*#__PURE__*/_react.default.createElement(_KeyboardFocusView.KeyboardFocusView, {
|
|
60
67
|
style: style,
|
|
@@ -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","React","forwardRef","_ref","ref","canBeFocused","focusStyle","style","onFocusChange","onPress","onLongPress","onKeyDownPress","onPressOut","onPressIn","props","onKeyUpPressHandler","useCallback","e","nativeEvent","keyCode","isLongPress","onPressablePressHandler","event","identifier","undefined","onKeyDownHandler","createElement","KeyboardFocusView","withView","onKeyUpPress","exports"],"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,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,KAlBzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAYA,MAAMQ,sBAAsB,GAAG,EAAE;AAE1B,MAAMC,SAAS,gBAAGC,cAAK,CAACC,UAAU,CAIvC,CAAAC,IAAA,EAaEC,GAAG,KACA;EAAA,IAbH;IACEC,YAAY;IACZC,UAAU;IACVC,KAAK;IACLC,aAAa;IACbC,OAAO;IACPC,WAAW;IACXC,cAAc;IACdC,UAAU;IACVC,SAAS;IACT,GAAGC;EACL,CAAC,GAAAX,IAAA;EAGD,MAAMY,mBAAmB,GAAGd,cAAK,CAACe,WAAW,CAC1CC,CAAC,IAAK;IACL,MAAM;MACJC,WAAW,EAAE;QAAEC,OAAO;QAAEC;MAAY;IACtC,CAAC,GAAGH,CAAC;IAEL,IAAIE,OAAO,KAAKpB,sBAAsB,EAAE;MACtCa,UAAU,aAAVA,UAAU,uBAAVA,UAAU,CAAGK,CAAqC,CAAC;MACnD,IAAIG,WAAW,EAAE;QACfV,WAAW,aAAXA,WAAW,uBAAXA,WAAW,CAAGO,CAAC,CAAC;MAClB,CAAC,MAAM;QACLR,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAGQ,CAAC,CAAC;MACd;IACF;EACF,CAAC,EACD,CAACP,WAAW,EAAED,OAAO,EAAEG,UAAU,CACnC,CAAC;EAED,MAAMS,uBAAuB,GAAIC,KAA4B,IAAK;IAChE,IAAIA,KAAK,CAACJ,WAAW,CAACK,UAAU,KAAKC,SAAS,EAAE;MAC9Cf,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAGa,KAAK,CAAC;IAClB;EACF,CAAC;EAED,MAAMG,gBAAgB,GAAGxB,cAAK,CAACe,WAAW,CACvCC,CAAC,IAAK;
|
|
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","React","forwardRef","_ref","ref","canBeFocused","focusStyle","style","onFocusChange","onPress","onLongPress","onKeyDownPress","onPressOut","onPressIn","props","onKeyUpPressHandler","useCallback","e","nativeEvent","keyCode","isLongPress","onPressablePressHandler","event","identifier","undefined","onKeyDownHandler","createElement","KeyboardFocusView","withView","onKeyUpPress","exports"],"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,SA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|
50
50
|
const onKeyDownHandler = React.useCallback(e => {
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
const {
|
|
52
|
+
nativeEvent: {
|
|
53
|
+
keyCode
|
|
54
|
+
}
|
|
55
|
+
} = e;
|
|
56
|
+
if (keyCode === ANDROID_SPACE_KEY_CODE) {
|
|
57
|
+
onKeyDownPress === null || onKeyDownPress === void 0 ? void 0 : onKeyDownPress(e);
|
|
58
|
+
onPressIn === null || onPressIn === void 0 ? void 0 : onPressIn(e);
|
|
59
|
+
}
|
|
53
60
|
}, [onKeyDownPress, onPressIn]);
|
|
54
61
|
return /*#__PURE__*/React.createElement(KeyboardFocusView, {
|
|
55
62
|
style: style,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Pressable","RNPressable","KeyboardFocusView","ANDROID_SPACE_KEY_CODE","forwardRef","_ref","ref","canBeFocused","focusStyle","style","onFocusChange","onPress","onLongPress","onKeyDownPress","onPressOut","onPressIn","props","onKeyUpPressHandler","useCallback","e","nativeEvent","keyCode","isLongPress","onPressablePressHandler","event","identifier","undefined","onKeyDownHandler","createElement","withView","onKeyUpPress","_extends"],"sourceRoot":"../../../../src","sources":["components/Pressable/Pressable.android.tsx"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAEEC,SAAS,IAAIC,WAAW,QAGnB,cAAc;AAErB,SAASC,iBAAiB,QAAQ,sBAAsB;AAExD,MAAMC,sBAAsB,GAAG,EAAE;AAEjC,OAAO,MAAMH,SAAS,gBAAGD,KAAK,CAACK,UAAU,CAIvC,CAAAC,IAAA,EAaEC,GAAG,KACA;EAAA,IAbH;IACEC,YAAY;IACZC,UAAU;IACVC,KAAK;IACLC,aAAa;IACbC,OAAO;IACPC,WAAW;IACXC,cAAc;IACdC,UAAU;IACVC,SAAS;IACT,GAAGC;EACL,CAAC,GAAAX,IAAA;EAGD,MAAMY,mBAAmB,GAAGlB,KAAK,CAACmB,WAAW,CAC1CC,CAAC,IAAK;IACL,MAAM;MACJC,WAAW,EAAE;QAAEC,OAAO;QAAEC;MAAY;IACtC,CAAC,GAAGH,CAAC;IAEL,IAAIE,OAAO,KAAKlB,sBAAsB,EAAE;MACtCW,UAAU,aAAVA,UAAU,uBAAVA,UAAU,CAAGK,CAAqC,CAAC;MACnD,IAAIG,WAAW,EAAE;QACfV,WAAW,aAAXA,WAAW,uBAAXA,WAAW,CAAGO,CAAC,CAAC;MAClB,CAAC,MAAM;QACLR,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAGQ,CAAC,CAAC;MACd;IACF;EACF,CAAC,EACD,CAACP,WAAW,EAAED,OAAO,EAAEG,UAAU,CACnC,CAAC;EAED,MAAMS,uBAAuB,GAAIC,KAA4B,IAAK;IAChE,IAAIA,KAAK,CAACJ,WAAW,CAACK,UAAU,KAAKC,SAAS,EAAE;MAC9Cf,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAGa,KAAK,CAAC;IAClB;EACF,CAAC;EAED,MAAMG,gBAAgB,GAAG5B,KAAK,CAACmB,WAAW,CACvCC,CAAC,IAAK;
|
|
1
|
+
{"version":3,"names":["React","Pressable","RNPressable","KeyboardFocusView","ANDROID_SPACE_KEY_CODE","forwardRef","_ref","ref","canBeFocused","focusStyle","style","onFocusChange","onPress","onLongPress","onKeyDownPress","onPressOut","onPressIn","props","onKeyUpPressHandler","useCallback","e","nativeEvent","keyCode","isLongPress","onPressablePressHandler","event","identifier","undefined","onKeyDownHandler","createElement","withView","onKeyUpPress","_extends"],"sourceRoot":"../../../../src","sources":["components/Pressable/Pressable.android.tsx"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAEEC,SAAS,IAAIC,WAAW,QAGnB,cAAc;AAErB,SAASC,iBAAiB,QAAQ,sBAAsB;AAExD,MAAMC,sBAAsB,GAAG,EAAE;AAEjC,O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D,CAACN,cAAc,EAAEE,SAAS,CAC5B,CAAC;EAED,oBACEhB,KAAA,CAAA6B,aAAA,CAAC1B,iBAAiB;IAChBO,KAAK,EAAEA,KAAM;IACbD,UAAU,EAAEA,UAAW;IACvBF,GAAG,EAAEA,GAAI;IACTuB,QAAQ,EAAE,KAAM;IAChBC,YAAY,EAAEb,mBAAoB;IAClCJ,cAAc,EAAEc,gBAAiB;IACjCpB,YAAY,EAAEA,YAAa;IAC3BG,aAAa,EAAEA;EAAc,gBAE7BX,KAAA,CAAA6B,aAAA,CAAC3B,WAAW,EAAA8B,QAAA;IACVjB,UAAU,EAAEA,UAAW;IACvBC,SAAS,EAAEA,SAAU;IACrBJ,OAAO,EAAEY,uBAAwB;IACjCX,WAAW,EAAEA;EAAY,GACrBI,KAAK,CACV,CACgB,CAAC;AAExB,CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pressable.android.d.ts","sourceRoot":"","sources":["../../../../src/components/Pressable/Pressable.android.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,qBAAqB,EAErB,IAAI,EACJ,cAAc,EACf,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAA0B,YAAY,EAAE,MAAM,aAAa,CAAC;AAKxE,eAAO,MAAM,SAAS;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"Pressable.android.d.ts","sourceRoot":"","sources":["../../../../src/components/Pressable/Pressable.android.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,qBAAqB,EAErB,IAAI,EACJ,cAAc,EACf,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAA0B,YAAY,EAAE,MAAM,aAAa,CAAC;AAKxE,eAAO,MAAM,SAAS;;;;;;;;;;8BA8ErB,CAAC"}
|
package/package.json
CHANGED
|
@@ -65,8 +65,14 @@ export const Pressable = React.forwardRef<
|
|
|
65
65
|
|
|
66
66
|
const onKeyDownHandler = React.useCallback<OnKeyPressFn>(
|
|
67
67
|
(e) => {
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
const {
|
|
69
|
+
nativeEvent: { keyCode },
|
|
70
|
+
} = e;
|
|
71
|
+
|
|
72
|
+
if (keyCode === ANDROID_SPACE_KEY_CODE) {
|
|
73
|
+
onKeyDownPress?.(e);
|
|
74
|
+
onPressIn?.(e as unknown as GestureResponderEvent);
|
|
75
|
+
}
|
|
70
76
|
},
|
|
71
77
|
[onKeyDownPress, onPressIn]
|
|
72
78
|
);
|
|
@@ -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 */
|