@fluentui/react-tabster 0.0.0-nightly-20230317-0436.1 → 0.0.0-nightly-20230317-1454.1
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/.swcrc +39 -0
- package/CHANGELOG.json +9 -9
- package/CHANGELOG.md +7 -7
- package/lib/focus/constants.js +4 -4
- package/lib/focus/constants.js.map +1 -1
- package/lib/focus/createCustomFocusIndicatorStyle.js +7 -7
- package/lib/focus/createCustomFocusIndicatorStyle.js.map +1 -1
- package/lib/focus/createFocusOutlineStyle.js +14 -15
- package/lib/focus/createFocusOutlineStyle.js.map +1 -1
- package/lib/focus/focusVisiblePolyfill.js +7 -7
- package/lib/focus/focusVisiblePolyfill.js.map +1 -1
- package/lib/focus/focusWithinPolyfill.js +6 -6
- package/lib/focus/focusWithinPolyfill.js.map +1 -1
- package/lib/focus/index.js +4 -4
- package/lib/focus/index.js.map +1 -1
- package/lib/hooks/index.js +8 -8
- package/lib/hooks/index.js.map +1 -1
- package/lib/hooks/useArrowNavigationGroup.js +8 -8
- package/lib/hooks/useArrowNavigationGroup.js.map +1 -1
- package/lib/hooks/useFocusFinders.js +7 -7
- package/lib/hooks/useFocusFinders.js.map +1 -1
- package/lib/hooks/useFocusVisible.js +5 -6
- package/lib/hooks/useFocusVisible.js.map +1 -1
- package/lib/hooks/useFocusWithin.js +4 -4
- package/lib/hooks/useFocusWithin.js.map +1 -1
- package/lib/hooks/useFocusableGroup.js +7 -7
- package/lib/hooks/useFocusableGroup.js.map +1 -1
- package/lib/hooks/useKeyboardNavAttribute.js +5 -5
- package/lib/hooks/useKeyboardNavAttribute.js.map +1 -1
- package/lib/hooks/useModalAttributes.js +5 -5
- package/lib/hooks/useModalAttributes.js.map +1 -1
- package/lib/hooks/useTabster.js +5 -5
- package/lib/hooks/useTabster.js.map +1 -1
- package/lib/hooks/useTabsterAttributes.js +2 -2
- package/lib/hooks/useTabsterAttributes.js.map +1 -1
- package/lib/index.js +3 -3
- package/lib/index.js.map +1 -1
- package/lib-commonjs/focus/constants.js +23 -17
- package/lib-commonjs/focus/constants.js.map +1 -1
- package/lib-commonjs/focus/createCustomFocusIndicatorStyle.js +23 -31
- package/lib-commonjs/focus/createCustomFocusIndicatorStyle.js.map +1 -1
- package/lib-commonjs/focus/createFocusOutlineStyle.js +42 -57
- package/lib-commonjs/focus/createFocusOutlineStyle.js.map +1 -1
- package/lib-commonjs/focus/focusVisiblePolyfill.js +65 -68
- package/lib-commonjs/focus/focusVisiblePolyfill.js.map +1 -1
- package/lib-commonjs/focus/focusWithinPolyfill.js +44 -47
- package/lib-commonjs/focus/focusWithinPolyfill.js.map +1 -1
- package/lib-commonjs/focus/index.js +8 -7
- package/lib-commonjs/focus/index.js.map +1 -1
- package/lib-commonjs/hooks/index.js +12 -11
- package/lib-commonjs/hooks/index.js.map +1 -1
- package/lib-commonjs/hooks/useArrowNavigationGroup.js +42 -51
- package/lib-commonjs/hooks/useArrowNavigationGroup.js.map +1 -1
- package/lib-commonjs/hooks/useFocusFinders.js +64 -58
- package/lib-commonjs/hooks/useFocusFinders.js.map +1 -1
- package/lib-commonjs/hooks/useFocusVisible.js +23 -18
- package/lib-commonjs/hooks/useFocusVisible.js.map +1 -1
- package/lib-commonjs/hooks/useFocusWithin.js +22 -23
- package/lib-commonjs/hooks/useFocusWithin.js.map +1 -1
- package/lib-commonjs/hooks/useFocusableGroup.js +30 -32
- package/lib-commonjs/hooks/useFocusableGroup.js.map +1 -1
- package/lib-commonjs/hooks/useKeyboardNavAttribute.js +37 -38
- package/lib-commonjs/hooks/useKeyboardNavAttribute.js.map +1 -1
- package/lib-commonjs/hooks/useModalAttributes.js +35 -44
- package/lib-commonjs/hooks/useModalAttributes.js.map +1 -1
- package/lib-commonjs/hooks/useTabster.js +36 -38
- package/lib-commonjs/hooks/useTabster.js.map +1 -1
- package/lib-commonjs/hooks/useTabsterAttributes.js +14 -16
- package/lib-commonjs/hooks/useTabsterAttributes.js.map +1 -1
- package/lib-commonjs/index.js +25 -73
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +6 -6
@@ -1,42 +1,40 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
4
|
-
|
3
|
+
value: true
|
4
|
+
});
|
5
|
+
Object.defineProperty(exports, "useTabster", {
|
6
|
+
enumerable: true,
|
7
|
+
get: ()=>useTabster
|
5
8
|
});
|
6
|
-
|
7
|
-
const
|
8
|
-
const
|
9
|
-
const
|
10
|
-
const
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
};
|
38
|
-
}, [tabster]);
|
39
|
-
return tabster;
|
40
|
-
};
|
41
|
-
exports.useTabster = useTabster;
|
9
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
10
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
11
|
+
const _reactSharedContexts = require("@fluentui/react-shared-contexts");
|
12
|
+
const _tabster = require("tabster");
|
13
|
+
const _reactUtilities = require("@fluentui/react-utilities");
|
14
|
+
const useTabster = ()=>{
|
15
|
+
const { targetDocument } = (0, _reactSharedContexts.useFluent_unstable)();
|
16
|
+
const defaultView = targetDocument?.defaultView || undefined;
|
17
|
+
const tabster = _react.useMemo(()=>{
|
18
|
+
if (!defaultView) {
|
19
|
+
return null;
|
20
|
+
}
|
21
|
+
return (0, _tabster.createTabster)(defaultView, {
|
22
|
+
autoRoot: {},
|
23
|
+
controlTab: false
|
24
|
+
});
|
25
|
+
}, [
|
26
|
+
defaultView
|
27
|
+
]);
|
28
|
+
(0, _reactUtilities.useIsomorphicLayoutEffect)(()=>{
|
29
|
+
return ()=>{
|
30
|
+
if (tabster) {
|
31
|
+
(0, _tabster.disposeTabster)(tabster);
|
32
|
+
}
|
33
|
+
};
|
34
|
+
}, [
|
35
|
+
tabster
|
36
|
+
]);
|
37
|
+
return tabster;
|
38
|
+
}; //# sourceMappingURL=useTabster.js.map
|
39
|
+
|
42
40
|
//# sourceMappingURL=useTabster.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../../lib/hooks/useTabster.js"],"sourcesContent":["import * as React from \"react\";\nimport { useFluent_unstable as useFluent } from \"@fluentui/react-shared-contexts\";\nimport { createTabster, disposeTabster } from \"tabster\";\nimport { useIsomorphicLayoutEffect } from \"@fluentui/react-utilities\";\n/**\n * Tries to get a tabster instance on the current window or creates a new one\n * Since Tabster is single instance only, feel free to call this hook to ensure Tabster exists if necessary\n *\n * @internal\n * @returns Tabster core instance\n */\nexport const useTabster = () => {\n const {\n targetDocument\n } = useFluent();\n const defaultView = targetDocument?.defaultView || undefined;\n const tabster = React.useMemo(() => {\n if (!defaultView) {\n return null;\n }\n return createTabster(defaultView, {\n autoRoot: {},\n controlTab: false\n });\n }, [defaultView]);\n useIsomorphicLayoutEffect(() => {\n return () => {\n if (tabster) {\n disposeTabster(tabster);\n }\n };\n }, [tabster]);\n return tabster;\n};\n//# sourceMappingURL=useTabster.js.map"],"names":["useTabster","targetDocument","useFluent","defaultView","undefined","tabster","React","useMemo","createTabster","autoRoot","controlTab","useIsomorphicLayoutEffect","disposeTabster"],"mappings":";;;;+BAWaA;;aAAAA;;;6DAXU;qCACyB;yBACF;gCACJ;AAQnC,MAAMA,aAAa,IAAM;IAC9B,MAAM,EACJC,eAAc,EACf,GAAGC,IAAAA,uCAAS;IACb,MAAMC,cAAcF,gBAAgBE,eAAeC;IACnD,MAAMC,UAAUC,OAAMC,OAAO,CAAC,IAAM;QAClC,IAAI,CAACJ,aAAa;YAChB,OAAO,IAAI;QACb,CAAC;QACD,OAAOK,IAAAA,sBAAa,EAACL,aAAa;YAChCM,UAAU,CAAC;YACXC,YAAY,KAAK;QACnB;IACF,GAAG;QAACP;KAAY;IAChBQ,IAAAA,yCAAyB,EAAC,IAAM;QAC9B,OAAO,IAAM;YACX,IAAIN,SAAS;gBACXO,IAAAA,uBAAc,EAACP;YACjB,CAAC;QACH;IACF,GAAG;QAACA;KAAQ;IACZ,OAAOA;AACT,GACA,sCAAsC"}
|
@@ -1,20 +1,18 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
4
|
-
|
3
|
+
value: true
|
4
|
+
});
|
5
|
+
Object.defineProperty(exports, "useTabsterAttributes", {
|
6
|
+
enumerable: true,
|
7
|
+
get: ()=>useTabsterAttributes
|
5
8
|
});
|
6
|
-
|
7
|
-
const
|
8
|
-
const
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
// but calling the hook will ensure that a tabster instance exists internally and avoids consumers doing the same
|
16
|
-
useTabster_1.useTabster();
|
17
|
-
return tabster_1.getTabsterAttribute(props);
|
18
|
-
};
|
19
|
-
exports.useTabsterAttributes = useTabsterAttributes;
|
9
|
+
const _tabster = require("tabster");
|
10
|
+
const _useTabster = require("./useTabster");
|
11
|
+
const useTabsterAttributes = (props)=>{
|
12
|
+
// A tabster instance is not necessary to generate tabster attributes
|
13
|
+
// but calling the hook will ensure that a tabster instance exists internally and avoids consumers doing the same
|
14
|
+
(0, _useTabster.useTabster)();
|
15
|
+
return (0, _tabster.getTabsterAttribute)(props);
|
16
|
+
}; //# sourceMappingURL=useTabsterAttributes.js.map
|
17
|
+
|
20
18
|
//# sourceMappingURL=useTabsterAttributes.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../../lib/hooks/useTabsterAttributes.js"],"sourcesContent":["import { getTabsterAttribute } from \"tabster\";\nimport { useTabster } from \"./useTabster\";\n/**\n * @internal\n * Hook that returns tabster attributes while ensuring tabster exists\n */\nexport const useTabsterAttributes = props => {\n // A tabster instance is not necessary to generate tabster attributes\n // but calling the hook will ensure that a tabster instance exists internally and avoids consumers doing the same\n useTabster();\n return getTabsterAttribute(props);\n};\n//# sourceMappingURL=useTabsterAttributes.js.map"],"names":["useTabsterAttributes","props","useTabster","getTabsterAttribute"],"mappings":";;;;+BAMaA;;aAAAA;;yBANuB;4BACT;AAKpB,MAAMA,uBAAuBC,CAAAA,QAAS;IAC3C,qEAAqE;IACrE,iHAAiH;IACjHC,IAAAA,sBAAU;IACV,OAAOC,IAAAA,4BAAmB,EAACF;AAC7B,GACA,gDAAgD"}
|
package/lib-commonjs/index.js
CHANGED
@@ -1,76 +1,28 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
4
|
-
|
5
|
-
});
|
6
|
-
|
7
|
-
var
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
return index_1.useFocusVisible;
|
30
|
-
}
|
31
|
-
});
|
32
|
-
Object.defineProperty(exports, "useFocusWithin", {
|
33
|
-
enumerable: true,
|
34
|
-
get: function () {
|
35
|
-
return index_1.useFocusWithin;
|
36
|
-
}
|
37
|
-
});
|
38
|
-
Object.defineProperty(exports, "useKeyboardNavAttribute", {
|
39
|
-
enumerable: true,
|
40
|
-
get: function () {
|
41
|
-
return index_1.useKeyboardNavAttribute;
|
42
|
-
}
|
43
|
-
});
|
44
|
-
Object.defineProperty(exports, "useModalAttributes", {
|
45
|
-
enumerable: true,
|
46
|
-
get: function () {
|
47
|
-
return index_1.useModalAttributes;
|
48
|
-
}
|
49
|
-
});
|
50
|
-
Object.defineProperty(exports, "useTabsterAttributes", {
|
51
|
-
enumerable: true,
|
52
|
-
get: function () {
|
53
|
-
return index_1.useTabsterAttributes;
|
54
|
-
}
|
55
|
-
});
|
56
|
-
var index_2 = /*#__PURE__*/require("./focus/index");
|
57
|
-
Object.defineProperty(exports, "createCustomFocusIndicatorStyle", {
|
58
|
-
enumerable: true,
|
59
|
-
get: function () {
|
60
|
-
return index_2.createCustomFocusIndicatorStyle;
|
61
|
-
}
|
62
|
-
});
|
63
|
-
Object.defineProperty(exports, "createFocusOutlineStyle", {
|
64
|
-
enumerable: true,
|
65
|
-
get: function () {
|
66
|
-
return index_2.createFocusOutlineStyle;
|
67
|
-
}
|
68
|
-
});
|
69
|
-
var index_3 = /*#__PURE__*/require("./focus/index");
|
70
|
-
Object.defineProperty(exports, "applyFocusVisiblePolyfill", {
|
71
|
-
enumerable: true,
|
72
|
-
get: function () {
|
73
|
-
return index_3.applyFocusVisiblePolyfill;
|
74
|
-
}
|
75
|
-
});
|
3
|
+
value: true
|
4
|
+
});
|
5
|
+
function _export(target, all) {
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
7
|
+
enumerable: true,
|
8
|
+
get: all[name]
|
9
|
+
});
|
10
|
+
}
|
11
|
+
_export(exports, {
|
12
|
+
useArrowNavigationGroup: ()=>_index.useArrowNavigationGroup,
|
13
|
+
useFocusableGroup: ()=>_index.useFocusableGroup,
|
14
|
+
useFocusFinders: ()=>_index.useFocusFinders,
|
15
|
+
useFocusVisible: ()=>_index.useFocusVisible,
|
16
|
+
useFocusWithin: ()=>_index.useFocusWithin,
|
17
|
+
useKeyboardNavAttribute: ()=>_index.useKeyboardNavAttribute,
|
18
|
+
useModalAttributes: ()=>_index.useModalAttributes,
|
19
|
+
useTabsterAttributes: ()=>_index.useTabsterAttributes,
|
20
|
+
createCustomFocusIndicatorStyle: ()=>_index1.createCustomFocusIndicatorStyle,
|
21
|
+
createFocusOutlineStyle: ()=>_index1.createFocusOutlineStyle,
|
22
|
+
applyFocusVisiblePolyfill: ()=>_index1.applyFocusVisiblePolyfill
|
23
|
+
});
|
24
|
+
const _index = require("./hooks/index");
|
25
|
+
const _index1 = require("./focus/index");
|
26
|
+
//# sourceMappingURL=index.js.map
|
27
|
+
|
76
28
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../lib/index.js"],"sourcesContent":["export { useArrowNavigationGroup, useFocusableGroup, useFocusFinders, useFocusVisible, useFocusWithin, useKeyboardNavAttribute, useModalAttributes, useTabsterAttributes } from \"./hooks/index\";\nexport { createCustomFocusIndicatorStyle, createFocusOutlineStyle } from \"./focus/index\";\nexport { applyFocusVisiblePolyfill } from \"./focus/index\";\n//# sourceMappingURL=index.js.map"],"names":["useArrowNavigationGroup","useFocusableGroup","useFocusFinders","useFocusVisible","useFocusWithin","useKeyboardNavAttribute","useModalAttributes","useTabsterAttributes","createCustomFocusIndicatorStyle","createFocusOutlineStyle","applyFocusVisiblePolyfill"],"mappings":";;;;;;;;;;;IAASA,uBAAuB,MAAvBA,8BAAuB;IAAEC,iBAAiB,MAAjBA,wBAAiB;IAAEC,eAAe,MAAfA,sBAAe;IAAEC,eAAe,MAAfA,sBAAe;IAAEC,cAAc,MAAdA,qBAAc;IAAEC,uBAAuB,MAAvBA,8BAAuB;IAAEC,kBAAkB,MAAlBA,yBAAkB;IAAEC,oBAAoB,MAApBA,2BAAoB;IAC/JC,+BAA+B,MAA/BA,uCAA+B;IAAEC,uBAAuB,MAAvBA,+BAAuB;IACxDC,yBAAyB,MAAzBA,iCAAyB;;uBAF8I;wBACvG;CAEzE,iCAAiC"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fluentui/react-tabster",
|
3
|
-
"version": "0.0.0-nightly-20230317-
|
3
|
+
"version": "0.0.0-nightly-20230317-1454.1",
|
4
4
|
"description": "Utilities for focus management and facade for tabster",
|
5
5
|
"main": "lib-commonjs/index.js",
|
6
6
|
"module": "lib/index.js",
|
@@ -21,7 +21,7 @@
|
|
21
21
|
"lint": "just-scripts lint",
|
22
22
|
"test": "jest --passWithNoTests",
|
23
23
|
"type-check": "tsc -b tsconfig.json",
|
24
|
-
"generate-api": "
|
24
|
+
"generate-api": "just-scripts generate-api"
|
25
25
|
},
|
26
26
|
"devDependencies": {
|
27
27
|
"@fluentui/eslint-plugin": "*",
|
@@ -31,12 +31,12 @@
|
|
31
31
|
},
|
32
32
|
"dependencies": {
|
33
33
|
"@griffel/react": "^1.5.2",
|
34
|
-
"@fluentui/react-shared-contexts": "0.0.0-nightly-20230317-
|
35
|
-
"@fluentui/react-theme": "0.0.0-nightly-20230317-
|
36
|
-
"@fluentui/react-utilities": "0.0.0-nightly-20230317-
|
34
|
+
"@fluentui/react-shared-contexts": "0.0.0-nightly-20230317-1454.1",
|
35
|
+
"@fluentui/react-theme": "0.0.0-nightly-20230317-1454.1",
|
36
|
+
"@fluentui/react-utilities": "0.0.0-nightly-20230317-1454.1",
|
37
37
|
"keyborg": "^2.0.0",
|
38
38
|
"tabster": "^4.1.1",
|
39
|
-
"
|
39
|
+
"@swc/helpers": "^0.4.14"
|
40
40
|
},
|
41
41
|
"peerDependencies": {
|
42
42
|
"@types/react": ">=16.8.0 <19.0.0",
|