react-native-external-keyboard 0.8.4 → 0.9.0-alpha.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.
Files changed (61) hide show
  1. package/android/src/main/java/com/externalkeyboard/delegates/FocusOrderDelegate.java +2 -4
  2. package/android/src/main/java/com/externalkeyboard/delegates/FocusOrderDelegateHost.java +14 -0
  3. package/android/src/main/java/com/externalkeyboard/views/ExternalKeyboardView/ExternalKeyboardView.java +2 -1
  4. package/android/src/main/java/com/externalkeyboard/views/TextInputFocusWrapper/TextInputFocusWrapper.java +150 -3
  5. package/android/src/main/java/com/externalkeyboard/views/TextInputFocusWrapper/TextInputFocusWrapperManager.java +92 -0
  6. package/android/src/oldarch/TextInputFocusWrapperManagerSpec.java +24 -0
  7. package/ios/Delegates/RNCEKVFocusOrderDelegate/RNCEKVFocusGuideDelegate/RNCEKVFocusGuideDelegate.h +1 -1
  8. package/ios/Delegates/RNCEKVFocusOrderDelegate/RNCEKVFocusOrderDelegate.h +5 -0
  9. package/ios/Delegates/RNCEKVFocusOrderDelegate/RNCEKVFocusOrderDelegate.mm +84 -48
  10. package/ios/Delegates/RNCEKVFocusOrderDelegate/RNCEKVFocusOrderProtocol.h +6 -8
  11. package/ios/Delegates/RNCEKVGroupIdentifierDelegate/RNCEKVGroupIdentifierDelegate.mm +60 -60
  12. package/ios/Delegates/RNCEKVHaloDelegate/RNCEKVHaloDelegate.h +4 -3
  13. package/ios/Delegates/RNCEKVHaloDelegate/RNCEKVHaloDelegate.mm +110 -87
  14. package/ios/Delegates/RNCEKVHaloDelegate/RNCEKVHaloProtocol.h +1 -1
  15. package/ios/Extensions/RCTEnhancedScrollView+RNCEKVExternalKeyboard.mm +1 -1
  16. package/ios/Extensions/RCTTextInputComponentView+RNCEKVExternalKeyboard.mm +15 -0
  17. package/ios/Extensions/RCTViewComponentView+RNCEKVExternalKeyboard.h +1 -1
  18. package/ios/Extensions/RCTViewComponentView+RNCEKVExternalKeyboard.mm +31 -23
  19. package/ios/Extensions/UIViewController+RNCEKVExternalKeyboard.h +1 -0
  20. package/ios/Extensions/UIViewController+RNCEKVExternalKeyboard.mm +8 -0
  21. package/ios/Helpers/RNCEKVNativeProps/RNCEKVNativeProps.h +123 -0
  22. package/ios/Protocols/RNCEKVCustomFocusEffectProtocol.h +15 -0
  23. package/ios/Protocols/RNCEKVCustomGroudIdProtocol.h +15 -0
  24. package/ios/Views/Base/ContextMenu/RNCEKVViewContextMenuBase.h +33 -0
  25. package/ios/Views/Base/ContextMenu/RNCEKVViewContextMenuBase.mm +83 -0
  26. package/ios/Views/Base/FocusChange/RNCEKVViewFocusChangeBase.h +37 -0
  27. package/ios/Views/Base/FocusChange/RNCEKVViewFocusChangeBase.mm +88 -0
  28. package/ios/Views/Base/FocusOrderGroup/RNCEKVViewOrderGroupBase.h +49 -0
  29. package/ios/Views/Base/FocusOrderGroup/RNCEKVViewOrderGroupBase.mm +200 -0
  30. package/ios/Views/Base/FocusRequest/RNCEKVViewFocusRequestBase.h +34 -0
  31. package/ios/Views/Base/FocusRequest/RNCEKVViewFocusRequestBase.mm +117 -0
  32. package/ios/Views/Base/GroupIdentifier/RNCEKVViewGroupIdentifierBase.h +27 -0
  33. package/ios/Views/Base/GroupIdentifier/RNCEKVViewGroupIdentifierBase.mm +61 -0
  34. package/ios/Views/Base/KeyPress/RNCEKVViewKeyPress.h +30 -0
  35. package/ios/Views/Base/KeyPress/RNCEKVViewKeyPress.mm +82 -0
  36. package/ios/Views/Base/KeyboardHallo/RNCEKVExternalKeyboardHalloBase.h +33 -0
  37. package/ios/Views/Base/KeyboardHallo/RNCEKVExternalKeyboardHalloBase.mm +102 -0
  38. package/ios/Views/Base/ViewGroup/RNCEKVViewGroupBase.h +36 -0
  39. package/ios/Views/Base/ViewGroup/RNCEKVViewGroupBase.mm +63 -0
  40. package/ios/Views/RNCEKVExternalKeyboardView/RNCEKVExternalKeyboardView.h +75 -74
  41. package/ios/Views/RNCEKVExternalKeyboardView/RNCEKVExternalKeyboardView.mm +23 -492
  42. package/ios/Views/RNCEKVExternalKeyboardView/RNCEKVExternalKeyboardViewManager.mm +3 -6
  43. package/ios/Views/RNCEKVKeyboardFocusGroupView/RNCEKVKeyboardFocusGroup.mm +12 -12
  44. package/ios/Views/RNCEKVTextInputFocusWrapper/RNCEKVTextInputFocusWrapper.h +44 -6
  45. package/ios/Views/RNCEKVTextInputFocusWrapper/RNCEKVTextInputFocusWrapper.mm +42 -66
  46. package/ios/Views/RNCEKVTextInputFocusWrapper/RNCEKVTextInputFocusWrapperManager.mm +76 -7
  47. package/lib/commonjs/components/KeyboardExtendedInput/KeyboardExtendedInput.js +51 -0
  48. package/lib/commonjs/components/KeyboardExtendedInput/KeyboardExtendedInput.js.map +1 -1
  49. package/lib/commonjs/nativeSpec/TextInputFocusWrapperNativeComponent.ts +16 -0
  50. package/lib/module/components/KeyboardExtendedInput/KeyboardExtendedInput.js +51 -0
  51. package/lib/module/components/KeyboardExtendedInput/KeyboardExtendedInput.js.map +1 -1
  52. package/lib/module/nativeSpec/TextInputFocusWrapperNativeComponent.ts +16 -0
  53. package/lib/typescript/src/components/KeyboardExtendedInput/KeyboardExtendedInput.d.ts.map +1 -1
  54. package/lib/typescript/src/components/KeyboardExtendedInput/KeyboardExtendedInput.types.d.ts +11 -0
  55. package/lib/typescript/src/components/KeyboardExtendedInput/KeyboardExtendedInput.types.d.ts.map +1 -1
  56. package/lib/typescript/src/nativeSpec/TextInputFocusWrapperNativeComponent.d.ts +16 -1
  57. package/lib/typescript/src/nativeSpec/TextInputFocusWrapperNativeComponent.d.ts.map +1 -1
  58. package/package.json +1 -1
  59. package/src/components/KeyboardExtendedInput/KeyboardExtendedInput.tsx +56 -0
  60. package/src/components/KeyboardExtendedInput/KeyboardExtendedInput.types.ts +11 -0
  61. package/src/nativeSpec/TextInputFocusWrapperNativeComponent.ts +16 -0
