react-native-external-keyboard 0.8.5 → 0.9.1

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 (159) hide show
  1. package/README.md +149 -67
  2. package/android/src/main/java/com/externalkeyboard/delegates/FocusOrderDelegate.java +81 -75
  3. package/android/src/main/java/com/externalkeyboard/delegates/FocusOrderDelegateHost.java +14 -0
  4. package/android/src/main/java/com/externalkeyboard/helper/Linking/A11yOrderLinking.java +5 -0
  5. package/android/src/main/java/com/externalkeyboard/modules/ExternalKeyboardModule.java +10 -10
  6. package/android/src/main/java/com/externalkeyboard/services/FocusLinkObserver/FocusLinkObserver.java +26 -35
  7. package/android/src/main/java/com/externalkeyboard/views/ExternalKeyboardLockView/ExternalKeyboardLockView.java +5 -0
  8. package/android/src/main/java/com/externalkeyboard/views/ExternalKeyboardLockView/ExternalKeyboardLockViewManager.java +6 -0
  9. package/android/src/main/java/com/externalkeyboard/views/ExternalKeyboardView/ExternalKeyboardView.java +8 -307
  10. package/android/src/main/java/com/externalkeyboard/views/ExternalKeyboardView/ExternalKeyboardViewManager.java +11 -18
  11. package/android/src/main/java/com/externalkeyboard/views/TextInputFocusWrapper/TextInputFocusWrapper.java +208 -101
  12. package/android/src/main/java/com/externalkeyboard/views/TextInputFocusWrapper/TextInputFocusWrapperManager.java +123 -34
  13. package/android/src/main/java/com/externalkeyboard/views/base/FocusHighlightBase.java +38 -0
  14. package/android/src/main/java/com/externalkeyboard/views/base/ViewGroupBase.java +19 -0
  15. package/android/src/main/java/com/externalkeyboard/views/base/ViewOrderGroupBase.java +190 -0
  16. package/android/src/main/java/com/externalkeyboard/views/base/keyboard/ViewFocusChangeBase.java +39 -0
  17. package/android/src/main/java/com/externalkeyboard/views/base/keyboard/ViewFocusRequestBase.java +125 -0
  18. package/android/src/main/java/com/externalkeyboard/views/base/keyboard/ViewKeyHandlerBase.java +40 -0
  19. package/android/src/newarch/TextInputFocusWrapperManagerSpec.java +2 -8
  20. package/android/src/oldarch/ExternalKeyboardLockViewManagerSpec.java +1 -0
  21. package/android/src/oldarch/TextInputFocusWrapperManagerSpec.java +32 -2
  22. package/ios/Delegates/RNCEKVFocusLinkDelegate/RNCEKVFocusLinkDelegate.h +35 -0
  23. package/ios/Delegates/RNCEKVFocusLinkDelegate/RNCEKVFocusLinkDelegate.mm +195 -0
  24. package/ios/Delegates/RNCEKVFocusOrderDelegate/RNCEKVFocusOrderProtocol.h +6 -8
  25. package/ios/Delegates/RNCEKVFocusSequenceDelegate/RNCEKVFocusSequenceDelegate.h +25 -0
  26. package/ios/Delegates/RNCEKVFocusSequenceDelegate/RNCEKVFocusSequenceDelegate.mm +163 -0
  27. package/ios/Delegates/RNCEKVGroupIdentifierDelegate/RNCEKVGroupIdentifierDelegate.h +2 -6
  28. package/ios/Delegates/RNCEKVGroupIdentifierDelegate/RNCEKVGroupIdentifierDelegate.mm +6 -78
  29. package/ios/Delegates/RNCEKVHaloDelegate/RNCEKVHaloDelegate.h +3 -4
  30. package/ios/Delegates/RNCEKVHaloDelegate/RNCEKVHaloDelegate.mm +32 -101
  31. package/ios/Delegates/RNCEKVHaloDelegate/RNCEKVHaloProtocol.h +1 -1
  32. package/ios/Extensions/RCTEnhancedScrollView+RNCEKVExternalKeyboard.mm +1 -1
  33. package/ios/Extensions/RCTTextInputComponentView+RNCEKVExternalKeyboard.mm +15 -0
  34. package/ios/Extensions/RCTViewComponentView+RNCEKVExternalKeyboard.h +9 -6
  35. package/ios/Extensions/RCTViewComponentView+RNCEKVExternalKeyboard.mm +16 -29
  36. package/ios/Extensions/UIViewController+RNCEKVExternalKeyboard.h +1 -0
  37. package/ios/Extensions/UIViewController+RNCEKVExternalKeyboard.mm +8 -0
  38. package/ios/Helpers/RNCEKVNativeProps/RNCEKVNativeProps.h +123 -0
  39. package/ios/Protocols/RNCEKVCustomFocusEffectProtocol.h +15 -0
  40. package/ios/Protocols/RNCEKVCustomGroudIdProtocol.h +15 -0
  41. package/ios/Protocols/RNCEKVKeyboardFocusableProtocol.h +15 -0
  42. package/ios/Services/RNCEKVFocusLinkObserver.mm +2 -3
  43. package/ios/Services/RNCEKVKeyboardOrderManager/RNCEKVOrderRelationship/RNCEKVOrderRelationship.mm +15 -28
  44. package/ios/Services/RNCEKVOrderLinking.mm +43 -51
  45. package/ios/Views/Base/ContextMenu/RNCEKVViewContextMenuBase.h +33 -0
  46. package/ios/Views/Base/ContextMenu/RNCEKVViewContextMenuBase.mm +84 -0
  47. package/ios/Views/Base/FocusChange/RNCEKVViewFocusChangeBase.h +37 -0
  48. package/ios/Views/Base/FocusChange/RNCEKVViewFocusChangeBase.mm +89 -0
  49. package/ios/Views/Base/FocusOrderGroup/RNCEKVViewOrderGroupBase.h +49 -0
  50. package/ios/Views/Base/FocusOrderGroup/RNCEKVViewOrderGroupBase.mm +245 -0
  51. package/ios/Views/Base/FocusRequest/RNCEKVViewFocusRequestBase.h +34 -0
  52. package/ios/Views/Base/FocusRequest/RNCEKVViewFocusRequestBase.mm +112 -0
  53. package/ios/Views/Base/GroupIdentifier/RNCEKVViewGroupIdentifierBase.h +27 -0
  54. package/ios/Views/Base/GroupIdentifier/RNCEKVViewGroupIdentifierBase.mm +69 -0
  55. package/ios/Views/Base/KeyPress/RNCEKVViewKeyPress.h +30 -0
  56. package/ios/Views/Base/KeyPress/RNCEKVViewKeyPress.mm +75 -0
  57. package/ios/Views/Base/KeyboardHallo/RNCEKVExternalKeyboardHalloBase.h +33 -0
  58. package/ios/Views/Base/KeyboardHallo/RNCEKVExternalKeyboardHalloBase.mm +92 -0
  59. package/ios/Views/Base/ViewGroup/RNCEKVViewGroupBase.h +36 -0
  60. package/ios/Views/Base/ViewGroup/RNCEKVViewGroupBase.mm +63 -0
  61. package/ios/Views/RNCEKVExternalKeyboardLockView/RNCEKVExternalKeyboardLockView.h +8 -0
  62. package/ios/Views/RNCEKVExternalKeyboardLockView/RNCEKVExternalKeyboardLockView.mm +105 -2
  63. package/ios/Views/RNCEKVExternalKeyboardLockView/RNCEKVExternalKeyboardLockViewManager.mm +11 -0
  64. package/ios/Views/RNCEKVExternalKeyboardView/RNCEKVExternalKeyboardView.h +7 -82
  65. package/ios/Views/RNCEKVExternalKeyboardView/RNCEKVExternalKeyboardView.mm +23 -493
  66. package/ios/Views/RNCEKVExternalKeyboardView/RNCEKVExternalKeyboardViewManager.mm +5 -7
  67. package/ios/Views/RNCEKVKeyboardFocusGroupView/RNCEKVKeyboardFocusGroup.mm +20 -17
  68. package/ios/Views/RNCEKVTextInputFocusWrapper/RNCEKVTextInputFocusWrapper.h +10 -39
  69. package/ios/Views/RNCEKVTextInputFocusWrapper/RNCEKVTextInputFocusWrapper.mm +40 -73
  70. package/ios/Views/RNCEKVTextInputFocusWrapper/RNCEKVTextInputFocusWrapperManager.mm +76 -8
  71. package/lib/commonjs/components/BaseKeyboardView/BaseKeyboardView.js +35 -7
  72. package/lib/commonjs/components/BaseKeyboardView/BaseKeyboardView.js.map +1 -1
  73. package/lib/commonjs/components/KeyboardExtendedInput/KeyboardExtendedInput.js +79 -1
  74. package/lib/commonjs/components/KeyboardExtendedInput/KeyboardExtendedInput.js.map +1 -1
  75. package/lib/commonjs/components/KeyboardFocusLock/FocusTrap/FocusTrap.js +18 -4
  76. package/lib/commonjs/components/KeyboardFocusLock/FocusTrap/FocusTrap.js.map +1 -1
  77. package/lib/commonjs/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.js +17 -2
  78. package/lib/commonjs/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.js.map +1 -1
  79. package/lib/commonjs/components/KeyboardFocusView/KeyboardFocusView.js +2 -0
  80. package/lib/commonjs/components/KeyboardFocusView/KeyboardFocusView.js.map +1 -1
  81. package/lib/commonjs/nativeSpec/ExternalKeyboardLockViewNativeComponent.ts +1 -0
  82. package/lib/commonjs/nativeSpec/TextInputFocusWrapperNativeComponent.ts +16 -0
  83. package/lib/commonjs/utils/useFocusStyle.js +3 -9
  84. package/lib/commonjs/utils/useFocusStyle.js.map +1 -1
  85. package/lib/commonjs/utils/withKeyboardFocus.js +32 -15
  86. package/lib/commonjs/utils/withKeyboardFocus.js.map +1 -1
  87. package/lib/commonjs/utils/wrapOrderPrefix.js +17 -0
  88. package/lib/commonjs/utils/wrapOrderPrefix.js.map +1 -0
  89. package/lib/module/components/BaseKeyboardView/BaseKeyboardView.js +35 -7
  90. package/lib/module/components/BaseKeyboardView/BaseKeyboardView.js.map +1 -1
  91. package/lib/module/components/KeyboardExtendedInput/KeyboardExtendedInput.js +80 -2
  92. package/lib/module/components/KeyboardExtendedInput/KeyboardExtendedInput.js.map +1 -1
  93. package/lib/module/components/KeyboardFocusLock/FocusTrap/FocusTrap.js +18 -4
  94. package/lib/module/components/KeyboardFocusLock/FocusTrap/FocusTrap.js.map +1 -1
  95. package/lib/module/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.js +16 -2
  96. package/lib/module/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.js.map +1 -1
  97. package/lib/module/components/KeyboardFocusView/KeyboardFocusView.js +2 -0
  98. package/lib/module/components/KeyboardFocusView/KeyboardFocusView.js.map +1 -1
  99. package/lib/module/nativeSpec/ExternalKeyboardLockViewNativeComponent.ts +1 -0
  100. package/lib/module/nativeSpec/TextInputFocusWrapperNativeComponent.ts +16 -0
  101. package/lib/module/utils/useFocusStyle.js +4 -10
  102. package/lib/module/utils/useFocusStyle.js.map +1 -1
  103. package/lib/module/utils/withKeyboardFocus.js +32 -15
  104. package/lib/module/utils/withKeyboardFocus.js.map +1 -1
  105. package/lib/module/utils/wrapOrderPrefix.js +12 -0
  106. package/lib/module/utils/wrapOrderPrefix.js.map +1 -0
  107. package/lib/typescript/src/components/BaseKeyboardView/BaseKeyboardView.d.ts.map +1 -1
  108. package/lib/typescript/src/components/KeyboardExtendedInput/KeyboardExtendedInput.d.ts.map +1 -1
  109. package/lib/typescript/src/components/KeyboardExtendedInput/KeyboardExtendedInput.types.d.ts +15 -0
  110. package/lib/typescript/src/components/KeyboardExtendedInput/KeyboardExtendedInput.types.d.ts.map +1 -1
  111. package/lib/typescript/src/components/KeyboardFocusLock/FocusTrap/FocusTrap.d.ts +1 -1
  112. package/lib/typescript/src/components/KeyboardFocusLock/FocusTrap/FocusTrap.d.ts.map +1 -1
  113. package/lib/typescript/src/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.d.ts +2 -1
  114. package/lib/typescript/src/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.d.ts.map +1 -1
  115. package/lib/typescript/src/components/KeyboardFocusView/KeyboardFocusView.d.ts.map +1 -1
  116. package/lib/typescript/src/index.d.ts +1 -1
  117. package/lib/typescript/src/nativeSpec/ExternalKeyboardLockViewNativeComponent.d.ts +1 -0
  118. package/lib/typescript/src/nativeSpec/ExternalKeyboardLockViewNativeComponent.d.ts.map +1 -1
  119. package/lib/typescript/src/nativeSpec/TextInputFocusWrapperNativeComponent.d.ts +16 -1
  120. package/lib/typescript/src/nativeSpec/TextInputFocusWrapperNativeComponent.d.ts.map +1 -1
  121. package/lib/typescript/src/types/BaseKeyboardView.d.ts +2 -0
  122. package/lib/typescript/src/types/BaseKeyboardView.d.ts.map +1 -1
  123. package/lib/typescript/src/types/KeyboardFocusLock.types.d.ts +1 -0
  124. package/lib/typescript/src/types/KeyboardFocusLock.types.d.ts.map +1 -1
  125. package/lib/typescript/src/types/WithKeyboardFocus.d.ts +11 -2
  126. package/lib/typescript/src/types/WithKeyboardFocus.d.ts.map +1 -1
  127. package/lib/typescript/src/utils/useFocusStyle.d.ts +1 -0
  128. package/lib/typescript/src/utils/useFocusStyle.d.ts.map +1 -1
  129. package/lib/typescript/src/utils/withKeyboardFocus.d.ts.map +1 -1
  130. package/lib/typescript/src/utils/wrapOrderPrefix.d.ts +9 -0
  131. package/lib/typescript/src/utils/wrapOrderPrefix.d.ts.map +1 -0
  132. package/package.json +6 -2
  133. package/src/components/BaseKeyboardView/BaseKeyboardView.tsx +88 -10
  134. package/src/components/KeyboardExtendedInput/KeyboardExtendedInput.tsx +138 -2
  135. package/src/components/KeyboardExtendedInput/KeyboardExtendedInput.types.ts +15 -0
  136. package/src/components/KeyboardFocusLock/FocusTrap/FocusTrap.tsx +21 -4
  137. package/src/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.tsx +20 -3
  138. package/src/components/KeyboardFocusView/KeyboardFocusView.tsx +2 -0
  139. package/src/nativeSpec/ExternalKeyboardLockViewNativeComponent.ts +1 -0
  140. package/src/nativeSpec/TextInputFocusWrapperNativeComponent.ts +16 -0
  141. package/src/types/BaseKeyboardView.ts +2 -0
  142. package/src/types/KeyboardFocusLock.types.ts +1 -0
  143. package/src/types/WithKeyboardFocus.ts +19 -2
  144. package/src/utils/useFocusStyle.tsx +5 -15
  145. package/src/utils/withKeyboardFocus.tsx +44 -15
  146. package/src/utils/wrapOrderPrefix.ts +16 -0
  147. package/ios/Delegates/RNCEKVFocusOrderDelegate/RNCEKVFocusGuideDelegate/RNCEKVFocusGuideDelegate.h +0 -36
  148. package/ios/Delegates/RNCEKVFocusOrderDelegate/RNCEKVFocusGuideDelegate/RNCEKVFocusGuideDelegate.mm +0 -150
  149. package/ios/Delegates/RNCEKVFocusOrderDelegate/RNCEKVFocusOrderDelegate.h +0 -47
  150. package/ios/Delegates/RNCEKVFocusOrderDelegate/RNCEKVFocusOrderDelegate.mm +0 -326
  151. package/ios/Services/RNCEKVKeyboardOrderManager/RNCEKVKeyboardOrderManager.h +0 -17
  152. package/ios/Services/RNCEKVKeyboardOrderManager/RNCEKVKeyboardOrderManager.mm +0 -15
  153. package/lib/commonjs/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.android.js +0 -22
  154. package/lib/commonjs/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.android.js.map +0 -1
  155. package/lib/module/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.android.js +0 -17
  156. package/lib/module/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.android.js.map +0 -1
  157. package/lib/typescript/src/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.android.d.ts +0 -4
  158. package/lib/typescript/src/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.android.d.ts.map +0 -1
  159. package/src/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.android.tsx +0 -16
