react-native-a11y-order 0.2.2 → 0.2.5
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 +50 -70
- package/android/src/main/java/com/a11yorder/A11yOrderPackage.java +21 -45
- package/ios/A11yOrder.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/ios/A11yOrder.xcodeproj/project.xcworkspace/xcuserdata/Artur_Kalach.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/A11yOrder.xcodeproj/xcuserdata/Artur_Kalach.xcuserdatad/xcschemes/xcschememanagement.plist +14 -0
- package/lib/commonjs/components/A11yGroup/A11yGroup.android.js +4 -6
- package/lib/commonjs/components/A11yGroup/A11yGroup.android.js.map +1 -1
- package/lib/commonjs/components/A11yGroup/A11yGroup.ios.js +1 -1
- package/lib/commonjs/components/A11yGroup/A11yGroup.ios.js.map +1 -1
- package/lib/commonjs/components/A11yGroup/A11yGroup.js +1 -2
- package/lib/commonjs/components/A11yGroup/A11yGroup.js.map +1 -1
- package/lib/commonjs/components/A11yIndex/A11yIndex.js +9 -12
- package/lib/commonjs/components/A11yIndex/A11yIndex.js.map +1 -1
- package/lib/commonjs/components/A11yIndex/A11yIndex.web.js +5 -7
- package/lib/commonjs/components/A11yIndex/A11yIndex.web.js.map +1 -1
- package/lib/commonjs/components/A11ySequence/A11ySequence.js +3 -4
- package/lib/commonjs/components/A11ySequence/A11ySequence.js.map +1 -1
- package/lib/commonjs/context/A11ySequenceOrderContext.js +2 -3
- package/lib/commonjs/context/A11ySequenceOrderContext.js.map +1 -1
- package/lib/commonjs/index.js +1 -28
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/index.web.js +2 -46
- package/lib/commonjs/index.web.js.map +1 -1
- package/lib/commonjs/nativeSpecs/A11yGroupNativeComponent.js +2 -3
- package/lib/commonjs/nativeSpecs/A11yGroupNativeComponent.js.map +1 -1
- package/lib/commonjs/nativeSpecs/A11yIndexNativeComponent.js +3 -5
- package/lib/commonjs/nativeSpecs/A11yIndexNativeComponent.js.map +1 -1
- package/lib/commonjs/nativeSpecs/A11yOrderNativeComponent.js +2 -3
- package/lib/commonjs/nativeSpecs/A11yOrderNativeComponent.js.map +1 -1
- package/lib/commonjs/types/A11yGroup.types.js.map +1 -1
- package/lib/commonjs/types/A11yIndex.types.js.map +1 -1
- package/lib/commonjs/types/A11yModule.types.js.map +1 -1
- package/lib/module/components/A11yGroup/A11yGroup.android.js +3 -4
- package/lib/module/components/A11yGroup/A11yGroup.android.js.map +1 -1
- package/lib/module/components/A11yGroup/A11yGroup.ios.js.map +1 -1
- package/lib/module/components/A11yGroup/A11yGroup.js.map +1 -1
- package/lib/module/components/A11yIndex/A11yIndex.js +8 -9
- package/lib/module/components/A11yIndex/A11yIndex.js.map +1 -1
- package/lib/module/components/A11yIndex/A11yIndex.web.js +3 -3
- package/lib/module/components/A11yIndex/A11yIndex.web.js.map +1 -1
- package/lib/module/components/A11ySequence/A11ySequence.js +1 -1
- package/lib/module/components/A11ySequence/A11ySequence.js.map +1 -1
- package/lib/module/context/A11ySequenceOrderContext.js.map +1 -1
- package/lib/module/index.js +0 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.web.js +0 -40
- package/lib/module/index.web.js.map +1 -1
- package/lib/module/nativeSpecs/A11yGroupNativeComponent.js.map +1 -1
- package/lib/module/nativeSpecs/A11yIndexNativeComponent.js.map +1 -1
- package/lib/module/nativeSpecs/A11yOrderNativeComponent.js.map +1 -1
- package/lib/module/types/A11yGroup.types.js.map +1 -1
- package/lib/module/types/A11yIndex.types.js.map +1 -1
- package/lib/module/types/A11yModule.types.js.map +1 -1
- package/lib/typescript/components/A11yGroup/A11yGroup.android.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +0 -3
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/index.web.d.ts +1 -39
- package/lib/typescript/index.web.d.ts.map +1 -1
- package/package.json +12 -4
- package/src/components/A11yGroup/A11yGroup.android.tsx +2 -3
- package/src/components/A11yIndex/A11yIndex.tsx +2 -2
- package/src/components/A11yIndex/A11yIndex.web.tsx +2 -2
- package/src/index.ts +0 -8
- package/src/index.web.ts +0 -43
- package/android/src/main/java/com/a11yorder/A11yOrderModule.java +0 -84
- package/android/src/newarch/A11yOrderSpec.java +0 -9
- package/android/src/oldarch/A11yOrderSpec.java +0 -15
- package/ios/A11yOrder.h +0 -6
- package/ios/A11yOrder.mm +0 -72
- package/lib/commonjs/A11yModule/helper.js +0 -21
- package/lib/commonjs/A11yModule/helper.js.map +0 -1
- package/lib/commonjs/A11yModule/index.js +0 -20
- package/lib/commonjs/A11yModule/index.js.map +0 -1
- package/lib/commonjs/A11yModule/module.js +0 -24
- package/lib/commonjs/A11yModule/module.js.map +0 -1
- package/lib/commonjs/components/A11yOrder/A11yOrder.js +0 -40
- package/lib/commonjs/components/A11yOrder/A11yOrder.js.map +0 -1
- package/lib/commonjs/hooks/index.js +0 -27
- package/lib/commonjs/hooks/index.js.map +0 -1
- package/lib/commonjs/hooks/useA11yOrderManager/index.js +0 -13
- package/lib/commonjs/hooks/useA11yOrderManager/index.js.map +0 -1
- package/lib/commonjs/hooks/useA11yOrderManager/useA11yOrderManager.js +0 -74
- package/lib/commonjs/hooks/useA11yOrderManager/useA11yOrderManager.js.map +0 -1
- package/lib/commonjs/hooks/useDynamicFocusOrder/index.js +0 -20
- package/lib/commonjs/hooks/useDynamicFocusOrder/index.js.map +0 -1
- package/lib/commonjs/hooks/useDynamicFocusOrder/useDynamicFocusOrder.js +0 -36
- package/lib/commonjs/hooks/useDynamicFocusOrder/useDynamicFocusOrder.js.map +0 -1
- package/lib/commonjs/hooks/useDynamicFocusOrder/useDynamicFocusOrder.types.js +0 -6
- package/lib/commonjs/hooks/useDynamicFocusOrder/useDynamicFocusOrder.types.js.map +0 -1
- package/lib/commonjs/hooks/useFocusOrder/index.js +0 -13
- package/lib/commonjs/hooks/useFocusOrder/index.js.map +0 -1
- package/lib/commonjs/hooks/useFocusOrder/useFocusOrder.js +0 -32
- package/lib/commonjs/hooks/useFocusOrder/useFocusOrder.js.map +0 -1
- package/lib/commonjs/hooks/useFocusOrder/useFocusOrder.types.js +0 -6
- package/lib/commonjs/hooks/useFocusOrder/useFocusOrder.types.js.map +0 -1
- package/lib/commonjs/nativeSpecs/NativeA11yOrder.js +0 -10
- package/lib/commonjs/nativeSpecs/NativeA11yOrder.js.map +0 -1
- package/lib/commonjs/types/A11yOrder.types.js +0 -6
- package/lib/commonjs/types/A11yOrder.types.js.map +0 -1
- package/lib/module/A11yModule/helper.js +0 -14
- package/lib/module/A11yModule/helper.js.map +0 -1
- package/lib/module/A11yModule/index.js +0 -3
- package/lib/module/A11yModule/index.js.map +0 -1
- package/lib/module/A11yModule/module.js +0 -18
- package/lib/module/A11yModule/module.js.map +0 -1
- package/lib/module/components/A11yOrder/A11yOrder.js +0 -31
- package/lib/module/components/A11yOrder/A11yOrder.js.map +0 -1
- package/lib/module/hooks/index.js +0 -4
- package/lib/module/hooks/index.js.map +0 -1
- package/lib/module/hooks/useA11yOrderManager/index.js +0 -2
- package/lib/module/hooks/useA11yOrderManager/index.js.map +0 -1
- package/lib/module/hooks/useA11yOrderManager/useA11yOrderManager.js +0 -66
- package/lib/module/hooks/useA11yOrderManager/useA11yOrderManager.js.map +0 -1
- package/lib/module/hooks/useDynamicFocusOrder/index.js +0 -3
- package/lib/module/hooks/useDynamicFocusOrder/index.js.map +0 -1
- package/lib/module/hooks/useDynamicFocusOrder/useDynamicFocusOrder.js +0 -29
- package/lib/module/hooks/useDynamicFocusOrder/useDynamicFocusOrder.js.map +0 -1
- package/lib/module/hooks/useDynamicFocusOrder/useDynamicFocusOrder.types.js +0 -2
- package/lib/module/hooks/useDynamicFocusOrder/useDynamicFocusOrder.types.js.map +0 -1
- package/lib/module/hooks/useFocusOrder/index.js +0 -2
- package/lib/module/hooks/useFocusOrder/index.js.map +0 -1
- package/lib/module/hooks/useFocusOrder/useFocusOrder.js +0 -25
- package/lib/module/hooks/useFocusOrder/useFocusOrder.js.map +0 -1
- package/lib/module/hooks/useFocusOrder/useFocusOrder.types.js +0 -2
- package/lib/module/hooks/useFocusOrder/useFocusOrder.types.js.map +0 -1
- package/lib/module/nativeSpecs/NativeA11yOrder.js +0 -3
- package/lib/module/nativeSpecs/NativeA11yOrder.js.map +0 -1
- package/lib/module/types/A11yOrder.types.js +0 -2
- package/lib/module/types/A11yOrder.types.js.map +0 -1
- package/lib/typescript/A11yModule/helper.d.ts +0 -4
- package/lib/typescript/A11yModule/helper.d.ts.map +0 -1
- package/lib/typescript/A11yModule/index.d.ts +0 -3
- package/lib/typescript/A11yModule/index.d.ts.map +0 -1
- package/lib/typescript/A11yModule/module.d.ts +0 -2
- package/lib/typescript/A11yModule/module.d.ts.map +0 -1
- package/lib/typescript/components/A11yOrder/A11yOrder.d.ts +0 -8
- package/lib/typescript/components/A11yOrder/A11yOrder.d.ts.map +0 -1
- package/lib/typescript/hooks/index.d.ts +0 -4
- package/lib/typescript/hooks/index.d.ts.map +0 -1
- package/lib/typescript/hooks/useA11yOrderManager/index.d.ts +0 -2
- package/lib/typescript/hooks/useA11yOrderManager/index.d.ts.map +0 -1
- package/lib/typescript/hooks/useA11yOrderManager/useA11yOrderManager.d.ts +0 -15
- package/lib/typescript/hooks/useA11yOrderManager/useA11yOrderManager.d.ts.map +0 -1
- package/lib/typescript/hooks/useDynamicFocusOrder/index.d.ts +0 -3
- package/lib/typescript/hooks/useDynamicFocusOrder/index.d.ts.map +0 -1
- package/lib/typescript/hooks/useDynamicFocusOrder/useDynamicFocusOrder.d.ts +0 -9
- package/lib/typescript/hooks/useDynamicFocusOrder/useDynamicFocusOrder.d.ts.map +0 -1
- package/lib/typescript/hooks/useDynamicFocusOrder/useDynamicFocusOrder.types.d.ts +0 -12
- package/lib/typescript/hooks/useDynamicFocusOrder/useDynamicFocusOrder.types.d.ts.map +0 -1
- package/lib/typescript/hooks/useFocusOrder/index.d.ts +0 -2
- package/lib/typescript/hooks/useFocusOrder/index.d.ts.map +0 -1
- package/lib/typescript/hooks/useFocusOrder/useFocusOrder.d.ts +0 -9
- package/lib/typescript/hooks/useFocusOrder/useFocusOrder.d.ts.map +0 -1
- package/lib/typescript/hooks/useFocusOrder/useFocusOrder.types.d.ts +0 -6
- package/lib/typescript/hooks/useFocusOrder/useFocusOrder.types.d.ts.map +0 -1
- package/lib/typescript/nativeSpecs/NativeA11yOrder.d.ts +0 -7
- package/lib/typescript/nativeSpecs/NativeA11yOrder.d.ts.map +0 -1
- package/lib/typescript/types/A11yOrder.types.d.ts +0 -10
- package/lib/typescript/types/A11yOrder.types.d.ts.map +0 -1
- package/src/A11yModule/helper.ts +0 -20
- package/src/A11yModule/index.tsx +0 -2
- package/src/A11yModule/module.ts +0 -32
- package/src/components/A11yOrder/A11yOrder.tsx +0 -38
- package/src/hooks/index.ts +0 -3
- package/src/hooks/useA11yOrderManager/index.ts +0 -1
- package/src/hooks/useA11yOrderManager/useA11yOrderManager.ts +0 -88
- package/src/hooks/useDynamicFocusOrder/index.ts +0 -2
- package/src/hooks/useDynamicFocusOrder/useDynamicFocusOrder.ts +0 -41
- package/src/hooks/useDynamicFocusOrder/useDynamicFocusOrder.types.ts +0 -12
- package/src/hooks/useFocusOrder/index.ts +0 -1
- package/src/hooks/useFocusOrder/useFocusOrder.ts +0 -36
- package/src/hooks/useFocusOrder/useFocusOrder.types.ts +0 -9
- package/src/nativeSpecs/NativeA11yOrder.ts +0 -7
- package/src/types/A11yOrder.types.ts +0 -9
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["findNodeHandle","setA11yOrder","setA11yElementsOrder","_ref","tag","views","targetView","current","tags","map","view","filter","Boolean"],"sourceRoot":"../../../src","sources":["A11yModule/helper.ts"],"mappings":"AAAA,SAASA,cAAc,QAAQ,cAAc;AAE7C,SAASC,YAAY,QAAQ,UAAU;AAGvC,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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["setA11yElementsOrder","setA11yOrder"],"sourceRoot":"../../../src","sources":["A11yModule/index.tsx"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ,UAAU;AAC/C,SAASC,YAAY,QAAQ,UAAU"}
|
|
@@ -1,18 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
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); }
|
|
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 = _ref => {
|
|
9
|
-
let {
|
|
10
|
-
a11yOrder,
|
|
11
|
-
onLayout,
|
|
12
|
-
ignoreWarn,
|
|
13
|
-
...props
|
|
14
|
-
} = _ref;
|
|
15
|
-
if (!ignoreWarn) {
|
|
16
|
-
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');
|
|
17
|
-
}
|
|
18
|
-
const onLayoutHandler = useCallback(e => {
|
|
19
|
-
onLayout === null || onLayout === void 0 ? void 0 : onLayout(e);
|
|
20
|
-
a11yOrder.onLayout();
|
|
21
|
-
}, [a11yOrder, onLayout]);
|
|
22
|
-
const id = (useId === null || useId === void 0 ? void 0 : useId()) || 'mock_id'; // ToDo: use native component with tag to nativeTag
|
|
23
|
-
|
|
24
|
-
return /*#__PURE__*/React.createElement(View, _extends({
|
|
25
|
-
nativeID: id
|
|
26
|
-
}, props, {
|
|
27
|
-
onLayout: onLayoutHandler,
|
|
28
|
-
ref: a11yOrder.ref
|
|
29
|
-
}));
|
|
30
|
-
};
|
|
31
|
-
//# sourceMappingURL=A11yOrder.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","useCallback","useId","View","A11yOrder","_ref","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,GAAGC,IAAA,IAK7C;EAAA,IAL8C;IAClDC,SAAS;IACTC,QAAQ;IACRC,UAAU;IACV,GAAGC;EACL,CAAC,GAAAJ,IAAA;EACC,IAAI,CAACG,UAAU,EAAE;IACfE,OAAO,CAACC,IAAI,CACV,6LACF,CAAC;EACH;EACA,MAAMC,eAAe,GAAGX,WAAW,CAChCY,CAAoB,IAAK;IACxBN,QAAQ,aAARA,QAAQ,uBAARA,QAAQ,CAAGM,CAAC,CAAC;IACbP,SAAS,CAACC,QAAQ,CAAC,CAAC;EACtB,CAAC,EACD,CAACD,SAAS,EAAEC,QAAQ,CACtB,CAAC;EAED,MAAMO,EAAE,GAAG,CAAAZ,KAAK,aAALA,KAAK,uBAALA,KAAK,CAAG,CAAC,KAAI,SAAS,CAAC,CAAC;;EAEnC,oBACEF,KAAA,CAAAe,aAAA,CAACZ,IAAI,EAAAa,QAAA;IACHC,QAAQ,EAAEH;EAAG,GACTL,KAAK;IACTF,QAAQ,EAAEK,eAAgB;IAC1BM,GAAG,EAAEZ,SAAS,CAACY;EAAI,EACpB,CAAC;AAEN,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["useA11yOrderManager","useFocusOrder","useDynamicFocusOrder"],"sourceRoot":"../../../src","sources":["hooks/index.ts"],"mappings":"AAAA,SAASA,mBAAmB,QAAQ,uBAAuB;AAC3D,SAASC,aAAa,QAAQ,iBAAiB;AAC/C,SAASC,oBAAoB,QAAQ,wBAAwB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["useA11yOrderManager"],"sourceRoot":"../../../../src","sources":["hooks/useA11yOrderManager/index.ts"],"mappings":"AAAA,SAASA,mBAAmB,QAAQ,uBAAuB"}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { useRef, useCallback, useMemo } from 'react';
|
|
2
|
-
import { Platform } from 'react-native';
|
|
3
|
-
import { setA11yElementsOrder } from '../../A11yModule';
|
|
4
|
-
export const debounce = function (callback) {
|
|
5
|
-
let timeout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 100;
|
|
6
|
-
let timer;
|
|
7
|
-
return function () {
|
|
8
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
9
|
-
args[_key] = arguments[_key];
|
|
10
|
-
}
|
|
11
|
-
if (timer) {
|
|
12
|
-
clearTimeout(timer);
|
|
13
|
-
timer = null;
|
|
14
|
-
}
|
|
15
|
-
timer = setTimeout(() => callback(args), timeout);
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
const SECONDS_PER_FRAME = 16;
|
|
19
|
-
const COUNT_OF_FRAMES = 1;
|
|
20
|
-
const DEBOUNCE_DELAY = SECONDS_PER_FRAME * COUNT_OF_FRAMES;
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* @deprecated The method should not be used
|
|
24
|
-
* 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
|
|
25
|
-
*/
|
|
26
|
-
export const useA11yOrderManager = (orderRef, onlyFor, ignoreWarn) => {
|
|
27
|
-
if (!ignoreWarn) {
|
|
28
|
-
console.warn('useA11yOrderManager: 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');
|
|
29
|
-
}
|
|
30
|
-
const currentRef = useRef([]);
|
|
31
|
-
const registeredRefs = useRef([]);
|
|
32
|
-
const refWasUpdated = useRef(false);
|
|
33
|
-
const setOrder = useCallback(() => {
|
|
34
|
-
if (!onlyFor || onlyFor === Platform.OS) {
|
|
35
|
-
setA11yElementsOrder({
|
|
36
|
-
tag: orderRef,
|
|
37
|
-
views: registeredRefs.current
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
}, [onlyFor, orderRef]);
|
|
41
|
-
const debounceOrder = useMemo(() => debounce(setOrder, DEBOUNCE_DELAY), [setOrder]);
|
|
42
|
-
const registerOrderRef = useCallback(order => ref => {
|
|
43
|
-
refWasUpdated.current = true;
|
|
44
|
-
registeredRefs.current[order] = ref;
|
|
45
|
-
}, []);
|
|
46
|
-
const updateRefList = useCallback(() => {
|
|
47
|
-
if (!refWasUpdated.current) {
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
refWasUpdated.current = false;
|
|
51
|
-
currentRef.current = registeredRefs.current.filter(v => v);
|
|
52
|
-
debounceOrder();
|
|
53
|
-
}, [debounceOrder]);
|
|
54
|
-
const reset = useCallback(() => {
|
|
55
|
-
currentRef.current = [];
|
|
56
|
-
registeredRefs.current = [];
|
|
57
|
-
refWasUpdated.current = false;
|
|
58
|
-
}, []);
|
|
59
|
-
return {
|
|
60
|
-
registerOrderRef,
|
|
61
|
-
updateRefList,
|
|
62
|
-
reset,
|
|
63
|
-
setOrder
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
|
-
//# sourceMappingURL=useA11yOrderManager.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["useRef","useCallback","useMemo","Platform","setA11yElementsOrder","debounce","callback","timeout","arguments","length","undefined","timer","_len","args","Array","_key","clearTimeout","setTimeout","SECONDS_PER_FRAME","COUNT_OF_FRAMES","DEBOUNCE_DELAY","useA11yOrderManager","orderRef","onlyFor","ignoreWarn","console","warn","currentRef","registeredRefs","refWasUpdated","setOrder","OS","tag","views","current","debounceOrder","registerOrderRef","order","ref","updateRefList","filter","v","reset"],"sourceRoot":"../../../../src","sources":["hooks/useA11yOrderManager/useA11yOrderManager.ts"],"mappings":"AAAA,SAASA,MAAM,EAAEC,WAAW,EAAaC,OAAO,QAAQ,OAAO;AAC/D,SAASC,QAAQ,QAAQ,cAAc;AAEvC,SAASC,oBAAoB,QAAQ,kBAAkB;AAEvD,OAAO,MAAMC,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;AAED,MAAMW,iBAAiB,GAAG,EAAE;AAC5B,MAAMC,eAAe,GAAG,CAAC;AAEzB,MAAMC,cAAc,GAAGF,iBAAiB,GAAGC,eAAe;;AAE1D;AACA;AACA;AACA;AACA,OAAO,MAAME,mBAAmB,GAAGA,CACjCC,QAAyB,EACzBC,OAAwB,EACxBC,UAAoB,KACjB;EACH,IAAI,CAACA,UAAU,EAAE;IACfC,OAAO,CAACC,IAAI,CACV,uMACF,CAAC;EACH;EACA,MAAMC,UAAU,GAAG3B,MAAM,CAAe,EAAE,CAAC;EAC3C,MAAM4B,cAAc,GAAG5B,MAAM,CAAe,EAAE,CAAC;EAE/C,MAAM6B,aAAa,GAAG7B,MAAM,CAAU,KAAK,CAAC;EAE5C,MAAM8B,QAAQ,GAAG7B,WAAW,CAAC,MAAM;IACjC,IAAI,CAACsB,OAAO,IAAIA,OAAO,KAAKpB,QAAQ,CAAC4B,EAAE,EAAE;MACvC3B,oBAAoB,CAAC;QACnB4B,GAAG,EAAEV,QAAQ;QACbW,KAAK,EAAEL,cAAc,CAACM;MACxB,CAAC,CAAC;IACJ;EACF,CAAC,EAAE,CAACX,OAAO,EAAED,QAAQ,CAAC,CAAC;EAEvB,MAAMa,aAAa,GAAGjC,OAAO,CAC3B,MAAMG,QAAQ,CAACyB,QAAQ,EAAEV,cAAc,CAAC,EACxC,CAACU,QAAQ,CACX,CAAC;EAED,MAAMM,gBAAgB,GAAGnC,WAAW,CACjCoC,KAAa,IACXC,GAAa,IAAW;IACvBT,aAAa,CAACK,OAAO,GAAG,IAAI;IAC5BN,cAAc,CAACM,OAAO,CAACG,KAAK,CAAC,GAAGC,GAAG;EACrC,CAAC,EACH,EACF,CAAC;EAED,MAAMC,aAAa,GAAGtC,WAAW,CAAC,MAAM;IACtC,IAAI,CAAC4B,aAAa,CAACK,OAAO,EAAE;MAC1B;IACF;IAEAL,aAAa,CAACK,OAAO,GAAG,KAAK;IAC7BP,UAAU,CAACO,OAAO,GAAGN,cAAc,CAACM,OAAO,CAACM,MAAM,CAAEC,CAAC,IAAKA,CAAC,CAAC;IAE5DN,aAAa,CAAC,CAAC;EACjB,CAAC,EAAE,CAACA,aAAa,CAAC,CAAC;EAEnB,MAAMO,KAAK,GAAGzC,WAAW,CAAC,MAAM;IAC9B0B,UAAU,CAACO,OAAO,GAAG,EAAE;IACvBN,cAAc,CAACM,OAAO,GAAG,EAAE;IAC3BL,aAAa,CAACK,OAAO,GAAG,KAAK;EAC/B,CAAC,EAAE,EAAE,CAAC;EAEN,OAAO;IACLE,gBAAgB;IAChBG,aAAa;IACbG,KAAK;IACLZ;EACF,CAAC;AACH,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["useDynamicFocusOrder","UseDynamicFocusOrder"],"sourceRoot":"../../../../src","sources":["hooks/useDynamicFocusOrder/index.ts"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ,wBAAwB;AAC7D,SAASC,oBAAoB,QAAQ,8BAA8B"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { useRef, useLayoutEffect } from 'react';
|
|
2
|
-
import { useA11yOrderManager } from '../useA11yOrderManager';
|
|
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 const useDynamicFocusOrder = (onlyFor, ignoreWarn) => {
|
|
8
|
-
if (!ignoreWarn) {
|
|
9
|
-
console.warn('useDynamicFocusOrder: 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');
|
|
10
|
-
}
|
|
11
|
-
const a11yOrderRef = useRef(null);
|
|
12
|
-
const {
|
|
13
|
-
registerOrderRef: registerOrder,
|
|
14
|
-
updateRefList,
|
|
15
|
-
reset,
|
|
16
|
-
setOrder
|
|
17
|
-
} = useA11yOrderManager(a11yOrderRef, onlyFor);
|
|
18
|
-
useLayoutEffect(updateRefList);
|
|
19
|
-
return {
|
|
20
|
-
a11yOrder: {
|
|
21
|
-
ref: a11yOrderRef,
|
|
22
|
-
onLayout: updateRefList
|
|
23
|
-
},
|
|
24
|
-
registerOrder,
|
|
25
|
-
reset,
|
|
26
|
-
setOrder
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
//# sourceMappingURL=useDynamicFocusOrder.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["useRef","useLayoutEffect","useA11yOrderManager","useDynamicFocusOrder","onlyFor","ignoreWarn","console","warn","a11yOrderRef","registerOrderRef","registerOrder","updateRefList","reset","setOrder","a11yOrder","ref","onLayout"],"sourceRoot":"../../../../src","sources":["hooks/useDynamicFocusOrder/useDynamicFocusOrder.ts"],"mappings":"AAAA,SAASA,MAAM,EAAEC,eAAe,QAAQ,OAAO;AAG/C,SAASC,mBAAmB,QAAQ,wBAAwB;AAG5D;AACA;AACA;AACA;AACA,OAAO,MAAMC,oBAAoB,GAAGA,CAClCC,OAAwB,EACxBC,UAAoB,KACQ;EAC5B,IAAI,CAACA,UAAU,EAAE;IACfC,OAAO,CAACC,IAAI,CACV,wMACF,CAAC;EACH;EAEA,MAAMC,YAAY,GAAGR,MAAM,CAAO,IAAI,CAAC;EAEvC,MAAM;IACJS,gBAAgB,EAAEC,aAAa;IAC/BC,aAAa;IACbC,KAAK;IACLC;EACF,CAAC,GAAGX,mBAAmB,CAACM,YAAY,EAAEJ,OAAO,CAAC;EAE9CH,eAAe,CAACU,aAAa,CAAC;EAE9B,OAAO;IACLG,SAAS,EAAE;MACTC,GAAG,EAAEP,YAAY;MACjBQ,QAAQ,EAAEL;IACZ,CAAC;IACDD,aAAa;IACbE,KAAK;IACLC;EACF,CAAC;AACH,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["hooks/useDynamicFocusOrder/useDynamicFocusOrder.types.ts"],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["useFocusOrder"],"sourceRoot":"../../../../src","sources":["hooks/useFocusOrder/index.ts"],"mappings":"AAAA,SAASA,aAAa,QAAQ,iBAAiB"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { useRef } from 'react';
|
|
2
|
-
import { useDynamicFocusOrder } from '../useDynamicFocusOrder';
|
|
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 const useFocusOrder = (size, onlyFor, ignoreWarn) => {
|
|
8
|
-
if (!ignoreWarn) {
|
|
9
|
-
console.warn('useFocusOrder: 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');
|
|
10
|
-
}
|
|
11
|
-
const {
|
|
12
|
-
a11yOrder,
|
|
13
|
-
registerOrder,
|
|
14
|
-
reset,
|
|
15
|
-
setOrder
|
|
16
|
-
} = useDynamicFocusOrder(onlyFor);
|
|
17
|
-
const refs = useRef(Array(size).fill(null).map((_, i) => registerOrder(i))).current;
|
|
18
|
-
return {
|
|
19
|
-
a11yOrder,
|
|
20
|
-
refs,
|
|
21
|
-
reset,
|
|
22
|
-
setOrder
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
//# sourceMappingURL=useFocusOrder.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["useRef","useDynamicFocusOrder","useFocusOrder","size","onlyFor","ignoreWarn","console","warn","a11yOrder","registerOrder","reset","setOrder","refs","Array","fill","map","_","i","current"],"sourceRoot":"../../../../src","sources":["hooks/useFocusOrder/useFocusOrder.ts"],"mappings":"AAAA,SAASA,MAAM,QAAQ,OAAO;AAE9B,SAASC,oBAAoB,QAAQ,yBAAyB;AAG9D;AACA;AACA;AACA;AACA,OAAO,MAAMC,aAAa,GAAGA,CAC3BC,IAAY,EACZC,OAAwB,EACxBC,UAAoB,KACE;EACtB,IAAI,CAACA,UAAU,EAAE;IACfC,OAAO,CAACC,IAAI,CACV,iMACF,CAAC;EACH;EAEA,MAAM;IAAEC,SAAS;IAAEC,aAAa;IAAEC,KAAK;IAAEC;EAAS,CAAC,GACjDV,oBAAoB,CAACG,OAAO,CAAC;EAE/B,MAAMQ,IAAI,GAAGZ,MAAM,CACjBa,KAAK,CAACV,IAAI,CAAC,CACRW,IAAI,CAAC,IAAI,CAAC,CACVC,GAAG,CAAC,CAACC,CAAC,EAAEC,CAAC,KAAKR,aAAa,CAACQ,CAAC,CAAC,CACnC,CAAC,CAACC,OAAO;EAET,OAAO;IACLV,SAAS;IACTI,IAAI;IACJF,KAAK;IACLC;EACF,CAAC;AACH,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["hooks/useFocusOrder/useFocusOrder.types.ts"],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../../src","sources":["nativeSpecs/NativeA11yOrder.ts"],"mappings":"AAAA,SAASA,mBAAmB,QAA0B,cAAc;AAMpE,eAAeA,mBAAmB,CAACC,YAAY,CAAO,WAAW,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/A11yOrder.types.ts"],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../../../src/A11yModule/helper.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE1D,eAAO,MAAM,oBAAoB,+FAchC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/A11yModule/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../src/A11yModule/module.ts"],"names":[],"mappings":"AA0BA,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,EAAE,EACd,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,MAAM,CAAC,CAEjB"}
|
|
@@ -1,8 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useA11yOrderManager/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { RefObject } from 'react';
|
|
2
|
-
import { Platform } from 'react-native';
|
|
3
|
-
import type { View } from 'react-native';
|
|
4
|
-
export declare const debounce: <T extends Function>(callback: T, timeout?: number) => (...args: any) => void;
|
|
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 declare const useA11yOrderManager: <T extends import("react").Component<{}, {}, any>>(orderRef: RefObject<View>, onlyFor?: Platform['OS'], ignoreWarn?: Boolean) => {
|
|
10
|
-
registerOrderRef: (order: number) => (ref: T | null) => void;
|
|
11
|
-
updateRefList: () => void;
|
|
12
|
-
reset: () => void;
|
|
13
|
-
setOrder: () => void;
|
|
14
|
-
};
|
|
15
|
-
//# sourceMappingURL=useA11yOrderManager.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useA11yOrderManager.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useA11yOrderManager/useA11yOrderManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,SAAS,EAAW,MAAM,OAAO,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAGzC,eAAO,MAAM,QAAQ,mEAGF,GAAG,SAOrB,CAAC;AAOF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,+DACpB,UAAU,IAAI,CAAC,YACf,QAAQ,CAAC,IAAI,CAAC,eACX,OAAO;8BA2BV,MAAM,wBACK,IAAI;;;;CA8B1B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useDynamicFocusOrder/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { Platform } from 'react-native';
|
|
3
|
-
import type { UseDynamicFocusOrder } from './useDynamicFocusOrder.types';
|
|
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 declare const useDynamicFocusOrder: <T extends import("react").Component<{}, {}, any>>(onlyFor?: Platform['OS'], ignoreWarn?: Boolean) => UseDynamicFocusOrder<T>;
|
|
9
|
-
//# sourceMappingURL=useDynamicFocusOrder.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useDynamicFocusOrder.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useDynamicFocusOrder/useDynamicFocusOrder.ts"],"names":[],"mappings":";AACA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,cAAc,CAAC;AAGnD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEzE;;;GAGG;AACH,eAAO,MAAM,oBAAoB,+DACrB,QAAQ,CAAC,IAAI,CAAC,eACX,OAAO,4BA4BrB,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { RefObject, RefCallback } from 'react';
|
|
2
|
-
import type { View } from 'react-native';
|
|
3
|
-
export type UseDynamicFocusOrder<T extends React.Component> = {
|
|
4
|
-
a11yOrder: {
|
|
5
|
-
ref: RefObject<View>;
|
|
6
|
-
onLayout: () => void;
|
|
7
|
-
};
|
|
8
|
-
registerOrder: (order: number) => RefCallback<T>;
|
|
9
|
-
reset: () => void;
|
|
10
|
-
setOrder: () => void;
|
|
11
|
-
};
|
|
12
|
-
//# sourceMappingURL=useDynamicFocusOrder.types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useDynamicFocusOrder.types.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useDynamicFocusOrder/useDynamicFocusOrder.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,MAAM,MAAM,oBAAoB,CAAC,CAAC,SAAS,KAAK,CAAC,SAAS,IAAI;IAC5D,SAAS,EAAE;QACT,GAAG,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;QACrB,QAAQ,EAAE,MAAM,IAAI,CAAC;KACtB,CAAC;IACF,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC;IACjD,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useFocusOrder/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { Platform } from 'react-native';
|
|
3
|
-
import type { FocusOrderInfo } from './useFocusOrder.types';
|
|
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 declare const useFocusOrder: <T extends import("react").Component<{}, {}, any>>(size: number, onlyFor?: Platform['OS'], ignoreWarn?: boolean) => FocusOrderInfo<T>;
|
|
9
|
-
//# sourceMappingURL=useFocusOrder.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useFocusOrder.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useFocusOrder/useFocusOrder.ts"],"names":[],"mappings":";AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D;;;GAGG;AACH,eAAO,MAAM,aAAa,2DAClB,MAAM,YACF,QAAQ,CAAC,IAAI,CAAC,eACX,OAAO,sBAuBrB,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { RefCallback } from 'react';
|
|
2
|
-
import type { UseDynamicFocusOrder } from '../useDynamicFocusOrder';
|
|
3
|
-
export type FocusOrderInfo<T extends React.Component> = Pick<UseDynamicFocusOrder<T>, 'a11yOrder' | 'reset' | 'setOrder'> & {
|
|
4
|
-
refs: RefCallback<T>[];
|
|
5
|
-
};
|
|
6
|
-
//# sourceMappingURL=useFocusOrder.types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useFocusOrder.types.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useFocusOrder/useFocusOrder.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAEpE,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,KAAK,CAAC,SAAS,IAAI,IAAI,CAC1D,oBAAoB,CAAC,CAAC,CAAC,EACvB,WAAW,GAAG,OAAO,GAAG,UAAU,CACnC,GAAG;IACF,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC;CACxB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NativeA11yOrder.d.ts","sourceRoot":"","sources":["../../../src/nativeSpecs/NativeA11yOrder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAErE,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,SAAS,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAC5D;;AAED,wBAAmE"}
|
|
@@ -1,10 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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/src/A11yModule/helper.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { findNodeHandle } from 'react-native';
|
|
2
|
-
|
|
3
|
-
import { setA11yOrder } from './module';
|
|
4
|
-
import { A11yOrderInfo } from '../types/A11yModule.types';
|
|
5
|
-
|
|
6
|
-
export const setA11yElementsOrder = <T extends React.Component>({
|
|
7
|
-
tag,
|
|
8
|
-
views,
|
|
9
|
-
}: A11yOrderInfo<T>) => {
|
|
10
|
-
if (!tag) return;
|
|
11
|
-
|
|
12
|
-
const targetView = findNodeHandle(tag.current as React.Component);
|
|
13
|
-
if (!targetView) return;
|
|
14
|
-
|
|
15
|
-
const tags = views
|
|
16
|
-
.map((view) => findNodeHandle(view as React.Component))
|
|
17
|
-
.filter((view) => Boolean(view)) as number[];
|
|
18
|
-
|
|
19
|
-
setA11yOrder?.(tags, targetView);
|
|
20
|
-
};
|
package/src/A11yModule/index.tsx
DELETED
package/src/A11yModule/module.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { NativeModules, Platform } from 'react-native';
|
|
2
|
-
|
|
3
|
-
const LINKING_ERROR =
|
|
4
|
-
`The package 'react-native-a11y-order' doesn't seem to be linked. Make sure: \n\n` +
|
|
5
|
-
Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
|
|
6
|
-
'- You rebuilt the app after installing the package\n' +
|
|
7
|
-
'- You are not using Expo Go\n';
|
|
8
|
-
|
|
9
|
-
// @ts-expect-error
|
|
10
|
-
const isTurboModuleEnabled = global.__turboModuleProxy != null;
|
|
11
|
-
|
|
12
|
-
const A11yOrderModule = isTurboModuleEnabled
|
|
13
|
-
? require('../nativeSpecs/NativeA11yOrder').default
|
|
14
|
-
: NativeModules.A11yOrder;
|
|
15
|
-
|
|
16
|
-
const A11yOrder = A11yOrderModule
|
|
17
|
-
? A11yOrderModule
|
|
18
|
-
: new Proxy(
|
|
19
|
-
{},
|
|
20
|
-
{
|
|
21
|
-
get() {
|
|
22
|
-
throw new Error(LINKING_ERROR);
|
|
23
|
-
},
|
|
24
|
-
}
|
|
25
|
-
);
|
|
26
|
-
|
|
27
|
-
export function setA11yOrder(
|
|
28
|
-
tags: number[],
|
|
29
|
-
targetView?: number
|
|
30
|
-
): Promise<number> {
|
|
31
|
-
return A11yOrder.setA11yOrder(tags, targetView);
|
|
32
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
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/hooks/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { useA11yOrderManager } from './useA11yOrderManager';
|