@radix-ui/react-focus-guards 0.1.1-rc.7 → 1.0.0-rc.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/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -21
- package/dist/index.js.map +1 -1
- package/dist/index.module.js +1 -9
- package/dist/index.module.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAKA,4BAAqB,KAAK,EAAE,GAAG,OAG9B;AAED;;;GAGG;AACH,uCAcC;AAUD,OAAA,MAAM,wBAAkB,CAAC","sources":["packages/react/focus-guards/src/packages/react/focus-guards/src/FocusGuards.tsx","packages/react/focus-guards/src/packages/react/focus-guards/src/index.ts","packages/react/focus-guards/src/index.ts"],"sourcesContent":[null,null,"export
|
|
1
|
+
{"mappings":"AAKA,4BAAqB,KAAK,EAAE,GAAG,OAG9B;AAED;;;GAGG;AACH,uCAcC;AAUD,OAAA,MAAM,wBAAkB,CAAC","sources":["packages/react/focus-guards/src/packages/react/focus-guards/src/FocusGuards.tsx","packages/react/focus-guards/src/packages/react/focus-guards/src/index.ts","packages/react/focus-guards/src/index.ts"],"sourcesContent":[null,null,"export {\n FocusGuards,\n //\n Root,\n //\n useFocusGuards,\n} from './FocusGuards';\n"],"names":[],"version":3,"file":"index.d.ts.map"}
|
package/dist/index.js
CHANGED
|
@@ -1,29 +1,12 @@
|
|
|
1
1
|
var $cnctE$react = require("react");
|
|
2
2
|
|
|
3
|
-
function $parcel$exportWildcard(dest, source) {
|
|
4
|
-
Object.keys(source).forEach(function(key) {
|
|
5
|
-
if (key === 'default' || key === '__esModule' || dest.hasOwnProperty(key)) {
|
|
6
|
-
return;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
Object.defineProperty(dest, key, {
|
|
10
|
-
enumerable: true,
|
|
11
|
-
get: function get() {
|
|
12
|
-
return source[key];
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
return dest;
|
|
18
|
-
}
|
|
19
3
|
function $parcel$export(e, n, v, s) {
|
|
20
4
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
21
5
|
}
|
|
22
|
-
var $71476a6ed7dbbaf3$exports = {};
|
|
23
6
|
|
|
24
|
-
$parcel$export(
|
|
25
|
-
$parcel$export(
|
|
26
|
-
$parcel$export(
|
|
7
|
+
$parcel$export(module.exports, "FocusGuards", () => $71476a6ed7dbbaf3$export$ac5b58043b79449b);
|
|
8
|
+
$parcel$export(module.exports, "Root", () => $71476a6ed7dbbaf3$export$be92b6f5f03c0fe9);
|
|
9
|
+
$parcel$export(module.exports, "useFocusGuards", () => $71476a6ed7dbbaf3$export$b7ece24a22aeda8c);
|
|
27
10
|
|
|
28
11
|
/** Number of components which have requested interest to have focus guards */ let $71476a6ed7dbbaf3$var$count = 0;
|
|
29
12
|
function $71476a6ed7dbbaf3$export$ac5b58043b79449b(props) {
|
|
@@ -57,7 +40,6 @@ function $71476a6ed7dbbaf3$var$createFocusGuard() {
|
|
|
57
40
|
const $71476a6ed7dbbaf3$export$be92b6f5f03c0fe9 = $71476a6ed7dbbaf3$export$ac5b58043b79449b;
|
|
58
41
|
|
|
59
42
|
|
|
60
|
-
$parcel$exportWildcard(module.exports, $71476a6ed7dbbaf3$exports);
|
|
61
43
|
|
|
62
44
|
|
|
63
45
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;;;;;;;ACAA;AAEA,8EAAA,CACA,IAAII,2BAAK,GAAG,CAAZ,AAAA;AAEA,SAASJ,yCAAT,CAAqBK,KAArB,EAAiC;IAC/BH,yCAAc,EAAdA,CAAAA;IACA,OAAOG,KAAK,CAACC,QAAb,CAAA;CACD;AAED;;;GAGA,CACA,SAASJ,yCAAT,GAA0B;IACx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focus-guards/src/FocusGuards.tsx"],"sourcesContent":["export {\n FocusGuards,\n //\n Root,\n //\n useFocusGuards,\n} from './FocusGuards';\n","import * as React from 'react';\n\n/** Number of components which have requested interest to have focus guards */\nlet count = 0;\n\nfunction FocusGuards(props: any) {\n useFocusGuards();\n return props.children;\n}\n\n/**\n * Injects a pair of focus guards at the edges of the whole DOM tree\n * to ensure `focusin` & `focusout` events can be caught consistently.\n */\nfunction useFocusGuards() {\n React.useEffect(() => {\n const edgeGuards = document.querySelectorAll('[data-radix-focus-guard]');\n document.body.insertAdjacentElement('afterbegin', edgeGuards[0] ?? createFocusGuard());\n document.body.insertAdjacentElement('beforeend', edgeGuards[1] ?? createFocusGuard());\n count++;\n\n return () => {\n if (count === 1) {\n document.querySelectorAll('[data-radix-focus-guard]').forEach((node) => node.remove());\n }\n count--;\n };\n }, []);\n}\n\nfunction createFocusGuard() {\n const element = document.createElement('span');\n element.setAttribute('data-radix-focus-guard', '');\n element.tabIndex = 0;\n element.style.cssText = 'outline: none; opacity: 0; position: fixed; pointer-events: none';\n return element;\n}\n\nconst Root = FocusGuards;\n\nexport {\n FocusGuards,\n //\n Root,\n //\n useFocusGuards,\n};\n"],"names":["FocusGuards","Root","useFocusGuards","React","count","props","children","useEffect","edgeGuards","document","querySelectorAll","body","insertAdjacentElement","createFocusGuard","forEach","node","remove","element","createElement","setAttribute","tabIndex","style","cssText"],"version":3,"file":"index.js.map"}
|
package/dist/index.module.js
CHANGED
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
import {useEffect as $1wErz$useEffect} from "react";
|
|
2
2
|
|
|
3
|
-
function $parcel$export(e, n, v, s) {
|
|
4
|
-
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
5
|
-
}
|
|
6
|
-
var $3db38b7d1fb3fe6a$exports = {};
|
|
7
|
-
|
|
8
|
-
$parcel$export($3db38b7d1fb3fe6a$exports, "FocusGuards", () => $3db38b7d1fb3fe6a$export$ac5b58043b79449b);
|
|
9
|
-
$parcel$export($3db38b7d1fb3fe6a$exports, "useFocusGuards", () => $3db38b7d1fb3fe6a$export$b7ece24a22aeda8c);
|
|
10
|
-
$parcel$export($3db38b7d1fb3fe6a$exports, "Root", () => $3db38b7d1fb3fe6a$export$be92b6f5f03c0fe9);
|
|
11
3
|
|
|
12
4
|
/** Number of components which have requested interest to have focus guards */ let $3db38b7d1fb3fe6a$var$count = 0;
|
|
13
5
|
function $3db38b7d1fb3fe6a$export$ac5b58043b79449b(props) {
|
|
@@ -43,5 +35,5 @@ const $3db38b7d1fb3fe6a$export$be92b6f5f03c0fe9 = $3db38b7d1fb3fe6a$export$ac5b5
|
|
|
43
35
|
|
|
44
36
|
|
|
45
37
|
|
|
46
|
-
export {$3db38b7d1fb3fe6a$export$ac5b58043b79449b as FocusGuards, $3db38b7d1fb3fe6a$export$
|
|
38
|
+
export {$3db38b7d1fb3fe6a$export$ac5b58043b79449b as FocusGuards, $3db38b7d1fb3fe6a$export$be92b6f5f03c0fe9 as Root, $3db38b7d1fb3fe6a$export$b7ece24a22aeda8c as useFocusGuards};
|
|
47
39
|
//# sourceMappingURL=index.module.js.map
|
package/dist/index.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;ACAA;AAEA,8EAAA,CACA,IAAII,2BAAK,GAAG,CAAZ,AAAA;AAEA,SAASJ,yCAAT,CAAqBK,KAArB,EAAiC;IAC/BH,yCAAc,EAAdA,CAAAA;IACA,OAAOG,KAAK,CAACC,QAAb,CAAA;CACD;AAED;;;GAGA,CACA,SAASJ,yCAAT,GAA0B;IACxBC,gBAAA,CAAgB,IAAM;QAAA,IAAA,YAAA,EAAA,aAAA,AAAA;QACpB,MAAMK,UAAU,GAAGC,QAAQ,CAACC,gBAAT,CAA0B,0BAA1B,CAAnB,AAAA;QACAD,QAAQ,CAACE,IAAT,CAAcC,qBAAd,CAAoC,YAApC,EAAA,AAAA,CAAA,YAAA,GAAkDJ,UAAU,CAAC,CAAD,CAA5D,CAAA,KAAA,IAAA,IAAA,YAAA,KAAA,KAAA,CAAA,GAAA,YAAA,GAAmEK,sCAAgB,EAAnF,CAAAJ,CAAAA;QACAA,QAAQ,CAACE,IAAT,CAAcC,qBAAd,CAAoC,WAApC,EAAA,AAAA,CAAA,aAAA,GAAiDJ,UAAU,CAAC,CAAD,CAA3D,CAAA,KAAA,IAAA,IAAA,aAAA,KAAA,KAAA,CAAA,GAAA,aAAA,GAAkEK,sCAAgB,EAAlF,CAAAJ,CAAAA;QACAL,2BAAK,EAALA,CAAAA;QAEA,OAAO,IAAM;YACX,IAAIA,2BAAK,KAAK,CAAd,EACEK,QAAQ,CAACC,gBAAT,CAA0B,0BAA1B,CAAA,CAAsDI,OAAtD,CAA+DC,CAAAA,IAAD,GAAUA,IAAI,CAACC,MAAL,EAAxE;YAAA,CAAAP,CAAAA;YAEFL,2BAAK,EAALA,CAAAA;SAJF,CAKC;KAXH,EAYG,EAZH,CAYC,CAAA;CACF;AAED,SAASS,sCAAT,GAA4B;IAC1B,MAAMI,OAAO,GAAGR,QAAQ,CAACS,aAAT,CAAuB,MAAvB,CAAhB,AAAA;IACAD,OAAO,CAACE,YAAR,CAAqB,wBAArB,EAA+C,EAA/C,CAAAF,CAAAA;IACAA,OAAO,CAACG,QAAR,GAAmB,CAAnB,CAAAH;IACAA,OAAO,CAACI,KAAR,CAAcC,OAAd,GAAwB,kEAAxB,CAAAL;IACA,OAAOA,OAAP,CAAA;CACD;AAED,MAAMhB,yCAAI,GAAGD,yCAAb,AAAA;;ADtCA","sources":["packages/react/focus-guards/src/index.ts","packages/react/focus-guards/src/FocusGuards.tsx"],"sourcesContent":["export {\n FocusGuards,\n //\n Root,\n //\n useFocusGuards,\n} from './FocusGuards';\n","import * as React from 'react';\n\n/** Number of components which have requested interest to have focus guards */\nlet count = 0;\n\nfunction FocusGuards(props: any) {\n useFocusGuards();\n return props.children;\n}\n\n/**\n * Injects a pair of focus guards at the edges of the whole DOM tree\n * to ensure `focusin` & `focusout` events can be caught consistently.\n */\nfunction useFocusGuards() {\n React.useEffect(() => {\n const edgeGuards = document.querySelectorAll('[data-radix-focus-guard]');\n document.body.insertAdjacentElement('afterbegin', edgeGuards[0] ?? createFocusGuard());\n document.body.insertAdjacentElement('beforeend', edgeGuards[1] ?? createFocusGuard());\n count++;\n\n return () => {\n if (count === 1) {\n document.querySelectorAll('[data-radix-focus-guard]').forEach((node) => node.remove());\n }\n count--;\n };\n }, []);\n}\n\nfunction createFocusGuard() {\n const element = document.createElement('span');\n element.setAttribute('data-radix-focus-guard', '');\n element.tabIndex = 0;\n element.style.cssText = 'outline: none; opacity: 0; position: fixed; pointer-events: none';\n return element;\n}\n\nconst Root = FocusGuards;\n\nexport {\n FocusGuards,\n //\n Root,\n //\n useFocusGuards,\n};\n"],"names":["FocusGuards","Root","useFocusGuards","React","count","props","children","useEffect","edgeGuards","document","querySelectorAll","body","insertAdjacentElement","createFocusGuard","forEach","node","remove","element","createElement","setAttribute","tabIndex","style","cssText"],"version":3,"file":"index.module.js.map"}
|