react-native-external-keyboard 0.6.8 → 0.7.0
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 +37 -129
- package/android/src/main/java/com/externalkeyboard/ExternalKeyboardViewPackage.java +2 -0
- package/android/src/main/java/com/externalkeyboard/helper/FocusHelper.java +70 -0
- package/android/src/main/java/com/externalkeyboard/views/ExternalKeyboardLockView/ExternalKeyboardLockView.java +115 -0
- package/android/src/main/java/com/externalkeyboard/views/ExternalKeyboardLockView/ExternalKeyboardLockViewManager.java +32 -0
- package/android/src/main/java/com/externalkeyboard/views/ExternalKeyboardLockView/LockService.java +44 -0
- package/android/src/newarch/ExternalKeyboardLockViewManagerSpec.java +8 -0
- package/android/src/oldarch/ExternalKeyboardLockViewManagerSpec.java +12 -0
- package/ios/Delegates/RNCEKVFocusOrderDelegate/RNCEKVFocusGuideDelegate/RNCEKVFocusGuideDelegate.h +36 -0
- package/ios/Delegates/RNCEKVFocusOrderDelegate/RNCEKVFocusGuideDelegate/RNCEKVFocusGuideDelegate.mm +150 -0
- package/ios/Delegates/RNCEKVFocusOrderDelegate/RNCEKVFocusOrderDelegate.h +14 -0
- package/ios/Delegates/RNCEKVFocusOrderDelegate/RNCEKVFocusOrderDelegate.mm +98 -349
- package/ios/Extensions/RCTTextInputComponentView+RNCEKVExternalKeyboard.h +1 -1
- package/ios/Extensions/RCTTextInputComponentView+RNCEKVExternalKeyboard.mm +11 -3
- package/ios/Extensions/UIViewController+RNCEKVExternalKeyboard.h +1 -1
- package/ios/Extensions/UIViewController+RNCEKVExternalKeyboard.mm +17 -17
- package/ios/Helpers/RNCEKVFocusGuideHelper/RNCEKVFocusGuideHelper.h +32 -0
- package/ios/Helpers/RNCEKVFocusGuideHelper/RNCEKVFocusGuideHelper.mm +81 -0
- package/ios/Helpers/RNCEKVSwizzlingHelper/RNCEKVSwizzlingHelper.h +16 -0
- package/ios/Helpers/RNCEKVSwizzlingHelper/RNCEKVSwizzlingHelper.mm +27 -0
- package/ios/Modules/RNCEKVExternalKeyboardModule.mm +3 -3
- package/ios/Services/RNCEKVFocusLinkObserver.h +7 -1
- package/ios/Services/RNCEKVFocusLinkObserver.mm +31 -6
- package/ios/Services/RNCEKVKeyboardOrderManager/RNCEKVKeyboardOrderManager.h +17 -0
- package/ios/Services/RNCEKVKeyboardOrderManager/RNCEKVKeyboardOrderManager.mm +15 -0
- package/ios/Services/{RNCEKVRelashioship.h → RNCEKVKeyboardOrderManager/RNCEKVOrderRelationship/RNCEKVOrderRelationship.h} +8 -7
- package/ios/Services/{RNCEKVRelashioship.mm → RNCEKVKeyboardOrderManager/RNCEKVOrderRelationship/RNCEKVOrderRelationship.mm} +36 -13
- package/ios/Services/RNCEKVOrderLinking.h +2 -7
- package/ios/Services/RNCEKVOrderLinking.mm +27 -64
- package/ios/Services/RNCEKVOrderSubscriber.h +4 -3
- package/ios/Services/RNCEKVOrderSubscriber.mm +2 -1
- package/ios/Views/RNCEKVExternalKeyboardLockView/RNCEKVExternalKeyboardLockView.h +38 -0
- package/ios/Views/RNCEKVExternalKeyboardLockView/RNCEKVExternalKeyboardLockView.mm +62 -0
- package/ios/Views/RNCEKVExternalKeyboardLockView/RNCEKVExternalKeyboardLockViewManager.h +14 -0
- package/ios/Views/RNCEKVExternalKeyboardLockView/RNCEKVExternalKeyboardLockViewManager.mm +25 -0
- package/ios/Views/RNCEKVExternalKeyboardView/RNCEKVExternalKeyboardView.mm +2 -2
- package/ios/Views/RNCEKVKeyboardFocusGroupView/RNCEKVKeyboardFocusGroup.mm +0 -1
- package/ios/Views/RNCEKVTextInputFocusWrapper/RNCEKVTextInputFocusWrapper.mm +1 -15
- package/lib/commonjs/components/KeyboardFocusLock/FocusFrame/FocusFrame.android.js +21 -0
- package/lib/commonjs/components/KeyboardFocusLock/FocusFrame/FocusFrame.android.js.map +1 -0
- package/lib/commonjs/components/KeyboardFocusLock/FocusFrame/FocusFrame.js +11 -0
- package/lib/commonjs/components/KeyboardFocusLock/FocusFrame/FocusFrame.js.map +1 -0
- package/lib/commonjs/components/KeyboardFocusLock/FocusTrap/FocusTrap.android.js +19 -0
- package/lib/commonjs/components/KeyboardFocusLock/FocusTrap/FocusTrap.android.js.map +1 -0
- package/lib/commonjs/components/KeyboardFocusLock/FocusTrap/FocusTrap.js +15 -0
- package/lib/commonjs/components/KeyboardFocusLock/FocusTrap/FocusTrap.js.map +1 -0
- package/lib/commonjs/components/KeyboardFocusLock/FocusTrap/FocusTrapMountWrapper.js +46 -0
- package/lib/commonjs/components/KeyboardFocusLock/FocusTrap/FocusTrapMountWrapper.js.map +1 -0
- package/lib/commonjs/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.android.js +21 -0
- package/lib/commonjs/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.android.js.map +1 -0
- package/lib/commonjs/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.js +9 -0
- package/lib/commonjs/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.js.map +1 -0
- package/lib/commonjs/context/FocusFrameProviderContext.js +28 -0
- package/lib/commonjs/context/FocusFrameProviderContext.js.map +1 -0
- package/lib/commonjs/index.js +7 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/nativeSpec/ExternalKeyboardLockViewNativeComponent.js +10 -0
- package/lib/commonjs/nativeSpec/ExternalKeyboardLockViewNativeComponent.js.map +1 -0
- package/lib/commonjs/types/KeyboardFocusLock.types.js +6 -0
- package/lib/commonjs/types/KeyboardFocusLock.types.js.map +1 -0
- package/lib/module/components/KeyboardFocusLock/FocusFrame/FocusFrame.android.js +14 -0
- package/lib/module/components/KeyboardFocusLock/FocusFrame/FocusFrame.android.js.map +1 -0
- package/lib/module/components/KeyboardFocusLock/FocusFrame/FocusFrame.js +4 -0
- package/lib/module/components/KeyboardFocusLock/FocusFrame/FocusFrame.js.map +1 -0
- package/lib/module/components/KeyboardFocusLock/FocusTrap/FocusTrap.android.js +12 -0
- package/lib/module/components/KeyboardFocusLock/FocusTrap/FocusTrap.android.js.map +1 -0
- package/lib/module/components/KeyboardFocusLock/FocusTrap/FocusTrap.js +8 -0
- package/lib/module/components/KeyboardFocusLock/FocusTrap/FocusTrap.js.map +1 -0
- package/lib/module/components/KeyboardFocusLock/FocusTrap/FocusTrapMountWrapper.js +39 -0
- package/lib/module/components/KeyboardFocusLock/FocusTrap/FocusTrapMountWrapper.js.map +1 -0
- package/lib/module/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.android.js +14 -0
- package/lib/module/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.android.js.map +1 -0
- package/lib/module/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.js +3 -0
- package/lib/module/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.js.map +1 -0
- package/lib/module/context/FocusFrameProviderContext.js +20 -0
- package/lib/module/context/FocusFrameProviderContext.js.map +1 -0
- package/lib/module/index.js +6 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/nativeSpec/ExternalKeyboardLockViewNativeComponent.js +3 -0
- package/lib/module/nativeSpec/ExternalKeyboardLockViewNativeComponent.js.map +1 -0
- package/lib/module/types/KeyboardFocusLock.types.js +2 -0
- package/lib/module/types/KeyboardFocusLock.types.js.map +1 -0
- package/lib/typescript/src/components/KeyboardFocusLock/FocusFrame/FocusFrame.android.d.ts +4 -0
- package/lib/typescript/src/components/KeyboardFocusLock/FocusFrame/FocusFrame.android.d.ts.map +1 -0
- package/lib/typescript/src/components/KeyboardFocusLock/FocusFrame/FocusFrame.d.ts +3 -0
- package/lib/typescript/src/components/KeyboardFocusLock/FocusFrame/FocusFrame.d.ts.map +1 -0
- package/lib/typescript/src/components/KeyboardFocusLock/FocusTrap/FocusTrap.android.d.ts +4 -0
- package/lib/typescript/src/components/KeyboardFocusLock/FocusTrap/FocusTrap.android.d.ts.map +1 -0
- package/lib/typescript/src/components/KeyboardFocusLock/FocusTrap/FocusTrap.d.ts +3 -0
- package/lib/typescript/src/components/KeyboardFocusLock/FocusTrap/FocusTrap.d.ts.map +1 -0
- package/lib/typescript/src/components/KeyboardFocusLock/FocusTrap/FocusTrapMountWrapper.d.ts +3 -0
- package/lib/typescript/src/components/KeyboardFocusLock/FocusTrap/FocusTrapMountWrapper.d.ts.map +1 -0
- package/lib/typescript/src/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.android.d.ts +4 -0
- package/lib/typescript/src/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.android.d.ts.map +1 -0
- package/lib/typescript/src/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.d.ts +3 -0
- package/lib/typescript/src/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.d.ts.map +1 -0
- package/lib/typescript/src/components/Touchable/Pressable.d.ts +1 -1
- package/lib/typescript/src/context/FocusFrameProviderContext.d.ts +12 -0
- package/lib/typescript/src/context/FocusFrameProviderContext.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +4 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/nativeSpec/ExternalKeyboardLockViewNativeComponent.d.ts +9 -0
- package/lib/typescript/src/nativeSpec/ExternalKeyboardLockViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/types/KeyboardFocusLock.types.d.ts +6 -0
- package/lib/typescript/src/types/KeyboardFocusLock.types.d.ts.map +1 -0
- package/lib/typescript/src/utils/withKeyboardFocus.d.ts +1 -1
- package/package.json +4 -3
- package/src/components/KeyboardFocusLock/FocusFrame/FocusFrame.android.tsx +18 -0
- package/src/components/KeyboardFocusLock/FocusFrame/FocusFrame.tsx +8 -0
- package/src/components/KeyboardFocusLock/FocusTrap/FocusTrap.android.tsx +17 -0
- package/src/components/KeyboardFocusLock/FocusTrap/FocusTrap.tsx +9 -0
- package/src/components/KeyboardFocusLock/FocusTrap/FocusTrapMountWrapper.ts +40 -0
- package/src/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.android.tsx +16 -0
- package/src/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.tsx +5 -0
- package/src/context/FocusFrameProviderContext.tsx +36 -0
- package/src/index.tsx +8 -0
- package/src/nativeSpec/ExternalKeyboardLockViewNativeComponent.ts +13 -0
- package/src/types/KeyboardFocusLock.types.ts +6 -0
- package/ios/Services/RNCEKVFocusLinkObserverManager.h +0 -23
- package/ios/Services/RNCEKVFocusLinkObserverManager.mm +0 -30
- /package/ios/Services/{RNCEKVSortedMap.h → RNCEKVKeyboardOrderManager/RNCEKVOrderRelationship/RNCEKVSortedMap/RNCEKVSortedMap.h} +0 -0
- /package/ios/Services/{RNCEKVSortedMap.mm → RNCEKVKeyboardOrderManager/RNCEKVOrderRelationship/RNCEKVSortedMap/RNCEKVSortedMap.mm} +0 -0
package/ios/Delegates/RNCEKVFocusOrderDelegate/RNCEKVFocusGuideDelegate/RNCEKVFocusGuideDelegate.mm
ADDED
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
//
|
|
2
|
+
// RNCEKVFocusGuideDelegate.m
|
|
3
|
+
// react-native-external-keyboard
|
|
4
|
+
//
|
|
5
|
+
// Created by Artur Kalach on 16/07/2025.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
#import "RNCEKVFocusGuideDelegate.h"
|
|
10
|
+
|
|
11
|
+
@implementation RNCEKVFocusGuideDelegate{
|
|
12
|
+
BOOL _isFocused;
|
|
13
|
+
UIView<RNCEKVFocusOrderProtocol>* _delegate;
|
|
14
|
+
// UIFocusGuide *_leftFocusGuide;
|
|
15
|
+
// UIFocusGuide *_rightFocusGuide;
|
|
16
|
+
// UIFocusGuide *_upFocusGuide;
|
|
17
|
+
// UIFocusGuide *_downFocusGuide;
|
|
18
|
+
NSMutableDictionary<NSNumber *, UIFocusGuide*> *_sides;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
- (instancetype _Nonnull )initWithView:(UIView<RNCEKVFocusOrderProtocol> *_Nonnull)delegate{
|
|
22
|
+
self = [super init];
|
|
23
|
+
if (self) {
|
|
24
|
+
_delegate = delegate;
|
|
25
|
+
_isFocused = false;
|
|
26
|
+
_sides = [NSMutableDictionary dictionary];
|
|
27
|
+
}
|
|
28
|
+
return self;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
- (void)setGuideFor:(RNCEKVFocusGuideDirection)direction withView: (UIView *)view {
|
|
33
|
+
if (!view) return;
|
|
34
|
+
|
|
35
|
+
[self removeGuideFor: direction];
|
|
36
|
+
_sides[@(direction)] = [RNCEKVFocusGuideHelper setGuideForDirection: direction
|
|
37
|
+
inView:_delegate
|
|
38
|
+
focusView: view
|
|
39
|
+
enabled: _isFocused];
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
-(void)removeGuideFor:(RNCEKVFocusGuideDirection)direction {
|
|
43
|
+
if (_sides[@(direction)]) {
|
|
44
|
+
[_delegate removeLayoutGuide: _sides[@(direction)]];
|
|
45
|
+
_sides[@(direction)] = nil;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
//
|
|
50
|
+
//
|
|
51
|
+
//- (void)setLeftGuide:(UIView *)view {
|
|
52
|
+
// if (!view) {
|
|
53
|
+
// return;
|
|
54
|
+
// }
|
|
55
|
+
//
|
|
56
|
+
// [self removeLeftGuide];
|
|
57
|
+
// _leftFocusGuide = [RNCEKVFocusGuideHelper setGuideForDirection: RNCEKVFocusGuideDirectionLeft
|
|
58
|
+
// inView:_delegate
|
|
59
|
+
// focusView:view
|
|
60
|
+
// enabled: _isFocused];
|
|
61
|
+
//}
|
|
62
|
+
//
|
|
63
|
+
//
|
|
64
|
+
//
|
|
65
|
+
//- (void)setRightGuide:(UIView *)view {
|
|
66
|
+
// if (!view) return;
|
|
67
|
+
//
|
|
68
|
+
// [self removeRightGuide];
|
|
69
|
+
// _rightFocusGuide = [RNCEKVFocusGuideHelper setGuideForDirection: RNCEKVFocusGuideDirectionRight
|
|
70
|
+
// inView:_delegate
|
|
71
|
+
// focusView:view
|
|
72
|
+
// enabled: _isFocused];
|
|
73
|
+
//}
|
|
74
|
+
//
|
|
75
|
+
//- (void)setUpGuide:(UIView *)view {
|
|
76
|
+
// if (!view) return;
|
|
77
|
+
//
|
|
78
|
+
// [self removeUpGuide];
|
|
79
|
+
// _upFocusGuide = [RNCEKVFocusGuideHelper setGuideForDirection: RNCEKVFocusGuideDirectionUp
|
|
80
|
+
// inView:_delegate
|
|
81
|
+
// focusView:view
|
|
82
|
+
// enabled: _isFocused];
|
|
83
|
+
//}
|
|
84
|
+
//
|
|
85
|
+
//- (void)setDownGuide:(UIView *)view {
|
|
86
|
+
// if (!view) return;
|
|
87
|
+
//
|
|
88
|
+
// [self removeDownGuide];
|
|
89
|
+
// _downFocusGuide = [RNCEKVFocusGuideHelper setGuideForDirection: RNCEKVFocusGuideDirectionDown
|
|
90
|
+
// inView:_delegate
|
|
91
|
+
// focusView:view
|
|
92
|
+
// enabled: _isFocused];
|
|
93
|
+
//}
|
|
94
|
+
|
|
95
|
+
- (void)setIsFocused:(BOOL)value {
|
|
96
|
+
_isFocused = value;
|
|
97
|
+
|
|
98
|
+
for (NSNumber *key in _sides) {
|
|
99
|
+
UIFocusGuide* side = _sides[key];
|
|
100
|
+
if(side) {
|
|
101
|
+
side.enabled = value;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
//
|
|
105
|
+
// if(_leftFocusGuide != nil) {
|
|
106
|
+
// _leftFocusGuide.enabled = value;
|
|
107
|
+
// }
|
|
108
|
+
//
|
|
109
|
+
// if(_rightFocusGuide != nil) {
|
|
110
|
+
// _rightFocusGuide.enabled = value;
|
|
111
|
+
// }
|
|
112
|
+
//
|
|
113
|
+
// if(_upFocusGuide != nil) {
|
|
114
|
+
// _upFocusGuide.enabled = value;
|
|
115
|
+
// }
|
|
116
|
+
//
|
|
117
|
+
// if(_downFocusGuide != nil) {
|
|
118
|
+
// _downFocusGuide.enabled = value;
|
|
119
|
+
// }
|
|
120
|
+
}
|
|
121
|
+
//
|
|
122
|
+
//- (void)removeLeftGuide {
|
|
123
|
+
// if (_leftFocusGuide) {
|
|
124
|
+
// [_delegate removeLayoutGuide: _leftFocusGuide];
|
|
125
|
+
// _leftFocusGuide = nil;
|
|
126
|
+
// }
|
|
127
|
+
//}
|
|
128
|
+
//
|
|
129
|
+
//- (void)removeRightGuide {
|
|
130
|
+
// if (_rightFocusGuide) {
|
|
131
|
+
// [_delegate removeLayoutGuide: _rightFocusGuide];
|
|
132
|
+
// _rightFocusGuide = nil;
|
|
133
|
+
// }
|
|
134
|
+
//}
|
|
135
|
+
//
|
|
136
|
+
//- (void)removeUpGuide {
|
|
137
|
+
// if (_upFocusGuide) {
|
|
138
|
+
// [_delegate removeLayoutGuide:_upFocusGuide];
|
|
139
|
+
// _upFocusGuide = nil;
|
|
140
|
+
// }
|
|
141
|
+
//}
|
|
142
|
+
//
|
|
143
|
+
//- (void)removeDownGuide {
|
|
144
|
+
// if (_downFocusGuide) {
|
|
145
|
+
// [_delegate removeLayoutGuide:_downFocusGuide];
|
|
146
|
+
// _downFocusGuide = nil;
|
|
147
|
+
// }
|
|
148
|
+
//}
|
|
149
|
+
|
|
150
|
+
@end
|
|
@@ -10,6 +10,18 @@
|
|
|
10
10
|
|
|
11
11
|
#import <Foundation/Foundation.h>
|
|
12
12
|
#import "RNCEKVFocusOrderProtocol.h"
|
|
13
|
+
#import "RNCEKVFocusGuideDelegate.h"
|
|
14
|
+
#import "RNCEKVOrderSubscriber.h"
|
|
15
|
+
|
|
16
|
+
typedef NS_ENUM(NSUInteger, RNCEKVLinkDirection) {
|
|
17
|
+
RNCEKVLinkDirectionLeft,
|
|
18
|
+
RNCEKVLinkDirectionRight,
|
|
19
|
+
RNCEKVLinkDirectionUp,
|
|
20
|
+
RNCEKVLinkDirectionDown
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
13
25
|
|
|
14
26
|
@interface RNCEKVFocusOrderDelegate : NSObject
|
|
15
27
|
|
|
@@ -17,6 +29,8 @@
|
|
|
17
29
|
|
|
18
30
|
- (NSNumber*_Nullable)shouldUpdateFocusInContext:(UIFocusUpdateContext *_Nonnull)context;
|
|
19
31
|
|
|
32
|
+
@property (nonatomic, strong) NSMutableDictionary<NSNumber *, RNCEKVOrderSubscriber*> * _Nonnull subscribers;
|
|
33
|
+
|
|
20
34
|
- (void)linkId;
|
|
21
35
|
- (void)refreshId:(NSString*_Nullable)prev next:(NSString*_Nullable)next;
|
|
22
36
|
- (void)setIsFocused:(BOOL)value;
|