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.
- package/README.md +149 -67
- package/android/src/main/java/com/externalkeyboard/delegates/FocusOrderDelegate.java +81 -75
- package/android/src/main/java/com/externalkeyboard/delegates/FocusOrderDelegateHost.java +14 -0
- package/android/src/main/java/com/externalkeyboard/helper/Linking/A11yOrderLinking.java +5 -0
- package/android/src/main/java/com/externalkeyboard/modules/ExternalKeyboardModule.java +10 -10
- package/android/src/main/java/com/externalkeyboard/services/FocusLinkObserver/FocusLinkObserver.java +26 -35
- package/android/src/main/java/com/externalkeyboard/views/ExternalKeyboardLockView/ExternalKeyboardLockView.java +5 -0
- package/android/src/main/java/com/externalkeyboard/views/ExternalKeyboardLockView/ExternalKeyboardLockViewManager.java +6 -0
- package/android/src/main/java/com/externalkeyboard/views/ExternalKeyboardView/ExternalKeyboardView.java +8 -307
- package/android/src/main/java/com/externalkeyboard/views/ExternalKeyboardView/ExternalKeyboardViewManager.java +11 -18
- package/android/src/main/java/com/externalkeyboard/views/TextInputFocusWrapper/TextInputFocusWrapper.java +208 -101
- package/android/src/main/java/com/externalkeyboard/views/TextInputFocusWrapper/TextInputFocusWrapperManager.java +123 -34
- package/android/src/main/java/com/externalkeyboard/views/base/FocusHighlightBase.java +38 -0
- package/android/src/main/java/com/externalkeyboard/views/base/ViewGroupBase.java +19 -0
- package/android/src/main/java/com/externalkeyboard/views/base/ViewOrderGroupBase.java +190 -0
- package/android/src/main/java/com/externalkeyboard/views/base/keyboard/ViewFocusChangeBase.java +39 -0
- package/android/src/main/java/com/externalkeyboard/views/base/keyboard/ViewFocusRequestBase.java +125 -0
- package/android/src/main/java/com/externalkeyboard/views/base/keyboard/ViewKeyHandlerBase.java +40 -0
- package/android/src/newarch/TextInputFocusWrapperManagerSpec.java +2 -8
- package/android/src/oldarch/ExternalKeyboardLockViewManagerSpec.java +1 -0
- package/android/src/oldarch/TextInputFocusWrapperManagerSpec.java +32 -2
- package/ios/Delegates/RNCEKVFocusLinkDelegate/RNCEKVFocusLinkDelegate.h +35 -0
- package/ios/Delegates/RNCEKVFocusLinkDelegate/RNCEKVFocusLinkDelegate.mm +195 -0
- package/ios/Delegates/RNCEKVFocusOrderDelegate/RNCEKVFocusOrderProtocol.h +6 -8
- package/ios/Delegates/RNCEKVFocusSequenceDelegate/RNCEKVFocusSequenceDelegate.h +25 -0
- package/ios/Delegates/RNCEKVFocusSequenceDelegate/RNCEKVFocusSequenceDelegate.mm +163 -0
- package/ios/Delegates/RNCEKVGroupIdentifierDelegate/RNCEKVGroupIdentifierDelegate.h +2 -6
- package/ios/Delegates/RNCEKVGroupIdentifierDelegate/RNCEKVGroupIdentifierDelegate.mm +6 -78
- package/ios/Delegates/RNCEKVHaloDelegate/RNCEKVHaloDelegate.h +3 -4
- package/ios/Delegates/RNCEKVHaloDelegate/RNCEKVHaloDelegate.mm +32 -101
- package/ios/Delegates/RNCEKVHaloDelegate/RNCEKVHaloProtocol.h +1 -1
- package/ios/Extensions/RCTEnhancedScrollView+RNCEKVExternalKeyboard.mm +1 -1
- package/ios/Extensions/RCTTextInputComponentView+RNCEKVExternalKeyboard.mm +15 -0
- package/ios/Extensions/RCTViewComponentView+RNCEKVExternalKeyboard.h +9 -6
- package/ios/Extensions/RCTViewComponentView+RNCEKVExternalKeyboard.mm +16 -29
- package/ios/Extensions/UIViewController+RNCEKVExternalKeyboard.h +1 -0
- package/ios/Extensions/UIViewController+RNCEKVExternalKeyboard.mm +8 -0
- package/ios/Helpers/RNCEKVNativeProps/RNCEKVNativeProps.h +123 -0
- package/ios/Protocols/RNCEKVCustomFocusEffectProtocol.h +15 -0
- package/ios/Protocols/RNCEKVCustomGroudIdProtocol.h +15 -0
- package/ios/Protocols/RNCEKVKeyboardFocusableProtocol.h +15 -0
- package/ios/Services/RNCEKVFocusLinkObserver.mm +2 -3
- package/ios/Services/RNCEKVKeyboardOrderManager/RNCEKVOrderRelationship/RNCEKVOrderRelationship.mm +15 -28
- package/ios/Services/RNCEKVOrderLinking.mm +43 -51
- package/ios/Views/Base/ContextMenu/RNCEKVViewContextMenuBase.h +33 -0
- package/ios/Views/Base/ContextMenu/RNCEKVViewContextMenuBase.mm +84 -0
- package/ios/Views/Base/FocusChange/RNCEKVViewFocusChangeBase.h +37 -0
- package/ios/Views/Base/FocusChange/RNCEKVViewFocusChangeBase.mm +89 -0
- package/ios/Views/Base/FocusOrderGroup/RNCEKVViewOrderGroupBase.h +49 -0
- package/ios/Views/Base/FocusOrderGroup/RNCEKVViewOrderGroupBase.mm +245 -0
- package/ios/Views/Base/FocusRequest/RNCEKVViewFocusRequestBase.h +34 -0
- package/ios/Views/Base/FocusRequest/RNCEKVViewFocusRequestBase.mm +112 -0
- package/ios/Views/Base/GroupIdentifier/RNCEKVViewGroupIdentifierBase.h +27 -0
- package/ios/Views/Base/GroupIdentifier/RNCEKVViewGroupIdentifierBase.mm +69 -0
- package/ios/Views/Base/KeyPress/RNCEKVViewKeyPress.h +30 -0
- package/ios/Views/Base/KeyPress/RNCEKVViewKeyPress.mm +75 -0
- package/ios/Views/Base/KeyboardHallo/RNCEKVExternalKeyboardHalloBase.h +33 -0
- package/ios/Views/Base/KeyboardHallo/RNCEKVExternalKeyboardHalloBase.mm +92 -0
- package/ios/Views/Base/ViewGroup/RNCEKVViewGroupBase.h +36 -0
- package/ios/Views/Base/ViewGroup/RNCEKVViewGroupBase.mm +63 -0
- package/ios/Views/RNCEKVExternalKeyboardLockView/RNCEKVExternalKeyboardLockView.h +8 -0
- package/ios/Views/RNCEKVExternalKeyboardLockView/RNCEKVExternalKeyboardLockView.mm +105 -2
- package/ios/Views/RNCEKVExternalKeyboardLockView/RNCEKVExternalKeyboardLockViewManager.mm +11 -0
- package/ios/Views/RNCEKVExternalKeyboardView/RNCEKVExternalKeyboardView.h +7 -82
- package/ios/Views/RNCEKVExternalKeyboardView/RNCEKVExternalKeyboardView.mm +23 -493
- package/ios/Views/RNCEKVExternalKeyboardView/RNCEKVExternalKeyboardViewManager.mm +5 -7
- package/ios/Views/RNCEKVKeyboardFocusGroupView/RNCEKVKeyboardFocusGroup.mm +20 -17
- package/ios/Views/RNCEKVTextInputFocusWrapper/RNCEKVTextInputFocusWrapper.h +10 -39
- package/ios/Views/RNCEKVTextInputFocusWrapper/RNCEKVTextInputFocusWrapper.mm +40 -73
- package/ios/Views/RNCEKVTextInputFocusWrapper/RNCEKVTextInputFocusWrapperManager.mm +76 -8
- package/lib/commonjs/components/BaseKeyboardView/BaseKeyboardView.js +35 -7
- package/lib/commonjs/components/BaseKeyboardView/BaseKeyboardView.js.map +1 -1
- package/lib/commonjs/components/KeyboardExtendedInput/KeyboardExtendedInput.js +79 -1
- package/lib/commonjs/components/KeyboardExtendedInput/KeyboardExtendedInput.js.map +1 -1
- package/lib/commonjs/components/KeyboardFocusLock/FocusTrap/FocusTrap.js +18 -4
- package/lib/commonjs/components/KeyboardFocusLock/FocusTrap/FocusTrap.js.map +1 -1
- package/lib/commonjs/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.js +17 -2
- package/lib/commonjs/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.js.map +1 -1
- package/lib/commonjs/components/KeyboardFocusView/KeyboardFocusView.js +2 -0
- package/lib/commonjs/components/KeyboardFocusView/KeyboardFocusView.js.map +1 -1
- package/lib/commonjs/nativeSpec/ExternalKeyboardLockViewNativeComponent.ts +1 -0
- package/lib/commonjs/nativeSpec/TextInputFocusWrapperNativeComponent.ts +16 -0
- package/lib/commonjs/utils/useFocusStyle.js +3 -9
- package/lib/commonjs/utils/useFocusStyle.js.map +1 -1
- package/lib/commonjs/utils/withKeyboardFocus.js +32 -15
- package/lib/commonjs/utils/withKeyboardFocus.js.map +1 -1
- package/lib/commonjs/utils/wrapOrderPrefix.js +17 -0
- package/lib/commonjs/utils/wrapOrderPrefix.js.map +1 -0
- package/lib/module/components/BaseKeyboardView/BaseKeyboardView.js +35 -7
- package/lib/module/components/BaseKeyboardView/BaseKeyboardView.js.map +1 -1
- package/lib/module/components/KeyboardExtendedInput/KeyboardExtendedInput.js +80 -2
- package/lib/module/components/KeyboardExtendedInput/KeyboardExtendedInput.js.map +1 -1
- package/lib/module/components/KeyboardFocusLock/FocusTrap/FocusTrap.js +18 -4
- package/lib/module/components/KeyboardFocusLock/FocusTrap/FocusTrap.js.map +1 -1
- package/lib/module/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.js +16 -2
- package/lib/module/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.js.map +1 -1
- package/lib/module/components/KeyboardFocusView/KeyboardFocusView.js +2 -0
- package/lib/module/components/KeyboardFocusView/KeyboardFocusView.js.map +1 -1
- package/lib/module/nativeSpec/ExternalKeyboardLockViewNativeComponent.ts +1 -0
- package/lib/module/nativeSpec/TextInputFocusWrapperNativeComponent.ts +16 -0
- package/lib/module/utils/useFocusStyle.js +4 -10
- package/lib/module/utils/useFocusStyle.js.map +1 -1
- package/lib/module/utils/withKeyboardFocus.js +32 -15
- package/lib/module/utils/withKeyboardFocus.js.map +1 -1
- package/lib/module/utils/wrapOrderPrefix.js +12 -0
- package/lib/module/utils/wrapOrderPrefix.js.map +1 -0
- package/lib/typescript/src/components/BaseKeyboardView/BaseKeyboardView.d.ts.map +1 -1
- package/lib/typescript/src/components/KeyboardExtendedInput/KeyboardExtendedInput.d.ts.map +1 -1
- package/lib/typescript/src/components/KeyboardExtendedInput/KeyboardExtendedInput.types.d.ts +15 -0
- package/lib/typescript/src/components/KeyboardExtendedInput/KeyboardExtendedInput.types.d.ts.map +1 -1
- package/lib/typescript/src/components/KeyboardFocusLock/FocusTrap/FocusTrap.d.ts +1 -1
- package/lib/typescript/src/components/KeyboardFocusLock/FocusTrap/FocusTrap.d.ts.map +1 -1
- package/lib/typescript/src/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.d.ts +2 -1
- package/lib/typescript/src/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.d.ts.map +1 -1
- package/lib/typescript/src/components/KeyboardFocusView/KeyboardFocusView.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +1 -1
- package/lib/typescript/src/nativeSpec/ExternalKeyboardLockViewNativeComponent.d.ts +1 -0
- package/lib/typescript/src/nativeSpec/ExternalKeyboardLockViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/nativeSpec/TextInputFocusWrapperNativeComponent.d.ts +16 -1
- package/lib/typescript/src/nativeSpec/TextInputFocusWrapperNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/types/BaseKeyboardView.d.ts +2 -0
- package/lib/typescript/src/types/BaseKeyboardView.d.ts.map +1 -1
- package/lib/typescript/src/types/KeyboardFocusLock.types.d.ts +1 -0
- package/lib/typescript/src/types/KeyboardFocusLock.types.d.ts.map +1 -1
- package/lib/typescript/src/types/WithKeyboardFocus.d.ts +11 -2
- package/lib/typescript/src/types/WithKeyboardFocus.d.ts.map +1 -1
- package/lib/typescript/src/utils/useFocusStyle.d.ts +1 -0
- package/lib/typescript/src/utils/useFocusStyle.d.ts.map +1 -1
- package/lib/typescript/src/utils/withKeyboardFocus.d.ts.map +1 -1
- package/lib/typescript/src/utils/wrapOrderPrefix.d.ts +9 -0
- package/lib/typescript/src/utils/wrapOrderPrefix.d.ts.map +1 -0
- package/package.json +6 -2
- package/src/components/BaseKeyboardView/BaseKeyboardView.tsx +88 -10
- package/src/components/KeyboardExtendedInput/KeyboardExtendedInput.tsx +138 -2
- package/src/components/KeyboardExtendedInput/KeyboardExtendedInput.types.ts +15 -0
- package/src/components/KeyboardFocusLock/FocusTrap/FocusTrap.tsx +21 -4
- package/src/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.tsx +20 -3
- package/src/components/KeyboardFocusView/KeyboardFocusView.tsx +2 -0
- package/src/nativeSpec/ExternalKeyboardLockViewNativeComponent.ts +1 -0
- package/src/nativeSpec/TextInputFocusWrapperNativeComponent.ts +16 -0
- package/src/types/BaseKeyboardView.ts +2 -0
- package/src/types/KeyboardFocusLock.types.ts +1 -0
- package/src/types/WithKeyboardFocus.ts +19 -2
- package/src/utils/useFocusStyle.tsx +5 -15
- package/src/utils/withKeyboardFocus.tsx +44 -15
- package/src/utils/wrapOrderPrefix.ts +16 -0
- package/ios/Delegates/RNCEKVFocusOrderDelegate/RNCEKVFocusGuideDelegate/RNCEKVFocusGuideDelegate.h +0 -36
- package/ios/Delegates/RNCEKVFocusOrderDelegate/RNCEKVFocusGuideDelegate/RNCEKVFocusGuideDelegate.mm +0 -150
- package/ios/Delegates/RNCEKVFocusOrderDelegate/RNCEKVFocusOrderDelegate.h +0 -47
- package/ios/Delegates/RNCEKVFocusOrderDelegate/RNCEKVFocusOrderDelegate.mm +0 -326
- package/ios/Services/RNCEKVKeyboardOrderManager/RNCEKVKeyboardOrderManager.h +0 -17
- package/ios/Services/RNCEKVKeyboardOrderManager/RNCEKVKeyboardOrderManager.mm +0 -15
- package/lib/commonjs/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.android.js +0 -22
- package/lib/commonjs/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.android.js.map +0 -1
- package/lib/module/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.android.js +0 -17
- package/lib/module/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.android.js.map +0 -1
- package/lib/typescript/src/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.android.d.ts +0 -4
- package/lib/typescript/src/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.android.d.ts.map +0 -1
- package/src/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.android.tsx +0 -16
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
//
|
|
7
7
|
|
|
8
8
|
#import <Foundation/Foundation.h>
|
|
9
|
-
|
|
9
|
+
#import "UIViewController+RNCEKVExternalKeyboard.h"
|
|
10
10
|
|
|
11
11
|
#import <UIKit/UIKit.h>
|
|
12
12
|
#import <React/RCTViewManager.h>
|
|
@@ -33,6 +33,89 @@ using namespace facebook::react;
|
|
|
33
33
|
|
|
34
34
|
@implementation RNCEKVExternalKeyboardLockView
|
|
35
35
|
|
|
36
|
+
- (void)didMoveToSuperview {
|
|
37
|
+
[super didMoveToSuperview];
|
|
38
|
+
|
|
39
|
+
if (self.superview) {
|
|
40
|
+
[[NSNotificationCenter defaultCenter] addObserver:self
|
|
41
|
+
selector:@selector(onAccessibilityFocusChanged:)
|
|
42
|
+
name:UIAccessibilityElementFocusedNotification
|
|
43
|
+
object:nil];
|
|
44
|
+
} else {
|
|
45
|
+
[[NSNotificationCenter defaultCenter] removeObserver:self
|
|
46
|
+
name:UIAccessibilityElementFocusedNotification
|
|
47
|
+
object:nil];
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
- (void)dealloc {
|
|
52
|
+
[[NSNotificationCenter defaultCenter] removeObserver:self
|
|
53
|
+
name:UIAccessibilityElementFocusedNotification
|
|
54
|
+
object:nil];
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
58
|
+
- (void)prepareForRecycle {
|
|
59
|
+
[super prepareForRecycle];
|
|
60
|
+
_forceLock = NO;
|
|
61
|
+
_lockDisabled = NO;
|
|
62
|
+
[[NSNotificationCenter defaultCenter] removeObserver:self
|
|
63
|
+
name:UIAccessibilityElementFocusedNotification
|
|
64
|
+
object:nil];
|
|
65
|
+
}
|
|
66
|
+
#endif
|
|
67
|
+
|
|
68
|
+
- (void)onAccessibilityFocusChanged:(NSNotification *)notification {
|
|
69
|
+
if (!_forceLock || _lockDisabled) return;
|
|
70
|
+
|
|
71
|
+
id element = notification.userInfo[UIAccessibilityFocusedElementKey];
|
|
72
|
+
if (![element isKindOfClass:[UIView class]]) return;
|
|
73
|
+
|
|
74
|
+
UIView *focused = (UIView *)element;
|
|
75
|
+
if (![focused isDescendantOfView:self]) {
|
|
76
|
+
UIAccessibilityPostNotification(UIAccessibilityLayoutChangedNotification, self);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
- (void)setForceLock:(BOOL)forceLock {
|
|
81
|
+
_forceLock = forceLock;
|
|
82
|
+
[self requestFocus];
|
|
83
|
+
[self requestScreenReaderFocus];
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
- (void)setLockDisabled:(BOOL)lockDisabled {
|
|
87
|
+
_lockDisabled = lockDisabled;
|
|
88
|
+
[self requestFocus];
|
|
89
|
+
[self requestScreenReaderFocus];
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
- (BOOL)shouldUpdateFocusInContext:(UIFocusUpdateContext *)context {
|
|
93
|
+
if (_lockDisabled) {
|
|
94
|
+
return [super shouldUpdateFocusInContext: context];
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
UIView *nextFocus = (UIView *)context.nextFocusedView;
|
|
98
|
+
if(_forceLock && nextFocus != nil && ![nextFocus isDescendantOfView: self]) {
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
return [super shouldUpdateFocusInContext: context];
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
- (void)requestFocus {
|
|
106
|
+
if (!_forceLock && _lockDisabled) return;
|
|
107
|
+
|
|
108
|
+
UIViewController *controller = self.reactViewController;
|
|
109
|
+
if (controller != nil) {
|
|
110
|
+
[controller rncekvFocusView: self];
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
- (void)requestScreenReaderFocus {
|
|
115
|
+
if (!_forceLock && _lockDisabled) return;
|
|
116
|
+
|
|
117
|
+
UIAccessibilityPostNotification(UIAccessibilityLayoutChangedNotification, self);
|
|
118
|
+
}
|
|
36
119
|
|
|
37
120
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
38
121
|
|
|
@@ -48,10 +131,21 @@ using namespace facebook::react;
|
|
|
48
131
|
static const auto defaultProps = std::make_shared<const ExternalKeyboardLockViewProps>();
|
|
49
132
|
_props = defaultProps;
|
|
50
133
|
}
|
|
51
|
-
|
|
134
|
+
|
|
52
135
|
return self;
|
|
53
136
|
}
|
|
54
137
|
|
|
138
|
+
- (void)updateProps:(Props::Shared const &)props
|
|
139
|
+
oldProps:(Props::Shared const &)oldProps
|
|
140
|
+
{
|
|
141
|
+
const auto &newViewProps =
|
|
142
|
+
*std::static_pointer_cast<ExternalKeyboardLockViewProps const>(props);
|
|
143
|
+
[super updateProps:props oldProps:oldProps];
|
|
144
|
+
|
|
145
|
+
self.forceLock = newViewProps.forceLock;
|
|
146
|
+
self.lockDisabled = newViewProps.lockDisabled;
|
|
147
|
+
}
|
|
148
|
+
|
|
55
149
|
Class<RCTComponentViewProtocol> ExternalKeyboardLockViewCls(void)
|
|
56
150
|
{
|
|
57
151
|
return RNCEKVExternalKeyboardLockView.class;
|
|
@@ -59,4 +153,13 @@ Class<RCTComponentViewProtocol> ExternalKeyboardLockViewCls(void)
|
|
|
59
153
|
|
|
60
154
|
#endif
|
|
61
155
|
|
|
156
|
+
- (void)didMoveToWindow {
|
|
157
|
+
[super didMoveToWindow];
|
|
158
|
+
|
|
159
|
+
if (self.window) {
|
|
160
|
+
[self requestFocus];
|
|
161
|
+
[self requestScreenReaderFocus];
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
62
165
|
@end
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
#import <React/RCTViewManager.h>
|
|
12
12
|
#import <React/RCTUIManager.h>
|
|
13
|
+
#import <React/RCTConvert.h>
|
|
13
14
|
#import "RNCEKVExternalKeyboardLockView.h"
|
|
14
15
|
#import "RNCEKVExternalKeyboardLockViewManager.h"
|
|
15
16
|
|
|
@@ -22,4 +23,14 @@ RCT_EXPORT_MODULE(ExternalKeyboardLockView)
|
|
|
22
23
|
return [[RNCEKVExternalKeyboardLockView alloc] init];
|
|
23
24
|
}
|
|
24
25
|
|
|
26
|
+
RCT_CUSTOM_VIEW_PROPERTY(forceLock, BOOL, RNCEKVExternalKeyboardLockView)
|
|
27
|
+
{
|
|
28
|
+
view.forceLock = json ? [RCTConvert BOOL:json] : NO;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
RCT_CUSTOM_VIEW_PROPERTY(lockDisabled, BOOL, RNCEKVExternalKeyboardLockView)
|
|
32
|
+
{
|
|
33
|
+
view.lockDisabled = json ? [RCTConvert BOOL:json] : NO;
|
|
34
|
+
}
|
|
35
|
+
|
|
25
36
|
@end
|
|
@@ -4,101 +4,26 @@
|
|
|
4
4
|
#import <UIKit/UIKit.h>
|
|
5
5
|
#import "RNCEKVFocusProtocol.h"
|
|
6
6
|
#import "RNCEKVFocusOrderProtocol.h"
|
|
7
|
+
#import "RNCEKVKeyboardFocusableProtocol.h"
|
|
7
8
|
#import "RNCEKVHaloProtocol.h"
|
|
8
9
|
#import "RNCEKVGroupIdentifierProtocol.h"
|
|
10
|
+
#import "RNCEKVExternalKeyboardHalloBase.h"
|
|
11
|
+
#import "RNCEKVViewKeyPress.h"
|
|
9
12
|
|
|
10
|
-
|
|
11
|
-
#import "RCTViewComponentView+RNCEKVExternalKeyboard.h"
|
|
13
|
+
@interface RNCEKVExternalKeyboardView : RNCEKVViewKeyPress <RNCEKVKeyboardFocusableProtocol>
|
|
12
14
|
|
|
13
|
-
NS_ASSUME_NONNULL_BEGIN
|
|
14
|
-
|
|
15
|
-
#define RKNA_PROP_UPDATE(prop, setter, newProps) \
|
|
16
|
-
if ([RNCEKVPropHelper isPropChanged: _##prop stringValue: newProps.prop]) { \
|
|
17
|
-
[self setter: [RNCEKVPropHelper unwrapStringValue: newProps.prop]]; \
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
@interface RNCEKVExternalKeyboardView : RCTViewComponentView <UIContextMenuInteractionDelegate, RNCEKVHaloProtocol, RNCEKVFocusProtocol, RNCEKVFocusOrderProtocol, RNCEKVGroupIdentifierProtocol>
|
|
21
|
-
@property (nonatomic, strong, nullable) NSNumber *isHaloActive;
|
|
22
|
-
@property BOOL canBeFocused;
|
|
23
|
-
@property BOOL hasOnPressUp;
|
|
24
|
-
@property BOOL hasOnPressDown;
|
|
25
|
-
@property BOOL hasOnFocusChanged;
|
|
26
15
|
@property BOOL isGroup;
|
|
27
|
-
@property BOOL enableA11yFocus;
|
|
28
|
-
@property (nonatomic, assign) CGFloat haloCornerRadius;
|
|
29
|
-
@property (nonatomic, assign) CGFloat haloExpendX;
|
|
30
|
-
@property (nonatomic, assign) CGFloat haloExpendY;
|
|
31
|
-
@property (nullable, nonatomic, strong) UIView* myPreferredFocusedView;
|
|
32
|
-
@property (nonatomic, strong, nullable) NSString *customGroupId;
|
|
33
|
-
@property BOOL autoFocus;
|
|
34
|
-
@property BOOL enableContextMenu;
|
|
35
|
-
@property NSNumber* orderPosition;
|
|
36
|
-
@property NSNumber* lockFocus;
|
|
37
|
-
@property (nonatomic, strong) NSString* orderGroup;
|
|
38
|
-
@property (nonatomic, strong) NSString* orderId;
|
|
39
|
-
@property (nonatomic, strong) NSString* orderLeft;
|
|
40
|
-
@property (nonatomic, strong) NSString* orderRight;
|
|
41
|
-
@property (nonatomic, strong) NSString* orderUp;
|
|
42
|
-
@property (nonatomic, strong) NSString* orderDown;
|
|
43
|
-
@property NSString* orderForward;
|
|
44
|
-
@property NSString* orderBackward;
|
|
45
|
-
@property NSString* orderLast;
|
|
46
|
-
@property NSString* orderFirst;
|
|
47
|
-
@property BOOL isLinked;
|
|
48
|
-
|
|
49
|
-
- (UIView*)getFocusTargetView;
|
|
50
|
-
|
|
51
|
-
- (void)focus;
|
|
52
|
-
|
|
53
|
-
@end
|
|
54
|
-
|
|
55
|
-
NS_ASSUME_NONNULL_END
|
|
56
16
|
|
|
57
|
-
|
|
58
|
-
#else /* RCT_NEW_ARCH_ENABLED */
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
#import <React/RCTView.h>
|
|
62
|
-
@interface RNCEKVExternalKeyboardView : RCTView <UIContextMenuInteractionDelegate, RNCEKVHaloProtocol, RNCEKVFocusOrderProtocol, RNCEKVFocusProtocol, RNCEKVGroupIdentifierProtocol>
|
|
63
|
-
|
|
64
|
-
@property BOOL autoFocus;
|
|
65
|
-
@property BOOL canBeFocused;
|
|
66
|
-
@property BOOL hasOnPressUp;
|
|
67
|
-
@property BOOL hasOnPressDown;
|
|
68
|
-
@property BOOL hasOnFocusChanged;
|
|
69
|
-
@property BOOL isGroup;
|
|
70
|
-
@property BOOL enableA11yFocus;
|
|
71
|
-
@property UIView* myPreferredFocusedView;
|
|
72
|
-
@property (nonatomic, assign) CGFloat haloCornerRadius;
|
|
73
|
-
@property (nonatomic, assign) CGFloat haloExpendX;
|
|
74
|
-
@property (nonatomic, assign) CGFloat haloExpendY;
|
|
17
|
+
#ifndef RCT_NEW_ARCH_ENABLED
|
|
75
18
|
@property (nonatomic, copy) RCTDirectEventBlock onFocusChange;
|
|
76
19
|
@property (nonatomic, copy) RCTDirectEventBlock onContextMenuPress;
|
|
77
20
|
@property (nonatomic, copy) RCTDirectEventBlock onKeyUpPress;
|
|
78
21
|
@property (nonatomic, copy) RCTDirectEventBlock onKeyDownPress;
|
|
79
22
|
@property (nonatomic, copy) RCTBubblingEventBlock onBubbledContextMenuPress;
|
|
80
|
-
|
|
81
|
-
@property NSNumber* orderPosition;
|
|
82
|
-
@property NSNumber* lockFocus;
|
|
83
|
-
@property (nonatomic, strong)NSString* orderGroup;
|
|
84
|
-
@property (nonatomic, strong) NSString* orderId;
|
|
85
|
-
@property (nonatomic, strong)NSString* orderLeft;
|
|
86
|
-
@property (nonatomic, strong)NSString* orderRight;
|
|
87
|
-
@property (nonatomic, strong) NSString* orderUp;
|
|
88
|
-
@property (nonatomic, strong) NSString* orderDown;
|
|
89
|
-
@property NSString* orderForward;
|
|
90
|
-
@property NSString* orderBackward;
|
|
91
|
-
@property NSString* orderLast;
|
|
92
|
-
@property NSString* orderFirst;
|
|
93
|
-
@property BOOL isLinked;
|
|
94
|
-
@property BOOL enableContextMenu;
|
|
95
|
-
|
|
96
|
-
- (UIView*)getFocusTargetView;
|
|
23
|
+
#endif
|
|
97
24
|
|
|
98
|
-
@property (nonatomic, strong, nullable) NSNumber *isHaloActive;
|
|
99
|
-
- (void)focus;
|
|
100
25
|
@end
|
|
101
26
|
|
|
102
27
|
|
|
103
|
-
|
|
28
|
+
//#endif /* RCT_NEW_ARCH_ENABLED */
|
|
104
29
|
#endif /* ExternalKeyboardViewNativeComponent_h */
|