@@ -0,0 +1,37 @@
1
+ //
2
+ // RNCEKVViewFocusChangeBase.h
3
+ // Pods
4
+ //
5
+ // Created by Artur Kalach on 09/04/2026.
6
+ //
7
+
8
+ #ifndef RNCEKVViewFocusChangeBase_h
9
+ #define RNCEKVViewFocusChangeBase_h
10
+
11
+ #import "RNCEKVViewGroupIdentifierBase.h"
12
+ #import "RNCEKVFocusDelegate.h"
13
+
14
+ #ifdef RCT_NEW_ARCH_ENABLED
15
+ #import "RNCEKVNativeProps.h"
16
+ #endif
17
+
18
+ @interface RNCEKVViewFocusChangeBase : RNCEKVViewGroupIdentifierBase<RNCEKVFocusProtocol>
19
+
20
+ @property BOOL canBeFocused;
21
+ @property BOOL hasOnFocusChanged;
22
+ @property (nonatomic, assign, readonly) BOOL isKeyboardFocused;
23
+
24
+
25
+ @property (nonatomic, strong, readonly) RNCEKVFocusDelegate* focusDelegate;
26
+
27
+ #ifdef RCT_NEW_ARCH_ENABLED
28
+ - (void)updateFocusProps:(const RNCEKV::FocusProps &)oldProps
29
+ newProps:(const RNCEKV::FocusProps &)newProps;
30
+ #endif
31
+
32
+ - (void)onFocusChangeHandler:(BOOL)isFocused;
33
+
34
+ @end
35
+
36
+
37
+ #endif /* RNCEKVViewFocusChangeBase_h */
@@ -0,0 +1,88 @@
1
+ //
2
+ // RNCEKVViewFocusChangeBase.m
3
+ // react-native-external-keyboard
4
+ //
5
+ // Created by Artur Kalach on 09/04/2026.
6
+ //
7
+
8
+ #import <Foundation/Foundation.h>
9
+
10
+
11
+ #import "RNCEKVViewFocusChangeBase.h"
12
+
13
+ #ifdef RCT_NEW_ARCH_ENABLED
14
+ #import "RNCEKVNativeProps.h"
15
+ #import "RNCEKVFabricEventHelper.h"
16
+ #endif
17
+ //#import "RNCEKVFocusDelegate.h"
18
+
19
+ @implementation RNCEKVViewFocusChangeBase {
20
+ NSNumber* _isFocused;
21
+ }
22
+
23
+ - (BOOL)isGroup {
24
+ return false;
25
+ }
26
+
27
+ - (BOOL)isKeyboardFocused {
28
+ return [_isFocused isEqual:@YES];
29
+ }
30
+
31
+ - (instancetype)initWithFrame:(CGRect)frame {
32
+ if (self = [super initWithFrame:frame]) {
33
+ _focusDelegate = [[RNCEKVFocusDelegate alloc] initWithView:self];
34
+ _isFocused = nil;
35
+ }
36
+
37
+ return self;
38
+ }
39
+
40
+ - (void)cleanReferences {
41
+ _isFocused = nil;
42
+ _canBeFocused = false;
43
+ _hasOnFocusChanged = false;
44
+ }
45
+
46
+ - (UIView *)getFocusTargetView {
47
+ return [_focusDelegate getFocusingView];
48
+ }
49
+
50
+
51
+ - (BOOL)canBecomeFocused {
52
+ if (!_canBeFocused)
53
+ NO;
54
+ return [_focusDelegate canBecomeFocused];
55
+ }
56
+
57
+
58
+ - (void)didUpdateFocusInContext:(UIFocusUpdateContext *)context
59
+ withAnimationCoordinator:(UIFocusAnimationCoordinator *)coordinator {
60
+ _isFocused = [_focusDelegate isFocusChanged:context];
61
+
62
+ if ([self hasOnFocusChanged]) {
63
+ if (_isFocused != nil) {
64
+ [self onFocusChangeHandler:[_isFocused isEqual:@YES]];
65
+ }
66
+ }
67
+
68
+ [super didUpdateFocusInContext:context withAnimationCoordinator:coordinator];
69
+ }
70
+
71
+
72
+ #ifdef RCT_NEW_ARCH_ENABLED
73
+ - (void)updateFocusProps:(const RNCEKV::FocusProps &)oldProps
74
+ newProps:(const RNCEKV::FocusProps &)newProps {
75
+ if (oldProps.canBeFocused != newProps.canBeFocused) {
76
+ [self setCanBeFocused:newProps.canBeFocused];
77
+ }
78
+
79
+ if (_hasOnFocusChanged != newProps.hasOnFocusChanged) {
80
+ [self setHasOnFocusChanged:newProps.hasOnFocusChanged];
81
+ }
82
+ }
83
+
84
+ #endif
85
+
86
+ - (void)onFocusChangeHandler:(BOOL)isFocused {}
87
+
88
+ @end
@@ -0,0 +1,49 @@
1
+ //
2
+ // RNCEKVViewOrderGroupBase.h
3
+ // Pods
4
+ //
5
+ // Created by Artur Kalach on 07/04/2026.
6
+ //
7
+
8
+ #ifndef RNCEKVViewOrderGroupBase_h
9
+ #define RNCEKVViewOrderGroupBase_h
10
+
11
+ #import <UIKit/UIKit.h>
12
+ #import "RNCEKVViewGroupBase.h"
13
+ #import "RNCEKVFocusOrderProtocol.h"
14
+ #import "RNCEKVFocusOrderDelegate.h"
15
+
16
+ #ifdef RCT_NEW_ARCH_ENABLED
17
+ #include "RNCEKVNativeProps.h"
18
+ #endif
19
+
20
+ @interface RNCEKVViewOrderGroupBase : RNCEKVViewGroupBase <RNCEKVFocusOrderProtocol>
21
+
22
+ - (void)cleanReferences;
23
+
24
+
25
+ @property (nonatomic, strong) NSString* orderGroup;
26
+ @property (nonatomic, strong) NSNumber* lockFocus;
27
+ @property (nonatomic, strong) NSNumber* orderPosition;
28
+ @property (nonatomic, strong) NSString* orderLeft;
29
+ @property (nonatomic, strong) NSString* orderRight;
30
+ @property (nonatomic, strong) NSString* orderUp;
31
+ @property (nonatomic, strong) NSString* orderDown;
32
+ @property (nonatomic, strong) NSString* orderForward;
33
+ @property (nonatomic, strong) NSString* orderBackward;
34
+ @property (nonatomic, strong) NSString* orderLast;
35
+ @property (nonatomic, strong) NSString* orderFirst;
36
+
37
+ @property (nonatomic, strong) NSString* orderId;
38
+
39
+ @property (nonatomic, strong, readonly) RNCEKVFocusOrderDelegate* focusOrderDelegate;
40
+
41
+
42
+ #ifdef RCT_NEW_ARCH_ENABLED
43
+ - (void)updateFocusOrderProps:(const RNCEKV::OrderProps &)oldProps
44
+ newProps:(const RNCEKV::OrderProps &)newProps;
45
+ #endif
46
+
47
+ @end
48
+
49
+ #endif /* RNCEKVViewOrderGroupBase_h */
@@ -0,0 +1,200 @@
1
+ //
2
+ // RNCEKVViewOrderGroupBase.m
3
+ // react-native-external-keyboard
4
+ //
5
+ // Created by Artur Kalach on 07/04/2026.
6
+ //
7
+
8
+ #import <Foundation/Foundation.h>
9
+ #import "RNCEKVViewOrderGroupBase.h"
10
+ #import "RNCEKVFocusOrderDelegate.h"
11
+ #import "RNCEKVOrderLinking.h"
12
+ #import "UIViewController+RNCEKVExternalKeyboard.h"
13
+ #import "UIView+React.h"
14
+
15
+ #ifdef RCT_NEW_ARCH_ENABLED
16
+ #include "RNCEKVNativeProps.h"
17
+ #import "RNCEKVPropHelper.h"
18
+ #endif
19
+
20
+ @interface RNCEKVViewOrderGroupBase ()
21
+ @property (nonatomic, strong, readwrite) RNCEKVFocusOrderDelegate* focusOrderDelegate;
22
+ @end
23
+
24
+ @implementation RNCEKVViewOrderGroupBase
25
+
26
+ - (instancetype)initWithFrame:(CGRect)frame
27
+ {
28
+ if (self = [super initWithFrame:frame]) {
29
+ _focusOrderDelegate = [[RNCEKVFocusOrderDelegate alloc] initWithView:self];
30
+ }
31
+
32
+ return self;
33
+ }
34
+
35
+ - (BOOL)getIsViewFocused:(UIFocusUpdateContext *)context {
36
+ return context.nextFocusedView == [self getStoredView];
37
+ }
38
+
39
+
40
+ - (void)didUpdateFocusInContext:(UIFocusUpdateContext *)context
41
+ withAnimationCoordinator:(UIFocusAnimationCoordinator *)coordinator {
42
+ BOOL isFocused = [self getIsViewFocused: context];
43
+ [_focusOrderDelegate setIsFocused: isFocused];
44
+
45
+ [super didUpdateFocusInContext:context withAnimationCoordinator:coordinator];
46
+ }
47
+
48
+ - (void)focus {
49
+ UIViewController *controller = self.reactViewController;
50
+ BOOL isAttached = self.superview != nil && controller != nil;
51
+
52
+ if (isAttached) {
53
+ [controller rncekvFocusView:[self getStoredView]];
54
+ }
55
+ }
56
+
57
+ - (void)cleanReferences {
58
+ [super cleanReferences];
59
+ [_focusOrderDelegate unlink];
60
+
61
+ _orderGroup = nil;
62
+ _orderPosition = nil;
63
+ _orderLeft = nil;
64
+ _orderRight = nil;
65
+ _orderUp = nil;
66
+ _orderDown = nil;
67
+ _orderForward = nil;
68
+ _orderBackward = nil;
69
+ _orderLast = nil;
70
+ _orderFirst = nil;
71
+ _orderId = nil;
72
+ _lockFocus = nil;
73
+ }
74
+
75
+ - (UIView *)getFocusTargetView {
76
+ return [self getStoredView];
77
+ }
78
+
79
+ - (void)didMoveToWindow {
80
+ if (self.window) {
81
+ [_focusOrderDelegate link];
82
+ } else {
83
+ [_focusOrderDelegate unlink];
84
+ }
85
+ }
86
+
87
+ - (BOOL)shouldUpdateFocusInContext:(UIFocusUpdateContext *)context {
88
+ NSNumber* result = [_focusOrderDelegate shouldUpdateFocusInContext: context];
89
+
90
+ if(result == nil) {
91
+ return [super shouldUpdateFocusInContext: context];
92
+ }
93
+
94
+ return result.boolValue;
95
+ }
96
+
97
+ #ifdef RCT_NEW_ARCH_ENABLED
98
+ - (void)updateFocusOrderProps:(const RNCEKV::OrderProps &)oldViewProps
99
+ newProps:(const RNCEKV::OrderProps &)newViewProps {
100
+ if ((oldViewProps.lockFocus != newViewProps.lockFocus)) {
101
+ NSNumber* lockValue = [RNCEKVPropHelper unwrapIntValue: newViewProps.lockFocus];
102
+ [self setLockFocus: lockValue];
103
+ }
104
+
105
+ if ((oldViewProps.orderIndex != newViewProps.orderIndex)) {
106
+ NSNumber* position = [RNCEKVPropHelper unwrapIntValue: newViewProps.orderIndex];
107
+ [self setOrderPosition: position];
108
+ }
109
+
110
+ if ((oldViewProps.orderGroup != newViewProps.orderGroup)) {
111
+ NSString* orderGroup = [RNCEKVPropHelper unwrapStringValue: newViewProps.orderGroup];
112
+ [self setOrderGroup: orderGroup];
113
+ }
114
+
115
+ if ((oldViewProps.orderId != newViewProps.orderId)) {
116
+ NSString* orderId = [RNCEKVPropHelper unwrapStringValue: newViewProps.orderId];
117
+ [self setOrderId: orderId];
118
+ }
119
+
120
+ if ((oldViewProps.orderLeft != newViewProps.orderLeft)) {
121
+ NSString* orderLeft = [RNCEKVPropHelper unwrapStringValue: newViewProps.orderLeft];
122
+ [self setOrderLeft: orderLeft];
123
+ }
124
+
125
+ if ((oldViewProps.orderRight != newViewProps.orderRight)) {
126
+ NSString* orderRight = [RNCEKVPropHelper unwrapStringValue: newViewProps.orderRight];
127
+ [self setOrderRight: orderRight];
128
+ }
129
+
130
+ if ((oldViewProps.orderUp != newViewProps.orderUp)) {
131
+ NSString* orderUp = [RNCEKVPropHelper unwrapStringValue: newViewProps.orderUp];
132
+ [self setOrderUp: orderUp];
133
+ }
134
+
135
+ if ((oldViewProps.orderDown != newViewProps.orderDown)) {
136
+ NSString* orderDown = [RNCEKVPropHelper unwrapStringValue: newViewProps.orderDown];
137
+ [self setOrderDown: orderDown];
138
+ }
139
+
140
+ if ((oldViewProps.orderForward != newViewProps.orderForward)) {
141
+ NSString* orderForward = [RNCEKVPropHelper unwrapStringValue: newViewProps.orderForward];
142
+ [self setOrderForward: orderForward];
143
+ }
144
+
145
+ if ((oldViewProps.orderBackward != newViewProps.orderBackward)) {
146
+ NSString* orderBackward = [RNCEKVPropHelper unwrapStringValue: newViewProps.orderBackward];
147
+ [self setOrderBackward: orderBackward];
148
+ }
149
+
150
+ if ((oldViewProps.orderLast != newViewProps.orderLast)) {
151
+ NSString* orderLast = [RNCEKVPropHelper unwrapStringValue: newViewProps.orderLast];
152
+ [self setOrderLast: orderLast];
153
+ }
154
+
155
+ if ((oldViewProps.orderFirst != newViewProps.orderFirst)) {
156
+ NSString* orderFirst = [RNCEKVPropHelper unwrapStringValue: newViewProps.orderFirst];
157
+ [self setOrderFirst: orderFirst];
158
+ }
159
+ }
160
+ #endif
161
+
162
+
163
+ - (void)setOrderGroup:(NSString *)orderGroup {
164
+ [_focusOrderDelegate updateOrderGroup: orderGroup];
165
+ _orderGroup = orderGroup;
166
+ }
167
+
168
+
169
+ - (void)setOrderId:(NSString *)next {
170
+ [_focusOrderDelegate refreshId:_orderId next:next];
171
+ _orderId = next;
172
+ }
173
+
174
+ - (void)setOrderLeft:(NSString *)orderLeft {
175
+ [_focusOrderDelegate refreshLeft: _orderLeft next: orderLeft];
176
+ _orderLeft = orderLeft;
177
+ }
178
+
179
+ - (void)setOrderRight:(NSString *)orderRight {
180
+ [_focusOrderDelegate refreshRight: _orderRight next: orderRight];
181
+ _orderRight = orderRight;
182
+ }
183
+
184
+ - (void)setOrderUp:(NSString *)orderUp {
185
+ [_focusOrderDelegate refreshUp: _orderUp next: orderUp];
186
+ _orderUp = orderUp;
187
+ }
188
+
189
+ - (void)setOrderDown:(NSString *)orderDown {
190
+ [_focusOrderDelegate refreshDown: _orderDown next: orderDown];
191
+ _orderDown = orderDown;
192
+ }
193
+
194
+
195
+ - (void)setOrderPosition:(NSNumber *)position {
196
+ [_focusOrderDelegate updatePosition: position];
197
+ _orderPosition = position;
198
+ }
199
+
200
+ @end
@@ -0,0 +1,34 @@
1
+ //
2
+ // RNCEKVViewFocusRequestBase.h
3
+ // Pods
4
+ //
5
+ // Created by Artur Kalach on 09/04/2026.
6
+ //
7
+
8
+ #ifndef RNCEKVViewFocusRequestBase_h
9
+ #define RNCEKVViewFocusRequestBase_h
10
+
11
+
12
+ #import "RNCEKVViewContextMenuBase.h"
13
+
14
+ #ifdef RCT_NEW_ARCH_ENABLED
15
+ #import "RNCEKVNativeProps.h"
16
+ #endif
17
+
18
+ @interface RNCEKVViewFocusRequestBase : RNCEKVViewContextMenuBase
19
+
20
+ @property BOOL autoFocus;
21
+ @property BOOL enableA11yFocus;
22
+
23
+
24
+ #ifdef RCT_NEW_ARCH_ENABLED
25
+ - (void)updateFocusRequestProps:(const RNCEKV::AutoFocusProps &)oldProps
26
+ newProps:(const RNCEKV::AutoFocusProps &)newProps;
27
+
28
+ #endif
29
+
30
+ - (void)focus;
31
+
32
+ @end
33
+
34
+ #endif /* RNCEKVViewFocusRequestBase_h */
@@ -0,0 +1,117 @@
1
+ //
2
+ // RNCEKVViewFocusRequestBase.m
3
+ // react-native-external-keyboard
4
+ //
5
+ // Created by Artur Kalach on 09/04/2026.
6
+ //
7
+
8
+ #import <Foundation/Foundation.h>
9
+ #import "UIViewController+RNCEKVExternalKeyboard.h"
10
+
11
+ #import "UIView+React.h"
12
+ #import "RNCEKVViewFocusRequestBase.h"
13
+
14
+ #ifdef RCT_NEW_ARCH_ENABLED
15
+ #import "RNCEKVNativeProps.h"
16
+ #import "RNCEKVFabricEventHelper.h"
17
+ #endif
18
+
19
+ @implementation RNCEKVViewFocusRequestBase {
20
+ BOOL _isAttachedToWindow;
21
+ BOOL _autoFocusRequested;
22
+ BOOL _enableA11yFocus;
23
+ }
24
+
25
+ - (void)cleanReferences {
26
+ [super cleanReferences];
27
+ _isAttachedToWindow = NO;
28
+ _enableA11yFocus = NO;
29
+ _autoFocusRequested = NO;
30
+ }
31
+
32
+ - (instancetype)initWithFrame:(CGRect)frame {
33
+ if (self = [super initWithFrame:frame]) {
34
+ _isAttachedToWindow = NO;
35
+ _autoFocusRequested = NO;
36
+ }
37
+
38
+ return self;
39
+ }
40
+
41
+ - (void)focus {
42
+
43
+ UIViewController *controller = self.reactViewController;
44
+ if (controller != nil) {
45
+ [controller rncekvFocusView: self];
46
+ }
47
+
48
+ dispatch_async(dispatch_get_main_queue(), ^{
49
+ [self a11yFocus];
50
+ });
51
+ }
52
+
53
+ #ifdef RCT_NEW_ARCH_ENABLED
54
+ - (void)updateFocusRequestProps:(const RNCEKV::AutoFocusProps &)oldProps
55
+ newProps:(const RNCEKV::AutoFocusProps &)newProps {
56
+ if (oldProps.autoFocus != newProps.autoFocus) {
57
+ [self setAutoFocus: newProps.autoFocus];
58
+ }
59
+
60
+ if (_enableA11yFocus != newProps.enableA11yFocus) {
61
+ [self setEnableA11yFocus: newProps.enableA11yFocus];
62
+ }
63
+ }
64
+
65
+
66
+ #endif
67
+
68
+
69
+ - (void)onAttached
70
+ {
71
+ [self focusOnMount];
72
+ }
73
+
74
+
75
+ - (void)onViewAttached {
76
+ if (self.autoFocus) {
77
+ [self focus];
78
+ }
79
+ }
80
+
81
+ - (void)a11yFocus {
82
+ if (!_enableA11yFocus)
83
+ return;
84
+ UIView *focusView = [self getFocusTargetView];
85
+ UIAccessibilityPostNotification(UIAccessibilityLayoutChangedNotification,
86
+ focusView);
87
+ }
88
+
89
+ - (void)focusOnMount {
90
+ if (self.autoFocus) {
91
+ if(!_autoFocusRequested) {
92
+ _autoFocusRequested = YES;
93
+ dispatch_async(dispatch_get_main_queue(), ^{
94
+ dispatch_async(dispatch_get_main_queue(), ^{
95
+ [self focus];
96
+ });
97
+ });
98
+ }
99
+ }
100
+ }
101
+
102
+
103
+ - (void)didMoveToWindow {
104
+ [super didMoveToWindow];
105
+
106
+ if (self.window) {
107
+ [self onAttached];
108
+ }
109
+
110
+ if (self.window && !_isAttachedToWindow) {
111
+ [self onViewAttached];
112
+ _isAttachedToWindow = YES;
113
+ }
114
+ }
115
+
116
+
117
+ @end
@@ -0,0 +1,27 @@
1
+ //
2
+ // RNCEKVViewGroupIdentifierBase.h
3
+ // Pods
4
+ //
5
+ // Created by Artur Kalach on 09/04/2026.
6
+ //
7
+
8
+ #ifndef RNCEKVViewGroupIdentifierBase_h
9
+ #define RNCEKVViewGroupIdentifierBase_h
10
+
11
+ #import "RNCEKVExternalKeyboardHalloBase.h"
12
+ #import "RNCEKVGroupIdentifierProtocol.h"
13
+ #import "RNCEKVCustomGroudIdProtocol.h"
14
+
15
+ @interface RNCEKVViewGroupIdentifierBase : RNCEKVExternalKeyboardHalloBase<RNCEKVGroupIdentifierProtocol, RNCEKVCustomGroudIdProtocol>
16
+
17
+ @property (nonatomic, strong, nullable) NSString *customGroupId;
18
+
19
+ #ifdef RCT_NEW_ARCH_ENABLED
20
+ - (void)updateGroupIdentifierProps:(const RNCEKV::GroupIdentifierProps &)oldProps
21
+ newProps:(const RNCEKV::GroupIdentifierProps &)newProps;
22
+ #endif
23
+
24
+ @end
25
+
26
+
27
+ #endif /* RNCEKVViewGroupIdentifierBase_h */
@@ -0,0 +1,61 @@
1
+ //
2
+ // RNCEKVViewGroupIdentifierBase.m
3
+ // react-native-external-keyboard
4
+ //
5
+ // Created by Artur Kalach on 09/04/2026.
6
+ //
7
+
8
+ #import <Foundation/Foundation.h>
9
+ #import "RNCEKVViewGroupIdentifierBase.h"
10
+ #import "RNCEKVGroupIdentifierDelegate.h"
11
+
12
+ #ifdef RCT_NEW_ARCH_ENABLED
13
+ #include "RNCEKVNativeProps.h"
14
+ #import "RNCEKVPropHelper.h"
15
+ #endif
16
+
17
+ @implementation RNCEKVViewGroupIdentifierBase {
18
+ RNCEKVGroupIdentifierDelegate *_gIdDelegate;
19
+ }
20
+
21
+ - (instancetype)initWithFrame:(CGRect)frame
22
+ {
23
+ if (self = [super initWithFrame:frame]) {
24
+ _gIdDelegate = [[RNCEKVGroupIdentifierDelegate alloc] initWithView: self];
25
+ }
26
+
27
+ return self;
28
+ }
29
+
30
+ - (NSString*)customGroupIdentifier {
31
+ return [_gIdDelegate getFocusGroupIdentifier];
32
+ }
33
+
34
+
35
+ #ifdef RCT_NEW_ARCH_ENABLED
36
+ - (void)updateGroupIdentifierProps:(const RNCEKV::GroupIdentifierProps &)oldProps
37
+ newProps:(const RNCEKV::GroupIdentifierProps &)newProps {
38
+ if (newProps.groupIdentifier.empty() && self.customGroupId != nil) {
39
+ self.customGroupId = nil;
40
+ }
41
+
42
+
43
+ NSString* newGroupId = [RNCEKVPropHelper unwrapStringValue: newProps.groupIdentifier];
44
+
45
+ if(![_customGroupId isEqual: newGroupId]) {
46
+ [self setCustomGroupId: newGroupId];
47
+ }
48
+ }
49
+ #endif
50
+
51
+ - (void) setCustomGroupId:(NSString *)customGroupId {
52
+ _customGroupId = customGroupId;
53
+ }
54
+
55
+ - (void)cleanReferences {
56
+ [super cleanReferences];
57
+ _customGroupId = nil;
58
+ }
59
+
60
+
61
+ @end
@@ -0,0 +1,30 @@
1
+ //
2
+ // RNCEKVViewKeyPress.h
3
+ // Pods
4
+ //
5
+ // Created by Artur Kalach on 09/04/2026.
6
+ //
7
+
8
+ #ifndef RNCEKVViewKeyPress_h
9
+ #define RNCEKVViewKeyPress_h
10
+
11
+ #import "RNCEKVViewFocusRequestBase.h"
12
+
13
+ @interface RNCEKVViewKeyPress : RNCEKVViewFocusRequestBase
14
+
15
+ @property BOOL hasOnPressUp;
16
+ @property BOOL hasOnPressDown;
17
+
18
+ #ifdef RCT_NEW_ARCH_ENABLED
19
+ - (void)updateKeyPressProps:(const RNCEKV::KeyPressProps &)oldProps
20
+ newProps:(const RNCEKV::KeyPressProps &)newProps;
21
+
22
+ #endif
23
+
24
+ - (void)onKeyDownPressHandler:(NSDictionary *)eventInfo;
25
+ - (void)onKeyUpPressHandler:(NSDictionary *)eventInfo;
26
+
27
+ @end
28
+
29
+
30
+ #endif /* RNCEKVViewKeyPress_h */