react-native-a11y-order 0.2.5 → 0.3.0
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 +89 -50
- package/ios/views/RNAOA11yGroupView/RNAOA11yGroupViewManager.h +4 -0
- package/ios/views/RNAOA11yGroupView/RNAOA11yGroupViewManager.mm +4 -0
- package/ios/views/RNAOA11yIndexView/RNAOA11yIndexViewManager.h +4 -0
- package/ios/views/RNAOA11yIndexView/RNAOA11yIndexViewManager.mm +4 -0
- package/ios/views/RNAOA11yOrderView/RNAOA11yOrderViewManager.h +4 -0
- package/ios/views/RNAOA11yOrderView/RNAOA11yOrderViewManager.mm +4 -1
- package/lib/commonjs/components/A11yGroup/A11yGroup.android.js +4 -3
- package/lib/commonjs/components/A11yGroup/A11yGroup.android.js.map +1 -1
- package/lib/commonjs/components/A11yIndex/A11yIndex.js +2 -2
- package/lib/commonjs/components/A11yIndex/A11yIndex.js.map +1 -1
- package/lib/commonjs/components/A11yIndex/A11yIndex.web.js +2 -2
- package/lib/commonjs/components/A11yIndex/A11yIndex.web.js.map +1 -1
- package/lib/commonjs/components/A11yOrder/A11yOrder.js +38 -0
- package/lib/commonjs/components/A11yOrder/A11yOrder.js.map +1 -0
- package/lib/commonjs/index.js +7 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/index.web.js +43 -1
- package/lib/commonjs/index.web.js.map +1 -1
- package/lib/commonjs/types/A11yOrder.types.js +6 -0
- package/lib/commonjs/types/A11yOrder.types.js.map +1 -0
- package/lib/module/components/A11yGroup/A11yGroup.android.js +3 -2
- package/lib/module/components/A11yGroup/A11yGroup.android.js.map +1 -1
- package/lib/module/components/A11yIndex/A11yIndex.js +2 -2
- package/lib/module/components/A11yIndex/A11yIndex.js.map +1 -1
- package/lib/module/components/A11yIndex/A11yIndex.web.js +2 -2
- package/lib/module/components/A11yIndex/A11yIndex.web.js.map +1 -1
- package/lib/module/components/A11yOrder/A11yOrder.js +30 -0
- package/lib/module/components/A11yOrder/A11yOrder.js.map +1 -0
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.web.js +40 -0
- package/lib/module/index.web.js.map +1 -1
- package/lib/module/types/A11yOrder.types.js +2 -0
- package/lib/module/types/A11yOrder.types.js.map +1 -0
- package/lib/typescript/components/A11yGroup/A11yGroup.android.d.ts.map +1 -1
- package/lib/typescript/components/A11yOrder/A11yOrder.d.ts +8 -0
- package/lib/typescript/components/A11yOrder/A11yOrder.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +2 -0
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/index.web.d.ts +39 -1
- package/lib/typescript/index.web.d.ts.map +1 -1
- package/lib/typescript/types/A11yOrder.types.d.ts +10 -0
- package/lib/typescript/types/A11yOrder.types.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/components/A11yGroup/A11yGroup.android.tsx +3 -2
- package/src/components/A11yIndex/A11yIndex.tsx +2 -2
- package/src/components/A11yIndex/A11yIndex.web.tsx +2 -2
- package/src/components/A11yOrder/A11yOrder.tsx +38 -0
- package/src/index.ts +2 -0
- package/src/index.web.ts +43 -0
- package/src/types/A11yOrder.types.ts +9 -0
package/README.md
CHANGED
|
@@ -4,10 +4,6 @@ React Native A11y Order Library: Advanced control of screen reader order.
|
|
|
4
4
|
|
|
5
5
|
Setting the right reading order can be a challenge, but there is a way to do it. The react-native-a11y-order is a native-first library designed to solve problems with the ordering of screen readers on both Android and iOS platforms.
|
|
6
6
|
|
|
7
|
-
## Breaking Changes !!!
|
|
8
|
-
> The `A11yModule`, `A11yOrder` and hooks `useFocusOrder`, `useDynamicFocusOrder`, and `useA11yOrderManager` have been removed. This API was deprecated and did not work properly with the new architecture. You can refer to the migration guide to update it.
|
|
9
|
-
|
|
10
|
-
|
|
11
7
|
| iOS reader | Android reader |
|
|
12
8
|
| --------------------------------------------------------- | ------------------------------------------------------------- |
|
|
13
9
|
| <img src="/.github/images/ios-reader.gif" height="500" /> | <img src="/.github/images/android-reader.gif" height="500" /> |
|
|
@@ -26,6 +22,25 @@ npm install react-native-a11y-order
|
|
|
26
22
|
yarn add react-native-a11y-order
|
|
27
23
|
```
|
|
28
24
|
|
|
25
|
+
### For React Native Below Version 0.74.x
|
|
26
|
+
If you are using a React Native version below `0.74.x` with NewArch enabled, you may encounter an error with component registration. To resolve this issue, add the following code to your `ios/Podfile` file.
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
post_install do |installer|
|
|
32
|
+
installer.pods_project.targets.each do |target|
|
|
33
|
+
target.build_configurations.each do |config|
|
|
34
|
+
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)']
|
|
35
|
+
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << "RCT_VIEW_MANAGER_ENABLED=1"
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
You can also use version `react-native-a11y-order@0.2.3`. Version `0.3.0` is released solely to support React Native versions `0.79.x to 0.80.x`.
|
|
42
|
+
|
|
43
|
+
|
|
29
44
|
## Usage
|
|
30
45
|
|
|
31
46
|
#### A11y.Order, A11y.Index
|
|
@@ -92,57 +107,81 @@ export default function App() {
|
|
|
92
107
|
}
|
|
93
108
|
```
|
|
94
109
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
<
|
|
105
|
-
<
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
/>
|
|
127
|
-
<View
|
|
128
|
-
accessible
|
|
129
|
-
accessibilityLabel="Peach"
|
|
130
|
-
style={{width: '100%', height: 200, backgroundColor: '#F4B393'}}
|
|
131
|
-
/>
|
|
132
|
-
</ScrollView>
|
|
133
|
-
</A11y.Index>
|
|
134
|
-
</A11y.Order>
|
|
135
|
-
</View>
|
|
110
|
+
> [!NOTE]
|
|
111
|
+
> Because of its native nature, it is important to wrap all components inside `A11y.Order` with `A11y.Index`. Components not wrapped in `A11y.Index` may be skipped from the reading order on iOS, or read at the end on Android. If you need to manage many elements, try to group them with a view and then control them via the ordering system. You can find an example below.
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
Don't:
|
|
115
|
+
|
|
116
|
+
```js
|
|
117
|
+
export default function App() {
|
|
118
|
+
return (
|
|
119
|
+
<Viw style={styles.container}>
|
|
120
|
+
<A11y.Order>
|
|
121
|
+
<A11y.Index index={1}>
|
|
122
|
+
<Text style={styles.font}>
|
|
123
|
+
First
|
|
124
|
+
</Text>
|
|
125
|
+
</A11y.Index>
|
|
126
|
+
<Text style={styles.font}>
|
|
127
|
+
Third
|
|
128
|
+
</Text> // <===== Do not leave components unwrapped
|
|
129
|
+
<A11y.Index index={2}>
|
|
130
|
+
<Text style={styles.font}>
|
|
131
|
+
Second
|
|
132
|
+
</Text>
|
|
133
|
+
</A11y.Index>
|
|
134
|
+
<Text style={styles.font}>Fourth</Text> // <===== This is also incorrect
|
|
135
|
+
<Text style={styles.font}>Fifth</Text>
|
|
136
|
+
</A11y.Order>
|
|
137
|
+
<Text style={styles.font}>Sixth</Text> // <===== This is correct because it is outside of `A11y.Order`
|
|
138
|
+
</View>
|
|
139
|
+
);
|
|
140
|
+
}
|
|
136
141
|
```
|
|
137
142
|
|
|
138
|
-
|
|
143
|
+
Do
|
|
139
144
|
|
|
145
|
+
```js
|
|
146
|
+
export default function App() {
|
|
147
|
+
return (
|
|
148
|
+
<Viw style={styles.container}>
|
|
149
|
+
<A11y.Order>
|
|
150
|
+
<A11y.Index index={1}>
|
|
151
|
+
<Text style={styles.font}>
|
|
152
|
+
First
|
|
153
|
+
</Text>
|
|
154
|
+
</A11y.Index>
|
|
155
|
+
<A11y.Index index={3}>
|
|
156
|
+
<Text style={styles.font}>
|
|
157
|
+
Third
|
|
158
|
+
</Text>
|
|
159
|
+
</A11y.Index>
|
|
160
|
+
<A11y.Index index={4}> // <===== attention here, we group four and five to manage correct order flow
|
|
161
|
+
<View>
|
|
162
|
+
<Text style={styles.font}>Four</Text>
|
|
163
|
+
</View>
|
|
164
|
+
<View>
|
|
165
|
+
<Text style={styles.font}>Five</Text>
|
|
166
|
+
</View>
|
|
167
|
+
</A11y.Index>
|
|
168
|
+
<A11y.Index index={2}>
|
|
169
|
+
<Text style={styles.font}>
|
|
170
|
+
Second
|
|
171
|
+
</Text>
|
|
172
|
+
</A11y.Index>
|
|
173
|
+
</A11y.Order>
|
|
174
|
+
<Text style={styles.font}>Six</Text>
|
|
175
|
+
</View>
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
```
|
|
140
179
|
|
|
141
180
|
A11y.Index Props:
|
|
142
181
|
|
|
143
182
|
| Props | Description |
|
|
144
183
|
| -------------- | ------------------------------------------------ |
|
|
145
|
-
| ViewProps | Default View props
|
|
184
|
+
| ViewProps | Default View props includin style, testID, etc |
|
|
146
185
|
| index | `number`, position in order |
|
|
147
186
|
| ref: focus | focus command for setting accessibility focus |
|
|
148
187
|
|
|
@@ -181,7 +220,7 @@ export default function App() {
|
|
|
181
220
|
<Text>Title: 1</Text>
|
|
182
221
|
</View>
|
|
183
222
|
<View>
|
|
184
|
-
<Text>
|
|
223
|
+
<Text>Desctiption: 1</Text>
|
|
185
224
|
</View>
|
|
186
225
|
</A11y.Group>
|
|
187
226
|
<A11y.Group style={styles.slide}>
|
|
@@ -189,7 +228,7 @@ export default function App() {
|
|
|
189
228
|
<Text>Title: 2</Text>
|
|
190
229
|
</View>
|
|
191
230
|
<View>
|
|
192
|
-
<Text>
|
|
231
|
+
<Text>Desctiption: 2</Text>
|
|
193
232
|
</View>
|
|
194
233
|
</A11y.Group>
|
|
195
234
|
</ScrollView>
|
|
@@ -200,7 +239,7 @@ export default function App() {
|
|
|
200
239
|
|
|
201
240
|
| Props | Description |
|
|
202
241
|
| -------------- | ------------------------------------------------ |
|
|
203
|
-
| ViewProps | Default View props
|
|
242
|
+
| ViewProps | Default View props includin style, testID, etc |
|
|
204
243
|
|
|
205
244
|
|
|
206
245
|
## Migration
|
|
@@ -5,13 +5,17 @@
|
|
|
5
5
|
// Created by Artur Kalach on 13/07/2024.
|
|
6
6
|
// Copyright © 2024 Facebook. All rights reserved.
|
|
7
7
|
//
|
|
8
|
+
#if (!defined(RCT_NEW_ARCH_ENABLED) || RCT_NEW_ARCH_ENABLED == 0) || (defined(RCT_VIEW_MANAGER_ENABLED) && RCT_VIEW_MANAGER_ENABLED == 1)
|
|
8
9
|
|
|
9
10
|
#ifndef RNAOA11yGroupViewManager_h
|
|
10
11
|
#define RNAOA11yGroupViewManager_h
|
|
11
12
|
|
|
13
|
+
|
|
12
14
|
#import <React/RCTViewManager.h>
|
|
13
15
|
@interface RNAOA11yGroupViewManager : RCTViewManager
|
|
14
16
|
@end
|
|
15
17
|
|
|
16
18
|
|
|
17
19
|
#endif /* RNAOA11yGroupViewManager_h */
|
|
20
|
+
|
|
21
|
+
#endif
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
// Copyright © 2024 Facebook. All rights reserved.
|
|
7
7
|
//
|
|
8
8
|
|
|
9
|
+
#if (!defined(RCT_NEW_ARCH_ENABLED) || RCT_NEW_ARCH_ENABLED == 0) || (defined(RCT_VIEW_MANAGER_ENABLED) && RCT_VIEW_MANAGER_ENABLED == 1)
|
|
10
|
+
|
|
9
11
|
#import <Foundation/Foundation.h>
|
|
10
12
|
|
|
11
13
|
#import <React/RCTViewManager.h>
|
|
@@ -23,3 +25,5 @@ RCT_EXPORT_MODULE(A11yGroupView)
|
|
|
23
25
|
}
|
|
24
26
|
|
|
25
27
|
@end
|
|
28
|
+
|
|
29
|
+
#endif
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
// Copyright © 2024 Facebook. All rights reserved.
|
|
7
7
|
//
|
|
8
8
|
|
|
9
|
+
#if (!defined(RCT_NEW_ARCH_ENABLED) || RCT_NEW_ARCH_ENABLED == 0) || (defined(RCT_VIEW_MANAGER_ENABLED) && RCT_VIEW_MANAGER_ENABLED == 1)
|
|
10
|
+
|
|
9
11
|
#ifndef RNAOA11yIndexViewManager_h
|
|
10
12
|
#define RNAOA11yIndexViewManager_h
|
|
11
13
|
|
|
@@ -17,3 +19,5 @@
|
|
|
17
19
|
|
|
18
20
|
|
|
19
21
|
#endif /* RNAOA11yIndexViewManager_h */
|
|
22
|
+
|
|
23
|
+
#endif
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
// Copyright © 2024 Facebook. All rights reserved.
|
|
7
7
|
//
|
|
8
8
|
|
|
9
|
+
#if (!defined(RCT_NEW_ARCH_ENABLED) || RCT_NEW_ARCH_ENABLED == 0) || (defined(RCT_VIEW_MANAGER_ENABLED) && RCT_VIEW_MANAGER_ENABLED == 1)
|
|
10
|
+
|
|
9
11
|
#import <React/RCTViewManager.h>
|
|
10
12
|
#import <React/RCTUIManager.h>
|
|
11
13
|
#import "RNAOA11yIndexView.h"
|
|
@@ -44,3 +46,5 @@ RCT_EXPORT_METHOD(focus:(nonnull NSNumber *)reactTag)
|
|
|
44
46
|
}
|
|
45
47
|
|
|
46
48
|
@end
|
|
49
|
+
|
|
50
|
+
#endif
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
// Copyright © 2024 Facebook. All rights reserved.
|
|
7
7
|
//
|
|
8
8
|
|
|
9
|
+
#if (!defined(RCT_NEW_ARCH_ENABLED) || RCT_NEW_ARCH_ENABLED == 0) || (defined(RCT_VIEW_MANAGER_ENABLED) && RCT_VIEW_MANAGER_ENABLED == 1)
|
|
10
|
+
|
|
9
11
|
#ifndef RNAOA11yOrderViewManager_h
|
|
10
12
|
#define RNAOA11yOrderViewManager_h
|
|
11
13
|
|
|
@@ -16,3 +18,5 @@
|
|
|
16
18
|
|
|
17
19
|
|
|
18
20
|
#endif /* RNAOA11yOrderViewManager_h */
|
|
21
|
+
|
|
22
|
+
#endif
|
|
@@ -6,8 +6,9 @@
|
|
|
6
6
|
// Copyright © 2024 Facebook. All rights reserved.
|
|
7
7
|
//
|
|
8
8
|
|
|
9
|
-
#
|
|
9
|
+
#if (!defined(RCT_NEW_ARCH_ENABLED) || RCT_NEW_ARCH_ENABLED == 0) || (defined(RCT_VIEW_MANAGER_ENABLED) && RCT_VIEW_MANAGER_ENABLED == 1)
|
|
10
10
|
|
|
11
|
+
#import <Foundation/Foundation.h>
|
|
11
12
|
|
|
12
13
|
#import <React/RCTViewManager.h>
|
|
13
14
|
#import <React/RCTUIManager.h>
|
|
@@ -30,3 +31,5 @@ RCT_CUSTOM_VIEW_PROPERTY(orderKey, NSString, RNAOA11yOrderView)
|
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
@end
|
|
34
|
+
|
|
35
|
+
#endif
|
|
@@ -4,13 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.A11yGroup = void 0;
|
|
7
|
-
var _react =
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
|
-
function
|
|
9
|
+
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); }
|
|
10
10
|
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); }
|
|
11
11
|
const A11yGroup = props => {
|
|
12
|
+
const id = (0, _react.useId)();
|
|
12
13
|
return /*#__PURE__*/_react.default.createElement(_reactNative.View, _extends({
|
|
13
|
-
|
|
14
|
+
nativeID: id
|
|
14
15
|
}, props));
|
|
15
16
|
};
|
|
16
17
|
exports.A11yGroup = A11yGroup;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","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","A11yGroup","props","id","useId","createElement","View","nativeID","exports"],"sourceRoot":"../../../../src","sources":["components/A11yGroup/A11yGroup.android.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAAoC,SAAAD,wBAAAG,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAL,uBAAA,YAAAA,CAAAG,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK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|
@@ -17,7 +17,7 @@ const A11yIndex = exports.A11yIndex = /*#__PURE__*/_react.default.memo(/*#__PURE
|
|
|
17
17
|
}, ref) => {
|
|
18
18
|
const orderKey = _react.default.useContext(_A11ySequenceOrderContext.A11ySequenceOrderContext);
|
|
19
19
|
if (!orderKey) {
|
|
20
|
-
throw new Error('
|
|
20
|
+
throw new Error('A11ySequence.Index should be used inside of A11ySequence.Container');
|
|
21
21
|
}
|
|
22
22
|
const indexRef = (0, _react.useRef)(null);
|
|
23
23
|
(0, _react.useImperativeHandle)(ref, () => ({
|
|
@@ -33,7 +33,7 @@ const A11yIndex = exports.A11yIndex = /*#__PURE__*/_react.default.memo(/*#__PURE
|
|
|
33
33
|
orderIndex: index,
|
|
34
34
|
orderKey: orderKey
|
|
35
35
|
}, props), isSingleChild && children, !isSingleChild && /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
36
|
-
|
|
36
|
+
nativeID: orderKey
|
|
37
37
|
}, children));
|
|
38
38
|
}));
|
|
39
39
|
//# sourceMappingURL=A11yIndex.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_A11ySequenceOrderContext","_A11yIndexNativeComponent","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","A11yIndex","exports","React","memo","forwardRef","children","index","props","ref","orderKey","useContext","A11ySequenceOrderContext","Error","indexRef","useRef","useImperativeHandle","focus","current","Commands","isSingleChild","Children","count","createElement","orderIndex","View","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_A11ySequenceOrderContext","_A11yIndexNativeComponent","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","A11yIndex","exports","React","memo","forwardRef","children","index","props","ref","orderKey","useContext","A11ySequenceOrderContext","Error","indexRef","useRef","useImperativeHandle","focus","current","Commands","isSingleChild","Children","count","createElement","orderIndex","View","nativeID"],"sourceRoot":"../../../../src","sources":["components/A11yIndex/A11yIndex.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,yBAAA,GAAAF,OAAA;AACA,IAAAG,yBAAA,GAAAJ,uBAAA,CAAAC,OAAA;AAEoD,SAAAD,wBAAAK,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAP,uBAAA,YAAAA,CAAAK,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAA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c,GAAG,EAAEK,QAAS;IACdU,UAAU,EAAEjB,KAAM;IAClBG,QAAQ,EAAEA;EAAS,GACfF,KAAK,GAERY,aAAa,IAAId,QAAQ,EACzB,CAACc,aAAa,iBAAIlD,MAAA,CAAAgB,OAAA,CAAAqC,aAAA,CAAClD,YAAA,CAAAoD,IAAI;IAACC,QAAQ,EAAEhB;EAAS,GAAEJ,QAAe,CAChD,CAAC;AAEpB,CACF,CACF,CAAC","ignoreList":[]}
|
|
@@ -8,13 +8,13 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
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); }
|
|
10
10
|
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); }
|
|
11
|
-
const
|
|
11
|
+
const WebUiMeneger = _reactNative.UIManager;
|
|
12
12
|
const A11yIndex = exports.A11yIndex = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
13
13
|
const viewRef = (0, _react.useRef)(null);
|
|
14
14
|
(0, _react.useImperativeHandle)(ref, () => ({
|
|
15
15
|
focus: () => {
|
|
16
16
|
if (viewRef.current) {
|
|
17
|
-
|
|
17
|
+
WebUiMeneger.focus(viewRef.current);
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","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","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","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","WebUiMeneger","UIManager","A11yIndex","exports","forwardRef","props","ref","viewRef","useRef","useImperativeHandle","focus","current","createElement","View"],"sourceRoot":"../../../../src","sources":["components/A11yIndex/A11yIndex.web.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAGA,IAAAC,YAAA,GAAAD,OAAA;AAAyC,SAAAD,wBAAAG,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAL,uBAAA,YAAAA,CAAAG,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,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CAAC;AAC1C,CACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.A11yOrder = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
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); }
|
|
10
|
+
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); }
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated The method should not be used
|
|
13
|
+
* This API is going to be removed in future releases, you can find migration instruction here: https://github.com/ArturKalach/react-native-a11y-order?tab=readme-ov-file#migration
|
|
14
|
+
*/
|
|
15
|
+
const A11yOrder = ({
|
|
16
|
+
a11yOrder,
|
|
17
|
+
onLayout,
|
|
18
|
+
ignoreWarn,
|
|
19
|
+
...props
|
|
20
|
+
}) => {
|
|
21
|
+
if (!ignoreWarn) {
|
|
22
|
+
console.warn('A11yOrder: This API is going to be removed in future releases, you can find migration instruction here: https://github.com/ArturKalach/react-native-a11y-order?tab=readme-ov-file#migration');
|
|
23
|
+
}
|
|
24
|
+
const onLayoutHandler = (0, _react.useCallback)(e => {
|
|
25
|
+
onLayout === null || onLayout === void 0 || onLayout(e);
|
|
26
|
+
a11yOrder.onLayout();
|
|
27
|
+
}, [a11yOrder, onLayout]);
|
|
28
|
+
const id = (_react.useId === null || _react.useId === void 0 ? void 0 : (0, _react.useId)()) || 'mock_id'; // ToDo: use native component with tag to nativeTag
|
|
29
|
+
|
|
30
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.View, _extends({
|
|
31
|
+
nativeID: id
|
|
32
|
+
}, props, {
|
|
33
|
+
onLayout: onLayoutHandler,
|
|
34
|
+
ref: a11yOrder.ref
|
|
35
|
+
}));
|
|
36
|
+
};
|
|
37
|
+
exports.A11yOrder = A11yOrder;
|
|
38
|
+
//# sourceMappingURL=A11yOrder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","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","A11yOrder","a11yOrder","onLayout","ignoreWarn","props","console","warn","onLayoutHandler","useCallback","id","useId","createElement","View","nativeID","ref","exports"],"sourceRoot":"../../../../src","sources":["components/A11yOrder/A11yOrder.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAAuD,SAAAD,wBAAAG,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAL,uBAAA,YAAAA,CAAAG,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,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AChCjC,CAAoB,IAAK;IACxB2B,QAAQ,aAARA,QAAQ,eAARA,QAAQ,CAAG3B,CAAC,CAAC;IACb0B,SAAS,CAACC,QAAQ,CAAC,CAAC;EACtB,CAAC,EACD,CAACD,SAAS,EAAEC,QAAQ,CACtB,CAAC;EAED,MAAMO,EAAE,GAAG,CAAAC,YAAK,aAALA,YAAK,uBAAL,IAAAA,YAAK,EAAG,CAAC,KAAI,SAAS,CAAC,CAAC;;EAEnC,oBACEvC,MAAA,CAAAc,OAAA,CAAA0B,aAAA,CAACrC,YAAA,CAAAsC,IAAI,EAAAlB,QAAA;IACHmB,QAAQ,EAAEJ;EAAG,GACTL,KAAK;IACTF,QAAQ,EAAEK,eAAgB;IAC1BO,GAAG,EAAEb,SAAS,CAACa;EAAI,EACpB,CAAC;AAEN,CAAC;AAACC,OAAA,CAAAf,SAAA,GAAAA,SAAA","ignoreList":[]}
|
package/lib/commonjs/index.js
CHANGED
|
@@ -4,9 +4,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.A11y = void 0;
|
|
7
|
+
Object.defineProperty(exports, "A11yOrder", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () {
|
|
10
|
+
return _A11yOrder.A11yOrder;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
7
13
|
var _A11yIndex = require("./components/A11yIndex/A11yIndex");
|
|
8
14
|
var _A11ySequence = require("./components/A11ySequence/A11ySequence");
|
|
9
15
|
var _A11yGroup = require("./components/A11yGroup/A11yGroup");
|
|
16
|
+
var _A11yOrder = require("./components/A11yOrder/A11yOrder");
|
|
10
17
|
const A11y = exports.A11y = {
|
|
11
18
|
Order: _A11ySequence.A11yIndexSequence,
|
|
12
19
|
Index: _A11yIndex.A11yIndex,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_A11yIndex","require","_A11ySequence","_A11yGroup","A11y","exports","Order","A11yIndexSequence","Index","A11yIndex","Group","A11yGroup"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_A11yIndex","require","_A11ySequence","_A11yGroup","_A11yOrder","A11y","exports","Order","A11yIndexSequence","Index","A11yIndex","Group","A11yGroup"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAEA,IAAAG,UAAA,GAAAH,OAAA;AAIO,MAAMI,IAAI,GAAAC,OAAA,CAAAD,IAAA,GAAG;EAClBE,KAAK,EAAEC,+BAAiB;EACxBC,KAAK,EAAEC,oBAAS;EAChBC,KAAK,EAAEC;AACT,CAAC","ignoreList":[]}
|
|
@@ -3,9 +3,51 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.A11y = void 0;
|
|
6
|
+
exports.useFocusOrder = exports.useDynamicFocusOrder = exports.useA11yOrderManager = exports.A11yOrder = exports.A11y = void 0;
|
|
7
|
+
var _react = require("react");
|
|
7
8
|
var _reactNative = require("react-native");
|
|
8
9
|
var _A11yIndex = require("./components/A11yIndex/A11yIndex.web");
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated The method should not be used
|
|
12
|
+
* This API is going to be removed in future releases, you can find migration instruction here: https://github.com/ArturKalach/react-native-a11y-order?tab=readme-ov-file#migration
|
|
13
|
+
*/
|
|
14
|
+
const useFocusOrder = () => ({
|
|
15
|
+
a11yOrder: {
|
|
16
|
+
ref: /*#__PURE__*/(0, _react.createRef)(),
|
|
17
|
+
onLayout: () => {}
|
|
18
|
+
},
|
|
19
|
+
refs: [],
|
|
20
|
+
reset: () => {},
|
|
21
|
+
setOrder: () => {}
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @deprecated The method should not be used
|
|
26
|
+
* This API is going to be removed in future releases, you can find migration instruction here: https://github.com/ArturKalach/react-native-a11y-order?tab=readme-ov-file#migration
|
|
27
|
+
*/
|
|
28
|
+
exports.useFocusOrder = useFocusOrder;
|
|
29
|
+
const useDynamicFocusOrder = () => ({
|
|
30
|
+
a11yOrder: {
|
|
31
|
+
ref: /*#__PURE__*/(0, _react.createRef)(),
|
|
32
|
+
onLayout: () => {}
|
|
33
|
+
},
|
|
34
|
+
registerOrder: () => _react.createRef,
|
|
35
|
+
reset: () => {},
|
|
36
|
+
setOrder: () => {}
|
|
37
|
+
});
|
|
38
|
+
exports.useDynamicFocusOrder = useDynamicFocusOrder;
|
|
39
|
+
const useA11yOrderManager = () => ({
|
|
40
|
+
registerOrderRef: () => () => {},
|
|
41
|
+
updateRefList: () => {},
|
|
42
|
+
reset: () => {},
|
|
43
|
+
setOrder: () => {}
|
|
44
|
+
});
|
|
45
|
+
exports.useA11yOrderManager = useA11yOrderManager;
|
|
46
|
+
/**
|
|
47
|
+
* @deprecated The method should not be used
|
|
48
|
+
* This API is going to be removed in future releases, you can find migration instruction here: https://github.com/ArturKalach/react-native-a11y-order?tab=readme-ov-file#migration
|
|
49
|
+
*/
|
|
50
|
+
const A11yOrder = exports.A11yOrder = _reactNative.View;
|
|
9
51
|
const A11y = exports.A11y = {
|
|
10
52
|
Order: _reactNative.View,
|
|
11
53
|
Group: _reactNative.View,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_A11yIndex","useFocusOrder","a11yOrder","ref","createRef","onLayout","refs","reset","setOrder","exports","useDynamicFocusOrder","registerOrder","useA11yOrderManager","registerOrderRef","updateRefList","A11yOrder","View","A11y","Order","Group","Index","A11yIndex"],"sourceRoot":"../../src","sources":["index.web.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAEA;AACA;A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"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/A11yOrder.types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
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); }
|
|
2
|
-
import React from 'react';
|
|
2
|
+
import React, { useId } from 'react';
|
|
3
3
|
import { View } from 'react-native';
|
|
4
4
|
export const A11yGroup = props => {
|
|
5
|
+
const id = useId();
|
|
5
6
|
return /*#__PURE__*/React.createElement(View, _extends({
|
|
6
|
-
|
|
7
|
+
nativeID: id
|
|
7
8
|
}, props));
|
|
8
9
|
};
|
|
9
10
|
//# sourceMappingURL=A11yGroup.android.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","A11yGroup","props","createElement","_extends","
|
|
1
|
+
{"version":3,"names":["React","useId","View","A11yGroup","props","id","createElement","_extends","nativeID"],"sourceRoot":"../../../../src","sources":["components/A11yGroup/A11yGroup.android.tsx"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,KAAK,QAAQ,OAAO;AACpC,SAASC,IAAI,QAAQ,cAAc;AAInC,OAAO,MAAMC,SAAS,GAAIC,KAAqB,IAAK;EAClD,MAAMC,EAAE,GAAGJ,KAAK,CAAC,CAAC;EAClB,oBAAOD,KAAA,CAAAM,aAAA,CAACJ,IAAI,EAAAK,QAAA;IAACC,QAAQ,EAAEH;EAAG,GAAKD,KAAK,CAAG,CAAC;AAC1C,CAAC","ignoreList":[]}
|
|
@@ -10,7 +10,7 @@ export const A11yIndex = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef((
|
|
|
10
10
|
}, ref) => {
|
|
11
11
|
const orderKey = React.useContext(A11ySequenceOrderContext);
|
|
12
12
|
if (!orderKey) {
|
|
13
|
-
throw new Error('
|
|
13
|
+
throw new Error('A11ySequence.Index should be used inside of A11ySequence.Container');
|
|
14
14
|
}
|
|
15
15
|
const indexRef = useRef(null);
|
|
16
16
|
useImperativeHandle(ref, () => ({
|
|
@@ -26,7 +26,7 @@ export const A11yIndex = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef((
|
|
|
26
26
|
orderIndex: index,
|
|
27
27
|
orderKey: orderKey
|
|
28
28
|
}, props), isSingleChild && children, !isSingleChild && /*#__PURE__*/React.createElement(View, {
|
|
29
|
-
|
|
29
|
+
nativeID: orderKey
|
|
30
30
|
}, children));
|
|
31
31
|
}));
|
|
32
32
|
//# sourceMappingURL=A11yIndex.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useImperativeHandle","useRef","View","A11ySequenceOrderContext","A11yIndexView","Commands","A11yIndex","memo","forwardRef","children","index","props","ref","orderKey","useContext","Error","indexRef","focus","current","isSingleChild","Children","count","createElement","_extends","orderIndex","
|
|
1
|
+
{"version":3,"names":["React","useImperativeHandle","useRef","View","A11ySequenceOrderContext","A11yIndexView","Commands","A11yIndex","memo","forwardRef","children","index","props","ref","orderKey","useContext","Error","indexRef","focus","current","isSingleChild","Children","count","createElement","_extends","orderIndex","nativeID"],"sourceRoot":"../../../../src","sources":["components/A11yIndex/A11yIndex.tsx"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,mBAAmB,EAAEC,MAAM,QAAQ,OAAO;AAC1D,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,wBAAwB,QAAQ,wCAAwC;AACjF,OAAOC,aAAa,IAClBC,QAAQ,QACH,4CAA4C;AAGnD,OAAO,MAAMC,SAAS,gBAAGP,KAAK,CAACQ,IAAI,cACjCR,KAAK,CAACS,UAAU,CACd,CAAC;EAAEC,QAAQ;EAAEC,KAAK;EAAE,GAAGC;AAAM,CAAC,EAAEC,GAAG,KAAK;EACtC,MAAMC,QAAQ,GAAGd,KAAK,CAACe,UAAU,CAACX,wBAAwB,CAAC;EAC3D,IAAI,CAACU,QAAQ,EAAE;IACb,MAAM,IAAIE,KAAK,CACb,oEACF,CAAC;EACH;EAEA,MAAMC,QAAQ,GAAGf,MAAM,CAAwC,IAAI,CAAC;EAEpED,mBAAmB,CAACY,GAAG,EAAE,OAAO;IAC9BK,KAAK,EAAEA,CAAA,KAAM;MACX,IAAID,QAAQ,CAACE,OAAO,EAAE;QACpBb,QAAQ,CAACY,KAAK,CAACD,QAAQ,CAACE,OAAO,CAAC;MAClC;IACF;EACF,CAAC,CAAC,CAAC;EAEH,MAAMC,aAAa,GAAGpB,KAAK,CAACqB,QAAQ,CAACC,KAAK,CAACZ,QAAQ,CAAC,KAAK,CAAC;EAE1D,oBACEV,KAAA,CAAAuB,aAAA,CAAClB,aAAa,EAAAmB,QAAA;IACZX,GAAG,EAAEI,QAAS;IACdQ,UAAU,EAAEd,KAAM;IAClBG,QAAQ,EAAEA;EAAS,GACfF,KAAK,GAERQ,aAAa,IAAIV,QAAQ,EACzB,CAACU,aAAa,iBAAIpB,KAAA,CAAAuB,aAAA,CAACpB,IAAI;IAACuB,QAAQ,EAAEZ;EAAS,GAAEJ,QAAe,CAChD,CAAC;AAEpB,CACF,CACF,CAAC","ignoreList":[]}
|
|
@@ -3,13 +3,13 @@ import React from 'react';
|
|
|
3
3
|
import { forwardRef, useImperativeHandle, useRef } from 'react';
|
|
4
4
|
import { UIManager } from 'react-native';
|
|
5
5
|
import { View } from 'react-native';
|
|
6
|
-
const
|
|
6
|
+
const WebUiMeneger = UIManager;
|
|
7
7
|
export const A11yIndex = /*#__PURE__*/forwardRef((props, ref) => {
|
|
8
8
|
const viewRef = useRef(null);
|
|
9
9
|
useImperativeHandle(ref, () => ({
|
|
10
10
|
focus: () => {
|
|
11
11
|
if (viewRef.current) {
|
|
12
|
-
|
|
12
|
+
WebUiMeneger.focus(viewRef.current);
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","forwardRef","useImperativeHandle","useRef","UIManager","View","
|
|
1
|
+
{"version":3,"names":["React","forwardRef","useImperativeHandle","useRef","UIManager","View","WebUiMeneger","A11yIndex","props","ref","viewRef","focus","current","createElement","_extends"],"sourceRoot":"../../../../src","sources":["components/A11yIndex/A11yIndex.web.tsx"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,EAAEC,mBAAmB,EAAEC,MAAM,QAAQ,OAAO;AAE/D,SAASC,SAAS,QAAQ,cAAc;AACxC,SAASC,IAAI,QAAQ,cAAc;AAEnC,MAAMC,YAAY,GAAGF,SAEpB;AAED,OAAO,MAAMG,SAAS,gBAAGN,UAAU,CACjC,CAACO,KAAK,EAAEC,GAAG,KAAK;EACd,MAAMC,OAAO,GAAGP,MAAM,CAAO,IAAI,CAAC;EAClCD,mBAAmB,CAACO,GAAG,EAAE,OAAO;IAC9BE,KAAK,EAAEA,CAAA,KAAM;MACX,IAAID,OAAO,CAACE,OAAO,EAAE;QACnBN,YAAY,CAACK,KAAK,CAACD,OAAO,CAACE,OAAO,CAAC;MACrC;IACF;EACF,CAAC,CAAC,CAAC;EAEH,oBAAOZ,KAAA,CAAAa,aAAA,CAACR,IAAI,EAAAS,QAAA,KAAKN,KAAK;IAAEC,GAAG,EAAEC;EAAQ,EAAE,CAAC;AAC1C,CACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
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); }
|
|
2
|
+
import React, { useCallback, useId } from 'react';
|
|
3
|
+
import { View } from 'react-native';
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated The method should not be used
|
|
6
|
+
* This API is going to be removed in future releases, you can find migration instruction here: https://github.com/ArturKalach/react-native-a11y-order?tab=readme-ov-file#migration
|
|
7
|
+
*/
|
|
8
|
+
export const A11yOrder = ({
|
|
9
|
+
a11yOrder,
|
|
10
|
+
onLayout,
|
|
11
|
+
ignoreWarn,
|
|
12
|
+
...props
|
|
13
|
+
}) => {
|
|
14
|
+
if (!ignoreWarn) {
|
|
15
|
+
console.warn('A11yOrder: This API is going to be removed in future releases, you can find migration instruction here: https://github.com/ArturKalach/react-native-a11y-order?tab=readme-ov-file#migration');
|
|
16
|
+
}
|
|
17
|
+
const onLayoutHandler = useCallback(e => {
|
|
18
|
+
onLayout === null || onLayout === void 0 || onLayout(e);
|
|
19
|
+
a11yOrder.onLayout();
|
|
20
|
+
}, [a11yOrder, onLayout]);
|
|
21
|
+
const id = (useId === null || useId === void 0 ? void 0 : useId()) || 'mock_id'; // ToDo: use native component with tag to nativeTag
|
|
22
|
+
|
|
23
|
+
return /*#__PURE__*/React.createElement(View, _extends({
|
|
24
|
+
nativeID: id
|
|
25
|
+
}, props, {
|
|
26
|
+
onLayout: onLayoutHandler,
|
|
27
|
+
ref: a11yOrder.ref
|
|
28
|
+
}));
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=A11yOrder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useCallback","useId","View","A11yOrder","a11yOrder","onLayout","ignoreWarn","props","console","warn","onLayoutHandler","e","id","createElement","_extends","nativeID","ref"],"sourceRoot":"../../../../src","sources":["components/A11yOrder/A11yOrder.tsx"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,KAAK,QAAQ,OAAO;AACjD,SAASC,IAAI,QAA2B,cAAc;AAGtD;AACA;AACA;AACA;AACA,OAAO,MAAMC,SAAmC,GAAGA,CAAC;EAClDC,SAAS;EACTC,QAAQ;EACRC,UAAU;EACV,GAAGC;AACL,CAAC,KAAK;EACJ,IAAI,CAACD,UAAU,EAAE;IACfE,OAAO,CAACC,IAAI,CACV,6LACF,CAAC;EACH;EACA,MAAMC,eAAe,GAAGV,WAAW,CAChCW,CAAoB,IAAK;IACxBN,QAAQ,aAARA,QAAQ,eAARA,QAAQ,CAAGM,CAAC,CAAC;IACbP,SAAS,CAACC,QAAQ,CAAC,CAAC;EACtB,CAAC,EACD,CAACD,SAAS,EAAEC,QAAQ,CACtB,CAAC;EAED,MAAMO,EAAE,GAAG,CAAAX,KAAK,aAALA,KAAK,uBAALA,KAAK,CAAG,CAAC,KAAI,SAAS,CAAC,CAAC;;EAEnC,oBACEF,KAAA,CAAAc,aAAA,CAACX,IAAI,EAAAY,QAAA;IACHC,QAAQ,EAAEH;EAAG,GACTL,KAAK;IACTF,QAAQ,EAAEK,eAAgB;IAC1BM,GAAG,EAAEZ,SAAS,CAACY;EAAI,EACpB,CAAC;AAEN,CAAC","ignoreList":[]}
|
package/lib/module/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { A11yIndex } from './components/A11yIndex/A11yIndex';
|
|
2
2
|
import { A11yIndexSequence } from './components/A11ySequence/A11ySequence';
|
|
3
3
|
import { A11yGroup } from './components/A11yGroup/A11yGroup';
|
|
4
|
+
export { A11yOrder } from './components/A11yOrder/A11yOrder';
|
|
4
5
|
export const A11y = {
|
|
5
6
|
Order: A11yIndexSequence,
|
|
6
7
|
Index: A11yIndex,
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["A11yIndex","A11yIndexSequence","A11yGroup","A11y","Order","Index","Group"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":"AAAA,SAASA,SAAS,QAAQ,kCAAkC;AAC5D,SAASC,iBAAiB,QAAQ,wCAAwC;AAC1E,SAASC,SAAS,QAAQ,kCAAkC;AAI5D,OAAO,MAAMC,IAAI,GAAG;EAClBC,KAAK,
|
|
1
|
+
{"version":3,"names":["A11yIndex","A11yIndexSequence","A11yGroup","A11yOrder","A11y","Order","Index","Group"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":"AAAA,SAASA,SAAS,QAAQ,kCAAkC;AAC5D,SAASC,iBAAiB,QAAQ,wCAAwC;AAC1E,SAASC,SAAS,QAAQ,kCAAkC;AAE5D,SAASC,SAAS,QAAQ,kCAAkC;AAI5D,OAAO,MAAMC,IAAI,GAAG;EAClBC,KAAK,EAAEJ,iBAAiB;EACxBK,KAAK,EAAEN,SAAS;EAChBO,KAAK,EAAEL;AACT,CAAC","ignoreList":[]}
|
package/lib/module/index.web.js
CHANGED
|
@@ -1,5 +1,45 @@
|
|
|
1
|
+
import { createRef } from 'react';
|
|
1
2
|
import { View } from 'react-native';
|
|
2
3
|
import { A11yIndex } from './components/A11yIndex/A11yIndex.web';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated The method should not be used
|
|
7
|
+
* This API is going to be removed in future releases, you can find migration instruction here: https://github.com/ArturKalach/react-native-a11y-order?tab=readme-ov-file#migration
|
|
8
|
+
*/
|
|
9
|
+
export const useFocusOrder = () => ({
|
|
10
|
+
a11yOrder: {
|
|
11
|
+
ref: /*#__PURE__*/createRef(),
|
|
12
|
+
onLayout: () => {}
|
|
13
|
+
},
|
|
14
|
+
refs: [],
|
|
15
|
+
reset: () => {},
|
|
16
|
+
setOrder: () => {}
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @deprecated The method should not be used
|
|
21
|
+
* This API is going to be removed in future releases, you can find migration instruction here: https://github.com/ArturKalach/react-native-a11y-order?tab=readme-ov-file#migration
|
|
22
|
+
*/
|
|
23
|
+
export const useDynamicFocusOrder = () => ({
|
|
24
|
+
a11yOrder: {
|
|
25
|
+
ref: /*#__PURE__*/createRef(),
|
|
26
|
+
onLayout: () => {}
|
|
27
|
+
},
|
|
28
|
+
registerOrder: () => createRef,
|
|
29
|
+
reset: () => {},
|
|
30
|
+
setOrder: () => {}
|
|
31
|
+
});
|
|
32
|
+
export const useA11yOrderManager = () => ({
|
|
33
|
+
registerOrderRef: () => () => {},
|
|
34
|
+
updateRefList: () => {},
|
|
35
|
+
reset: () => {},
|
|
36
|
+
setOrder: () => {}
|
|
37
|
+
});
|
|
38
|
+
/**
|
|
39
|
+
* @deprecated The method should not be used
|
|
40
|
+
* This API is going to be removed in future releases, you can find migration instruction here: https://github.com/ArturKalach/react-native-a11y-order?tab=readme-ov-file#migration
|
|
41
|
+
*/
|
|
42
|
+
export const A11yOrder = View;
|
|
3
43
|
export const A11y = {
|
|
4
44
|
Order: View,
|
|
5
45
|
Group: View,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["View","A11yIndex","A11y","Order","Group","Index"],"sourceRoot":"../../src","sources":["index.web.ts"],"mappings":"AAAA,SAASA,IAAI,QAAQ,cAAc;AACnC,SAASC,SAAS,QAAQ,sCAAsC;
|
|
1
|
+
{"version":3,"names":["createRef","View","A11yIndex","useFocusOrder","a11yOrder","ref","onLayout","refs","reset","setOrder","useDynamicFocusOrder","registerOrder","useA11yOrderManager","registerOrderRef","updateRefList","A11yOrder","A11y","Order","Group","Index"],"sourceRoot":"../../src","sources":["index.web.ts"],"mappings":"AAAA,SAASA,SAAS,QAAQ,OAAO;AACjC,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,SAAS,QAAQ,sCAAsC;;AAEhE;AACA;AACA;AACA;AACA,OAAO,MAAMC,aAAa,GAAGA,CAAA,MAAO;EAClCC,SAAS,EAAE;IACTC,GAAG,eAAEL,SAAS,CAAC,CAAC;IAChBM,QAAQ,EAAEA,CAAA,KAAM,CAAC;EACnB,CAAC;EACDC,IAAI,EAAE,EAAE;EACRC,KAAK,EAAEA,CAAA,KAAM,CAAC,CAAC;EACfC,QAAQ,EAAEA,CAAA,KAAM,CAAC;AACnB,CAAC,CAAC;;AAEF;AACA;AACA;AACA;AACA,OAAO,MAAMC,oBAAoB,GAAGA,CAAA,MAAO;EACzCN,SAAS,EAAE;IACTC,GAAG,eAAEL,SAAS,CAAC,CAAC;IAChBM,QAAQ,EAAEA,CAAA,KAAM,CAAC;EACnB,CAAC;EACDK,aAAa,EAAEA,CAAA,KAAMX,SAAS;EAC9BQ,KAAK,EAAEA,CAAA,KAAM,CAAC,CAAC;EACfC,QAAQ,EAAEA,CAAA,KAAM,CAAC;AACnB,CAAC,CAAC;AAEF,OAAO,MAAMG,mBAAmB,GAAGA,CAAA,MAAO;EACxCC,gBAAgB,EAAEA,CAAA,KAAM,MAAM,CAAC,CAAC;EAChCC,aAAa,EAAEA,CAAA,KAAM,CAAC,CAAC;EACvBN,KAAK,EAAEA,CAAA,KAAM,CAAC,CAAC;EACfC,QAAQ,EAAEA,CAAA,KAAM,CAAC;AACnB,CAAC,CAAC;AAKF;AACA;AACA;AACA;AACA,OAAO,MAAMM,SAAS,GAAGd,IAAI;AAE7B,OAAO,MAAMe,IAAI,GAAG;EAClBC,KAAK,EAAEhB,IAAI;EACXiB,KAAK,EAAEjB,IAAI;EACXkB,KAAK,EAAEjB;AACT,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/A11yOrder.types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"A11yGroup.android.d.ts","sourceRoot":"","sources":["../../../../src/components/A11yGroup/A11yGroup.android.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"A11yGroup.android.d.ts","sourceRoot":"","sources":["../../../../src/components/A11yGroup/A11yGroup.android.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgB,MAAM,OAAO,CAAC;AAGrC,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,eAAO,MAAM,SAAS,UAAW,cAAc,sBAG9C,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { A11yOrderProps } from '../../types/A11yOrder.types';
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated The method should not be used
|
|
5
|
+
* This API is going to be removed in future releases, you can find migration instruction here: https://github.com/ArturKalach/react-native-a11y-order?tab=readme-ov-file#migration
|
|
6
|
+
*/
|
|
7
|
+
export declare const A11yOrder: React.FC<A11yOrderProps>;
|
|
8
|
+
//# sourceMappingURL=A11yOrder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"A11yOrder.d.ts","sourceRoot":"","sources":["../../../../src/components/A11yOrder/A11yOrder.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6B,MAAM,OAAO,CAAC;AAElD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAElE;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CA6B9C,CAAC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
export { A11yOrder } from './components/A11yOrder/A11yOrder';
|
|
3
|
+
export type { A11yOrderProps } from './types/A11yOrder.types';
|
|
2
4
|
export type { IndexCommands } from './types/A11yIndex.types';
|
|
3
5
|
export declare const A11y: {
|
|
4
6
|
Order: import("react").NamedExoticComponent<import("react-native").ViewProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAIA,YAAY,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAE7D,eAAO,MAAM,IAAI;;;;;;;CAIhB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAC7D,YAAY,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,YAAY,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAE7D,eAAO,MAAM,IAAI;;;;;;;CAIhB,CAAC"}
|
|
@@ -1,6 +1,44 @@
|
|
|
1
|
-
|
|
1
|
+
import { createRef } from 'react';
|
|
2
2
|
import { View } from 'react-native';
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated The method should not be used
|
|
5
|
+
* This API is going to be removed in future releases, you can find migration instruction here: https://github.com/ArturKalach/react-native-a11y-order?tab=readme-ov-file#migration
|
|
6
|
+
*/
|
|
7
|
+
export declare const useFocusOrder: () => {
|
|
8
|
+
a11yOrder: {
|
|
9
|
+
ref: import("react").RefObject<unknown>;
|
|
10
|
+
onLayout: () => void;
|
|
11
|
+
};
|
|
12
|
+
refs: never[];
|
|
13
|
+
reset: () => void;
|
|
14
|
+
setOrder: () => void;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* @deprecated The method should not be used
|
|
18
|
+
* This API is going to be removed in future releases, you can find migration instruction here: https://github.com/ArturKalach/react-native-a11y-order?tab=readme-ov-file#migration
|
|
19
|
+
*/
|
|
20
|
+
export declare const useDynamicFocusOrder: () => {
|
|
21
|
+
a11yOrder: {
|
|
22
|
+
ref: import("react").RefObject<unknown>;
|
|
23
|
+
onLayout: () => void;
|
|
24
|
+
};
|
|
25
|
+
registerOrder: () => typeof createRef;
|
|
26
|
+
reset: () => void;
|
|
27
|
+
setOrder: () => void;
|
|
28
|
+
};
|
|
29
|
+
export declare const useA11yOrderManager: () => {
|
|
30
|
+
registerOrderRef: () => () => void;
|
|
31
|
+
updateRefList: () => void;
|
|
32
|
+
reset: () => void;
|
|
33
|
+
setOrder: () => void;
|
|
34
|
+
};
|
|
35
|
+
export type { A11yOrderProps } from './types/A11yOrder.types';
|
|
3
36
|
export type { IndexCommands } from './types/A11yIndex.types';
|
|
37
|
+
/**
|
|
38
|
+
* @deprecated The method should not be used
|
|
39
|
+
* This API is going to be removed in future releases, you can find migration instruction here: https://github.com/ArturKalach/react-native-a11y-order?tab=readme-ov-file#migration
|
|
40
|
+
*/
|
|
41
|
+
export declare const A11yOrder: typeof View;
|
|
4
42
|
export declare const A11y: {
|
|
5
43
|
Order: typeof View;
|
|
6
44
|
Group: typeof View;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../src/index.web.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../src/index.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAGpC;;;GAGG;AACH,eAAO,MAAM,aAAa;;;;;;;;CAQxB,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;CAQ/B,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;CAK9B,CAAC;AAEH,YAAY,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,YAAY,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAE7D;;;GAGG;AACH,eAAO,MAAM,SAAS,aAAO,CAAC;AAE9B,eAAO,MAAM,IAAI;;;;;;;CAIhB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { ViewProps, View } from 'react-native';
|
|
3
|
+
export type A11yOrderProps = {
|
|
4
|
+
a11yOrder: {
|
|
5
|
+
ref: React.RefObject<View>;
|
|
6
|
+
onLayout: () => void;
|
|
7
|
+
};
|
|
8
|
+
ignoreWarn?: boolean;
|
|
9
|
+
} & ViewProps;
|
|
10
|
+
//# sourceMappingURL=A11yOrder.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"A11yOrder.types.d.ts","sourceRoot":"","sources":["../../../src/types/A11yOrder.types.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpD,MAAM,MAAM,cAAc,GAAG;IAC3B,SAAS,EAAE;QACT,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QAC3B,QAAQ,EAAE,MAAM,IAAI,CAAC;KACtB,CAAC;IACF,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,GAAG,SAAS,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useId } from 'react';
|
|
2
2
|
import { View } from 'react-native';
|
|
3
3
|
|
|
4
4
|
import { A11yGroupProps } from '../../types/A11yGroup.types';
|
|
5
5
|
|
|
6
6
|
export const A11yGroup = (props: A11yGroupProps) => {
|
|
7
|
-
|
|
7
|
+
const id = useId();
|
|
8
|
+
return <View nativeID={id} {...props} />;
|
|
8
9
|
};
|
|
@@ -12,7 +12,7 @@ export const A11yIndex = React.memo(
|
|
|
12
12
|
const orderKey = React.useContext(A11ySequenceOrderContext);
|
|
13
13
|
if (!orderKey) {
|
|
14
14
|
throw new Error(
|
|
15
|
-
'
|
|
15
|
+
'A11ySequence.Index should be used inside of A11ySequence.Container'
|
|
16
16
|
);
|
|
17
17
|
}
|
|
18
18
|
|
|
@@ -36,7 +36,7 @@ export const A11yIndex = React.memo(
|
|
|
36
36
|
{...props}
|
|
37
37
|
>
|
|
38
38
|
{isSingleChild && children}
|
|
39
|
-
{!isSingleChild && <View
|
|
39
|
+
{!isSingleChild && <View nativeID={orderKey}>{children}</View>}
|
|
40
40
|
</A11yIndexView>
|
|
41
41
|
);
|
|
42
42
|
}
|
|
@@ -4,7 +4,7 @@ import { IndexCommands, A11yIndexProps } from '../../types/A11yIndex.types';
|
|
|
4
4
|
import { UIManager } from 'react-native';
|
|
5
5
|
import { View } from 'react-native';
|
|
6
6
|
|
|
7
|
-
const
|
|
7
|
+
const WebUiMeneger = UIManager as unknown as {
|
|
8
8
|
focus: (v: View) => void;
|
|
9
9
|
};
|
|
10
10
|
|
|
@@ -14,7 +14,7 @@ export const A11yIndex = forwardRef<IndexCommands, A11yIndexProps>(
|
|
|
14
14
|
useImperativeHandle(ref, () => ({
|
|
15
15
|
focus: () => {
|
|
16
16
|
if (viewRef.current) {
|
|
17
|
-
|
|
17
|
+
WebUiMeneger.focus(viewRef.current);
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
}));
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React, { useCallback, useId } from 'react';
|
|
2
|
+
import { View, LayoutChangeEvent } from 'react-native';
|
|
3
|
+
import type { A11yOrderProps } from '../../types/A11yOrder.types';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated The method should not be used
|
|
7
|
+
* This API is going to be removed in future releases, you can find migration instruction here: https://github.com/ArturKalach/react-native-a11y-order?tab=readme-ov-file#migration
|
|
8
|
+
*/
|
|
9
|
+
export const A11yOrder: React.FC<A11yOrderProps> = ({
|
|
10
|
+
a11yOrder,
|
|
11
|
+
onLayout,
|
|
12
|
+
ignoreWarn,
|
|
13
|
+
...props
|
|
14
|
+
}) => {
|
|
15
|
+
if (!ignoreWarn) {
|
|
16
|
+
console.warn(
|
|
17
|
+
'A11yOrder: This API is going to be removed in future releases, you can find migration instruction here: https://github.com/ArturKalach/react-native-a11y-order?tab=readme-ov-file#migration'
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
const onLayoutHandler = useCallback(
|
|
21
|
+
(e: LayoutChangeEvent) => {
|
|
22
|
+
onLayout?.(e);
|
|
23
|
+
a11yOrder.onLayout();
|
|
24
|
+
},
|
|
25
|
+
[a11yOrder, onLayout]
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
const id = useId?.() || 'mock_id'; // ToDo: use native component with tag to nativeTag
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<View
|
|
32
|
+
nativeID={id}
|
|
33
|
+
{...props}
|
|
34
|
+
onLayout={onLayoutHandler}
|
|
35
|
+
ref={a11yOrder.ref}
|
|
36
|
+
/>
|
|
37
|
+
);
|
|
38
|
+
};
|
package/src/index.ts
CHANGED
|
@@ -2,6 +2,8 @@ import { A11yIndex } from './components/A11yIndex/A11yIndex';
|
|
|
2
2
|
import { A11yIndexSequence } from './components/A11ySequence/A11ySequence';
|
|
3
3
|
import { A11yGroup } from './components/A11yGroup/A11yGroup';
|
|
4
4
|
|
|
5
|
+
export { A11yOrder } from './components/A11yOrder/A11yOrder';
|
|
6
|
+
export type { A11yOrderProps } from './types/A11yOrder.types';
|
|
5
7
|
export type { IndexCommands } from './types/A11yIndex.types';
|
|
6
8
|
|
|
7
9
|
export const A11y = {
|
package/src/index.web.ts
CHANGED
|
@@ -1,8 +1,51 @@
|
|
|
1
|
+
import { createRef } from 'react';
|
|
1
2
|
import { View } from 'react-native';
|
|
2
3
|
import { A11yIndex } from './components/A11yIndex/A11yIndex.web';
|
|
3
4
|
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated The method should not be used
|
|
7
|
+
* This API is going to be removed in future releases, you can find migration instruction here: https://github.com/ArturKalach/react-native-a11y-order?tab=readme-ov-file#migration
|
|
8
|
+
*/
|
|
9
|
+
export const useFocusOrder = () => ({
|
|
10
|
+
a11yOrder: {
|
|
11
|
+
ref: createRef(),
|
|
12
|
+
onLayout: () => {},
|
|
13
|
+
},
|
|
14
|
+
refs: [],
|
|
15
|
+
reset: () => {},
|
|
16
|
+
setOrder: () => {},
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @deprecated The method should not be used
|
|
21
|
+
* This API is going to be removed in future releases, you can find migration instruction here: https://github.com/ArturKalach/react-native-a11y-order?tab=readme-ov-file#migration
|
|
22
|
+
*/
|
|
23
|
+
export const useDynamicFocusOrder = () => ({
|
|
24
|
+
a11yOrder: {
|
|
25
|
+
ref: createRef(),
|
|
26
|
+
onLayout: () => {},
|
|
27
|
+
},
|
|
28
|
+
registerOrder: () => createRef,
|
|
29
|
+
reset: () => {},
|
|
30
|
+
setOrder: () => {},
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
export const useA11yOrderManager = () => ({
|
|
34
|
+
registerOrderRef: () => () => {},
|
|
35
|
+
updateRefList: () => {},
|
|
36
|
+
reset: () => {},
|
|
37
|
+
setOrder: () => {},
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
export type { A11yOrderProps } from './types/A11yOrder.types';
|
|
4
41
|
export type { IndexCommands } from './types/A11yIndex.types';
|
|
5
42
|
|
|
43
|
+
/**
|
|
44
|
+
* @deprecated The method should not be used
|
|
45
|
+
* This API is going to be removed in future releases, you can find migration instruction here: https://github.com/ArturKalach/react-native-a11y-order?tab=readme-ov-file#migration
|
|
46
|
+
*/
|
|
47
|
+
export const A11yOrder = View;
|
|
48
|
+
|
|
6
49
|
export const A11y = {
|
|
7
50
|
Order: View,
|
|
8
51
|
Group: View,
|