react-native-external-keyboard 0.6.8 → 0.7.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 (123) hide show
  1. package/README.md +37 -129
  2. package/android/src/main/java/com/externalkeyboard/ExternalKeyboardViewPackage.java +2 -0
  3. package/android/src/main/java/com/externalkeyboard/helper/FocusHelper.java +70 -0
  4. package/android/src/main/java/com/externalkeyboard/views/ExternalKeyboardLockView/ExternalKeyboardLockView.java +115 -0
  5. package/android/src/main/java/com/externalkeyboard/views/ExternalKeyboardLockView/ExternalKeyboardLockViewManager.java +32 -0
  6. package/android/src/main/java/com/externalkeyboard/views/ExternalKeyboardLockView/LockService.java +44 -0
  7. package/android/src/newarch/ExternalKeyboardLockViewManagerSpec.java +8 -0
  8. package/android/src/oldarch/ExternalKeyboardLockViewManagerSpec.java +12 -0
  9. package/ios/Delegates/RNCEKVFocusOrderDelegate/RNCEKVFocusGuideDelegate/RNCEKVFocusGuideDelegate.h +36 -0
  10. package/ios/Delegates/RNCEKVFocusOrderDelegate/RNCEKVFocusGuideDelegate/RNCEKVFocusGuideDelegate.mm +150 -0
  11. package/ios/Delegates/RNCEKVFocusOrderDelegate/RNCEKVFocusOrderDelegate.h +14 -0
  12. package/ios/Delegates/RNCEKVFocusOrderDelegate/RNCEKVFocusOrderDelegate.mm +98 -349
  13. package/ios/Extensions/RCTTextInputComponentView+RNCEKVExternalKeyboard.h +1 -1
  14. package/ios/Extensions/RCTTextInputComponentView+RNCEKVExternalKeyboard.mm +11 -3
  15. package/ios/Extensions/UIViewController+RNCEKVExternalKeyboard.h +1 -1
  16. package/ios/Extensions/UIViewController+RNCEKVExternalKeyboard.mm +17 -17
  17. package/ios/Helpers/RNCEKVFocusGuideHelper/RNCEKVFocusGuideHelper.h +32 -0
  18. package/ios/Helpers/RNCEKVFocusGuideHelper/RNCEKVFocusGuideHelper.mm +81 -0
  19. package/ios/Helpers/RNCEKVSwizzlingHelper/RNCEKVSwizzlingHelper.h +16 -0
  20. package/ios/Helpers/RNCEKVSwizzlingHelper/RNCEKVSwizzlingHelper.mm +27 -0
  21. package/ios/Modules/RNCEKVExternalKeyboardModule.mm +3 -3
  22. package/ios/Services/RNCEKVFocusLinkObserver.h +7 -1
  23. package/ios/Services/RNCEKVFocusLinkObserver.mm +31 -6
  24. package/ios/Services/RNCEKVKeyboardOrderManager/RNCEKVKeyboardOrderManager.h +17 -0
  25. package/ios/Services/RNCEKVKeyboardOrderManager/RNCEKVKeyboardOrderManager.mm +15 -0
  26. package/ios/Services/{RNCEKVRelashioship.h → RNCEKVKeyboardOrderManager/RNCEKVOrderRelationship/RNCEKVOrderRelationship.h} +8 -7
  27. package/ios/Services/{RNCEKVRelashioship.mm → RNCEKVKeyboardOrderManager/RNCEKVOrderRelationship/RNCEKVOrderRelationship.mm} +36 -13
  28. package/ios/Services/RNCEKVOrderLinking.h +2 -7
  29. package/ios/Services/RNCEKVOrderLinking.mm +27 -64
  30. package/ios/Services/RNCEKVOrderSubscriber.h +4 -3
  31. package/ios/Services/RNCEKVOrderSubscriber.mm +2 -1
  32. package/ios/Views/RNCEKVExternalKeyboardLockView/RNCEKVExternalKeyboardLockView.h +38 -0
  33. package/ios/Views/RNCEKVExternalKeyboardLockView/RNCEKVExternalKeyboardLockView.mm +62 -0
  34. package/ios/Views/RNCEKVExternalKeyboardLockView/RNCEKVExternalKeyboardLockViewManager.h +14 -0
  35. package/ios/Views/RNCEKVExternalKeyboardLockView/RNCEKVExternalKeyboardLockViewManager.mm +25 -0
  36. package/ios/Views/RNCEKVExternalKeyboardView/Helpers/RNCEKVFabricEventHelper/RNCEKVFabricEventHelper.mm +6 -4
  37. package/ios/Views/RNCEKVExternalKeyboardView/RNCEKVExternalKeyboardView.mm +2 -2
  38. package/ios/Views/RNCEKVKeyboardFocusGroupView/RNCEKVKeyboardFocusGroup.mm +0 -1
  39. package/ios/Views/RNCEKVTextInputFocusWrapper/RNCEKVTextInputFocusWrapper.mm +1 -15
  40. package/lib/commonjs/components/KeyboardFocusLock/FocusFrame/FocusFrame.android.js +21 -0
  41. package/lib/commonjs/components/KeyboardFocusLock/FocusFrame/FocusFrame.android.js.map +1 -0
  42. package/lib/commonjs/components/KeyboardFocusLock/FocusFrame/FocusFrame.js +11 -0
  43. package/lib/commonjs/components/KeyboardFocusLock/FocusFrame/FocusFrame.js.map +1 -0
  44. package/lib/commonjs/components/KeyboardFocusLock/FocusTrap/FocusTrap.android.js +19 -0
  45. package/lib/commonjs/components/KeyboardFocusLock/FocusTrap/FocusTrap.android.js.map +1 -0
  46. package/lib/commonjs/components/KeyboardFocusLock/FocusTrap/FocusTrap.js +15 -0
  47. package/lib/commonjs/components/KeyboardFocusLock/FocusTrap/FocusTrap.js.map +1 -0
  48. package/lib/commonjs/components/KeyboardFocusLock/FocusTrap/FocusTrapMountWrapper.js +46 -0
  49. package/lib/commonjs/components/KeyboardFocusLock/FocusTrap/FocusTrapMountWrapper.js.map +1 -0
  50. package/lib/commonjs/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.android.js +21 -0
  51. package/lib/commonjs/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.android.js.map +1 -0
  52. package/lib/commonjs/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.js +9 -0
  53. package/lib/commonjs/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.js.map +1 -0
  54. package/lib/commonjs/context/FocusFrameProviderContext.js +28 -0
  55. package/lib/commonjs/context/FocusFrameProviderContext.js.map +1 -0
  56. package/lib/commonjs/index.js +7 -1
  57. package/lib/commonjs/index.js.map +1 -1
  58. package/lib/commonjs/nativeSpec/ExternalKeyboardLockViewNativeComponent.js +10 -0
  59. package/lib/commonjs/nativeSpec/ExternalKeyboardLockViewNativeComponent.js.map +1 -0
  60. package/lib/commonjs/types/KeyboardFocusLock.types.js +6 -0
  61. package/lib/commonjs/types/KeyboardFocusLock.types.js.map +1 -0
  62. package/lib/module/components/KeyboardFocusLock/FocusFrame/FocusFrame.android.js +14 -0
  63. package/lib/module/components/KeyboardFocusLock/FocusFrame/FocusFrame.android.js.map +1 -0
  64. package/lib/module/components/KeyboardFocusLock/FocusFrame/FocusFrame.js +4 -0
  65. package/lib/module/components/KeyboardFocusLock/FocusFrame/FocusFrame.js.map +1 -0
  66. package/lib/module/components/KeyboardFocusLock/FocusTrap/FocusTrap.android.js +12 -0
  67. package/lib/module/components/KeyboardFocusLock/FocusTrap/FocusTrap.android.js.map +1 -0
  68. package/lib/module/components/KeyboardFocusLock/FocusTrap/FocusTrap.js +8 -0
  69. package/lib/module/components/KeyboardFocusLock/FocusTrap/FocusTrap.js.map +1 -0
  70. package/lib/module/components/KeyboardFocusLock/FocusTrap/FocusTrapMountWrapper.js +39 -0
  71. package/lib/module/components/KeyboardFocusLock/FocusTrap/FocusTrapMountWrapper.js.map +1 -0
  72. package/lib/module/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.android.js +14 -0
  73. package/lib/module/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.android.js.map +1 -0
  74. package/lib/module/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.js +3 -0
  75. package/lib/module/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.js.map +1 -0
  76. package/lib/module/context/FocusFrameProviderContext.js +20 -0
  77. package/lib/module/context/FocusFrameProviderContext.js.map +1 -0
  78. package/lib/module/index.js +6 -0
  79. package/lib/module/index.js.map +1 -1
  80. package/lib/module/nativeSpec/ExternalKeyboardLockViewNativeComponent.js +3 -0
  81. package/lib/module/nativeSpec/ExternalKeyboardLockViewNativeComponent.js.map +1 -0
  82. package/lib/module/types/KeyboardFocusLock.types.js +2 -0
  83. package/lib/module/types/KeyboardFocusLock.types.js.map +1 -0
  84. package/lib/typescript/src/components/KeyboardFocusLock/FocusFrame/FocusFrame.android.d.ts +4 -0
  85. package/lib/typescript/src/components/KeyboardFocusLock/FocusFrame/FocusFrame.android.d.ts.map +1 -0
  86. package/lib/typescript/src/components/KeyboardFocusLock/FocusFrame/FocusFrame.d.ts +3 -0
  87. package/lib/typescript/src/components/KeyboardFocusLock/FocusFrame/FocusFrame.d.ts.map +1 -0
  88. package/lib/typescript/src/components/KeyboardFocusLock/FocusTrap/FocusTrap.android.d.ts +4 -0
  89. package/lib/typescript/src/components/KeyboardFocusLock/FocusTrap/FocusTrap.android.d.ts.map +1 -0
  90. package/lib/typescript/src/components/KeyboardFocusLock/FocusTrap/FocusTrap.d.ts +3 -0
  91. package/lib/typescript/src/components/KeyboardFocusLock/FocusTrap/FocusTrap.d.ts.map +1 -0
  92. package/lib/typescript/src/components/KeyboardFocusLock/FocusTrap/FocusTrapMountWrapper.d.ts +3 -0
  93. package/lib/typescript/src/components/KeyboardFocusLock/FocusTrap/FocusTrapMountWrapper.d.ts.map +1 -0
  94. package/lib/typescript/src/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.android.d.ts +4 -0
  95. package/lib/typescript/src/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.android.d.ts.map +1 -0
  96. package/lib/typescript/src/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.d.ts +3 -0
  97. package/lib/typescript/src/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.d.ts.map +1 -0
  98. package/lib/typescript/src/components/Touchable/Pressable.d.ts +1 -1
  99. package/lib/typescript/src/context/FocusFrameProviderContext.d.ts +12 -0
  100. package/lib/typescript/src/context/FocusFrameProviderContext.d.ts.map +1 -0
  101. package/lib/typescript/src/index.d.ts +4 -0
  102. package/lib/typescript/src/index.d.ts.map +1 -1
  103. package/lib/typescript/src/nativeSpec/ExternalKeyboardLockViewNativeComponent.d.ts +9 -0
  104. package/lib/typescript/src/nativeSpec/ExternalKeyboardLockViewNativeComponent.d.ts.map +1 -0
  105. package/lib/typescript/src/types/KeyboardFocusLock.types.d.ts +6 -0
  106. package/lib/typescript/src/types/KeyboardFocusLock.types.d.ts.map +1 -0
  107. package/lib/typescript/src/utils/withKeyboardFocus.d.ts +1 -1
  108. package/package.json +4 -3
  109. package/src/components/KeyboardFocusLock/FocusFrame/FocusFrame.android.tsx +18 -0
  110. package/src/components/KeyboardFocusLock/FocusFrame/FocusFrame.tsx +8 -0
  111. package/src/components/KeyboardFocusLock/FocusTrap/FocusTrap.android.tsx +17 -0
  112. package/src/components/KeyboardFocusLock/FocusTrap/FocusTrap.tsx +9 -0
  113. package/src/components/KeyboardFocusLock/FocusTrap/FocusTrapMountWrapper.ts +40 -0
  114. package/src/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.android.tsx +16 -0
  115. package/src/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.tsx +5 -0
  116. package/src/context/FocusFrameProviderContext.tsx +36 -0
  117. package/src/index.tsx +8 -0
  118. package/src/nativeSpec/ExternalKeyboardLockViewNativeComponent.ts +13 -0
  119. package/src/types/KeyboardFocusLock.types.ts +6 -0
  120. package/ios/Services/RNCEKVFocusLinkObserverManager.h +0 -23
  121. package/ios/Services/RNCEKVFocusLinkObserverManager.mm +0 -30
  122. /package/ios/Services/{RNCEKVSortedMap.h → RNCEKVKeyboardOrderManager/RNCEKVOrderRelationship/RNCEKVSortedMap/RNCEKVSortedMap.h} +0 -0
  123. /package/ios/Services/{RNCEKVSortedMap.mm → RNCEKVKeyboardOrderManager/RNCEKVOrderRelationship/RNCEKVSortedMap/RNCEKVSortedMap.mm} +0 -0
@@ -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;