@tamagui/focus-guard 2.0.0-rc.3 → 2.0.0-rc.30
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/cjs/FocusGuard.cjs +1 -1
- package/dist/cjs/index.js +11 -8
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -6
- package/dist/jsx/index.js +1 -1
- package/dist/jsx/index.js.map +1 -6
- package/package.json +16 -4
- package/dist/cjs/FocusGuard.js +0 -48
- package/dist/cjs/FocusGuard.js.map +0 -6
- package/dist/esm/FocusGuard.js +0 -24
- package/dist/esm/FocusGuard.js.map +0 -6
- package/dist/jsx/FocusGuard.js +0 -24
- package/dist/jsx/FocusGuard.js.map +0 -6
package/dist/cjs/FocusGuard.cjs
CHANGED
|
@@ -36,7 +36,7 @@ __export(FocusGuard_exports, {
|
|
|
36
36
|
useFocusGuards: () => useFocusGuards
|
|
37
37
|
});
|
|
38
38
|
module.exports = __toCommonJS(FocusGuard_exports);
|
|
39
|
-
var React = __toESM(require("react"));
|
|
39
|
+
var React = __toESM(require("react"), 1);
|
|
40
40
|
let count = 0;
|
|
41
41
|
function FocusGuards(props) {
|
|
42
42
|
return useFocusGuards(), props.children;
|
package/dist/cjs/index.js
CHANGED
|
@@ -3,13 +3,16 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
5
|
var __copyProps = (to, from, except, desc) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
7
|
+
get: () => from[key],
|
|
8
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
9
|
+
});
|
|
10
|
+
return to;
|
|
11
|
+
},
|
|
12
|
+
__reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
13
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
14
|
+
value: !0
|
|
15
|
+
}), mod);
|
|
12
16
|
var index_exports = {};
|
|
13
17
|
module.exports = __toCommonJS(index_exports);
|
|
14
|
-
__reExport(index_exports, require("./FocusGuard"), module.exports);
|
|
15
|
-
//# sourceMappingURL=index.js.map
|
|
18
|
+
__reExport(index_exports, require("./FocusGuard.cjs"), module.exports);
|
package/dist/esm/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./FocusGuard";
|
|
1
|
+
export * from "./FocusGuard.mjs";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
package/dist/jsx/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./FocusGuard";
|
|
1
|
+
export * from "./FocusGuard.mjs";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/jsx/index.js.map
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/focus-guard",
|
|
3
|
-
"version": "2.0.0-rc.
|
|
3
|
+
"version": "2.0.0-rc.30",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
|
+
"type": "module",
|
|
5
6
|
"files": [
|
|
6
7
|
"src",
|
|
7
8
|
"types",
|
|
@@ -11,6 +12,17 @@
|
|
|
11
12
|
"main": "dist/cjs",
|
|
12
13
|
"module": "dist/esm",
|
|
13
14
|
"types": "./types/index.d.ts",
|
|
15
|
+
"exports": {
|
|
16
|
+
"./package.json": "./package.json",
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./types/index.d.ts",
|
|
19
|
+
"react-native": "./dist/esm/index.native.js",
|
|
20
|
+
"browser": "./dist/esm/index.mjs",
|
|
21
|
+
"import": "./dist/esm/index.mjs",
|
|
22
|
+
"require": "./dist/cjs/index.cjs",
|
|
23
|
+
"default": "./dist/esm/index.mjs"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
14
26
|
"publishConfig": {
|
|
15
27
|
"access": "public"
|
|
16
28
|
},
|
|
@@ -21,11 +33,11 @@
|
|
|
21
33
|
"clean:build": "tamagui-build clean:build"
|
|
22
34
|
},
|
|
23
35
|
"dependencies": {
|
|
24
|
-
"@tamagui/compose-refs": "2.0.0-rc.
|
|
25
|
-
"@tamagui/use-event": "2.0.0-rc.
|
|
36
|
+
"@tamagui/compose-refs": "2.0.0-rc.30",
|
|
37
|
+
"@tamagui/use-event": "2.0.0-rc.30"
|
|
26
38
|
},
|
|
27
39
|
"devDependencies": {
|
|
28
|
-
"@tamagui/build": "2.0.0-rc.
|
|
40
|
+
"@tamagui/build": "2.0.0-rc.30",
|
|
29
41
|
"react": ">=19"
|
|
30
42
|
},
|
|
31
43
|
"peerDependencies": {
|
package/dist/cjs/FocusGuard.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
9
|
-
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
-
return to;
|
|
14
|
-
};
|
|
15
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
16
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
17
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
18
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
19
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
21
|
-
mod
|
|
22
|
-
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
23
|
-
var FocusGuard_exports = {};
|
|
24
|
-
__export(FocusGuard_exports, {
|
|
25
|
-
FocusGuards: () => FocusGuards,
|
|
26
|
-
Root: () => Root,
|
|
27
|
-
useFocusGuards: () => useFocusGuards
|
|
28
|
-
});
|
|
29
|
-
module.exports = __toCommonJS(FocusGuard_exports);
|
|
30
|
-
var React = __toESM(require("react"));
|
|
31
|
-
let count = 0;
|
|
32
|
-
function FocusGuards(props) {
|
|
33
|
-
return useFocusGuards(), props.children;
|
|
34
|
-
}
|
|
35
|
-
function useFocusGuards() {
|
|
36
|
-
React.useEffect(() => {
|
|
37
|
-
const edgeGuards = document.querySelectorAll("[data-tamagui-focus-guard]");
|
|
38
|
-
return document.body.insertAdjacentElement("afterbegin", edgeGuards[0] ?? createFocusGuard()), document.body.insertAdjacentElement("beforeend", edgeGuards[1] ?? createFocusGuard()), count++, () => {
|
|
39
|
-
count === 1 && document.querySelectorAll("[data-tamagui-focus-guard]").forEach((node) => node.remove()), count--;
|
|
40
|
-
};
|
|
41
|
-
}, []);
|
|
42
|
-
}
|
|
43
|
-
function createFocusGuard() {
|
|
44
|
-
const element = document.createElement("span");
|
|
45
|
-
return element.setAttribute("data-tamagui-focus-guard", ""), element.tabIndex = 0, element.style.cssText = "outline: none; opacity: 0; position: fixed; pointer-events: none", element;
|
|
46
|
-
}
|
|
47
|
-
const Root = FocusGuards;
|
|
48
|
-
//# sourceMappingURL=FocusGuard.js.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/FocusGuard.tsx"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAAuB;AAGvB,IAAI,QAAQ;AAEZ,SAAS,YAAY,OAAY;AAC/B,wBAAe,GACR,MAAM;AACf;AAMA,SAAS,iBAAiB;AACxB,QAAM,UAAU,MAAM;AACpB,UAAM,aAAa,SAAS,iBAAiB,4BAA4B;AACzE,oBAAS,KAAK,sBAAsB,cAAc,WAAW,CAAC,KAAK,iBAAiB,CAAC,GACrF,SAAS,KAAK,sBAAsB,aAAa,WAAW,CAAC,KAAK,iBAAiB,CAAC,GACpF,SAEO,MAAM;AACX,MAAI,UAAU,KACZ,SACG,iBAAiB,4BAA4B,EAC7C,QAAQ,CAAC,SAAS,KAAK,OAAO,CAAC,GAEpC;AAAA,IACF;AAAA,EACF,GAAG,CAAC,CAAC;AACP;AAEA,SAAS,mBAAmB;AAC1B,QAAM,UAAU,SAAS,cAAc,MAAM;AAC7C,iBAAQ,aAAa,4BAA4B,EAAE,GACnD,QAAQ,WAAW,GACnB,QAAQ,MAAM,UACZ,oEACK;AACT;AAEA,MAAM,OAAO;",
|
|
5
|
-
"names": []
|
|
6
|
-
}
|
package/dist/esm/FocusGuard.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
let count = 0;
|
|
3
|
-
function FocusGuards(props) {
|
|
4
|
-
return useFocusGuards(), props.children;
|
|
5
|
-
}
|
|
6
|
-
function useFocusGuards() {
|
|
7
|
-
React.useEffect(() => {
|
|
8
|
-
const edgeGuards = document.querySelectorAll("[data-tamagui-focus-guard]");
|
|
9
|
-
return document.body.insertAdjacentElement("afterbegin", edgeGuards[0] ?? createFocusGuard()), document.body.insertAdjacentElement("beforeend", edgeGuards[1] ?? createFocusGuard()), count++, () => {
|
|
10
|
-
count === 1 && document.querySelectorAll("[data-tamagui-focus-guard]").forEach((node) => node.remove()), count--;
|
|
11
|
-
};
|
|
12
|
-
}, []);
|
|
13
|
-
}
|
|
14
|
-
function createFocusGuard() {
|
|
15
|
-
const element = document.createElement("span");
|
|
16
|
-
return element.setAttribute("data-tamagui-focus-guard", ""), element.tabIndex = 0, element.style.cssText = "outline: none; opacity: 0; position: fixed; pointer-events: none", element;
|
|
17
|
-
}
|
|
18
|
-
const Root = FocusGuards;
|
|
19
|
-
export {
|
|
20
|
-
FocusGuards,
|
|
21
|
-
Root,
|
|
22
|
-
useFocusGuards
|
|
23
|
-
};
|
|
24
|
-
//# sourceMappingURL=FocusGuard.js.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/FocusGuard.tsx"],
|
|
4
|
-
"mappings": "AAAA,YAAY,WAAW;AAGvB,IAAI,QAAQ;AAEZ,SAAS,YAAY,OAAY;AAC/B,wBAAe,GACR,MAAM;AACf;AAMA,SAAS,iBAAiB;AACxB,QAAM,UAAU,MAAM;AACpB,UAAM,aAAa,SAAS,iBAAiB,4BAA4B;AACzE,oBAAS,KAAK,sBAAsB,cAAc,WAAW,CAAC,KAAK,iBAAiB,CAAC,GACrF,SAAS,KAAK,sBAAsB,aAAa,WAAW,CAAC,KAAK,iBAAiB,CAAC,GACpF,SAEO,MAAM;AACX,MAAI,UAAU,KACZ,SACG,iBAAiB,4BAA4B,EAC7C,QAAQ,CAAC,SAAS,KAAK,OAAO,CAAC,GAEpC;AAAA,IACF;AAAA,EACF,GAAG,CAAC,CAAC;AACP;AAEA,SAAS,mBAAmB;AAC1B,QAAM,UAAU,SAAS,cAAc,MAAM;AAC7C,iBAAQ,aAAa,4BAA4B,EAAE,GACnD,QAAQ,WAAW,GACnB,QAAQ,MAAM,UACZ,oEACK;AACT;AAEA,MAAM,OAAO;",
|
|
5
|
-
"names": []
|
|
6
|
-
}
|
package/dist/jsx/FocusGuard.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
let count = 0;
|
|
3
|
-
function FocusGuards(props) {
|
|
4
|
-
return useFocusGuards(), props.children;
|
|
5
|
-
}
|
|
6
|
-
function useFocusGuards() {
|
|
7
|
-
React.useEffect(() => {
|
|
8
|
-
const edgeGuards = document.querySelectorAll("[data-tamagui-focus-guard]");
|
|
9
|
-
return document.body.insertAdjacentElement("afterbegin", edgeGuards[0] ?? createFocusGuard()), document.body.insertAdjacentElement("beforeend", edgeGuards[1] ?? createFocusGuard()), count++, () => {
|
|
10
|
-
count === 1 && document.querySelectorAll("[data-tamagui-focus-guard]").forEach((node) => node.remove()), count--;
|
|
11
|
-
};
|
|
12
|
-
}, []);
|
|
13
|
-
}
|
|
14
|
-
function createFocusGuard() {
|
|
15
|
-
const element = document.createElement("span");
|
|
16
|
-
return element.setAttribute("data-tamagui-focus-guard", ""), element.tabIndex = 0, element.style.cssText = "outline: none; opacity: 0; position: fixed; pointer-events: none", element;
|
|
17
|
-
}
|
|
18
|
-
const Root = FocusGuards;
|
|
19
|
-
export {
|
|
20
|
-
FocusGuards,
|
|
21
|
-
Root,
|
|
22
|
-
useFocusGuards
|
|
23
|
-
};
|
|
24
|
-
//# sourceMappingURL=FocusGuard.js.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/FocusGuard.tsx"],
|
|
4
|
-
"mappings": "AAAA,YAAY,WAAW;AAGvB,IAAI,QAAQ;AAEZ,SAAS,YAAY,OAAY;AAC/B,wBAAe,GACR,MAAM;AACf;AAMA,SAAS,iBAAiB;AACxB,QAAM,UAAU,MAAM;AACpB,UAAM,aAAa,SAAS,iBAAiB,4BAA4B;AACzE,oBAAS,KAAK,sBAAsB,cAAc,WAAW,CAAC,KAAK,iBAAiB,CAAC,GACrF,SAAS,KAAK,sBAAsB,aAAa,WAAW,CAAC,KAAK,iBAAiB,CAAC,GACpF,SAEO,MAAM;AACX,MAAI,UAAU,KACZ,SACG,iBAAiB,4BAA4B,EAC7C,QAAQ,CAAC,SAAS,KAAK,OAAO,CAAC,GAEpC;AAAA,IACF;AAAA,EACF,GAAG,CAAC,CAAC;AACP;AAEA,SAAS,mBAAmB;AAC1B,QAAM,UAAU,SAAS,cAAc,MAAM;AAC7C,iBAAQ,aAAa,4BAA4B,EAAE,GACnD,QAAQ,WAAW,GACnB,QAAQ,MAAM,UACZ,oEACK;AACT;AAEA,MAAM,OAAO;",
|
|
5
|
-
"names": []
|
|
6
|
-
}
|