@@ -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,112 @@
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
+ - (void)a11yFocus {
75
+ if (!_enableA11yFocus)
76
+ return;
77
+ UIView *focusView = [self getFocusTargetView];
78
+ UIAccessibilityPostNotification(UIAccessibilityLayoutChangedNotification,
79
+ focusView);
80
+ }
81
+
82
+ - (void)focusOnMount {
83
+ if (self.autoFocus) {
84
+ if(!_autoFocusRequested) {
85
+ _autoFocusRequested = YES;
86
+ dispatch_async(dispatch_get_main_queue(), ^{
87
+ dispatch_async(dispatch_get_main_queue(), ^{
88
+ [self focus];
89
+ });
90
+ });
91
+ }
92
+ }
93
+ }
94
+
95
+
96
+ - (void)didMoveToWindow {
97
+ [super didMoveToWindow];
98
+
99
+ if (self.window) {
100
+ [self onAttached];
101
+ }
102
+
103
+ if (self.window && !_isAttachedToWindow) {
104
+ if (self.autoFocus) {
105
+ [self focus];
106
+ }
107
+ _isAttachedToWindow = YES;
108
+ }
109
+ }
110
+
111
+
112
+ @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,69 @@
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 *)focusGroupIdentifier {
31
+ if(self.canBecomeFocused) {
32
+ return [self customGroupIdentifier];
33
+ }
34
+
35
+ return [super focusGroupIdentifier];
36
+ }
37
+
38
+ - (NSString*)customGroupIdentifier {
39
+ return _gIdDelegate.focusGroupIdentifier;
40
+ }
41
+
42
+
43
+ #ifdef RCT_NEW_ARCH_ENABLED
44
+ - (void)updateGroupIdentifierProps:(const RNCEKV::GroupIdentifierProps &)oldProps
45
+ newProps:(const RNCEKV::GroupIdentifierProps &)newProps {
46
+ if (newProps.groupIdentifier.empty() && self.customGroupId != nil) {
47
+ self.customGroupId = nil;
48
+ }
49
+
50
+
51
+ NSString* newGroupId = [RNCEKVPropHelper unwrapStringValue: newProps.groupIdentifier];
52
+
53
+ if(![_customGroupId isEqual: newGroupId]) {
54
+ [self setCustomGroupId: newGroupId];
55
+ }
56
+ }
57
+ #endif
58
+
59
+ - (void) setCustomGroupId:(NSString *)customGroupId {
60
+ _customGroupId = customGroupId;
61
+ }
62
+
63
+ - (void)cleanReferences {
64
+ [super cleanReferences];
65
+ _customGroupId = nil;
66
+ }
67
+
68
+
69
+ @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 */
@@ -0,0 +1,75 @@
1
+ //
2
+ // RNCEKVViewKeyPress.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
+ #import "RNCEKVViewKeyPress.h"
11
+ #import "RNCEKVKeyboardKeyPressHandler.h"
12
+
13
+
14
+
15
+
16
+ @implementation RNCEKVViewKeyPress {
17
+ RNCEKVKeyboardKeyPressHandler *_keyboardKeyPressHandler;
18
+ }
19
+
20
+ - (instancetype)initWithFrame:(CGRect)frame {
21
+ if (self = [super initWithFrame:frame]) {
22
+ _keyboardKeyPressHandler = [[RNCEKVKeyboardKeyPressHandler alloc] init];
23
+ }
24
+
25
+ return self;
26
+ }
27
+
28
+ - (void)cleanReferences {
29
+ [super cleanReferences];
30
+ }
31
+
32
+ #ifdef RCT_NEW_ARCH_ENABLED
33
+ - (void)updateKeyPressProps:(const RNCEKV::KeyPressProps &)oldProps
34
+ newProps:(const RNCEKV::KeyPressProps &)newProps {
35
+ if (oldProps.hasKeyUpPress != newProps.hasKeyUpPress) {
36
+ [self setHasOnPressUp:newProps.hasKeyUpPress];
37
+ }
38
+
39
+ if (oldProps.hasKeyDownPress != newProps.hasKeyDownPress) {
40
+ [self setHasOnPressDown:newProps.hasKeyDownPress];
41
+ }
42
+ }
43
+
44
+ #endif
45
+
46
+
47
+ - (void)pressesBegan:(NSSet<UIPress *> *)presses
48
+ withEvent:(UIPressesEvent *)event {
49
+ NSDictionary *eventInfo = [_keyboardKeyPressHandler actionDownHandler:presses
50
+ withEvent:event];
51
+
52
+ if (self.hasOnPressUp || self.hasOnPressDown) {
53
+ [self onKeyDownPressHandler:eventInfo];
54
+ }
55
+
56
+ [super pressesBegan:presses withEvent:event];
57
+ }
58
+
59
+ - (void)pressesEnded:(NSSet<UIPress *> *)presses
60
+ withEvent:(UIPressesEvent *)event {
61
+ NSDictionary *eventInfo = [_keyboardKeyPressHandler actionUpHandler:presses
62
+ withEvent:event];
63
+
64
+ if (self.hasOnPressUp || self.hasOnPressDown) {
65
+ [self onKeyUpPressHandler:eventInfo];
66
+ }
67
+
68
+ [super pressesEnded:presses withEvent:event];
69
+ }
70
+
71
+ - (void)onKeyDownPressHandler:(NSDictionary *)eventInfo{}
72
+ - (void)onKeyUpPressHandler:(NSDictionary *)eventInfo{}
73
+
74
+
75
+ @end
@@ -0,0 +1,33 @@
1
+ //
2
+ // RNCEKVExternalKeyboardHalloBase.h
3
+ // Pods
4
+ //
5
+ // Created by Artur Kalach on 08/04/2026.
6
+ //
7
+
8
+ #ifndef RNCEKVExternalKeyboardHalloBase_h
9
+ #define RNCEKVExternalKeyboardHalloBase_h
10
+
11
+ #import "RNCEKVViewOrderGroupBase.h"
12
+ #import "RNCEKVCustomFocusEffectProtocol.h"
13
+ #import "RNCEKVHaloProtocol.h"
14
+
15
+ #ifdef RCT_NEW_ARCH_ENABLED
16
+ #include "RNCEKVNativeProps.h"
17
+ #endif
18
+
19
+ @interface RNCEKVExternalKeyboardHalloBase : RNCEKVViewOrderGroupBase<RNCEKVHaloProtocol, RNCEKVCustomFocusEffectProtocol>
20
+
21
+ @property (nonatomic, assign) CGFloat haloCornerRadius;
22
+ @property (nonatomic, assign) CGFloat haloExpendX;
23
+ @property (nonatomic, assign) CGFloat haloExpendY;
24
+ @property (nonatomic, assign) BOOL isHaloHidden;
25
+
26
+ #ifdef RCT_NEW_ARCH_ENABLED
27
+ - (void)updateHaloProps:(const RNCEKV::HaloProps &)oldProps
28
+ newProps:(const RNCEKV::HaloProps &)newProps;
29
+ #endif
30
+
31
+ @end
32
+
33
+ #endif /* RNCEKVExternalKeyboardHalloBase_h */
@@ -0,0 +1,92 @@
1
+ //
2
+ // RNCEKVExternakKeyboardHalloBase.m
3
+ // react-native-external-keyboard
4
+ //
5
+ // Created by Artur Kalach on 08/04/2026.
6
+ //
7
+
8
+ #import <Foundation/Foundation.h>
9
+
10
+ #import "RNCEKVHaloDelegate.h"
11
+ #import "RNCEKVExternalKeyboardHalloBase.h"
12
+
13
+ #ifdef RCT_NEW_ARCH_ENABLED
14
+ #import <React/RCTConversions.h>
15
+ #endif
16
+
17
+ @implementation RNCEKVExternalKeyboardHalloBase {
18
+ RNCEKVHaloDelegate *_haloDelegate;
19
+ }
20
+
21
+ - (instancetype)initWithFrame:(CGRect)frame
22
+ {
23
+ if (self = [super initWithFrame:frame]) {
24
+ _haloDelegate = [[RNCEKVHaloDelegate alloc] initWithView:self];
25
+ }
26
+
27
+ return self;
28
+ }
29
+
30
+ - (UIFocusEffect*)customFocusEffect API_AVAILABLE(ios(15.0)){
31
+ return _haloDelegate.focusEffect;
32
+ }
33
+
34
+ - (void)cleanReferences {
35
+ [super cleanReferences];
36
+ [_haloDelegate clear];
37
+ _isHaloHidden = false;
38
+ _haloExpendX = 0;
39
+ _haloExpendY = 0;
40
+ _haloCornerRadius = 0;
41
+ }
42
+
43
+
44
+ - (void)setIsHaloHidden:(BOOL)isHaloHidden {
45
+ _isHaloHidden = isHaloHidden;
46
+ [_haloDelegate invalidate];
47
+ }
48
+
49
+ - (void)setHaloCornerRadius:(CGFloat)haloCornerRadius {
50
+ _haloCornerRadius = haloCornerRadius;
51
+ [_haloDelegate invalidate];
52
+ }
53
+
54
+ - (void)setHaloExpendX:(CGFloat)haloExpendX {
55
+ _haloExpendX = haloExpendX;
56
+ [_haloDelegate invalidate];
57
+ }
58
+
59
+ - (void)setHaloExpendY:(CGFloat)haloExpendY {
60
+ _haloExpendY = haloExpendY;
61
+ [_haloDelegate invalidate];
62
+ }
63
+
64
+ #ifdef RCT_NEW_ARCH_ENABLED
65
+ - (void)updateHaloProps:(const RNCEKV::HaloProps &)oldProps
66
+ newProps:(const RNCEKV::HaloProps &)newProps {
67
+ if (_isHaloHidden == newProps.haloEffect) {
68
+ [self setIsHaloHidden: !newProps.haloEffect];
69
+ }
70
+
71
+ if (oldProps.haloExpendX != newProps.haloExpendX) {
72
+ [self setHaloExpendX:newProps.haloExpendX];
73
+ }
74
+
75
+ if (oldProps.haloExpendY != newProps.haloExpendY) {
76
+ [self setHaloExpendY:newProps.haloExpendY];
77
+ }
78
+
79
+ if (oldProps.haloCornerRadius != newProps.haloCornerRadius) {
80
+ [self setHaloCornerRadius:newProps.haloCornerRadius];
81
+ }
82
+
83
+ UIColor *newColor = RCTUIColorFromSharedColor(newProps.tintColor);
84
+ BOOL renewColor = newColor != nil && self.tintColor == nil;
85
+ BOOL isColorChanged = oldProps.tintColor != newProps.tintColor;
86
+ if (isColorChanged || renewColor) {
87
+ self.tintColor = RCTUIColorFromSharedColor(newProps.tintColor);
88
+ }
89
+ }
90
+ #endif
91
+
92
+ @end
@@ -0,0 +1,36 @@
1
+ //
2
+ // RNCEKVViewGroupBase.h
3
+ // Pods
4
+ //
5
+ // Created by Artur Kalach on 07/04/2026.
6
+ //
7
+
8
+ #ifndef RNCEKVViewGroupBase_h
9
+ #define RNCEKVViewGroupBase_h
10
+
11
+ #import <UIKit/UIKit.h>
12
+
13
+ #ifdef RCT_NEW_ARCH_ENABLED
14
+ #import <React/RCTViewComponentView.h>
15
+ #define RNCEKVBaseViewClass RCTViewComponentView
16
+ #else
17
+ #import <React/RCTView.h>
18
+ #define RNCEKVBaseViewClass RCTView
19
+ #endif
20
+
21
+ NS_ASSUME_NONNULL_BEGIN
22
+
23
+ @interface RNCEKVViewGroupBase : RNCEKVBaseViewClass
24
+
25
+ - (UIView*)getStoredView;
26
+ - (void)onSubviewAdded:(UIView *)subview;
27
+ - (void)onSubviewRemoved:(UIView *)subview;
28
+ - (void)onSubviewsLayoutUpdated;
29
+
30
+ - (void)cleanReferences;
31
+
32
+ @end
33
+
34
+ NS_ASSUME_NONNULL_END
35
+
36
+ #endif /* RNCEKVViewGroupBase_h */
@@ -0,0 +1,63 @@
1
+ //
2
+ // RNCEKVViewGroupBase.m
3
+ // react-native-external-keyboard
4
+ //
5
+ // Created by Artur Kalach on 07/04/2026.
6
+ //
7
+
8
+ #import "RNCEKVViewGroupBase.h"
9
+
10
+ @interface RNCEKVViewGroupBase ()
11
+
12
+ @property (nonatomic, weak, nullable) UIView *storedView;
13
+
14
+ @end
15
+
16
+
17
+ @implementation RNCEKVViewGroupBase
18
+
19
+ - (void)didAddSubview:(UIView *)subview {
20
+ [super didAddSubview:subview];
21
+
22
+ if (self.storedView == nil) {
23
+ self.storedView = subview;
24
+ [self onSubviewAdded:subview];
25
+ }
26
+ }
27
+
28
+ - (void)cleanReferences{
29
+ self.storedView = nil;
30
+ }
31
+
32
+ - (void)willRemoveSubview:(UIView *)subview {
33
+ [super willRemoveSubview:subview];
34
+
35
+ if (self.storedView == subview) {
36
+ self.storedView = nil;
37
+ [self onSubviewRemoved:subview];
38
+ }
39
+ }
40
+
41
+ - (UIView*)getStoredView {
42
+ return self.storedView;
43
+ }
44
+
45
+ #pragma mark - Layout updates
46
+
47
+ - (void)layoutSubviews {
48
+ [super layoutSubviews];
49
+
50
+ if (self.storedView != nil) {
51
+ [self onSubviewsLayoutUpdated];
52
+ }
53
+ }
54
+
55
+ #pragma mark - Hooks (override in subclass)
56
+
57
+ - (void)onSubviewAdded:(UIView *)subview {}
58
+
59
+ - (void)onSubviewRemoved:(UIView *)subview {}
60
+
61
+ - (void)onSubviewsLayoutUpdated {}
62
+
63
+ @end
@@ -20,6 +20,10 @@
20
20
  NS_ASSUME_NONNULL_BEGIN
21
21
 
22
22
  @interface RNCEKVExternalKeyboardLockView : RCTViewComponentView
23
+
24
+ @property (nonatomic, assign) BOOL forceLock;
25
+ @property (nonatomic, assign) BOOL lockDisabled;
26
+
23
27
  @end
24
28
 
25
29
  NS_ASSUME_NONNULL_END
@@ -30,6 +34,10 @@ NS_ASSUME_NONNULL_END
30
34
 
31
35
  #import <React/RCTView.h>
32
36
  @interface RNCEKVExternalKeyboardLockView : RCTView
37
+
38
+ @property (nonatomic, assign) BOOL forceLock;
39
+ @property (nonatomic, assign) BOOL lockDisabled;
40
+
33
41
  @end
34
42
 
35
43
  #endif