react-native-external-keyboard 0.5.6 → 0.6.1-rc
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 +277 -14
- package/android/src/main/java/com/externalkeyboard/delegates/FocusOrderDelegate.java +213 -0
- package/android/src/main/java/com/externalkeyboard/helper/FocusHelper.java +44 -0
- package/android/src/main/java/com/externalkeyboard/helper/Linking/A11yOrderLinking.java +81 -0
- package/android/src/main/java/com/externalkeyboard/helper/Linking/LinkingQueue.java +94 -0
- package/android/src/main/java/com/externalkeyboard/helper/ReactNativeVersionChecker.java +24 -0
- package/android/src/main/java/com/externalkeyboard/services/FocusLinkObserver/FocusLinkObserver.java +131 -0
- package/android/src/main/java/com/externalkeyboard/services/FocusLinkObserver/FocusLinkObserverSingleton.java +20 -0
- package/android/src/main/java/com/externalkeyboard/views/ExternalKeyboardView/ExternalKeyboardView.java +144 -0
- package/android/src/main/java/com/externalkeyboard/views/ExternalKeyboardView/ExternalKeyboardViewManager.java +128 -8
- package/android/src/main/java/com/externalkeyboard/views/KeyboardFocusGroup/KeyboardFocusGroupManager.java +7 -3
- package/android/src/main/java/com/externalkeyboard/views/TextInputFocusWrapper/TextInputFocusWrapper.java +2 -13
- package/android/src/oldarch/ExternalKeyboardViewManagerSpec.java +25 -0
- package/android/src/oldarch/KeyboardFocusGroupManagerSpec.java +8 -1
- package/ios/Delegates/RNCEKVFocusOrderDelegate/RNCEKVFocusOrderDelegate.h +33 -0
- package/ios/Delegates/RNCEKVFocusOrderDelegate/RNCEKVFocusOrderDelegate.mm +577 -0
- package/ios/Delegates/RNCEKVFocusOrderDelegate/RNCEKVFocusOrderProtocol.h +34 -0
- package/ios/Delegates/RNCEKVGroupIdentifierDelegate/RNCEKVGroupIdentifierDelegate.h +1 -0
- package/ios/Delegates/RNCEKVGroupIdentifierDelegate/RNCEKVGroupIdentifierDelegate.mm +9 -0
- package/ios/Helpers/RNCEKVPropHelper/RNCEKVPropHelper.h +22 -0
- package/ios/Helpers/RNCEKVPropHelper/RNCEKVPropHelper.mm +48 -0
- package/ios/Services/RNCEKVFocusLinkObserver.h +27 -0
- package/ios/Services/RNCEKVFocusLinkObserver.mm +101 -0
- package/ios/Services/RNCEKVFocusLinkObserverManager.h +23 -0
- package/ios/Services/RNCEKVFocusLinkObserverManager.mm +30 -0
- package/ios/Services/RNCEKVOrderLinking.h +33 -0
- package/ios/Services/RNCEKVOrderLinking.mm +143 -0
- package/ios/Services/RNCEKVOrderSubscriber.h +24 -0
- package/ios/Services/RNCEKVOrderSubscriber.mm +23 -0
- package/ios/Services/RNCEKVRelashioship.h +28 -0
- package/ios/Services/RNCEKVRelashioship.mm +61 -0
- package/ios/Services/RNCEKVSortedMap.h +22 -0
- package/ios/Services/RNCEKVSortedMap.mm +112 -0
- package/ios/Views/RNCEKVExternalKeyboardView/RNCEKVExternalKeyboardView.h +34 -3
- package/ios/Views/RNCEKVExternalKeyboardView/RNCEKVExternalKeyboardView.mm +214 -54
- package/ios/Views/RNCEKVExternalKeyboardView/RNCEKVExternalKeyboardViewManager.h +9 -0
- package/ios/Views/RNCEKVExternalKeyboardView/RNCEKVExternalKeyboardViewManager.mm +80 -55
- package/ios/Views/RNCEKVKeyboardFocusGroupView/RNCEKVKeyboardFocusGroup.h +2 -0
- package/ios/Views/RNCEKVKeyboardFocusGroupView/RNCEKVKeyboardFocusGroup.mm +161 -3
- package/ios/Views/RNCEKVKeyboardFocusGroupView/RNCEKVKeyboardFocusGroupManager.mm +6 -0
- package/lib/commonjs/components/BaseKeyboardView/BaseKeyboardView.js +56 -3
- package/lib/commonjs/components/BaseKeyboardView/BaseKeyboardView.js.map +1 -1
- package/lib/commonjs/components/KeyboardFocusGroup/KeyboardFocusGroup.android.js +30 -0
- package/lib/commonjs/components/KeyboardFocusGroup/KeyboardFocusGroup.android.js.map +1 -0
- package/lib/commonjs/components/KeyboardFocusGroup/KeyboardFocusGroup.ios.js.map +1 -1
- package/lib/commonjs/components/KeyboardFocusGroup/KeyboardFocusGroup.js.map +1 -1
- package/lib/commonjs/context/OrderFocusContext.js +23 -0
- package/lib/commonjs/context/OrderFocusContext.js.map +1 -0
- package/lib/commonjs/index.js +19 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/nativeSpec/ExternalKeyboardViewNativeComponent.js.map +1 -1
- package/lib/commonjs/nativeSpec/KeyboardFocusGroupNativeComponent.js.map +1 -1
- package/lib/commonjs/types/BaseKeyboardView.js +12 -0
- package/lib/commonjs/types/BaseKeyboardView.js.map +1 -1
- package/lib/commonjs/utils/withKeyboardFocus.js +25 -1
- package/lib/commonjs/utils/withKeyboardFocus.js.map +1 -1
- package/lib/module/components/BaseKeyboardView/BaseKeyboardView.js +55 -2
- package/lib/module/components/BaseKeyboardView/BaseKeyboardView.js.map +1 -1
- package/lib/module/components/KeyboardFocusGroup/KeyboardFocusGroup.android.js +23 -0
- package/lib/module/components/KeyboardFocusGroup/KeyboardFocusGroup.android.js.map +1 -0
- package/lib/module/components/KeyboardFocusGroup/KeyboardFocusGroup.ios.js.map +1 -1
- package/lib/module/components/KeyboardFocusGroup/KeyboardFocusGroup.js.map +1 -1
- package/lib/module/context/OrderFocusContext.js +14 -0
- package/lib/module/context/OrderFocusContext.js.map +1 -0
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/nativeSpec/ExternalKeyboardViewNativeComponent.js.map +1 -1
- package/lib/module/nativeSpec/KeyboardFocusGroupNativeComponent.js.map +1 -1
- package/lib/module/types/BaseKeyboardView.js +11 -1
- package/lib/module/types/BaseKeyboardView.js.map +1 -1
- package/lib/module/utils/withKeyboardFocus.js +25 -1
- package/lib/module/utils/withKeyboardFocus.js.map +1 -1
- package/lib/typescript/src/components/BaseKeyboardView/BaseKeyboardView.d.ts +1 -1
- package/lib/typescript/src/components/BaseKeyboardView/BaseKeyboardView.d.ts.map +1 -1
- package/lib/typescript/src/components/KeyboardFocusGroup/KeyboardFocusGroup.android.d.ts +24 -0
- package/lib/typescript/src/components/KeyboardFocusGroup/KeyboardFocusGroup.android.d.ts.map +1 -0
- package/lib/typescript/src/components/KeyboardFocusGroup/KeyboardFocusGroup.d.ts +1 -0
- package/lib/typescript/src/components/KeyboardFocusGroup/KeyboardFocusGroup.d.ts.map +1 -1
- package/lib/typescript/src/components/KeyboardFocusGroup/KeyboardFocusGroup.ios.d.ts +2 -0
- package/lib/typescript/src/components/KeyboardFocusGroup/KeyboardFocusGroup.ios.d.ts.map +1 -1
- package/lib/typescript/src/context/OrderFocusContext.d.ts +10 -0
- package/lib/typescript/src/context/OrderFocusContext.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/nativeSpec/ExternalKeyboardViewNativeComponent.d.ts +12 -0
- package/lib/typescript/src/nativeSpec/ExternalKeyboardViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/nativeSpec/KeyboardFocusGroupNativeComponent.d.ts +1 -0
- package/lib/typescript/src/nativeSpec/KeyboardFocusGroupNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/types/BaseKeyboardView.d.ts +24 -0
- package/lib/typescript/src/types/BaseKeyboardView.d.ts.map +1 -1
- package/lib/typescript/src/utils/withKeyboardFocus.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/BaseKeyboardView/BaseKeyboardView.tsx +77 -4
- package/src/components/KeyboardFocusGroup/KeyboardFocusGroup.android.tsx +39 -0
- package/src/components/KeyboardFocusGroup/KeyboardFocusGroup.ios.tsx +1 -0
- package/src/components/KeyboardFocusGroup/KeyboardFocusGroup.tsx +1 -0
- package/src/context/OrderFocusContext.tsx +25 -0
- package/src/index.tsx +5 -0
- package/src/nativeSpec/ExternalKeyboardViewNativeComponent.ts +12 -0
- package/src/nativeSpec/KeyboardFocusGroupNativeComponent.ts +1 -0
- package/src/types/BaseKeyboardView.ts +26 -0
- package/src/utils/withKeyboardFocus.tsx +24 -0
|
@@ -10,7 +10,7 @@ RCT_EXPORT_MODULE(ExternalKeyboardView)
|
|
|
10
10
|
|
|
11
11
|
- (UIView *)view
|
|
12
12
|
{
|
|
13
|
-
|
|
13
|
+
return [[RNCEKVExternalKeyboardView alloc] init];
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
RCT_EXPORT_VIEW_PROPERTY(onFocusChange, RCTDirectEventBlock)
|
|
@@ -22,124 +22,149 @@ RCT_EXPORT_VIEW_PROPERTY(myPreferredFocusedView, UIView)
|
|
|
22
22
|
|
|
23
23
|
RCT_CUSTOM_VIEW_PROPERTY(canBeFocused, BOOL, RNCEKVExternalKeyboardView)
|
|
24
24
|
{
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
BOOL value = json ? [RCTConvert BOOL:json] : YES;
|
|
26
|
+
[view setCanBeFocused: value];
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
RCT_CUSTOM_VIEW_PROPERTY(tintColor, UIColor, RNCEKVExternalKeyboardView)
|
|
30
30
|
{
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
if (json) {
|
|
32
|
+
UIColor *tintColor = [RCTConvert UIColor:json];
|
|
33
|
+
[view setTintColor: tintColor];
|
|
34
|
+
}
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
RCT_CUSTOM_VIEW_PROPERTY(hasOnFocusChanged, BOOL, RNCEKVExternalKeyboardView)
|
|
38
38
|
{
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
BOOL value = json ? [RCTConvert BOOL:json] : NO;
|
|
40
|
+
[view setHasOnFocusChanged: value];
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
RCT_CUSTOM_VIEW_PROPERTY(hasKeyDownPress, BOOL, RNCEKVExternalKeyboardView)
|
|
44
44
|
{
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
BOOL value = json ? [RCTConvert BOOL:json] : NO;
|
|
46
|
+
[view setHasOnPressDown: value];
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
RCT_CUSTOM_VIEW_PROPERTY(hasKeyUpPress, BOOL, RNCEKVExternalKeyboardView)
|
|
50
50
|
{
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
BOOL value = json ? [RCTConvert BOOL:json] : NO;
|
|
52
|
+
[view setHasOnPressUp: value];
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
RCT_CUSTOM_VIEW_PROPERTY(autoFocus, BOOL, RNCEKVExternalKeyboardView)
|
|
56
56
|
{
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
if (json) {
|
|
58
|
+
BOOL value = [RCTConvert BOOL:json];
|
|
59
|
+
[view setAutoFocus: value];
|
|
60
|
+
}
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
RCT_CUSTOM_VIEW_PROPERTY(haloEffect, BOOL, RNCEKVExternalKeyboardView)
|
|
64
64
|
{
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
if(view.isHaloActive != nil) {
|
|
71
|
-
[view setIsHaloActive: @(value)];
|
|
72
|
-
}
|
|
65
|
+
if(json) {
|
|
66
|
+
BOOL value = [RCTConvert BOOL:json];
|
|
67
|
+
if(view.isHaloActive == nil && !value) {
|
|
68
|
+
[view setIsHaloActive: @0];
|
|
73
69
|
}
|
|
70
|
+
if(view.isHaloActive != nil) {
|
|
71
|
+
[view setIsHaloActive: @(value)];
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
RCT_CUSTOM_VIEW_PROPERTY(enableA11yFocus, BOOL, RNCEKVExternalKeyboardView)
|
|
77
77
|
{
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
78
|
+
if(json) {
|
|
79
|
+
BOOL value = json ? [RCTConvert BOOL:json] : NO;
|
|
80
|
+
[view setEnableA11yFocus: value];
|
|
81
|
+
}
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
RCT_CUSTOM_VIEW_PROPERTY(screenAutoA11yFocus, BOOL, RNCEKVExternalKeyboardView)
|
|
85
85
|
{
|
|
86
|
-
|
|
86
|
+
//stub
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
RCT_CUSTOM_VIEW_PROPERTY(screenAutoA11yFocusDelay, int, RNCEKVExternalKeyboardView)
|
|
90
90
|
{
|
|
91
|
-
|
|
91
|
+
//stub
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
RCT_CUSTOM_VIEW_PROPERTY(haloCornerRadius, float, RNCEKVExternalKeyboardView)
|
|
95
95
|
{
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
96
|
+
if(json) {
|
|
97
|
+
CGFloat value = [RCTConvert CGFloat:json];
|
|
98
|
+
[view setHaloCornerRadius: value];
|
|
99
|
+
}
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
RCT_CUSTOM_VIEW_PROPERTY(haloExpendX, float, RNCEKVExternalKeyboardView)
|
|
103
103
|
{
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
104
|
+
if(json) {
|
|
105
|
+
CGFloat value = [RCTConvert CGFloat:json];
|
|
106
|
+
[view setHaloExpendX: value];
|
|
107
|
+
}
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
RCT_CUSTOM_VIEW_PROPERTY(haloExpendY, float, RNCEKVExternalKeyboardView)
|
|
111
111
|
{
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
112
|
+
if(json) {
|
|
113
|
+
CGFloat value = [RCTConvert CGFloat:json];
|
|
114
|
+
[view setHaloExpendY: value];
|
|
115
|
+
}
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
|
|
119
119
|
RCT_CUSTOM_VIEW_PROPERTY(group, BOOL, RNCEKVExternalKeyboardView)
|
|
120
120
|
{
|
|
121
|
-
|
|
122
|
-
|
|
121
|
+
BOOL value = json ? [RCTConvert BOOL:json] : NO;
|
|
122
|
+
[view setIsGroup: value];
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
RCT_CUSTOM_VIEW_PROPERTY(groupIdentifier, NSString, RNCEKVExternalKeyboardView)
|
|
126
126
|
{
|
|
127
|
-
|
|
128
|
-
|
|
127
|
+
NSString* value = json ? [RCTConvert NSString:json] : nil;
|
|
128
|
+
[view setCustomGroupId: value];
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
+
RCTK_SIMPLE_PROP(orderGroup, NSString, RNCEKVExternalKeyboardView)
|
|
132
|
+
RCTK_SIMPLE_PROP(orderId, NSString, RNCEKVExternalKeyboardView)
|
|
133
|
+
RCTK_SIMPLE_PROP(orderLeft, NSString, RNCEKVExternalKeyboardView)
|
|
134
|
+
RCTK_SIMPLE_PROP(orderRight, NSString, RNCEKVExternalKeyboardView)
|
|
135
|
+
RCTK_SIMPLE_PROP(orderUp, NSString, RNCEKVExternalKeyboardView)
|
|
136
|
+
RCTK_SIMPLE_PROP(orderDown, NSString, RNCEKVExternalKeyboardView)
|
|
137
|
+
RCTK_SIMPLE_PROP(orderForward, NSString, RNCEKVExternalKeyboardView)
|
|
138
|
+
RCTK_SIMPLE_PROP(orderBackward, NSString, RNCEKVExternalKeyboardView)
|
|
139
|
+
RCTK_SIMPLE_PROP(orderLast, NSString, RNCEKVExternalKeyboardView)
|
|
140
|
+
RCTK_SIMPLE_PROP(orderFirst, NSString, RNCEKVExternalKeyboardView)
|
|
131
141
|
|
|
142
|
+
RCT_CUSTOM_VIEW_PROPERTY(orderIndex, NSNumber, RNCEKVExternalKeyboardView)
|
|
143
|
+
{
|
|
144
|
+
if(json){
|
|
145
|
+
NSNumber* value = [RCTConvert NSNumber:json];
|
|
146
|
+
[view setOrderPosition: value];
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
RCT_CUSTOM_VIEW_PROPERTY(lockFocus, NSNumber, RNCEKVExternalKeyboardView)
|
|
151
|
+
{
|
|
152
|
+
if(json){
|
|
153
|
+
NSNumber* value = [RCTConvert NSNumber:json];
|
|
154
|
+
[view setLockFocus: value];
|
|
155
|
+
}
|
|
156
|
+
}
|
|
132
157
|
|
|
133
158
|
RCT_EXPORT_METHOD(focus:(nonnull NSNumber *)reactTag)
|
|
134
159
|
{
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
160
|
+
[self.bridge.uiManager addUIBlock:^(RCTUIManager *uiManager, NSDictionary<NSNumber *,UIView *> *viewRegistry) {
|
|
161
|
+
UIView *view = viewRegistry[reactTag];
|
|
162
|
+
if (!view || ![view isKindOfClass:[RNCEKVExternalKeyboardView class]]) {
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
RNCEKVExternalKeyboardView *keyboardView = (RNCEKVExternalKeyboardView*)view;
|
|
166
|
+
[keyboardView focus];
|
|
167
|
+
}];
|
|
143
168
|
}
|
|
144
169
|
|
|
145
170
|
@end
|
|
@@ -18,6 +18,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
18
18
|
|
|
19
19
|
@interface RNCEKVKeyboardFocusGroup : RCTViewComponentView
|
|
20
20
|
@property (nonatomic, strong, nullable) NSString *customGroupId;
|
|
21
|
+
@property (nonatomic, strong, nullable) NSString *orderGroup;
|
|
21
22
|
@property BOOL isGroupFocused;
|
|
22
23
|
@end
|
|
23
24
|
|
|
@@ -30,6 +31,7 @@ NS_ASSUME_NONNULL_END
|
|
|
30
31
|
#import <React/RCTView.h>
|
|
31
32
|
@interface RNCEKVKeyboardFocusGroup : RCTView
|
|
32
33
|
@property (nonatomic, strong, nullable) NSString *customGroupId;
|
|
34
|
+
@property (nonatomic, strong, nullable) NSString *orderGroup;
|
|
33
35
|
@property BOOL isGroupFocused;
|
|
34
36
|
@property (nonatomic, copy) RCTDirectEventBlock onGroupFocusChange;
|
|
35
37
|
@end
|
|
@@ -8,6 +8,10 @@
|
|
|
8
8
|
#import "RNCEKVKeyboardFocusGroup.h"
|
|
9
9
|
#import <UIKit/UIKit.h>
|
|
10
10
|
#import <React/RCTViewManager.h>
|
|
11
|
+
#import "UIViewController+RNCEKVExternalKeyboard.h"
|
|
12
|
+
#import "RNCEKVOrderLinking.h"
|
|
13
|
+
#import "RNCEKVRelashioship.h"
|
|
14
|
+
#import "RNCEKVExternalKeyboardView.h"
|
|
11
15
|
|
|
12
16
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
13
17
|
#include <string>
|
|
@@ -28,12 +32,18 @@ using namespace facebook::react;
|
|
|
28
32
|
|
|
29
33
|
#endif
|
|
30
34
|
|
|
31
|
-
@implementation RNCEKVKeyboardFocusGroup
|
|
35
|
+
@implementation RNCEKVKeyboardFocusGroup {
|
|
36
|
+
UIView* _entry;
|
|
37
|
+
UIView* _exit;
|
|
38
|
+
UIView* _lock;
|
|
39
|
+
}
|
|
32
40
|
|
|
33
41
|
- (instancetype)initWithFrame:(CGRect)frame
|
|
34
42
|
{
|
|
35
43
|
if (self = [super initWithFrame:frame]) {
|
|
36
44
|
_isGroupFocused = false;
|
|
45
|
+
_entry = nil;
|
|
46
|
+
_exit = nil;
|
|
37
47
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
38
48
|
static const auto defaultProps = std::make_shared<const KeyboardFocusGroupProps>();
|
|
39
49
|
_props = defaultProps;
|
|
@@ -43,6 +53,7 @@ using namespace facebook::react;
|
|
|
43
53
|
return self;
|
|
44
54
|
}
|
|
45
55
|
|
|
56
|
+
|
|
46
57
|
- (void)didUpdateFocusInContext:(UIFocusUpdateContext *)context
|
|
47
58
|
withAnimationCoordinator:(UIFocusAnimationCoordinator *)coordinator {
|
|
48
59
|
|
|
@@ -86,6 +97,150 @@ using namespace facebook::react;
|
|
|
86
97
|
#endif
|
|
87
98
|
|
|
88
99
|
|
|
100
|
+
#pragma mark - Get Order Focus List
|
|
101
|
+
- (NSArray<UIView *> *)getOrder {
|
|
102
|
+
RNCEKVRelashioship* orderRelationship = [[RNCEKVOrderLinking sharedInstance] getInfo:_orderGroup];
|
|
103
|
+
return [orderRelationship getArray];
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
#pragma mark - Focus Find Index
|
|
108
|
+
- (int)findOrderIndex:(NSArray *)order element:(UIView*)el {
|
|
109
|
+
int resultIndex = -1;
|
|
110
|
+
|
|
111
|
+
for (int i = 0; i < order.count; i++) {
|
|
112
|
+
UIView *element = order[i];
|
|
113
|
+
if (element.subviews[0] == el) { //ToDo focus element
|
|
114
|
+
resultIndex = i;
|
|
115
|
+
break;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
return resultIndex;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
#pragma mark - Next Focus Handling
|
|
124
|
+
- (void)handleNextFocus:(UIView *)current currentIndex:(NSInteger)currentIndex {
|
|
125
|
+
NSArray<UIView *> * order = [self getOrder];
|
|
126
|
+
|
|
127
|
+
BOOL isEntry = _entry == current;
|
|
128
|
+
if (isEntry) {
|
|
129
|
+
UIView* firstElement = order[0];
|
|
130
|
+
if ([firstElement isKindOfClass:[RNCEKVExternalKeyboardView class]]) {
|
|
131
|
+
[(RNCEKVExternalKeyboardView*)firstElement focus];
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
BOOL isLast = currentIndex == order.count - 1 && _exit;
|
|
136
|
+
if (isLast) {
|
|
137
|
+
[self updateFocus: _exit];
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
BOOL inOrderRange = currentIndex >= 0 && currentIndex < order.count - 1;
|
|
141
|
+
if (inOrderRange) {
|
|
142
|
+
UIView* nextElement = order[currentIndex + 1];
|
|
143
|
+
if ([nextElement isKindOfClass:[RNCEKVExternalKeyboardView class]]) {
|
|
144
|
+
[(RNCEKVExternalKeyboardView*)nextElement focus];
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
#pragma mark - Prev Focus Handling
|
|
150
|
+
- (void)handlePrevFocus:(UIView *)current currentIndex:(NSInteger)currentIndex {
|
|
151
|
+
NSArray<UIView *> * order = [self getOrder];
|
|
152
|
+
|
|
153
|
+
BOOL isExit = _exit == current;
|
|
154
|
+
if (isExit) {
|
|
155
|
+
UIView* lastElement = order[order.count - 1];
|
|
156
|
+
if ([lastElement isKindOfClass:[RNCEKVExternalKeyboardView class]]) {
|
|
157
|
+
[(RNCEKVExternalKeyboardView*)lastElement focus];
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
BOOL isFirst = currentIndex == 0 && _entry;
|
|
162
|
+
if (isFirst) {
|
|
163
|
+
[self updateFocus: _entry];
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
BOOL inRange = currentIndex > 0 && currentIndex <= order.count - 1;
|
|
167
|
+
if (inRange) {
|
|
168
|
+
UIView* prevElement = order[currentIndex - 1];
|
|
169
|
+
if ([prevElement isKindOfClass:[RNCEKVExternalKeyboardView class]]) {
|
|
170
|
+
[(RNCEKVExternalKeyboardView*)prevElement focus];
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
#pragma mark - Focus Order Handler
|
|
176
|
+
- (BOOL)shouldUpdateFocusInContext:(UIFocusUpdateContext *)context {
|
|
177
|
+
return YES;
|
|
178
|
+
UIView *next = (UIView *)context.nextFocusedItem;
|
|
179
|
+
UIView *current = (UIView *)context.previouslyFocusedItem;
|
|
180
|
+
UIFocusHeading movementHint = context.focusHeading;
|
|
181
|
+
|
|
182
|
+
// UIView* rnkv = current.superview; //ToDo Create a map for RNKV <-> Target relations
|
|
183
|
+
// if ([rnkv isKindOfClass:[RNCEKVExternalKeyboardView class]]) {
|
|
184
|
+
// NSUInteger rawFocusLockValue = [((RNCEKVExternalKeyboardView *)rnkv).lockFocus unsignedIntegerValue];
|
|
185
|
+
//
|
|
186
|
+
// BOOL isDirectionLock = (rawFocusLockValue & movementHint) != 0;
|
|
187
|
+
// if (isDirectionLock) {
|
|
188
|
+
// return NO;
|
|
189
|
+
// }
|
|
190
|
+
// }
|
|
191
|
+
|
|
192
|
+
if(_orderGroup) {
|
|
193
|
+
RNCEKVRelashioship* orderRelationship = [[RNCEKVOrderLinking sharedInstance] getInfo:_orderGroup];
|
|
194
|
+
NSArray *order = [orderRelationship getArray];
|
|
195
|
+
if(order.count == 0) {
|
|
196
|
+
return YES;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
int currentIndex = [self findOrderIndex:order element:current];
|
|
200
|
+
int nextIndex = [self findOrderIndex:order element:next];
|
|
201
|
+
|
|
202
|
+
BOOL isEntryElement = _entry == nil && currentIndex == -1 && movementHint == UIFocusHeadingNext;
|
|
203
|
+
if(isEntryElement) {
|
|
204
|
+
_entry = current;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
BOOL isExit = _exit == nil && nextIndex == -1 && movementHint == UIFocusHeadingNext;
|
|
208
|
+
if(isExit) {
|
|
209
|
+
_exit = next;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
if(context.focusHeading == UIFocusHeadingNext) {
|
|
213
|
+
[self handleNextFocus:current currentIndex: currentIndex];
|
|
214
|
+
return YES;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
if(context.focusHeading == UIFocusHeadingPrevious) {
|
|
219
|
+
[self handlePrevFocus:current currentIndex: currentIndex];
|
|
220
|
+
return YES;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
//ToDo add sides focus handlers
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
return YES;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
- (void)updateFocus:(UIView *)focusingView {
|
|
230
|
+
UIViewController *controller = self.reactViewController;
|
|
231
|
+
|
|
232
|
+
if (controller != nil) {
|
|
233
|
+
controller.customFocusView = focusingView;
|
|
234
|
+
dispatch_async(dispatch_get_main_queue(), ^{
|
|
235
|
+
[controller setNeedsFocusUpdate];
|
|
236
|
+
[controller updateFocusIfNeeded];
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
|
|
89
244
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
90
245
|
+ (ComponentDescriptorProvider)componentDescriptorProvider
|
|
91
246
|
{
|
|
@@ -123,9 +278,12 @@ using namespace facebook::react;
|
|
|
123
278
|
[self setCustomGroupId:newGroupId];
|
|
124
279
|
}
|
|
125
280
|
}
|
|
126
|
-
|
|
127
|
-
|
|
281
|
+
|
|
282
|
+
if(oldViewProps.orderGroup != newViewProps.orderGroup) {
|
|
283
|
+
_orderGroup = [NSString stringWithUTF8String:newViewProps.orderGroup.c_str()];
|
|
284
|
+
}
|
|
128
285
|
|
|
286
|
+
}
|
|
129
287
|
|
|
130
288
|
Class<RCTComponentViewProtocol> KeyboardFocusGroupCls(void)
|
|
131
289
|
{
|
|
@@ -36,6 +36,12 @@ RCT_CUSTOM_VIEW_PROPERTY(groupIdentifier, NSString, RNCEKVKeyboardFocusGroup)
|
|
|
36
36
|
[view setCustomGroupId: value];
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
RCT_CUSTOM_VIEW_PROPERTY(orderGroup, NSString, RNCEKVKeyboardFocusGroup)
|
|
40
|
+
{
|
|
41
|
+
NSString* value = json ? [RCTConvert NSString:json] : nil;
|
|
42
|
+
[view setOrderGroup: value];
|
|
43
|
+
}
|
|
44
|
+
|
|
39
45
|
|
|
40
46
|
|
|
41
47
|
@end
|
|
@@ -8,14 +8,45 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
var _nativeSpec = require("../../nativeSpec");
|
|
10
10
|
var _ExternalKeyboardViewNativeComponent = require("../../nativeSpec/ExternalKeyboardViewNativeComponent");
|
|
11
|
+
var _BaseKeyboardView = require("../../types/BaseKeyboardView");
|
|
11
12
|
var _BubbledKeyPressContext = require("../../context/BubbledKeyPressContext");
|
|
12
|
-
var
|
|
13
|
+
var _BaseKeyboardView2 = require("./BaseKeyboardView.hooks");
|
|
13
14
|
var _GroupIdentifierContext = require("../../context/GroupIdentifierContext");
|
|
14
15
|
var _useOnFocusChange = require("../../utils/useOnFocusChange");
|
|
16
|
+
var _OrderFocusContext = require("../../context/OrderFocusContext");
|
|
15
17
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
16
18
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
17
19
|
const isIOS = _reactNative.Platform.OS === 'ios';
|
|
18
20
|
const DEFAULT_EXPOSE_METHODS = ['blur', 'measure', 'measureInWindow', 'measureLayout', 'setNativeProps'];
|
|
21
|
+
var BITS = /*#__PURE__*/function (BITS) {
|
|
22
|
+
BITS[BITS["BIT_01"] = 1] = "BIT_01";
|
|
23
|
+
BITS[BITS["BIT_02"] = 2] = "BIT_02";
|
|
24
|
+
BITS[BITS["BIT_03"] = 4] = "BIT_03";
|
|
25
|
+
BITS[BITS["BIT_04"] = 8] = "BIT_04";
|
|
26
|
+
BITS[BITS["BIT_05"] = 16] = "BIT_05";
|
|
27
|
+
BITS[BITS["BIT_06"] = 32] = "BIT_06";
|
|
28
|
+
BITS[BITS["BIT_07"] = 64] = "BIT_07";
|
|
29
|
+
BITS[BITS["BIT_08"] = 128] = "BIT_08";
|
|
30
|
+
BITS[BITS["BIT_09"] = 256] = "BIT_09";
|
|
31
|
+
BITS[BITS["BIT_10"] = 512] = "BIT_10";
|
|
32
|
+
return BITS;
|
|
33
|
+
}(BITS || {});
|
|
34
|
+
const focusBinaryValue = {
|
|
35
|
+
[_BaseKeyboardView.LockFocusEnum.Up]: BITS.BIT_01,
|
|
36
|
+
[_BaseKeyboardView.LockFocusEnum.Down]: BITS.BIT_02,
|
|
37
|
+
[_BaseKeyboardView.LockFocusEnum.Left]: BITS.BIT_03,
|
|
38
|
+
[_BaseKeyboardView.LockFocusEnum.Right]: BITS.BIT_04,
|
|
39
|
+
[_BaseKeyboardView.LockFocusEnum.Forward]: BITS.BIT_05,
|
|
40
|
+
[_BaseKeyboardView.LockFocusEnum.Backward]: BITS.BIT_06,
|
|
41
|
+
[_BaseKeyboardView.LockFocusEnum.First]: BITS.BIT_09,
|
|
42
|
+
[_BaseKeyboardView.LockFocusEnum.Last]: BITS.BIT_10
|
|
43
|
+
};
|
|
44
|
+
const mapFocusValues = values => {
|
|
45
|
+
if (!values || !values.length) return 0;
|
|
46
|
+
|
|
47
|
+
// eslint-disable-next-line no-bitwise
|
|
48
|
+
return values.reduce((acc, item) => acc | focusBinaryValue[item], 0);
|
|
49
|
+
};
|
|
19
50
|
const BaseKeyboardView = exports.BaseKeyboardView = /*#__PURE__*/_react.default.memo(/*#__PURE__*/_react.default.forwardRef(({
|
|
20
51
|
onFocusChange,
|
|
21
52
|
onKeyUpPress,
|
|
@@ -35,11 +66,24 @@ const BaseKeyboardView = exports.BaseKeyboardView = /*#__PURE__*/_react.default.
|
|
|
35
66
|
exposeMethods = DEFAULT_EXPOSE_METHODS,
|
|
36
67
|
enableA11yFocus = false,
|
|
37
68
|
screenAutoA11yFocusDelay = 500,
|
|
69
|
+
lockFocus,
|
|
70
|
+
orderIndex,
|
|
71
|
+
orderForward,
|
|
72
|
+
orderBackward,
|
|
73
|
+
orderFirst,
|
|
74
|
+
orderLast,
|
|
75
|
+
orderGroup,
|
|
38
76
|
...props
|
|
39
77
|
}, ref) => {
|
|
40
78
|
const localRef = (0, _react.useRef)();
|
|
41
79
|
const targetRef = viewRef ?? localRef;
|
|
80
|
+
const lockFocusValue = (0, _react.useMemo)(() => mapFocusValues(lockFocus), [lockFocus]);
|
|
42
81
|
const contextIdentifier = (0, _GroupIdentifierContext.useGroupIdentifierContext)();
|
|
82
|
+
const contextGroupId = (0, _OrderFocusContext.useOrderFocusGroup)();
|
|
83
|
+
const groupId = orderGroup ?? contextGroupId;
|
|
84
|
+
(0, _react.useEffect)(() => {
|
|
85
|
+
if (orderIndex !== undefined && !groupId) console.warn('`orderIndex` must be declared alongside `orderGroup` for proper functionality. Ensure components are wrapped with `KeyboardOrderFocusGroup` or provide `orderGroup` directly.');
|
|
86
|
+
}, [groupId, orderIndex]);
|
|
43
87
|
(0, _react.useImperativeHandle)(ref, () => {
|
|
44
88
|
const actions = {};
|
|
45
89
|
exposeMethods.forEach(method => {
|
|
@@ -56,7 +100,7 @@ const BaseKeyboardView = exports.BaseKeyboardView = /*#__PURE__*/_react.default.
|
|
|
56
100
|
};
|
|
57
101
|
return actions;
|
|
58
102
|
}, [exposeMethods, targetRef]);
|
|
59
|
-
const bubbled = (0,
|
|
103
|
+
const bubbled = (0, _BaseKeyboardView2.useBubbledInfo)(onBubbledContextMenuPress);
|
|
60
104
|
const onFocusChangeHandler = (0, _useOnFocusChange.useOnFocusChange)({
|
|
61
105
|
onFocusChange,
|
|
62
106
|
onFocus,
|
|
@@ -64,6 +108,8 @@ const BaseKeyboardView = exports.BaseKeyboardView = /*#__PURE__*/_react.default.
|
|
|
64
108
|
});
|
|
65
109
|
const hasOnFocusChanged = onFocusChange || onFocus || onBlur;
|
|
66
110
|
const ignoreFocusHint = _reactNative.Platform.OS !== 'ios' || !ignoreGroupFocusHint;
|
|
111
|
+
const _orderFirst = orderFirst === null ? undefined : orderFirst ?? orderForward;
|
|
112
|
+
const _orderLast = orderLast === null ? undefined : orderLast ?? orderBackward;
|
|
67
113
|
return /*#__PURE__*/_react.default.createElement(_BubbledKeyPressContext.KeyPressContext.Provider, {
|
|
68
114
|
value: bubbled.context
|
|
69
115
|
}, /*#__PURE__*/_react.default.createElement(_nativeSpec.ExternalKeyboardViewNative, _extends({}, props, {
|
|
@@ -84,8 +130,15 @@ const BaseKeyboardView = exports.BaseKeyboardView = /*#__PURE__*/_react.default.
|
|
|
84
130
|
hasKeyUpPress: Boolean(onKeyUpPress),
|
|
85
131
|
hasOnFocusChanged: Boolean(hasOnFocusChanged),
|
|
86
132
|
group: group,
|
|
133
|
+
orderIndex: orderIndex ?? -1,
|
|
87
134
|
enableA11yFocus: enableA11yFocus,
|
|
88
|
-
screenAutoA11yFocusDelay: screenAutoA11yFocusDelay
|
|
135
|
+
screenAutoA11yFocusDelay: screenAutoA11yFocusDelay,
|
|
136
|
+
lockFocus: lockFocusValue,
|
|
137
|
+
orderForward: orderForward,
|
|
138
|
+
orderBackward: orderBackward,
|
|
139
|
+
orderFirst: _orderFirst,
|
|
140
|
+
orderLast: _orderLast,
|
|
141
|
+
orderGroup: groupId
|
|
89
142
|
})));
|
|
90
143
|
}));
|
|
91
144
|
//# sourceMappingURL=BaseKeyboardView.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_nativeSpec","_ExternalKeyboardViewNativeComponent","_BubbledKeyPressContext","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_nativeSpec","_ExternalKeyboardViewNativeComponent","_BaseKeyboardView","_BubbledKeyPressContext","_BaseKeyboardView2","_GroupIdentifierContext","_useOnFocusChange","_OrderFocusContext","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_extends","assign","bind","arguments","length","apply","isIOS","Platform","OS","DEFAULT_EXPOSE_METHODS","BITS","focusBinaryValue","LockFocusEnum","Up","BIT_01","Down","BIT_02","Left","BIT_03","Right","BIT_04","Forward","BIT_05","Backward","BIT_06","First","BIT_09","Last","BIT_10","mapFocusValues","values","reduce","acc","item","BaseKeyboardView","exports","React","memo","forwardRef","onFocusChange","onKeyUpPress","onKeyDownPress","onBubbledContextMenuPress","haloEffect","autoFocus","canBeFocused","focusable","group","onFocus","onBlur","viewRef","groupIdentifier","tintColor","ignoreGroupFocusHint","exposeMethods","enableA11yFocus","screenAutoA11yFocusDelay","lockFocus","orderIndex","orderForward","orderBackward","orderFirst","orderLast","orderGroup","props","ref","localRef","useRef","targetRef","lockFocusValue","useMemo","contextIdentifier","useGroupIdentifierContext","contextGroupId","useOrderFocusGroup","groupId","useEffect","undefined","console","warn","useImperativeHandle","actions","forEach","method","args","_componentActions$met","componentActions","current","focus","Commands","bubbled","useBubbledInfo","onFocusChangeHandler","useOnFocusChange","hasOnFocusChanged","ignoreFocusHint","_orderFirst","_orderLast","createElement","KeyPressContext","Provider","value","context","ExternalKeyboardViewNative","contextMenu","hasKeyDownPress","Boolean","hasKeyUpPress"],"sourceRoot":"../../../../src","sources":["components/BaseKeyboardView/BaseKeyboardView.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAOA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,oCAAA,GAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAJ,OAAA;AAOA,IAAAK,uBAAA,GAAAL,OAAA;AACA,IAAAM,kBAAA,GAAAN,OAAA;AACA,IAAAO,uBAAA,GAAAP,OAAA;AACA,IAAAQ,iBAAA,GAAAR,OAAA;AACA,IAAAS,kBAAA,GAAAT,OAAA;AAAqE,SAAAD,wBAAAW,CAAA,EAAAC,CAAA,6BAAAC,OA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Property(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.KeyboardFocusGroup = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _nativeSpec = require("../../nativeSpec");
|
|
9
|
+
var _useOnFocusChange = require("../../utils/useOnFocusChange");
|
|
10
|
+
var _useFocusStyle = require("../../utils/useFocusStyle");
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
13
|
+
const KeyboardFocusGroup = exports.KeyboardFocusGroup = /*#__PURE__*/_react.default.memo(props => {
|
|
14
|
+
const {
|
|
15
|
+
containerFocusedStyle: focusStyle,
|
|
16
|
+
onFocusChangeHandler
|
|
17
|
+
} = (0, _useFocusStyle.useFocusStyle)({
|
|
18
|
+
onFocusChange: props.onFocusChange,
|
|
19
|
+
containerFocusStyle: props.focusStyle
|
|
20
|
+
});
|
|
21
|
+
const onGroupFocusChangeHandler = (0, _useOnFocusChange.useOnFocusChange)({
|
|
22
|
+
...props,
|
|
23
|
+
onFocusChange: onFocusChangeHandler
|
|
24
|
+
});
|
|
25
|
+
return /*#__PURE__*/_react.default.createElement(_nativeSpec.KeyboardFocusGroupNative, _extends({}, props, {
|
|
26
|
+
style: [props.style, focusStyle],
|
|
27
|
+
onGroupFocusChange: onGroupFocusChangeHandler
|
|
28
|
+
}));
|
|
29
|
+
});
|
|
30
|
+
//# sourceMappingURL=KeyboardFocusGroup.android.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_nativeSpec","_useOnFocusChange","_useFocusStyle","e","__esModule","default","_extends","Object","assign","bind","n","arguments","length","t","r","hasOwnProperty","call","apply","KeyboardFocusGroup","exports","React","memo","props","containerFocusedStyle","focusStyle","onFocusChangeHandler","useFocusStyle","onFocusChange","containerFocusStyle","onGroupFocusChangeHandler","useOnFocusChange","createElement","KeyboardFocusGroupNative","style","onGroupFocusChange"],"sourceRoot":"../../../../src","sources":["components/KeyboardFocusGroup/KeyboardFocusGroup.android.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,iBAAA,GAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;AAA0D,SAAAD,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,SAAA,WAAAA,QAAA,GAAAC,MAAA,CAAAC,MAAA,GAAAD,MAAA,CAAAC,MAAA,CAAAC,IAAA,eAAAC,CAAA,aAAAP,CAAA,MAAAA,CAAA,GAAAQ,SAAA,CAAAC,MAAA,EAAAT,CAAA,UAAAU,CAAA,GAAAF,SAAA,CAAAR,CAAA,YAAAW,CAAA,IAAAD,CAAA,OAAAE,cAAA,CAAAC,IAAA,CAAAH,CAAA,EAAAC,CAAA,MAAAJ,CAAA,CAAAI,CAAA,IAAAD,CAAA,CAAAC,CAAA,aAAAJ,CAAA,KAAAJ,QAAA,CAAAW,KAAA,OAAAN,SAAA;AAanD,MAAMO,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,gBAAGE,cAAK,CAACC,IAAI,CAEzCC,KAAK,IAAK;EACX,MAAM;IAAEC,qBAAqB,EAAEC,UAAU;IAAEC;EAAqB,CAAC,GAC/D,IAAAC,4BAAa,EAAC;IACZC,aAAa,EAAEL,KAAK,CAACK,aAAa;IAClCC,mBAAmB,EAAEN,KAAK,CAACE;EAC7B,CAAC,CAAC;EAEJ,MAAMK,yBAAyB,GAAG,IAAAC,kCAAgB,EAAC;IACjD,GAAGR,KAAK;IACRK,aAAa,EAAEF;EACjB,CAAC,CAAC;EAEF,oBACE5B,MAAA,CAAAQ,OAAA,CAAA0B,aAAA,CAAC/B,WAAA,CAAAgC,wBAAwB,EAAA1B,QAAA,KACnBgB,KAAK;IACTW,KAAK,EAAE,CAACX,KAAK,CAACW,KAAK,EAAET,UAAU,CAAE;IACjCU,kBAAkB,EAAEL;EAA0B,EAC/C,CAAC;AAEN,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_nativeSpec","_GroupIdentifierContext","_useOnFocusChange","_useFocusStyle","e","__esModule","default","_extends","Object","assign","bind","n","arguments","length","t","r","hasOwnProperty","call","apply","KeyboardFocusGroup","exports","React","memo","props","groupIdentifier","containerFocusedStyle","focusStyle","onFocusChangeHandler","useFocusStyle","onFocusChange","containerFocusStyle","onGroupFocusChangeHandler","useOnFocusChange","createElement","KeyboardFocusGroupNative","style","onGroupFocusChange","GroupIdentifierContext","Provider","value"],"sourceRoot":"../../../../src","sources":["components/KeyboardFocusGroup/KeyboardFocusGroup.ios.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,uBAAA,GAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAH,OAAA;AACA,IAAAI,cAAA,GAAAJ,OAAA;AAA0D,SAAAD,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,SAAA,WAAAA,QAAA,GAAAC,MAAA,CAAAC,MAAA,GAAAD,MAAA,CAAAC,MAAA,CAAAC,IAAA,eAAAC,CAAA,aAAAP,CAAA,MAAAA,CAAA,GAAAQ,SAAA,CAAAC,MAAA,EAAAT,CAAA,UAAAU,CAAA,GAAAF,SAAA,CAAAR,CAAA,YAAAW,CAAA,IAAAD,CAAA,OAAAE,cAAA,CAAAC,IAAA,CAAAH,CAAA,EAAAC,CAAA,MAAAJ,CAAA,CAAAI,CAAA,IAAAD,CAAA,CAAAC,CAAA,aAAAJ,CAAA,KAAAJ,QAAA,CAAAW,KAAA,OAAAN,SAAA;
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_nativeSpec","_GroupIdentifierContext","_useOnFocusChange","_useFocusStyle","e","__esModule","default","_extends","Object","assign","bind","n","arguments","length","t","r","hasOwnProperty","call","apply","KeyboardFocusGroup","exports","React","memo","props","groupIdentifier","containerFocusedStyle","focusStyle","onFocusChangeHandler","useFocusStyle","onFocusChange","containerFocusStyle","onGroupFocusChangeHandler","useOnFocusChange","createElement","KeyboardFocusGroupNative","style","onGroupFocusChange","GroupIdentifierContext","Provider","value"],"sourceRoot":"../../../../src","sources":["components/KeyboardFocusGroup/KeyboardFocusGroup.ios.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,uBAAA,GAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAH,OAAA;AACA,IAAAI,cAAA,GAAAJ,OAAA;AAA0D,SAAAD,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,SAAA,WAAAA,QAAA,GAAAC,MAAA,CAAAC,MAAA,GAAAD,MAAA,CAAAC,MAAA,CAAAC,IAAA,eAAAC,CAAA,aAAAP,CAAA,MAAAA,CAAA,GAAAQ,SAAA,CAAAC,MAAA,EAAAT,CAAA,UAAAU,CAAA,GAAAF,SAAA,CAAAR,CAAA,YAAAW,CAAA,IAAAD,CAAA,OAAAE,cAAA,CAAAC,IAAA,CAAAH,CAAA,EAAAC,CAAA,MAAAJ,CAAA,CAAAI,CAAA,IAAAD,CAAA,CAAAC,CAAA,aAAAJ,CAAA,KAAAJ,QAAA,CAAAW,KAAA,OAAAN,SAAA;AAanD,MAAMO,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,gBAAGE,cAAK,CAACC,IAAI,CAEzCC,KAAK,IAAK;EACX,MAAM;IAAEC;EAAgB,CAAC,GAAGD,KAAK;EAEjC,MAAM;IAAEE,qBAAqB,EAAEC,UAAU;IAAEC;EAAqB,CAAC,GAC/D,IAAAC,4BAAa,EAAC;IACZC,aAAa,EAAEN,KAAK,CAACM,aAAa;IAClCC,mBAAmB,EAAEP,KAAK,CAACG;EAC7B,CAAC,CAAC;EAEJ,MAAMK,yBAAyB,GAAG,IAAAC,kCAAgB,EAAC;IACjD,GAAGT,KAAK;IACRM,aAAa,EAAEF;EACjB,CAAC,CAAC;EAEF,IAAI,CAACH,eAAe,EAClB,oBACE3B,MAAA,CAAAS,OAAA,CAAA2B,aAAA,CAACjC,WAAA,CAAAkC,wBAAwB,EAAA3B,QAAA,KACnBgB,KAAK;IACTY,KAAK,EAAE,CAACZ,KAAK,CAACY,KAAK,EAAET,UAAU,CAAE;IACjCU,kBAAkB,EAAEL;EAA0B,EAC/C,CAAC;EAGN,oBACElC,MAAA,CAAAS,OAAA,CAAA2B,aAAA,CAAChC,uBAAA,CAAAoC,sBAAsB,CAACC,QAAQ;IAACC,KAAK,EAAEf;EAAgB,gBACtD3B,MAAA,CAAAS,OAAA,CAAA2B,aAAA,CAACjC,WAAA,CAAAkC,wBAAwB,EAAA3B,QAAA,KACnBgB,KAAK;IACTY,KAAK,EAAE,CAACZ,KAAK,CAACY,KAAK,EAAET,UAAU,CAAE;IACjCU,kBAAkB,EAAEL;EAA0B,EAC/C,CAC8B,CAAC;AAEtC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","KeyboardFocusGroup","exports","View"],"sourceRoot":"../../../../src","sources":["components/KeyboardFocusGroup/KeyboardFocusGroup.tsx"],"mappings":";;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;
|
|
1
|
+
{"version":3,"names":["_reactNative","require","KeyboardFocusGroup","exports","View"],"sourceRoot":"../../../../src","sources":["components/KeyboardFocusGroup/KeyboardFocusGroup.tsx"],"mappings":";;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AAeO,MAAMC,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,GAC7BE,iBAAoD","ignoreList":[]}
|