react-native-a11y-order 0.8.2 → 0.9.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 +25 -152
- package/android/build.gradle +0 -18
- package/android/src/main/java/com/a11yorder/services/focus/A11yFocusDelegate.java +10 -32
- package/android/src/main/java/com/a11yorder/services/order/A11yOrderService.java +70 -65
- package/android/src/main/java/com/a11yorder/services/order/linking/A11yLinkingQueue.java +37 -63
- package/android/src/main/java/com/a11yorder/services/order/linking/A11yOrderLinking.java +11 -14
- package/android/src/main/java/com/a11yorder/services/order/linking/WeakTreeMap.java +53 -31
- package/android/src/main/java/com/a11yorder/utils/A11yHelper.java +39 -59
- package/android/src/main/java/com/a11yorder/utils/ChoreographerUtils.java +7 -12
- package/android/src/main/java/com/a11yorder/utils/FragmentUtils.java +8 -48
- package/android/src/main/java/com/a11yorder/views/A11yIndexView/A11yIndexView.java +1 -1
- package/android/src/main/java/com/a11yorder/views/A11yLockView/A11yLockViewManager.java +5 -0
- package/android/src/main/java/com/a11yorder/views/A11yView/A11yView.java +1 -1
- package/android/src/oldarch/A11yLockViewManagerSpec.java +2 -0
- package/ios/delegates/RNAOViewItemDelegate/RNAOViewItemDelegate.mm +1 -1
- package/ios/extensions/RCTModalHostViewComponentView+RNAOA11yOrder.mm +21 -21
- package/ios/extensions/UIView+RNAOA11yOrder.mm +17 -20
- package/ios/extensions/UIViewController+RNAOA11yOrder.mm +8 -8
- package/ios/helpers/RNAOSwizzleInstall.h +30 -0
- package/ios/services/RNAOA11yItemDelegate/RNAOA11yItemDelegate.h +4 -6
- package/ios/services/RNAOA11yItemDelegate/RNAOA11yItemDelegate.mm +98 -87
- package/ios/services/RNAOA11yOrderLinking/RNAOA11yOrderLinking.h +5 -3
- package/ios/services/RNAOA11yOrderLinking/RNAOA11yOrderLinking.mm +49 -49
- package/ios/services/RNAOA11yRelationship/RNAOA11yRelationship.h +1 -0
- package/ios/services/RNAOA11yRelationship/RNAOA11yRelationship.mm +42 -36
- package/ios/services/RNAOSortedMap/RNAOSortedMap.h +2 -1
- package/ios/services/RNAOSortedMap/RNAOSortedMap.mm +48 -47
- package/ios/views/RNAOA11yLockView/RNAOA11yLockView.h +4 -2
- package/ios/views/RNAOA11yLockView/RNAOA11yLockView.mm +89 -3
- package/ios/views/RNAOA11yLockView/RNAOA11yLockViewManager.mm +3 -0
- package/lib/commonjs/components/A11yLock/A11yBaseLock/A11yBaseLock.js +18 -2
- package/lib/commonjs/components/A11yLock/A11yBaseLock/A11yBaseLock.js.map +1 -1
- package/lib/commonjs/components/A11yLock/A11yFocusTrap/A11yFocusTrap.js +23 -7
- package/lib/commonjs/components/A11yLock/A11yFocusTrap/A11yFocusTrap.js.map +1 -1
- package/lib/commonjs/nativeSpecs/A11yLockNativeComponent.ts +1 -0
- package/lib/module/components/A11yLock/A11yBaseLock/A11yBaseLock.js +17 -2
- package/lib/module/components/A11yLock/A11yBaseLock/A11yBaseLock.js.map +1 -1
- package/lib/module/components/A11yLock/A11yFocusTrap/A11yFocusTrap.js +23 -7
- package/lib/module/components/A11yLock/A11yFocusTrap/A11yFocusTrap.js.map +1 -1
- package/lib/module/nativeSpecs/A11yLockNativeComponent.ts +1 -0
- package/lib/typescript/src/components/A11yLock/A11yBaseLock/A11yBaseLock.d.ts +2 -1
- package/lib/typescript/src/components/A11yLock/A11yBaseLock/A11yBaseLock.d.ts.map +1 -1
- package/lib/typescript/src/components/A11yLock/A11yFocusTrap/A11yFocusTrap.d.ts +1 -1
- package/lib/typescript/src/components/A11yLock/A11yFocusTrap/A11yFocusTrap.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +1 -1
- package/lib/typescript/src/nativeSpecs/A11yLockNativeComponent.d.ts +1 -0
- package/lib/typescript/src/nativeSpecs/A11yLockNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/types/A11yLock.types.d.ts +1 -0
- package/lib/typescript/src/types/A11yLock.types.d.ts.map +1 -1
- package/package.json +3 -2
- package/src/components/A11yLock/A11yBaseLock/A11yBaseLock.tsx +20 -3
- package/src/components/A11yLock/A11yFocusTrap/A11yFocusTrap.tsx +24 -5
- package/src/nativeSpecs/A11yLockNativeComponent.ts +1 -0
- package/src/types/A11yLock.types.ts +1 -0
- package/lib/commonjs/components/A11yLock/A11yBaseLock/A11yBaseLock.android.js +0 -23
- package/lib/commonjs/components/A11yLock/A11yBaseLock/A11yBaseLock.android.js.map +0 -1
- package/lib/module/components/A11yLock/A11yBaseLock/A11yBaseLock.android.js +0 -18
- package/lib/module/components/A11yLock/A11yBaseLock/A11yBaseLock.android.js.map +0 -1
- package/lib/typescript/src/components/A11yLock/A11yBaseLock/A11yBaseLock.android.d.ts +0 -4
- package/lib/typescript/src/components/A11yLock/A11yBaseLock/A11yBaseLock.android.d.ts.map +0 -1
- package/src/components/A11yLock/A11yBaseLock/A11yBaseLock.android.tsx +0 -16
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
@implementation RNAOSortedMap {
|
|
13
13
|
NSMapTable *_dictionary;
|
|
14
14
|
NSMutableArray<NSNumber *> *_sortedKeys;
|
|
15
|
+
NSMutableArray *_cachedValues;
|
|
16
|
+
BOOL _isDirty;
|
|
15
17
|
}
|
|
16
18
|
|
|
17
19
|
- (instancetype)init {
|
|
@@ -19,78 +21,77 @@
|
|
|
19
21
|
if (self) {
|
|
20
22
|
_dictionary = [NSMapTable strongToWeakObjectsMapTable];
|
|
21
23
|
_sortedKeys = [NSMutableArray array];
|
|
24
|
+
_cachedValues = [NSMutableArray array];
|
|
25
|
+
_isDirty = YES;
|
|
22
26
|
}
|
|
23
27
|
return self;
|
|
24
28
|
}
|
|
25
29
|
|
|
26
|
-
- (void)updateSortedKey:(NSNumber*)position {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
indexOfFirstLarger = i;
|
|
36
|
-
break;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
if(indexOfFirstLarger == -1) {
|
|
42
|
-
[_sortedKeys addObject: position];
|
|
43
|
-
} else {
|
|
44
|
-
[_sortedKeys insertObject:position atIndex:indexOfFirstLarger];
|
|
45
|
-
}
|
|
46
|
-
}
|
|
30
|
+
- (void)updateSortedKey:(NSNumber *)position {
|
|
31
|
+
NSRange range = NSMakeRange(0, _sortedKeys.count);
|
|
32
|
+
NSUInteger insertIndex = [_sortedKeys indexOfObject:position
|
|
33
|
+
inSortedRange:range
|
|
34
|
+
options:NSBinarySearchingInsertionIndex
|
|
35
|
+
usingComparator:^NSComparisonResult(NSNumber *a, NSNumber *b) {
|
|
36
|
+
return [a compare:b];
|
|
37
|
+
}];
|
|
38
|
+
[_sortedKeys insertObject:position atIndex:insertIndex];
|
|
47
39
|
}
|
|
48
40
|
|
|
49
|
-
- (void)put:(NSNumber*)position withObject:(NSObject*)obj {
|
|
50
|
-
|
|
51
|
-
|
|
41
|
+
- (void)put:(NSNumber *)position withObject:(NSObject *)obj {
|
|
42
|
+
_isDirty = YES;
|
|
43
|
+
if ([_dictionary objectForKey:position] == nil) {
|
|
44
|
+
[self updateSortedKey:position];
|
|
52
45
|
}
|
|
53
|
-
[_dictionary setObject:
|
|
46
|
+
[_dictionary setObject:obj forKey:position];
|
|
54
47
|
}
|
|
55
48
|
|
|
56
|
-
- (void)remove:(NSNumber*)position {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
49
|
+
- (void)remove:(NSNumber *)position {
|
|
50
|
+
_isDirty = YES;
|
|
51
|
+
NSUInteger index = [_sortedKeys indexOfObject:position];
|
|
52
|
+
if (index != NSNotFound) {
|
|
53
|
+
[_sortedKeys removeObjectAtIndex:index];
|
|
60
54
|
}
|
|
61
55
|
[_dictionary removeObjectForKey:position];
|
|
62
56
|
}
|
|
63
57
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
NSUInteger
|
|
68
|
-
if (
|
|
69
|
-
[_sortedKeys removeObjectAtIndex:
|
|
58
|
+
- (void)remove:(NSNumber *)position withObject:(NSObject *)obj {
|
|
59
|
+
if ([_dictionary objectForKey:position] == obj) {
|
|
60
|
+
_isDirty = YES;
|
|
61
|
+
NSUInteger index = [_sortedKeys indexOfObject:position];
|
|
62
|
+
if (index != NSNotFound) {
|
|
63
|
+
[_sortedKeys removeObjectAtIndex:index];
|
|
70
64
|
}
|
|
71
65
|
[_dictionary removeObjectForKey:position];
|
|
72
66
|
}
|
|
73
67
|
}
|
|
74
68
|
|
|
69
|
+
- (void)update:(NSNumber *)lastPosition withPosition:(NSNumber *)position withObject:(NSObject *)obj {
|
|
70
|
+
[self remove:lastPosition withObject:obj];
|
|
71
|
+
[self put:position withObject:obj];
|
|
72
|
+
}
|
|
73
|
+
|
|
75
74
|
- (void)clear {
|
|
75
|
+
_isDirty = YES;
|
|
76
76
|
[_dictionary removeAllObjects];
|
|
77
77
|
[_sortedKeys removeAllObjects];
|
|
78
|
+
[_cachedValues removeAllObjects];
|
|
78
79
|
}
|
|
79
80
|
|
|
80
|
-
- (
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
NSMutableArray *result = [NSMutableArray arrayWithCapacity:_sortedKeys.count];
|
|
87
|
-
for (NSNumber *key in _sortedKeys) {
|
|
88
|
-
NSObject *object = [_dictionary objectForKey:key];
|
|
89
|
-
if (object) {
|
|
90
|
-
[result addObject:object];
|
|
81
|
+
- (NSArray *)getValues {
|
|
82
|
+
if (_isDirty) {
|
|
83
|
+
[_cachedValues removeAllObjects];
|
|
84
|
+
for (NSNumber *key in _sortedKeys) {
|
|
85
|
+
NSObject *obj = [_dictionary objectForKey:key];
|
|
86
|
+
if (obj) { [_cachedValues addObject:obj]; }
|
|
91
87
|
}
|
|
88
|
+
_isDirty = NO;
|
|
92
89
|
}
|
|
93
|
-
return
|
|
90
|
+
return [NSArray arrayWithArray:_cachedValues];
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
- (BOOL)isEmpty {
|
|
94
|
+
return _dictionary.count == 0;
|
|
94
95
|
}
|
|
95
96
|
|
|
96
97
|
@end
|
|
@@ -16,10 +16,11 @@
|
|
|
16
16
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
17
17
|
#import <React/RCTViewComponentView.h>
|
|
18
18
|
|
|
19
|
-
|
|
20
19
|
NS_ASSUME_NONNULL_BEGIN
|
|
21
20
|
|
|
22
21
|
@interface RNAOA11yLockView : RCTViewComponentView
|
|
22
|
+
@property (nonatomic, assign) BOOL lockDisabled;
|
|
23
|
+
@property (nonatomic, assign) NSInteger componentType;
|
|
23
24
|
@end
|
|
24
25
|
|
|
25
26
|
NS_ASSUME_NONNULL_END
|
|
@@ -27,9 +28,10 @@ NS_ASSUME_NONNULL_END
|
|
|
27
28
|
|
|
28
29
|
#else /* RCT_NEW_ARCH_ENABLED */
|
|
29
30
|
|
|
30
|
-
|
|
31
31
|
#import <React/RCTView.h>
|
|
32
32
|
@interface RNAOA11yLockView : RCTView
|
|
33
|
+
@property (nonatomic, assign) BOOL lockDisabled;
|
|
34
|
+
@property (nonatomic, assign) NSInteger componentType;
|
|
33
35
|
@end
|
|
34
36
|
|
|
35
37
|
#endif
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
|
|
8
8
|
#import <Foundation/Foundation.h>
|
|
9
9
|
|
|
10
|
-
|
|
11
10
|
#import <UIKit/UIKit.h>
|
|
12
11
|
#import <React/RCTViewManager.h>
|
|
13
12
|
#import "RNAOA11yLockView.h"
|
|
@@ -33,6 +32,85 @@ using namespace facebook::react;
|
|
|
33
32
|
|
|
34
33
|
@implementation RNAOA11yLockView
|
|
35
34
|
|
|
35
|
+
- (void)didMoveToSuperview {
|
|
36
|
+
[super didMoveToSuperview];
|
|
37
|
+
|
|
38
|
+
if (self.superview) {
|
|
39
|
+
[[NSNotificationCenter defaultCenter] addObserver:self
|
|
40
|
+
selector:@selector(onAccessibilityFocusChanged:)
|
|
41
|
+
name:UIAccessibilityElementFocusedNotification
|
|
42
|
+
object:nil];
|
|
43
|
+
} else {
|
|
44
|
+
[[NSNotificationCenter defaultCenter] removeObserver:self
|
|
45
|
+
name:UIAccessibilityElementFocusedNotification
|
|
46
|
+
object:nil];
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
- (void)dealloc {
|
|
51
|
+
[[NSNotificationCenter defaultCenter] removeObserver:self
|
|
52
|
+
name:UIAccessibilityElementFocusedNotification
|
|
53
|
+
object:nil];
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
57
|
+
- (void)prepareForRecycle {
|
|
58
|
+
[super prepareForRecycle];
|
|
59
|
+
_lockDisabled = NO;
|
|
60
|
+
_componentType = 0;
|
|
61
|
+
[[NSNotificationCenter defaultCenter] removeObserver:self
|
|
62
|
+
name:UIAccessibilityElementFocusedNotification
|
|
63
|
+
object:nil];
|
|
64
|
+
}
|
|
65
|
+
#endif
|
|
66
|
+
|
|
67
|
+
- (void)onAccessibilityFocusChanged:(NSNotification *)notification {
|
|
68
|
+
if (_lockDisabled) return;
|
|
69
|
+
|
|
70
|
+
id element = notification.userInfo[UIAccessibilityFocusedElementKey];
|
|
71
|
+
if (![element isKindOfClass:[UIView class]]) return;
|
|
72
|
+
|
|
73
|
+
UIView *focused = (UIView *)element;
|
|
74
|
+
if (![focused isDescendantOfView:self]) {
|
|
75
|
+
UIAccessibilityPostNotification(UIAccessibilityLayoutChangedNotification, self);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
- (void)setLockDisabled:(BOOL)lockDisabled {
|
|
80
|
+
_lockDisabled = lockDisabled;
|
|
81
|
+
[self requestScreenReaderFocus];
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
- (void)setComponentType:(NSInteger)componentType {
|
|
85
|
+
_componentType = componentType;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
- (BOOL)shouldUpdateFocusInContext:(UIFocusUpdateContext *)context {
|
|
89
|
+
if (_lockDisabled) {
|
|
90
|
+
return [super shouldUpdateFocusInContext:context];
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
UIView *nextFocus = (UIView *)context.nextFocusedView;
|
|
94
|
+
if (nextFocus != nil && ![nextFocus isDescendantOfView:self]) {
|
|
95
|
+
return NO;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return [super shouldUpdateFocusInContext:context];
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
- (void)requestScreenReaderFocus {
|
|
102
|
+
if (_lockDisabled) return;
|
|
103
|
+
UIAccessibilityPostNotification(UIAccessibilityLayoutChangedNotification, self);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
- (void)didMoveToWindow {
|
|
107
|
+
[super didMoveToWindow];
|
|
108
|
+
|
|
109
|
+
if (self.window) {
|
|
110
|
+
[self requestScreenReaderFocus];
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
36
114
|
|
|
37
115
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
38
116
|
|
|
@@ -41,17 +119,25 @@ using namespace facebook::react;
|
|
|
41
119
|
return concreteComponentDescriptorProvider<A11yLockComponentDescriptor>();
|
|
42
120
|
}
|
|
43
121
|
|
|
44
|
-
|
|
45
122
|
- (instancetype)initWithFrame:(CGRect)frame
|
|
46
123
|
{
|
|
47
124
|
if (self = [super initWithFrame:frame]) {
|
|
48
125
|
static const auto defaultProps = std::make_shared<const A11yLockProps>();
|
|
49
126
|
_props = defaultProps;
|
|
50
127
|
}
|
|
51
|
-
|
|
128
|
+
|
|
52
129
|
return self;
|
|
53
130
|
}
|
|
54
131
|
|
|
132
|
+
- (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &)oldProps
|
|
133
|
+
{
|
|
134
|
+
const auto &newViewProps = *std::static_pointer_cast<A11yLockProps const>(props);
|
|
135
|
+
[super updateProps:props oldProps:oldProps];
|
|
136
|
+
|
|
137
|
+
self.lockDisabled = newViewProps.lockDisabled;
|
|
138
|
+
self.componentType = newViewProps.componentType;
|
|
139
|
+
}
|
|
140
|
+
|
|
55
141
|
Class<RCTComponentViewProtocol> A11yLockCls(void)
|
|
56
142
|
{
|
|
57
143
|
return RNAOA11yLockView.class;
|
|
@@ -4,6 +4,22 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.A11yBaseLock = void 0;
|
|
7
|
-
var
|
|
8
|
-
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _A11yLockNativeComponent = _interopRequireDefault(require("../../../nativeSpecs/A11yLockNativeComponent"));
|
|
9
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
const A11yBaseLock = exports.A11yBaseLock = /*#__PURE__*/_react.default.memo(({
|
|
12
|
+
lockDisabled = false,
|
|
13
|
+
componentType = 0,
|
|
14
|
+
forceLock = false,
|
|
15
|
+
...props
|
|
16
|
+
}) => {
|
|
17
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_A11yLockNativeComponent.default, {
|
|
18
|
+
...props,
|
|
19
|
+
containerKey: "is-not-needed",
|
|
20
|
+
componentType: componentType,
|
|
21
|
+
lockDisabled: lockDisabled,
|
|
22
|
+
forceLock: forceLock
|
|
23
|
+
});
|
|
24
|
+
});
|
|
9
25
|
//# sourceMappingURL=A11yBaseLock.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_A11yLockNativeComponent","_jsxRuntime","e","__esModule","default","A11yBaseLock","exports","React","memo","lockDisabled","componentType","forceLock","props","jsx","containerKey"],"sourceRoot":"../../../../../src","sources":["components/A11yLock/A11yBaseLock/A11yBaseLock.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,wBAAA,GAAAF,sBAAA,CAAAC,OAAA;AAAmF,IAAAE,WAAA,GAAAF,OAAA;AAAA,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAG5E,MAAMG,YAAY,GAAAC,OAAA,CAAAD,YAAA,gBAAGE,cAAK,CAACC,IAAI,CACpC,CAAC;EACCC,YAAY,GAAG,KAAK;EACpBC,aAAa,GAAG,CAAC;EACjBC,SAAS,GAAG,KAAK;EACjB,GAAGC;AACL,CAAC,KAAK;EACJ,oBACE,IAAAX,WAAA,CAAAY,GAAA,EAACb,wBAAA,CAAAI,OAAuB;IAAA,GAClBQ,KAAK;IACTE,YAAY,EAAC,eAAe;IAC5BJ,aAAa,EAAEA,aAAc;IAC7BD,YAAY,EAAEA,YAAa;IAC3BE,SAAS,EAAEA;EAAU,CACtB,CAAC;AAEN,CACF,CAAC","ignoreList":[]}
|
|
@@ -7,14 +7,30 @@ exports.A11yFocusTrap = void 0;
|
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
var _A11yFocusTrapMountWrapper = require("./A11yFocusTrapMountWrapper");
|
|
10
|
+
var _A11yBaseLock = require("../A11yBaseLock/A11yBaseLock");
|
|
10
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
12
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
-
const A11yFocusTrap =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
const A11yFocusTrap = ({
|
|
14
|
+
forceLock = false,
|
|
15
|
+
...props
|
|
16
|
+
}) => {
|
|
17
|
+
if (forceLock) {
|
|
18
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_A11yFocusTrapMountWrapper.A11yFocusTrapMountWrapper, {
|
|
19
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_A11yBaseLock.A11yBaseLock, {
|
|
20
|
+
collapsable: false,
|
|
21
|
+
accessibilityViewIsModal: true,
|
|
22
|
+
forceLock: forceLock,
|
|
23
|
+
...props
|
|
24
|
+
})
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_A11yFocusTrapMountWrapper.A11yFocusTrapMountWrapper, {
|
|
28
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
29
|
+
collapsable: false,
|
|
30
|
+
accessibilityViewIsModal: true,
|
|
31
|
+
...props
|
|
32
|
+
})
|
|
33
|
+
});
|
|
34
|
+
};
|
|
19
35
|
exports.A11yFocusTrap = A11yFocusTrap;
|
|
20
36
|
//# sourceMappingURL=A11yFocusTrap.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_A11yFocusTrapMountWrapper","_jsxRuntime","e","__esModule","default","A11yFocusTrap","props","jsx","A11yFocusTrapMountWrapper","children","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_A11yFocusTrapMountWrapper","_A11yBaseLock","_jsxRuntime","e","__esModule","default","A11yFocusTrap","forceLock","props","jsx","A11yFocusTrapMountWrapper","children","A11yBaseLock","collapsable","accessibilityViewIsModal","View","exports"],"sourceRoot":"../../../../../src","sources":["components/A11yLock/A11yFocusTrap/A11yFocusTrap.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,0BAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AAA4D,IAAAI,WAAA,GAAAJ,OAAA;AAAA,SAAAD,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAErD,MAAMG,aAAa,GAAGA,CAAC;EAC5BC,SAAS,GAAG,KAAK;EACjB,GAAGC;AACU,CAAC,KAAK;EACnB,IAAID,SAAS,EAAE;IACb,oBACE,IAAAL,WAAA,CAAAO,GAAA,EAACT,0BAAA,CAAAU,yBAAyB;MAAAC,QAAA,eACxB,IAAAT,WAAA,CAAAO,GAAA,EAACR,aAAA,CAAAW,YAAY;QACXC,WAAW,EAAE,KAAM;QACnBC,wBAAwB,EAAE,IAAK;QAC/BP,SAAS,EAAEA,SAAU;QAAA,GACjBC;MAAK,CACV;IAAC,CACuB,CAAC;EAEhC;EAEA,oBACE,IAAAN,WAAA,CAAAO,GAAA,EAACT,0BAAA,CAAAU,yBAAyB;IAAAC,QAAA,eACxB,IAAAT,WAAA,CAAAO,GAAA,EAACV,YAAA,CAAAgB,IAAI;MAACF,WAAW,EAAE,KAAM;MAACC,wBAAwB,EAAE,IAAK;MAAA,GAAKN;IAAK,CAAG;EAAC,CAC9C,CAAC;AAEhC,CAAC;AAACQ,OAAA,CAAAV,aAAA,GAAAA,aAAA","ignoreList":[]}
|
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import A11yLockNativeComponent from '../../../nativeSpecs/A11yLockNativeComponent';
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
export const A11yBaseLock = /*#__PURE__*/React.memo(({
|
|
7
|
+
lockDisabled = false,
|
|
8
|
+
componentType = 0,
|
|
9
|
+
forceLock = false,
|
|
10
|
+
...props
|
|
11
|
+
}) => {
|
|
12
|
+
return /*#__PURE__*/_jsx(A11yLockNativeComponent, {
|
|
13
|
+
...props,
|
|
14
|
+
containerKey: "is-not-needed",
|
|
15
|
+
componentType: componentType,
|
|
16
|
+
lockDisabled: lockDisabled,
|
|
17
|
+
forceLock: forceLock
|
|
18
|
+
});
|
|
19
|
+
});
|
|
5
20
|
//# sourceMappingURL=A11yBaseLock.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["React","A11yLockNativeComponent","jsx","_jsx","A11yBaseLock","memo","lockDisabled","componentType","forceLock","props","containerKey"],"sourceRoot":"../../../../../src","sources":["components/A11yLock/A11yBaseLock/A11yBaseLock.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,uBAAuB,MAAM,8CAA8C;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAGnF,OAAO,MAAMC,YAAY,gBAAGJ,KAAK,CAACK,IAAI,CACpC,CAAC;EACCC,YAAY,GAAG,KAAK;EACpBC,aAAa,GAAG,CAAC;EACjBC,SAAS,GAAG,KAAK;EACjB,GAAGC;AACL,CAAC,KAAK;EACJ,oBACEN,IAAA,CAACF,uBAAuB;IAAA,GAClBQ,KAAK;IACTC,YAAY,EAAC,eAAe;IAC5BH,aAAa,EAAEA,aAAc;IAC7BD,YAAY,EAAEA,YAAa;IAC3BE,SAAS,EAAEA;EAAU,CACtB,CAAC;AAEN,CACF,CAAC","ignoreList":[]}
|
|
@@ -3,12 +3,28 @@
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { View } from 'react-native';
|
|
5
5
|
import { A11yFocusTrapMountWrapper } from './A11yFocusTrapMountWrapper';
|
|
6
|
+
import { A11yBaseLock } from '../A11yBaseLock/A11yBaseLock';
|
|
6
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
-
export const A11yFocusTrap =
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
export const A11yFocusTrap = ({
|
|
9
|
+
forceLock = false,
|
|
10
|
+
...props
|
|
11
|
+
}) => {
|
|
12
|
+
if (forceLock) {
|
|
13
|
+
return /*#__PURE__*/_jsx(A11yFocusTrapMountWrapper, {
|
|
14
|
+
children: /*#__PURE__*/_jsx(A11yBaseLock, {
|
|
15
|
+
collapsable: false,
|
|
16
|
+
accessibilityViewIsModal: true,
|
|
17
|
+
forceLock: forceLock,
|
|
18
|
+
...props
|
|
19
|
+
})
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
return /*#__PURE__*/_jsx(A11yFocusTrapMountWrapper, {
|
|
23
|
+
children: /*#__PURE__*/_jsx(View, {
|
|
24
|
+
collapsable: false,
|
|
25
|
+
accessibilityViewIsModal: true,
|
|
26
|
+
...props
|
|
27
|
+
})
|
|
28
|
+
});
|
|
29
|
+
};
|
|
14
30
|
//# sourceMappingURL=A11yFocusTrap.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","A11yFocusTrapMountWrapper","jsx","_jsx","A11yFocusTrap","props","children","collapsable","accessibilityViewIsModal"],"sourceRoot":"../../../../../src","sources":["components/A11yLock/A11yFocusTrap/A11yFocusTrap.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AAEnC,SAASC,yBAAyB,QAAQ,6BAA6B;AAAC,SAAAC,GAAA,IAAAC,IAAA;
|
|
1
|
+
{"version":3,"names":["React","View","A11yFocusTrapMountWrapper","A11yBaseLock","jsx","_jsx","A11yFocusTrap","forceLock","props","children","collapsable","accessibilityViewIsModal"],"sourceRoot":"../../../../../src","sources":["components/A11yLock/A11yFocusTrap/A11yFocusTrap.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AAEnC,SAASC,yBAAyB,QAAQ,6BAA6B;AACvE,SAASC,YAAY,QAAQ,8BAA8B;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE5D,OAAO,MAAMC,aAAa,GAAGA,CAAC;EAC5BC,SAAS,GAAG,KAAK;EACjB,GAAGC;AACU,CAAC,KAAK;EACnB,IAAID,SAAS,EAAE;IACb,oBACEF,IAAA,CAACH,yBAAyB;MAAAO,QAAA,eACxBJ,IAAA,CAACF,YAAY;QACXO,WAAW,EAAE,KAAM;QACnBC,wBAAwB,EAAE,IAAK;QAC/BJ,SAAS,EAAEA,SAAU;QAAA,GACjBC;MAAK,CACV;IAAC,CACuB,CAAC;EAEhC;EAEA,oBACEH,IAAA,CAACH,yBAAyB;IAAAO,QAAA,eACxBJ,IAAA,CAACJ,IAAI;MAACS,WAAW,EAAE,KAAM;MAACC,wBAAwB,EAAE,IAAK;MAAA,GAAKH;IAAK,CAAG;EAAC,CAC9C,CAAC;AAEhC,CAAC","ignoreList":[]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import type { A11yLockProps } from '../../../types/A11yLock.types';
|
|
2
|
-
export declare const A11yBaseLock: React.
|
|
3
|
+
export declare const A11yBaseLock: React.NamedExoticComponent<A11yLockProps>;
|
|
3
4
|
//# sourceMappingURL=A11yBaseLock.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"A11yBaseLock.d.ts","sourceRoot":"","sources":["../../../../../../src/components/A11yLock/A11yBaseLock/A11yBaseLock.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"A11yBaseLock.d.ts","sourceRoot":"","sources":["../../../../../../src/components/A11yLock/A11yBaseLock/A11yBaseLock.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAEnE,eAAO,MAAM,YAAY,2CAiBxB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { A11yLockProps } from '../../../types/A11yLock.types';
|
|
3
|
-
export declare const A11yFocusTrap: (props: A11yLockProps) => React.JSX.Element;
|
|
3
|
+
export declare const A11yFocusTrap: ({ forceLock, ...props }: A11yLockProps) => React.JSX.Element;
|
|
4
4
|
//# sourceMappingURL=A11yFocusTrap.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"A11yFocusTrap.d.ts","sourceRoot":"","sources":["../../../../../../src/components/A11yLock/A11yFocusTrap/A11yFocusTrap.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"A11yFocusTrap.d.ts","sourceRoot":"","sources":["../../../../../../src/components/A11yLock/A11yFocusTrap/A11yFocusTrap.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAInE,eAAO,MAAM,aAAa,GAAI,yBAG3B,aAAa,sBAmBf,CAAC"}
|
|
@@ -410,7 +410,7 @@ export declare const A11y: {
|
|
|
410
410
|
onScreenReaderDescendantFocusChanged?: (e: import(".").ScreenReaderDescendantFocusChangedEvent) => void;
|
|
411
411
|
} & import("react").RefAttributes<{}>>;
|
|
412
412
|
FocusFrame: (props: import("react-native").ViewProps) => import("react").JSX.Element;
|
|
413
|
-
FocusTrap: (props: import("./types/A11yLock.types").A11yLockProps) => import("react").JSX.Element;
|
|
413
|
+
FocusTrap: ({ forceLock, ...props }: import("./types/A11yLock.types").A11yLockProps) => import("react").JSX.Element;
|
|
414
414
|
};
|
|
415
415
|
export { A11yModule } from './modules/A11yAnnounceModule';
|
|
416
416
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -4,6 +4,7 @@ export interface A11yLockNativeComponentProps extends ViewProps {
|
|
|
4
4
|
componentType: Int32;
|
|
5
5
|
containerKey?: string;
|
|
6
6
|
lockDisabled?: boolean;
|
|
7
|
+
forceLock?: boolean;
|
|
7
8
|
}
|
|
8
9
|
declare const _default: (props: Omit<A11yLockNativeComponentProps, "ref"> & {
|
|
9
10
|
ref?: React.Ref<import("react-native").HostInstance>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"A11yLockNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/nativeSpecs/A11yLockNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2CAA2C,CAAC;AAIvE,MAAM,WAAW,4BAA6B,SAAQ,SAAS;IAC7D,aAAa,EAAE,KAAK,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"A11yLockNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/nativeSpecs/A11yLockNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2CAA2C,CAAC;AAIvE,MAAM,WAAW,4BAA6B,SAAQ,SAAS;IAC7D,aAAa,EAAE,KAAK,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;;;;AAED,wBAAgF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"A11yLock.types.d.ts","sourceRoot":"","sources":["../../../../src/types/A11yLock.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG;IACtC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"A11yLock.types.d.ts","sourceRoot":"","sources":["../../../../src/types/A11yLock.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG;IACtC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-a11y-order",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.1-rc",
|
|
4
4
|
"description": "ReactNative library for managing screen reader focus ordering",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -24,7 +24,8 @@
|
|
|
24
24
|
"!**/__tests__",
|
|
25
25
|
"!**/__fixtures__",
|
|
26
26
|
"!**/__mocks__",
|
|
27
|
-
"!**/.*"
|
|
27
|
+
"!**/.*",
|
|
28
|
+
"!**/CLAUDE.md"
|
|
28
29
|
],
|
|
29
30
|
"scripts": {
|
|
30
31
|
"example": "yarn workspace a11y-order-example",
|
|
@@ -1,5 +1,22 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import A11yLockNativeComponent from '../../../nativeSpecs/A11yLockNativeComponent';
|
|
2
3
|
import type { A11yLockProps } from '../../../types/A11yLock.types';
|
|
3
4
|
|
|
4
|
-
export const A11yBaseLock =
|
|
5
|
-
|
|
5
|
+
export const A11yBaseLock = React.memo<A11yLockProps>(
|
|
6
|
+
({
|
|
7
|
+
lockDisabled = false,
|
|
8
|
+
componentType = 0,
|
|
9
|
+
forceLock = false,
|
|
10
|
+
...props
|
|
11
|
+
}) => {
|
|
12
|
+
return (
|
|
13
|
+
<A11yLockNativeComponent
|
|
14
|
+
{...props}
|
|
15
|
+
containerKey="is-not-needed"
|
|
16
|
+
componentType={componentType}
|
|
17
|
+
lockDisabled={lockDisabled}
|
|
18
|
+
forceLock={forceLock}
|
|
19
|
+
/>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
);
|
|
@@ -2,9 +2,28 @@ import React from 'react';
|
|
|
2
2
|
import { View } from 'react-native';
|
|
3
3
|
import type { A11yLockProps } from '../../../types/A11yLock.types';
|
|
4
4
|
import { A11yFocusTrapMountWrapper } from './A11yFocusTrapMountWrapper';
|
|
5
|
+
import { A11yBaseLock } from '../A11yBaseLock/A11yBaseLock';
|
|
5
6
|
|
|
6
|
-
export const A11yFocusTrap = (
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
)
|
|
7
|
+
export const A11yFocusTrap = ({
|
|
8
|
+
forceLock = false,
|
|
9
|
+
...props
|
|
10
|
+
}: A11yLockProps) => {
|
|
11
|
+
if (forceLock) {
|
|
12
|
+
return (
|
|
13
|
+
<A11yFocusTrapMountWrapper>
|
|
14
|
+
<A11yBaseLock
|
|
15
|
+
collapsable={false}
|
|
16
|
+
accessibilityViewIsModal={true}
|
|
17
|
+
forceLock={forceLock}
|
|
18
|
+
{...props}
|
|
19
|
+
/>
|
|
20
|
+
</A11yFocusTrapMountWrapper>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<A11yFocusTrapMountWrapper>
|
|
26
|
+
<View collapsable={false} accessibilityViewIsModal={true} {...props} />
|
|
27
|
+
</A11yFocusTrapMountWrapper>
|
|
28
|
+
);
|
|
29
|
+
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.A11yBaseLock = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _A11yLockNativeComponent = _interopRequireDefault(require("../../../nativeSpecs/A11yLockNativeComponent"));
|
|
9
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
-
const A11yBaseLock = exports.A11yBaseLock = /*#__PURE__*/_react.default.memo(({
|
|
12
|
-
lockDisabled = false,
|
|
13
|
-
componentType = 0,
|
|
14
|
-
...props
|
|
15
|
-
}) => {
|
|
16
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_A11yLockNativeComponent.default, {
|
|
17
|
-
...props,
|
|
18
|
-
containerKey: "is-not-needed",
|
|
19
|
-
componentType: componentType,
|
|
20
|
-
lockDisabled: lockDisabled
|
|
21
|
-
});
|
|
22
|
-
});
|
|
23
|
-
//# sourceMappingURL=A11yBaseLock.android.js.map
|