react-native-a11y-order 0.1.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/LICENSE +20 -0
- package/README.md +53 -0
- package/android/build.gradle +90 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +4 -0
- package/android/src/main/java/com/a11yorder/A11yOrderModule.java +83 -0
- package/android/src/main/java/com/a11yorder/A11yOrderPackage.java +45 -0
- package/android/src/newarch/A11yOrderSpec.java +9 -0
- package/android/src/oldarch/A11yOrderSpec.java +15 -0
- package/ios/A11yOrder-Bridging-Header.h +3 -0
- package/ios/A11yOrder.h +6 -0
- package/ios/A11yOrder.mm +72 -0
- package/ios/A11yOrder.xcodeproj/project.pbxproj +281 -0
- package/ios/A11yOrder.xcodeproj/project.xcworkspace/contents.xcworkspacedata +4 -0
- package/ios/A11yOrder.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/ios/A11yOrder.xcodeproj/project.xcworkspace/xcuserdata/Artur_Kalach.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/A11yOrder.xcodeproj/xcuserdata/Artur_Kalach.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +40 -0
- package/ios/A11yOrder.xcodeproj/xcuserdata/Artur_Kalach.xcuserdatad/xcschemes/xcschememanagement.plist +14 -0
- package/lib/commonjs/A11yModule/helper.js +21 -0
- package/lib/commonjs/A11yModule/helper.js.map +1 -0
- package/lib/commonjs/A11yModule/index.js +20 -0
- package/lib/commonjs/A11yModule/index.js.map +1 -0
- package/lib/commonjs/A11yModule/module.js +24 -0
- package/lib/commonjs/A11yModule/module.js.map +1 -0
- package/lib/commonjs/components/A11yOrder/A11yOrder.js +32 -0
- package/lib/commonjs/components/A11yOrder/A11yOrder.js.map +1 -0
- package/lib/commonjs/components/A11yOrder/A11yOrder.types.js +6 -0
- package/lib/commonjs/components/A11yOrder/A11yOrder.types.js.map +1 -0
- package/lib/commonjs/components/A11yOrder/index.js +13 -0
- package/lib/commonjs/components/A11yOrder/index.js.map +1 -0
- package/lib/commonjs/components/index.js +13 -0
- package/lib/commonjs/components/index.js.map +1 -0
- package/lib/commonjs/hooks/index.js +27 -0
- package/lib/commonjs/hooks/index.js.map +1 -0
- package/lib/commonjs/hooks/useA11yOrderManager/index.js +13 -0
- package/lib/commonjs/hooks/useA11yOrderManager/index.js.map +1 -0
- package/lib/commonjs/hooks/useA11yOrderManager/useA11yOrderManager.js +66 -0
- package/lib/commonjs/hooks/useA11yOrderManager/useA11yOrderManager.js.map +1 -0
- package/lib/commonjs/hooks/useDynamicFocusOrder/index.js +20 -0
- package/lib/commonjs/hooks/useDynamicFocusOrder/index.js.map +1 -0
- package/lib/commonjs/hooks/useDynamicFocusOrder/useDynamicFocusOrder.js +29 -0
- package/lib/commonjs/hooks/useDynamicFocusOrder/useDynamicFocusOrder.js.map +1 -0
- package/lib/commonjs/hooks/useDynamicFocusOrder/useDynamicFocusOrder.types.js +6 -0
- package/lib/commonjs/hooks/useDynamicFocusOrder/useDynamicFocusOrder.types.js.map +1 -0
- package/lib/commonjs/hooks/useFocusOrder/index.js +13 -0
- package/lib/commonjs/hooks/useFocusOrder/index.js.map +1 -0
- package/lib/commonjs/hooks/useFocusOrder/useFocusOrder.js +25 -0
- package/lib/commonjs/hooks/useFocusOrder/useFocusOrder.js.map +1 -0
- package/lib/commonjs/hooks/useFocusOrder/useFocusOrder.types.js +6 -0
- package/lib/commonjs/hooks/useFocusOrder/useFocusOrder.types.js.map +1 -0
- package/lib/commonjs/index.js +32 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/nativeSpecs/NativeA11yOrder.js +10 -0
- package/lib/commonjs/nativeSpecs/NativeA11yOrder.js.map +1 -0
- package/lib/module/A11yModule/helper.js +14 -0
- package/lib/module/A11yModule/helper.js.map +1 -0
- package/lib/module/A11yModule/index.js +3 -0
- package/lib/module/A11yModule/index.js.map +1 -0
- package/lib/module/A11yModule/module.js +18 -0
- package/lib/module/A11yModule/module.js.map +1 -0
- package/lib/module/components/A11yOrder/A11yOrder.js +23 -0
- package/lib/module/components/A11yOrder/A11yOrder.js.map +1 -0
- package/lib/module/components/A11yOrder/A11yOrder.types.js +2 -0
- package/lib/module/components/A11yOrder/A11yOrder.types.js.map +1 -0
- package/lib/module/components/A11yOrder/index.js +2 -0
- package/lib/module/components/A11yOrder/index.js.map +1 -0
- package/lib/module/components/index.js +2 -0
- package/lib/module/components/index.js.map +1 -0
- package/lib/module/hooks/index.js +4 -0
- package/lib/module/hooks/index.js.map +1 -0
- package/lib/module/hooks/useA11yOrderManager/index.js +2 -0
- package/lib/module/hooks/useA11yOrderManager/index.js.map +1 -0
- package/lib/module/hooks/useA11yOrderManager/useA11yOrderManager.js +58 -0
- package/lib/module/hooks/useA11yOrderManager/useA11yOrderManager.js.map +1 -0
- package/lib/module/hooks/useDynamicFocusOrder/index.js +3 -0
- package/lib/module/hooks/useDynamicFocusOrder/index.js.map +1 -0
- package/lib/module/hooks/useDynamicFocusOrder/useDynamicFocusOrder.js +22 -0
- package/lib/module/hooks/useDynamicFocusOrder/useDynamicFocusOrder.js.map +1 -0
- package/lib/module/hooks/useDynamicFocusOrder/useDynamicFocusOrder.types.js +2 -0
- package/lib/module/hooks/useDynamicFocusOrder/useDynamicFocusOrder.types.js.map +1 -0
- package/lib/module/hooks/useFocusOrder/index.js +2 -0
- package/lib/module/hooks/useFocusOrder/index.js.map +1 -0
- package/lib/module/hooks/useFocusOrder/useFocusOrder.js +18 -0
- package/lib/module/hooks/useFocusOrder/useFocusOrder.js.map +1 -0
- package/lib/module/hooks/useFocusOrder/useFocusOrder.types.js +2 -0
- package/lib/module/hooks/useFocusOrder/useFocusOrder.types.js.map +1 -0
- package/lib/module/index.js +3 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/nativeSpecs/NativeA11yOrder.js +3 -0
- package/lib/module/nativeSpecs/NativeA11yOrder.js.map +1 -0
- package/lib/typescript/A11yModule/helper.d.ts +8 -0
- package/lib/typescript/A11yModule/helper.d.ts.map +1 -0
- package/lib/typescript/A11yModule/index.d.ts +3 -0
- package/lib/typescript/A11yModule/index.d.ts.map +1 -0
- package/lib/typescript/A11yModule/module.d.ts +2 -0
- package/lib/typescript/A11yModule/module.d.ts.map +1 -0
- package/lib/typescript/components/A11yOrder/A11yOrder.d.ts +4 -0
- package/lib/typescript/components/A11yOrder/A11yOrder.d.ts.map +1 -0
- package/lib/typescript/components/A11yOrder/A11yOrder.types.d.ts +9 -0
- package/lib/typescript/components/A11yOrder/A11yOrder.types.d.ts.map +1 -0
- package/lib/typescript/components/A11yOrder/index.d.ts +2 -0
- package/lib/typescript/components/A11yOrder/index.d.ts.map +1 -0
- package/lib/typescript/components/index.d.ts +2 -0
- package/lib/typescript/components/index.d.ts.map +1 -0
- package/lib/typescript/hooks/index.d.ts +4 -0
- package/lib/typescript/hooks/index.d.ts.map +1 -0
- package/lib/typescript/hooks/useA11yOrderManager/index.d.ts +2 -0
- package/lib/typescript/hooks/useA11yOrderManager/index.d.ts.map +1 -0
- package/lib/typescript/hooks/useA11yOrderManager/useA11yOrderManager.d.ts +11 -0
- package/lib/typescript/hooks/useA11yOrderManager/useA11yOrderManager.d.ts.map +1 -0
- package/lib/typescript/hooks/useDynamicFocusOrder/index.d.ts +3 -0
- package/lib/typescript/hooks/useDynamicFocusOrder/index.d.ts.map +1 -0
- package/lib/typescript/hooks/useDynamicFocusOrder/useDynamicFocusOrder.d.ts +5 -0
- package/lib/typescript/hooks/useDynamicFocusOrder/useDynamicFocusOrder.d.ts.map +1 -0
- package/lib/typescript/hooks/useDynamicFocusOrder/useDynamicFocusOrder.types.d.ts +12 -0
- package/lib/typescript/hooks/useDynamicFocusOrder/useDynamicFocusOrder.types.d.ts.map +1 -0
- package/lib/typescript/hooks/useFocusOrder/index.d.ts +2 -0
- package/lib/typescript/hooks/useFocusOrder/index.d.ts.map +1 -0
- package/lib/typescript/hooks/useFocusOrder/useFocusOrder.d.ts +5 -0
- package/lib/typescript/hooks/useFocusOrder/useFocusOrder.d.ts.map +1 -0
- package/lib/typescript/hooks/useFocusOrder/useFocusOrder.types.d.ts +6 -0
- package/lib/typescript/hooks/useFocusOrder/useFocusOrder.types.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +3 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/nativeSpecs/NativeA11yOrder.d.ts +7 -0
- package/lib/typescript/nativeSpecs/NativeA11yOrder.d.ts.map +1 -0
- package/package.json +165 -0
- package/react-native-a11y-order.podspec +35 -0
- package/src/A11yModule/helper.ts +26 -0
- package/src/A11yModule/index.tsx +2 -0
- package/src/A11yModule/module.ts +32 -0
- package/src/components/A11yOrder/A11yOrder.tsx +28 -0
- package/src/components/A11yOrder/A11yOrder.types.ts +8 -0
- package/src/components/A11yOrder/index.ts +1 -0
- package/src/components/index.ts +1 -0
- package/src/hooks/index.ts +3 -0
- package/src/hooks/useA11yOrderManager/index.ts +1 -0
- package/src/hooks/useA11yOrderManager/useA11yOrderManager.ts +78 -0
- package/src/hooks/useDynamicFocusOrder/index.ts +2 -0
- package/src/hooks/useDynamicFocusOrder/useDynamicFocusOrder.ts +30 -0
- package/src/hooks/useDynamicFocusOrder/useDynamicFocusOrder.types.ts +12 -0
- package/src/hooks/useFocusOrder/index.ts +1 -0
- package/src/hooks/useFocusOrder/useFocusOrder.ts +25 -0
- package/src/hooks/useFocusOrder/useFocusOrder.types.ts +9 -0
- package/src/index.ts +7 -0
- package/src/nativeSpecs/NativeA11yOrder.ts +8 -0
|
Binary file
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<Bucket
|
|
3
|
+
uuid = "1A8F833B-989C-45A9-974C-35C22AEFEA6D"
|
|
4
|
+
type = "1"
|
|
5
|
+
version = "2.0">
|
|
6
|
+
<Breakpoints>
|
|
7
|
+
<BreakpointProxy
|
|
8
|
+
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
|
9
|
+
<BreakpointContent
|
|
10
|
+
uuid = "CCC001DE-6703-4D2C-8A08-F147D6C4C688"
|
|
11
|
+
shouldBeEnabled = "Yes"
|
|
12
|
+
ignoreCount = "0"
|
|
13
|
+
continueAfterRunningActions = "No"
|
|
14
|
+
filePath = "A11yOrder.mm"
|
|
15
|
+
startingColumnNumber = "9223372036854775807"
|
|
16
|
+
endingColumnNumber = "9223372036854775807"
|
|
17
|
+
startingLineNumber = "24"
|
|
18
|
+
endingLineNumber = "24"
|
|
19
|
+
landmarkName = "-stopObserving"
|
|
20
|
+
landmarkType = "7">
|
|
21
|
+
</BreakpointContent>
|
|
22
|
+
</BreakpointProxy>
|
|
23
|
+
<BreakpointProxy
|
|
24
|
+
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
|
25
|
+
<BreakpointContent
|
|
26
|
+
uuid = "2C8CE2B9-C2A3-47F9-A9D4-83AA4950C0D4"
|
|
27
|
+
shouldBeEnabled = "Yes"
|
|
28
|
+
ignoreCount = "0"
|
|
29
|
+
continueAfterRunningActions = "No"
|
|
30
|
+
filePath = "A11yOrder.mm"
|
|
31
|
+
startingColumnNumber = "9223372036854775807"
|
|
32
|
+
endingColumnNumber = "9223372036854775807"
|
|
33
|
+
startingLineNumber = "37"
|
|
34
|
+
endingLineNumber = "37"
|
|
35
|
+
landmarkName = "RCT_EXPORT_METHOD(node)"
|
|
36
|
+
landmarkType = "9">
|
|
37
|
+
</BreakpointContent>
|
|
38
|
+
</BreakpointProxy>
|
|
39
|
+
</Breakpoints>
|
|
40
|
+
</Bucket>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>SchemeUserState</key>
|
|
6
|
+
<dict>
|
|
7
|
+
<key>A11yOrder.xcscheme_^#shared#^_</key>
|
|
8
|
+
<dict>
|
|
9
|
+
<key>orderHint</key>
|
|
10
|
+
<integer>0</integer>
|
|
11
|
+
</dict>
|
|
12
|
+
</dict>
|
|
13
|
+
</dict>
|
|
14
|
+
</plist>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.setA11yElementsOrder = void 0;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
var _module = require("./module");
|
|
9
|
+
const setA11yElementsOrder = _ref => {
|
|
10
|
+
let {
|
|
11
|
+
tag,
|
|
12
|
+
views
|
|
13
|
+
} = _ref;
|
|
14
|
+
if (!tag) return;
|
|
15
|
+
const targetView = (0, _reactNative.findNodeHandle)(tag.current);
|
|
16
|
+
if (!targetView) return;
|
|
17
|
+
const tags = views.map(view => (0, _reactNative.findNodeHandle)(view)).filter(view => Boolean(view));
|
|
18
|
+
_module.setA11yOrder === null || _module.setA11yOrder === void 0 ? void 0 : (0, _module.setA11yOrder)(tags, targetView);
|
|
19
|
+
};
|
|
20
|
+
exports.setA11yElementsOrder = setA11yElementsOrder;
|
|
21
|
+
//# sourceMappingURL=helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_module","setA11yElementsOrder","_ref","tag","views","targetView","findNodeHandle","current","tags","map","view","filter","Boolean","setA11yOrder","exports"],"sourceRoot":"../../../src","sources":["A11yModule/helper.ts"],"mappings":";;;;;;AAEA,IAAAA,YAAA,GAAAC,OAAA;AAEA,IAAAC,OAAA,GAAAD,OAAA;AAOO,MAAME,oBAAoB,GAAGC,IAAA,IAGZ;EAAA,IAHwC;IAC9DC,GAAG;IACHC;EACgB,CAAC,GAAAF,IAAA;EACjB,IAAI,CAACC,GAAG,EAAE;EAEV,MAAME,UAAU,GAAG,IAAAC,2BAAc,EAACH,GAAG,CAACI,OAA0B,CAAC;EACjE,IAAI,CAACF,UAAU,EAAE;EAEjB,MAAMG,IAAI,GAAGJ,KAAK,CACfK,GAAG,CAAEC,IAAI,IAAK,IAAAJ,2BAAc,EAACI,IAAuB,CAAC,CAAC,CACtDC,MAAM,CAAED,IAAI,IAAKE,OAAO,CAACF,IAAI,CAAC,CAAa;EAE9CG,oBAAY,aAAZA,oBAAY,uBAAZ,IAAAA,oBAAY,EAAGL,IAAI,EAAEH,UAAU,CAAC;AAClC,CAAC;AAACS,OAAA,CAAAb,oBAAA,GAAAA,oBAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "setA11yElementsOrder", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _helper.setA11yElementsOrder;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "setA11yOrder", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _module.setA11yOrder;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
var _helper = require("./helper");
|
|
19
|
+
var _module = require("./module");
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_helper","require","_module"],"sourceRoot":"../../../src","sources":["A11yModule/index.tsx"],"mappings":";;;;;;;;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.setA11yOrder = setA11yOrder;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
const LINKING_ERROR = `The package 'react-native-a11y-order' doesn't seem to be linked. Make sure: \n\n` + _reactNative.Platform.select({
|
|
9
|
+
ios: "- You have run 'pod install'\n",
|
|
10
|
+
default: ''
|
|
11
|
+
}) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n';
|
|
12
|
+
|
|
13
|
+
// @ts-expect-error
|
|
14
|
+
const isTurboModuleEnabled = global.__turboModuleProxy != null;
|
|
15
|
+
const A11yOrderModule = isTurboModuleEnabled ? require('../nativeSpecs/NativeA11yOrder').default : _reactNative.NativeModules.A11yOrder;
|
|
16
|
+
const A11yOrder = A11yOrderModule ? A11yOrderModule : new Proxy({}, {
|
|
17
|
+
get() {
|
|
18
|
+
throw new Error(LINKING_ERROR);
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
function setA11yOrder(tags, targetView) {
|
|
22
|
+
return A11yOrder.setA11yOrder(tags, targetView);
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","LINKING_ERROR","Platform","select","ios","default","isTurboModuleEnabled","global","__turboModuleProxy","A11yOrderModule","NativeModules","A11yOrder","Proxy","get","Error","setA11yOrder","tags","targetView"],"sourceRoot":"../../../src","sources":["A11yModule/module.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA,MAAMC,aAAa,GAChB,kFAAiF,GAClFC,qBAAQ,CAACC,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B;;AAEjC;AACA,MAAMC,oBAAoB,GAAGC,MAAM,CAACC,kBAAkB,IAAI,IAAI;AAE9D,MAAMC,eAAe,GAAGH,oBAAoB,GACxCN,OAAO,CAAC,gCAAgC,CAAC,CAACK,OAAO,GACjDK,0BAAa,CAACC,SAAS;AAE3B,MAAMA,SAAS,GAAGF,eAAe,GAC7BA,eAAe,GACf,IAAIG,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACb,aAAa,CAAC;EAChC;AACF,CACF,CAAC;AAEE,SAASc,YAAYA,CAC1BC,IAAc,EACdC,UAAmB,EACF;EACjB,OAAON,SAAS,CAACI,YAAY,CAACC,IAAI,EAAEC,UAAU,CAAC;AACjD"}
|
|
@@ -0,0 +1,32 @@
|
|
|
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 _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
10
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
11
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
12
|
+
const A11yOrder = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
a11yOrder,
|
|
15
|
+
onLayout,
|
|
16
|
+
...props
|
|
17
|
+
} = _ref;
|
|
18
|
+
const onLayoutHandler = (0, _react.useCallback)(e => {
|
|
19
|
+
onLayout === null || onLayout === void 0 ? void 0 : onLayout(e);
|
|
20
|
+
a11yOrder.onLayout();
|
|
21
|
+
}, [a11yOrder, onLayout]);
|
|
22
|
+
const id = (_react.useId === null || _react.useId === void 0 ? void 0 : (0, _react.useId)()) || 'mock_id'; // ToDo: use native component with tag to nativeTag
|
|
23
|
+
|
|
24
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.View, _extends({
|
|
25
|
+
nativeID: id
|
|
26
|
+
}, props, {
|
|
27
|
+
onLayout: onLayoutHandler,
|
|
28
|
+
ref: a11yOrder.ref
|
|
29
|
+
}));
|
|
30
|
+
};
|
|
31
|
+
exports.A11yOrder = A11yOrder;
|
|
32
|
+
//# sourceMappingURL=A11yOrder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_extends","assign","bind","target","i","arguments","length","source","apply","A11yOrder","_ref","a11yOrder","onLayout","props","onLayoutHandler","useCallback","e","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,SAAAE,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAJ,wBAAAQ,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IAAA,KAAAA,IAAA,CAAAV,GAAA,IAAAU,IAAA,CAAAC,GAAA,KAAAR,MAAA,CAAAC,cAAA,CAAAH,MAAA,EAAAK,GAAA,EAAAI,IAAA,YAAAT,MAAA,CAAAK,GAAA,IAAAX,GAAA,CAAAW,GAAA,SAAAL,MAAA,CAAAJ,OAAA,GAAAF,GAAA,MAAAG,KAAA,IAAAA,KAAA,CAAAa,GAAA,CAAAhB,GAAA,EAAAM,MAAA,YAAAA,MAAA;AAAA,SAAAW,SAAA,IAAAA,QAAA,GAAAT,MAAA,CAAAU,MAAA,GAAAV,MAAA,CAAAU,MAAA,CAAAC,IAAA,eAAAC,MAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAF,CAAA,UAAAG,MAAA,GAAAF,SAAA,CAAAD,CAAA,YAAAV,GAAA,IAAAa,MAAA,QAAAhB,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAU,MAAA,EAAAb,GAAA,KAAAS,MAAA,CAAAT,GAAA,IAAAa,MAAA,CAAAb,GAAA,gBAAAS,MAAA,YAAAH,QAAA,CAAAQ,KAAA,OAAAH,SAAA;AAGhD,MAAMI,SAAmC,GAAGC,IAAA,IAI7C;EAAA,IAJ8C;IAClDC,SAAS;IACTC,QAAQ;IACR,GAAGC;EACL,CAAC,GAAAH,IAAA;EACC,MAAMI,eAAe,GAAG,IAAAC,kBAAW,EAChCC,CAAoB,IAAK;IACxBJ,QAAQ,aAARA,QAAQ,uBAARA,QAAQ,CAAGI,CAAC,CAAC;IACbL,SAAS,CAACC,QAAQ,CAAC,CAAC;EACtB,CAAC,EACD,CAACD,SAAS,EAAEC,QAAQ,CACtB,CAAC;EAED,MAAMK,EAAE,GAAG,CAAAC,YAAK,aAALA,YAAK,uBAAL,IAAAA,YAAK,EAAG,CAAC,KAAI,SAAS,CAAC,CAAC;;EAEnC,oBACE5C,MAAA,CAAAW,OAAA,CAAAkC,aAAA,CAAC1C,YAAA,CAAA2C,IAAI,EAAApB,QAAA;IACHqB,QAAQ,EAAEJ;EAAG,GACTJ,KAAK;IACTD,QAAQ,EAAEE,eAAgB;IAC1BQ,GAAG,EAAEX,SAAS,CAACW;EAAI,EACpB,CAAC;AAEN,CAAC;AAACC,OAAA,CAAAd,SAAA,GAAAA,SAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["components/A11yOrder/A11yOrder.types.ts"],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "A11yOrder", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _A11yOrder.A11yOrder;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _A11yOrder = require("./A11yOrder");
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_A11yOrder","require"],"sourceRoot":"../../../../src","sources":["components/A11yOrder/index.ts"],"mappings":";;;;;;;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "A11yOrder", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _A11yOrder.A11yOrder;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _A11yOrder = require("./A11yOrder");
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_A11yOrder","require"],"sourceRoot":"../../../src","sources":["components/index.ts"],"mappings":";;;;;;;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "useA11yOrderManager", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _useA11yOrderManager.useA11yOrderManager;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "useDynamicFocusOrder", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _useDynamicFocusOrder.useDynamicFocusOrder;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "useFocusOrder", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _useFocusOrder.useFocusOrder;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
var _useA11yOrderManager = require("./useA11yOrderManager");
|
|
25
|
+
var _useFocusOrder = require("./useFocusOrder");
|
|
26
|
+
var _useDynamicFocusOrder = require("./useDynamicFocusOrder");
|
|
27
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_useA11yOrderManager","require","_useFocusOrder","_useDynamicFocusOrder"],"sourceRoot":"../../../src","sources":["hooks/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,oBAAA,GAAAC,OAAA;AACA,IAAAC,cAAA,GAAAD,OAAA;AACA,IAAAE,qBAAA,GAAAF,OAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "useA11yOrderManager", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _useA11yOrderManager.useA11yOrderManager;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _useA11yOrderManager = require("./useA11yOrderManager");
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_useA11yOrderManager","require"],"sourceRoot":"../../../../src","sources":["hooks/useA11yOrderManager/index.ts"],"mappings":";;;;;;;;;;;AAAA,IAAAA,oBAAA,GAAAC,OAAA"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useA11yOrderManager = exports.debounce = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _A11yModule = require("../../A11yModule");
|
|
10
|
+
const debounce = function (callback) {
|
|
11
|
+
let timeout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 100;
|
|
12
|
+
let timer;
|
|
13
|
+
return function () {
|
|
14
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
15
|
+
args[_key] = arguments[_key];
|
|
16
|
+
}
|
|
17
|
+
if (timer) {
|
|
18
|
+
clearTimeout(timer);
|
|
19
|
+
timer = null;
|
|
20
|
+
}
|
|
21
|
+
timer = setTimeout(() => callback(args), timeout);
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
exports.debounce = debounce;
|
|
25
|
+
const SECONDS_PER_FRAME = 16;
|
|
26
|
+
const COUNT_OF_FRAMES = 1;
|
|
27
|
+
const DEBOUNCE_DELAY = SECONDS_PER_FRAME * COUNT_OF_FRAMES;
|
|
28
|
+
const useA11yOrderManager = (orderRef, onlyFor) => {
|
|
29
|
+
const currentRef = (0, _react.useRef)([]);
|
|
30
|
+
const registeredRefs = (0, _react.useRef)([]);
|
|
31
|
+
const refWasUpdated = (0, _react.useRef)(false);
|
|
32
|
+
const setOrder = (0, _react.useCallback)(() => {
|
|
33
|
+
if (!onlyFor || onlyFor === _reactNative.Platform.OS) {
|
|
34
|
+
(0, _A11yModule.setA11yElementsOrder)({
|
|
35
|
+
tag: orderRef,
|
|
36
|
+
views: registeredRefs.current
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}, [onlyFor, orderRef]);
|
|
40
|
+
const debounceOrder = (0, _react.useMemo)(() => debounce(setOrder, DEBOUNCE_DELAY), [setOrder]);
|
|
41
|
+
const registerOrderRef = (0, _react.useCallback)(order => ref => {
|
|
42
|
+
refWasUpdated.current = true;
|
|
43
|
+
registeredRefs.current[order] = ref;
|
|
44
|
+
}, []);
|
|
45
|
+
const updateRefList = (0, _react.useCallback)(() => {
|
|
46
|
+
if (!refWasUpdated.current) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
refWasUpdated.current = false;
|
|
50
|
+
currentRef.current = registeredRefs.current.filter(v => v);
|
|
51
|
+
debounceOrder();
|
|
52
|
+
}, [debounceOrder]);
|
|
53
|
+
const reset = (0, _react.useCallback)(() => {
|
|
54
|
+
currentRef.current = [];
|
|
55
|
+
registeredRefs.current = [];
|
|
56
|
+
refWasUpdated.current = false;
|
|
57
|
+
}, []);
|
|
58
|
+
return {
|
|
59
|
+
registerOrderRef,
|
|
60
|
+
updateRefList,
|
|
61
|
+
reset,
|
|
62
|
+
setOrder
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
exports.useA11yOrderManager = useA11yOrderManager;
|
|
66
|
+
//# sourceMappingURL=useA11yOrderManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_A11yModule","debounce","callback","timeout","arguments","length","undefined","timer","_len","args","Array","_key","clearTimeout","setTimeout","exports","SECONDS_PER_FRAME","COUNT_OF_FRAMES","DEBOUNCE_DELAY","useA11yOrderManager","orderRef","onlyFor","currentRef","useRef","registeredRefs","refWasUpdated","setOrder","useCallback","Platform","OS","setA11yElementsOrder","tag","views","current","debounceOrder","useMemo","registerOrderRef","order","ref","updateRefList","filter","v","reset"],"sourceRoot":"../../../../src","sources":["hooks/useA11yOrderManager/useA11yOrderManager.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,WAAA,GAAAF,OAAA;AAEO,MAAMG,QAAQ,GAAG,SAAAA,CAAqBC,QAAW,EAAoB;EAAA,IAAlBC,OAAO,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,GAAG;EACrE,IAAIG,KAA4B;EAEhC,OAAO,YAAkB;IAAA,SAAAC,IAAA,GAAAJ,SAAA,CAAAC,MAAA,EAAdI,IAAI,OAAAC,KAAA,CAAAF,IAAA,GAAAG,IAAA,MAAAA,IAAA,GAAAH,IAAA,EAAAG,IAAA;MAAJF,IAAI,CAAAE,IAAA,IAAAP,SAAA,CAAAO,IAAA;IAAA;IACb,IAAIJ,KAAK,EAAE;MACTK,YAAY,CAACL,KAAK,CAAC;MACnBA,KAAK,GAAG,IAAI;IACd;IACAA,KAAK,GAAGM,UAAU,CAAC,MAAMX,QAAQ,CAACO,IAAI,CAAC,EAAEN,OAAO,CAAC;EACnD,CAAC;AACH,CAAC;AAACW,OAAA,CAAAb,QAAA,GAAAA,QAAA;AAEF,MAAMc,iBAAiB,GAAG,EAAE;AAC5B,MAAMC,eAAe,GAAG,CAAC;AAEzB,MAAMC,cAAc,GAAGF,iBAAiB,GAAGC,eAAe;AAEnD,MAAME,mBAAmB,GAAGA,CACjCC,QAAyB,EACzBC,OAAwB,KACrB;EACH,MAAMC,UAAU,GAAG,IAAAC,aAAM,EAAe,EAAE,CAAC;EAC3C,MAAMC,cAAc,GAAG,IAAAD,aAAM,EAAe,EAAE,CAAC;EAE/C,MAAME,aAAa,GAAG,IAAAF,aAAM,EAAU,KAAK,CAAC;EAE5C,MAAMG,QAAQ,GAAG,IAAAC,kBAAW,EAAC,MAAM;IACjC,IAAI,CAACN,OAAO,IAAIA,OAAO,KAAKO,qBAAQ,CAACC,EAAE,EAAE;MACvC,IAAAC,gCAAoB,EAAC;QACnBC,GAAG,EAAEX,QAAQ;QACbY,KAAK,EAAER,cAAc,CAACS;MACxB,CAAC,CAAC;IACJ;EACF,CAAC,EAAE,CAACZ,OAAO,EAAED,QAAQ,CAAC,CAAC;EAEvB,MAAMc,aAAa,GAAG,IAAAC,cAAO,EAC3B,MAAMjC,QAAQ,CAACwB,QAAQ,EAAER,cAAc,CAAC,EACxC,CAACQ,QAAQ,CACX,CAAC;EAED,MAAMU,gBAAgB,GAAG,IAAAT,kBAAW,EACjCU,KAAa,IACXC,GAAa,IAAW;IACvBb,aAAa,CAACQ,OAAO,GAAG,IAAI;IAC5BT,cAAc,CAACS,OAAO,CAACI,KAAK,CAAC,GAAGC,GAAG;EACrC,CAAC,EACH,EACF,CAAC;EAED,MAAMC,aAAa,GAAG,IAAAZ,kBAAW,EAAC,MAAM;IACtC,IAAI,CAACF,aAAa,CAACQ,OAAO,EAAE;MAC1B;IACF;IAEAR,aAAa,CAACQ,OAAO,GAAG,KAAK;IAC7BX,UAAU,CAACW,OAAO,GAAGT,cAAc,CAACS,OAAO,CAACO,MAAM,CAAEC,CAAC,IAAKA,CAAC,CAAC;IAE5DP,aAAa,CAAC,CAAC;EACjB,CAAC,EAAE,CAACA,aAAa,CAAC,CAAC;EAEnB,MAAMQ,KAAK,GAAG,IAAAf,kBAAW,EAAC,MAAM;IAC9BL,UAAU,CAACW,OAAO,GAAG,EAAE;IACvBT,cAAc,CAACS,OAAO,GAAG,EAAE;IAC3BR,aAAa,CAACQ,OAAO,GAAG,KAAK;EAC/B,CAAC,EAAE,EAAE,CAAC;EAEN,OAAO;IACLG,gBAAgB;IAChBG,aAAa;IACbG,KAAK;IACLhB;EACF,CAAC;AACH,CAAC;AAACX,OAAA,CAAAI,mBAAA,GAAAA,mBAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "UseDynamicFocusOrder", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _useDynamicFocusOrder2.UseDynamicFocusOrder;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "useDynamicFocusOrder", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _useDynamicFocusOrder.useDynamicFocusOrder;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
var _useDynamicFocusOrder = require("./useDynamicFocusOrder");
|
|
19
|
+
var _useDynamicFocusOrder2 = require("./useDynamicFocusOrder.types");
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_useDynamicFocusOrder","require","_useDynamicFocusOrder2"],"sourceRoot":"../../../../src","sources":["hooks/useDynamicFocusOrder/index.ts"],"mappings":";;;;;;;;;;;;;;;;;AAAA,IAAAA,qBAAA,GAAAC,OAAA;AACA,IAAAC,sBAAA,GAAAD,OAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useDynamicFocusOrder = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _useA11yOrderManager = require("../useA11yOrderManager");
|
|
9
|
+
const useDynamicFocusOrder = onlyFor => {
|
|
10
|
+
const a11yOrderRef = (0, _react.useRef)(null);
|
|
11
|
+
const {
|
|
12
|
+
registerOrderRef: registerOrder,
|
|
13
|
+
updateRefList,
|
|
14
|
+
reset,
|
|
15
|
+
setOrder
|
|
16
|
+
} = (0, _useA11yOrderManager.useA11yOrderManager)(a11yOrderRef, onlyFor);
|
|
17
|
+
(0, _react.useLayoutEffect)(updateRefList);
|
|
18
|
+
return {
|
|
19
|
+
a11yOrder: {
|
|
20
|
+
ref: a11yOrderRef,
|
|
21
|
+
onLayout: updateRefList
|
|
22
|
+
},
|
|
23
|
+
registerOrder,
|
|
24
|
+
reset,
|
|
25
|
+
setOrder
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
exports.useDynamicFocusOrder = useDynamicFocusOrder;
|
|
29
|
+
//# sourceMappingURL=useDynamicFocusOrder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_useA11yOrderManager","useDynamicFocusOrder","onlyFor","a11yOrderRef","useRef","registerOrderRef","registerOrder","updateRefList","reset","setOrder","useA11yOrderManager","useLayoutEffect","a11yOrder","ref","onLayout","exports"],"sourceRoot":"../../../../src","sources":["hooks/useDynamicFocusOrder/useDynamicFocusOrder.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAGA,IAAAC,oBAAA,GAAAD,OAAA;AAGO,MAAME,oBAAoB,GAC/BC,OAAwB,IACI;EAC5B,MAAMC,YAAY,GAAG,IAAAC,aAAM,EAAO,IAAI,CAAC;EAEvC,MAAM;IACJC,gBAAgB,EAAEC,aAAa;IAC/BC,aAAa;IACbC,KAAK;IACLC;EACF,CAAC,GAAG,IAAAC,wCAAmB,EAACP,YAAY,EAAED,OAAO,CAAC;EAE9C,IAAAS,sBAAe,EAACJ,aAAa,CAAC;EAE9B,OAAO;IACLK,SAAS,EAAE;MACTC,GAAG,EAAEV,YAAY;MACjBW,QAAQ,EAAEP;IACZ,CAAC;IACDD,aAAa;IACbE,KAAK;IACLC;EACF,CAAC;AACH,CAAC;AAACM,OAAA,CAAAd,oBAAA,GAAAA,oBAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["hooks/useDynamicFocusOrder/useDynamicFocusOrder.types.ts"],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "useFocusOrder", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _useFocusOrder.useFocusOrder;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _useFocusOrder = require("./useFocusOrder");
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_useFocusOrder","require"],"sourceRoot":"../../../../src","sources":["hooks/useFocusOrder/index.ts"],"mappings":";;;;;;;;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useFocusOrder = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _useDynamicFocusOrder = require("../useDynamicFocusOrder");
|
|
9
|
+
const useFocusOrder = (size, onlyFor) => {
|
|
10
|
+
const {
|
|
11
|
+
a11yOrder,
|
|
12
|
+
registerOrder,
|
|
13
|
+
reset,
|
|
14
|
+
setOrder
|
|
15
|
+
} = (0, _useDynamicFocusOrder.useDynamicFocusOrder)(onlyFor);
|
|
16
|
+
const refs = (0, _react.useRef)(Array(size).fill(null).map((_, i) => registerOrder(i))).current;
|
|
17
|
+
return {
|
|
18
|
+
a11yOrder,
|
|
19
|
+
refs,
|
|
20
|
+
reset,
|
|
21
|
+
setOrder
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
exports.useFocusOrder = useFocusOrder;
|
|
25
|
+
//# sourceMappingURL=useFocusOrder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_useDynamicFocusOrder","useFocusOrder","size","onlyFor","a11yOrder","registerOrder","reset","setOrder","useDynamicFocusOrder","refs","useRef","Array","fill","map","_","i","current","exports"],"sourceRoot":"../../../../src","sources":["hooks/useFocusOrder/useFocusOrder.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,qBAAA,GAAAD,OAAA;AAGO,MAAME,aAAa,GAAGA,CAC3BC,IAAY,EACZC,OAAwB,KACF;EACtB,MAAM;IAAEC,SAAS;IAAEC,aAAa;IAAEC,KAAK;IAAEC;EAAS,CAAC,GACjD,IAAAC,0CAAoB,EAACL,OAAO,CAAC;EAE/B,MAAMM,IAAI,GAAG,IAAAC,aAAM,EACjBC,KAAK,CAACT,IAAI,CAAC,CACRU,IAAI,CAAC,IAAI,CAAC,CACVC,GAAG,CAAC,CAACC,CAAC,EAAEC,CAAC,KAAKV,aAAa,CAACU,CAAC,CAAC,CACnC,CAAC,CAACC,OAAO;EAET,OAAO;IACLZ,SAAS;IACTK,IAAI;IACJH,KAAK;IACLC;EACF,CAAC;AACH,CAAC;AAACU,OAAA,CAAAhB,aAAA,GAAAA,aAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["hooks/useFocusOrder/useFocusOrder.types.ts"],"mappings":""}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "A11yOrder", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _components.A11yOrder;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "useA11yOrderManager", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _hooks.useA11yOrderManager;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "useDynamicFocusOrder", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _hooks.useDynamicFocusOrder;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "useFocusOrder", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _hooks.useFocusOrder;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
var _hooks = require("./hooks");
|
|
31
|
+
var _components = require("./components");
|
|
32
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_hooks","require","_components"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAMA,IAAAC,WAAA,GAAAD,OAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
var _default = _reactNative.TurboModuleRegistry.getEnforcing('A11yOrder');
|
|
9
|
+
exports.default = _default;
|
|
10
|
+
//# sourceMappingURL=NativeA11yOrder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_default","TurboModuleRegistry","getEnforcing","exports","default"],"sourceRoot":"../../../src","sources":["nativeSpecs/NativeA11yOrder.ts"],"mappings":";;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AAAmD,IAAAC,QAAA,GAMpCC,gCAAmB,CAACC,YAAY,CAAO,WAAW,CAAC;AAAAC,OAAA,CAAAC,OAAA,GAAAJ,QAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { findNodeHandle } from 'react-native';
|
|
2
|
+
import { setA11yOrder } from './module';
|
|
3
|
+
export const setA11yElementsOrder = _ref => {
|
|
4
|
+
let {
|
|
5
|
+
tag,
|
|
6
|
+
views
|
|
7
|
+
} = _ref;
|
|
8
|
+
if (!tag) return;
|
|
9
|
+
const targetView = findNodeHandle(tag.current);
|
|
10
|
+
if (!targetView) return;
|
|
11
|
+
const tags = views.map(view => findNodeHandle(view)).filter(view => Boolean(view));
|
|
12
|
+
setA11yOrder === null || setA11yOrder === void 0 ? void 0 : setA11yOrder(tags, targetView);
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["findNodeHandle","setA11yOrder","setA11yElementsOrder","_ref","tag","views","targetView","current","tags","map","view","filter","Boolean"],"sourceRoot":"../../../src","sources":["A11yModule/helper.ts"],"mappings":"AAEA,SAASA,cAAc,QAAQ,cAAc;AAE7C,SAASC,YAAY,QAAQ,UAAU;AAOvC,OAAO,MAAMC,oBAAoB,GAAGC,IAAA,IAGZ;EAAA,IAHwC;IAC9DC,GAAG;IACHC;EACgB,CAAC,GAAAF,IAAA;EACjB,IAAI,CAACC,GAAG,EAAE;EAEV,MAAME,UAAU,GAAGN,cAAc,CAACI,GAAG,CAACG,OAA0B,CAAC;EACjE,IAAI,CAACD,UAAU,EAAE;EAEjB,MAAME,IAAI,GAAGH,KAAK,CACfI,GAAG,CAAEC,IAAI,IAAKV,cAAc,CAACU,IAAuB,CAAC,CAAC,CACtDC,MAAM,CAAED,IAAI,IAAKE,OAAO,CAACF,IAAI,CAAC,CAAa;EAE9CT,YAAY,aAAZA,YAAY,uBAAZA,YAAY,CAAGO,IAAI,EAAEF,UAAU,CAAC;AAClC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["setA11yElementsOrder","setA11yOrder"],"sourceRoot":"../../../src","sources":["A11yModule/index.tsx"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ,UAAU;AAC/C,SAASC,YAAY,QAAQ,UAAU"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { NativeModules, Platform } from 'react-native';
|
|
2
|
+
const LINKING_ERROR = `The package 'react-native-a11y-order' doesn't seem to be linked. Make sure: \n\n` + Platform.select({
|
|
3
|
+
ios: "- You have run 'pod install'\n",
|
|
4
|
+
default: ''
|
|
5
|
+
}) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n';
|
|
6
|
+
|
|
7
|
+
// @ts-expect-error
|
|
8
|
+
const isTurboModuleEnabled = global.__turboModuleProxy != null;
|
|
9
|
+
const A11yOrderModule = isTurboModuleEnabled ? require('../nativeSpecs/NativeA11yOrder').default : NativeModules.A11yOrder;
|
|
10
|
+
const A11yOrder = A11yOrderModule ? A11yOrderModule : new Proxy({}, {
|
|
11
|
+
get() {
|
|
12
|
+
throw new Error(LINKING_ERROR);
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
export function setA11yOrder(tags, targetView) {
|
|
16
|
+
return A11yOrder.setA11yOrder(tags, targetView);
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["NativeModules","Platform","LINKING_ERROR","select","ios","default","isTurboModuleEnabled","global","__turboModuleProxy","A11yOrderModule","require","A11yOrder","Proxy","get","Error","setA11yOrder","tags","targetView"],"sourceRoot":"../../../src","sources":["A11yModule/module.ts"],"mappings":"AAAA,SAASA,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AAEtD,MAAMC,aAAa,GAChB,kFAAiF,GAClFD,QAAQ,CAACE,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B;;AAEjC;AACA,MAAMC,oBAAoB,GAAGC,MAAM,CAACC,kBAAkB,IAAI,IAAI;AAE9D,MAAMC,eAAe,GAAGH,oBAAoB,GACxCI,OAAO,CAAC,gCAAgC,CAAC,CAACL,OAAO,GACjDL,aAAa,CAACW,SAAS;AAE3B,MAAMA,SAAS,GAAGF,eAAe,GAC7BA,eAAe,GACf,IAAIG,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACZ,aAAa,CAAC;EAChC;AACF,CACF,CAAC;AAEL,OAAO,SAASa,YAAYA,CAC1BC,IAAc,EACdC,UAAmB,EACF;EACjB,OAAON,SAAS,CAACI,YAAY,CAACC,IAAI,EAAEC,UAAU,CAAC;AACjD"}
|