@tamagui/focus-guard 2.0.0-rc.4 → 2.0.0-rc.40

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.
@@ -2,33 +2,35 @@ var __create = Object.create;
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf,
6
- __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
7
  var __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: !0
11
- });
12
- },
13
- __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: true
11
+ });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
15
16
  get: () => from[key],
16
17
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
18
  });
18
- return to;
19
- };
19
+ }
20
+ return to;
21
+ };
20
22
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
26
- value: mod,
27
- enumerable: !0
28
- }) : target, mod)),
29
- __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
30
- value: !0
31
- }), mod);
23
+ // If the importer is in node compatibility mode or this is not an ESM
24
+ // file that has been converted to a CommonJS file using a Babel-
25
+ // compatible transform (i.e. "__esModule" has not been set), then set
26
+ // "default" to the CommonJS "module.exports" for node compatibility.
27
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
28
+ value: mod,
29
+ enumerable: true
30
+ }) : target, mod));
31
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
32
+ value: true
33
+ }), mod);
32
34
  var FocusGuard_exports = {};
33
35
  __export(FocusGuard_exports, {
34
36
  FocusGuards: () => FocusGuards,
@@ -36,21 +38,31 @@ __export(FocusGuard_exports, {
36
38
  useFocusGuards: () => useFocusGuards
37
39
  });
38
40
  module.exports = __toCommonJS(FocusGuard_exports);
39
- var React = __toESM(require("react"));
41
+ var React = __toESM(require("react"), 1);
40
42
  let count = 0;
41
43
  function FocusGuards(props) {
42
- return useFocusGuards(), props.children;
44
+ useFocusGuards();
45
+ return props.children;
43
46
  }
44
47
  function useFocusGuards() {
45
48
  React.useEffect(() => {
46
49
  const edgeGuards = document.querySelectorAll("[data-tamagui-focus-guard]");
47
- return document.body.insertAdjacentElement("afterbegin", edgeGuards[0] ?? createFocusGuard()), document.body.insertAdjacentElement("beforeend", edgeGuards[1] ?? createFocusGuard()), count++, () => {
48
- count === 1 && document.querySelectorAll("[data-tamagui-focus-guard]").forEach(node => node.remove()), count--;
50
+ document.body.insertAdjacentElement("afterbegin", edgeGuards[0] ?? createFocusGuard());
51
+ document.body.insertAdjacentElement("beforeend", edgeGuards[1] ?? createFocusGuard());
52
+ count++;
53
+ return () => {
54
+ if (count === 1) {
55
+ document.querySelectorAll("[data-tamagui-focus-guard]").forEach(node => node.remove());
56
+ }
57
+ count--;
49
58
  };
50
59
  }, []);
51
60
  }
52
61
  function createFocusGuard() {
53
62
  const element = document.createElement("span");
54
- return element.setAttribute("data-tamagui-focus-guard", ""), element.tabIndex = 0, element.style.cssText = "outline: none; opacity: 0; position: fixed; pointer-events: none", element;
63
+ element.setAttribute("data-tamagui-focus-guard", "");
64
+ element.tabIndex = 0;
65
+ element.style.cssText = "outline: none; opacity: 0; position: fixed; pointer-events: none";
66
+ return element;
55
67
  }
56
68
  const Root = FocusGuards;
@@ -5,20 +5,22 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
7
  var __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: !0
11
- });
12
- },
13
- __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: true
11
+ });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
15
16
  get: () => from[key],
16
17
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
18
  });
18
- return to;
19
- };
19
+ }
20
+ return to;
21
+ };
20
22
  var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
21
- value: !0
23
+ value: true
22
24
  }), mod);
23
25
  var FocusGuard_native_exports = {};
24
26
  __export(FocusGuard_native_exports, {
@@ -28,7 +30,8 @@ __export(FocusGuard_native_exports, {
28
30
  });
29
31
  module.exports = __toCommonJS(FocusGuard_native_exports);
30
32
  function FocusGuards(props) {
31
- return useFocusGuards(), props.children;
33
+ useFocusGuards();
34
+ return props.children;
32
35
  }
33
36
  function useFocusGuards() {
34
37
  return null;
@@ -1 +1 @@
1
- {"version":3,"names":["FocusGuard_native_exports","__export","FocusGuards","Root","useFocusGuards","module","exports","__toCommonJS","props","children"],"sources":["../../src/FocusGuard.native.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,yBAAA;AAAAC,QAAA,CAAAD,yBAAA;EAAAE,WAAA,EAAAA,CAAA,KAAAA,WAAA;EAAAC,IAAA,EAAAA,CAAA,KAAAA,IAAA;EAAAC,cAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAC,YAAA,CAAAP,yBAAA;AAAA,SAASE,YAAYM,KAAA,EAAO;EACxB,OAAAJ,cAAA,CAAe,GACRI,KAAA,CAAMC,QAAA;AACjB;AACA,SAASL,eAAA,EAAiB;EACtB,OAAO;AACX;AACA,IAAID,IAAA,GAAOD,WAAA","ignoreList":[]}
1
+ {"version":3,"names":["FocusGuard_native_exports","__export","FocusGuards","Root","useFocusGuards","module","exports","__toCommonJS","props","children"],"sources":["../../src/FocusGuard.native.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,yBAAA;AAAAC,QAAA,CAAAD,yBAAA;EAAAE,WAAA,EAAAA,CAAA,KAAAA,WAAA;EAAAC,IAAA,EAAAA,CAAA,KAAAA,IAAA;EAAAC,cAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAC,YAAA,CAAAP,yBAAA;AAAA,SAASE,YAAYM,KAAA,EAAO;EACxBJ,cAAA,CAAe;EACf,OAAOI,KAAA,CAAMC,QAAA;AACjB;AACA,SAASL,eAAA,EAAiB;EACtB,OAAO;AACX;AACA,IAAID,IAAA,GAAOD,WAAA","ignoreList":[]}
@@ -3,15 +3,17 @@ 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
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
7
8
  get: () => from[key],
8
9
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
9
10
  });
10
- return to;
11
- },
12
- __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
11
+ }
12
+ return to;
13
+ };
14
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
13
15
  var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
14
- value: !0
16
+ value: true
15
17
  }), mod);
16
18
  var index_exports = {};
17
19
  module.exports = __toCommonJS(index_exports);
@@ -5,15 +5,17 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
7
  var __copyProps = (to, from, except, desc) => {
8
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
8
+ if (from && typeof from === "object" || typeof from === "function") {
9
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
9
10
  get: () => from[key],
10
11
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
11
12
  });
12
- return to;
13
- },
14
- __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
13
+ }
14
+ return to;
15
+ };
16
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
17
  var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
16
- value: !0
18
+ value: true
17
19
  }), mod);
18
20
  var index_exports = {};
19
21
  module.exports = __toCommonJS(index_exports);
@@ -1 +1 @@
1
- {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","index_exports","module","exports"],"sources":["../../src/index.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,aAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAP,YAAc,CAAAK,aAAA","ignoreList":[]}
1
+ {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","index_exports","module","exports"],"sources":["../../src/index.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,aAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAP,YAAc,CAAAK,aAAA","ignoreList":[]}
@@ -1,19 +1,29 @@
1
1
  import * as React from "react";
2
2
  let count = 0;
3
3
  function FocusGuards(props) {
4
- return useFocusGuards(), props.children;
4
+ useFocusGuards();
5
+ return props.children;
5
6
  }
6
7
  function useFocusGuards() {
7
8
  React.useEffect(() => {
8
9
  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--;
10
+ document.body.insertAdjacentElement("afterbegin", edgeGuards[0] ?? createFocusGuard());
11
+ document.body.insertAdjacentElement("beforeend", edgeGuards[1] ?? createFocusGuard());
12
+ count++;
13
+ return () => {
14
+ if (count === 1) {
15
+ document.querySelectorAll("[data-tamagui-focus-guard]").forEach(node => node.remove());
16
+ }
17
+ count--;
11
18
  };
12
19
  }, []);
13
20
  }
14
21
  function createFocusGuard() {
15
22
  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;
23
+ element.setAttribute("data-tamagui-focus-guard", "");
24
+ element.tabIndex = 0;
25
+ element.style.cssText = "outline: none; opacity: 0; position: fixed; pointer-events: none";
26
+ return element;
17
27
  }
18
28
  const Root = FocusGuards;
19
29
  export { FocusGuards, Root, useFocusGuards };
@@ -1 +1 @@
1
- {"version":3,"names":["React","count","FocusGuards","props","useFocusGuards","children","useEffect","edgeGuards","document","querySelectorAll","body","insertAdjacentElement","createFocusGuard","forEach","node","remove","element","createElement","setAttribute","tabIndex","style","cssText","Root"],"sources":["../../src/FocusGuard.tsx"],"sourcesContent":[null],"mappings":"AAAA,YAAYA,KAAA,MAAW;AAGvB,IAAIC,KAAA,GAAQ;AAEZ,SAASC,YAAYC,KAAA,EAAY;EAC/B,OAAAC,cAAA,CAAe,GACRD,KAAA,CAAME,QAAA;AACf;AAMA,SAASD,eAAA,EAAiB;EACxBJ,KAAA,CAAMM,SAAA,CAAU,MAAM;IACpB,MAAMC,UAAA,GAAaC,QAAA,CAASC,gBAAA,CAAiB,4BAA4B;IACzE,OAAAD,QAAA,CAASE,IAAA,CAAKC,qBAAA,CAAsB,cAAcJ,UAAA,CAAW,CAAC,KAAKK,gBAAA,CAAiB,CAAC,GACrFJ,QAAA,CAASE,IAAA,CAAKC,qBAAA,CAAsB,aAAaJ,UAAA,CAAW,CAAC,KAAKK,gBAAA,CAAiB,CAAC,GACpFX,KAAA,IAEO,MAAM;MACPA,KAAA,KAAU,KACZO,QAAA,CACGC,gBAAA,CAAiB,4BAA4B,EAC7CI,OAAA,CAASC,IAAA,IAASA,IAAA,CAAKC,MAAA,CAAO,CAAC,GAEpCd,KAAA;IACF;EACF,GAAG,EAAE;AACP;AAEA,SAASW,iBAAA,EAAmB;EAC1B,MAAMI,OAAA,GAAUR,QAAA,CAASS,aAAA,CAAc,MAAM;EAC7C,OAAAD,OAAA,CAAQE,YAAA,CAAa,4BAA4B,EAAE,GACnDF,OAAA,CAAQG,QAAA,GAAW,GACnBH,OAAA,CAAQI,KAAA,CAAMC,OAAA,GACZ,oEACKL,OAAA;AACT;AAEA,MAAMM,IAAA,GAAOpB,WAAA","ignoreList":[]}
1
+ {"version":3,"names":["React","count","FocusGuards","props","useFocusGuards","children","useEffect","edgeGuards","document","querySelectorAll","body","insertAdjacentElement","createFocusGuard","forEach","node","remove","element","createElement","setAttribute","tabIndex","style","cssText","Root"],"sources":["../../src/FocusGuard.tsx"],"sourcesContent":[null],"mappings":"AAAA,YAAYA,KAAA,MAAW;AAGvB,IAAIC,KAAA,GAAQ;AAEZ,SAASC,YAAYC,KAAA,EAAY;EAC/BC,cAAA,CAAe;EACf,OAAOD,KAAA,CAAME,QAAA;AACf;AAMA,SAASD,eAAA,EAAiB;EACxBJ,KAAA,CAAMM,SAAA,CAAU,MAAM;IACpB,MAAMC,UAAA,GAAaC,QAAA,CAASC,gBAAA,CAAiB,4BAA4B;IACzED,QAAA,CAASE,IAAA,CAAKC,qBAAA,CAAsB,cAAcJ,UAAA,CAAW,CAAC,KAAKK,gBAAA,CAAiB,CAAC;IACrFJ,QAAA,CAASE,IAAA,CAAKC,qBAAA,CAAsB,aAAaJ,UAAA,CAAW,CAAC,KAAKK,gBAAA,CAAiB,CAAC;IACpFX,KAAA;IAEA,OAAO,MAAM;MACX,IAAIA,KAAA,KAAU,GAAG;QACfO,QAAA,CACGC,gBAAA,CAAiB,4BAA4B,EAC7CI,OAAA,CAASC,IAAA,IAASA,IAAA,CAAKC,MAAA,CAAO,CAAC;MACpC;MACAd,KAAA;IACF;EACF,GAAG,EAAE;AACP;AAEA,SAASW,iBAAA,EAAmB;EAC1B,MAAMI,OAAA,GAAUR,QAAA,CAASS,aAAA,CAAc,MAAM;EAC7CD,OAAA,CAAQE,YAAA,CAAa,4BAA4B,EAAE;EACnDF,OAAA,CAAQG,QAAA,GAAW;EACnBH,OAAA,CAAQI,KAAA,CAAMC,OAAA,GACZ;EACF,OAAOL,OAAA;AACT;AAEA,MAAMM,IAAA,GAAOpB,WAAA","ignoreList":[]}
@@ -1,5 +1,6 @@
1
1
  function FocusGuards(props) {
2
- return useFocusGuards(), props.children;
2
+ useFocusGuards();
3
+ return props.children;
3
4
  }
4
5
  function useFocusGuards() {
5
6
  return null;
@@ -1 +1 @@
1
- {"version":3,"names":["FocusGuards","props","useFocusGuards","children","Root"],"sources":["../../src/FocusGuard.native.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAASA,YAAYC,KAAA,EAAO;EACxB,OAAAC,cAAA,CAAe,GACRD,KAAA,CAAME,QAAA;AACjB;AACA,SAASD,eAAA,EAAiB;EACtB,OAAO;AACX;AACA,IAAIE,IAAA,GAAOJ,WAAA","ignoreList":[]}
1
+ {"version":3,"names":["FocusGuards","props","useFocusGuards","children","Root"],"sources":["../../src/FocusGuard.native.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAASA,YAAYC,KAAA,EAAO;EACxBC,cAAA,CAAe;EACf,OAAOD,KAAA,CAAME,QAAA;AACjB;AACA,SAASD,eAAA,EAAiB;EACtB,OAAO;AACX;AACA,IAAIE,IAAA,GAAOJ,WAAA","ignoreList":[]}
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
@@ -1,6 +1 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/index.tsx"],
4
- "mappings": "AAAA,cAAc;",
5
- "names": []
6
- }
1
+ {"version":3,"names":[],"sources":["../../src/index.tsx"],"sourcesContent":[null],"mappings":"AAAA,cAAc","ignoreList":[]}
@@ -1,19 +1,29 @@
1
1
  import * as React from "react";
2
2
  let count = 0;
3
3
  function FocusGuards(props) {
4
- return useFocusGuards(), props.children;
4
+ useFocusGuards();
5
+ return props.children;
5
6
  }
6
7
  function useFocusGuards() {
7
8
  React.useEffect(() => {
8
9
  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--;
10
+ document.body.insertAdjacentElement("afterbegin", edgeGuards[0] ?? createFocusGuard());
11
+ document.body.insertAdjacentElement("beforeend", edgeGuards[1] ?? createFocusGuard());
12
+ count++;
13
+ return () => {
14
+ if (count === 1) {
15
+ document.querySelectorAll("[data-tamagui-focus-guard]").forEach(node => node.remove());
16
+ }
17
+ count--;
11
18
  };
12
19
  }, []);
13
20
  }
14
21
  function createFocusGuard() {
15
22
  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;
23
+ element.setAttribute("data-tamagui-focus-guard", "");
24
+ element.tabIndex = 0;
25
+ element.style.cssText = "outline: none; opacity: 0; position: fixed; pointer-events: none";
26
+ return element;
17
27
  }
18
28
  const Root = FocusGuards;
19
29
  export { FocusGuards, Root, useFocusGuards };
@@ -1 +1 @@
1
- {"version":3,"names":["React","count","FocusGuards","props","useFocusGuards","children","useEffect","edgeGuards","document","querySelectorAll","body","insertAdjacentElement","createFocusGuard","forEach","node","remove","element","createElement","setAttribute","tabIndex","style","cssText","Root"],"sources":["../../src/FocusGuard.tsx"],"sourcesContent":[null],"mappings":"AAAA,YAAYA,KAAA,MAAW;AAGvB,IAAIC,KAAA,GAAQ;AAEZ,SAASC,YAAYC,KAAA,EAAY;EAC/B,OAAAC,cAAA,CAAe,GACRD,KAAA,CAAME,QAAA;AACf;AAMA,SAASD,eAAA,EAAiB;EACxBJ,KAAA,CAAMM,SAAA,CAAU,MAAM;IACpB,MAAMC,UAAA,GAAaC,QAAA,CAASC,gBAAA,CAAiB,4BAA4B;IACzE,OAAAD,QAAA,CAASE,IAAA,CAAKC,qBAAA,CAAsB,cAAcJ,UAAA,CAAW,CAAC,KAAKK,gBAAA,CAAiB,CAAC,GACrFJ,QAAA,CAASE,IAAA,CAAKC,qBAAA,CAAsB,aAAaJ,UAAA,CAAW,CAAC,KAAKK,gBAAA,CAAiB,CAAC,GACpFX,KAAA,IAEO,MAAM;MACPA,KAAA,KAAU,KACZO,QAAA,CACGC,gBAAA,CAAiB,4BAA4B,EAC7CI,OAAA,CAASC,IAAA,IAASA,IAAA,CAAKC,MAAA,CAAO,CAAC,GAEpCd,KAAA;IACF;EACF,GAAG,EAAE;AACP;AAEA,SAASW,iBAAA,EAAmB;EAC1B,MAAMI,OAAA,GAAUR,QAAA,CAASS,aAAA,CAAc,MAAM;EAC7C,OAAAD,OAAA,CAAQE,YAAA,CAAa,4BAA4B,EAAE,GACnDF,OAAA,CAAQG,QAAA,GAAW,GACnBH,OAAA,CAAQI,KAAA,CAAMC,OAAA,GACZ,oEACKL,OAAA;AACT;AAEA,MAAMM,IAAA,GAAOpB,WAAA","ignoreList":[]}
1
+ {"version":3,"names":["React","count","FocusGuards","props","useFocusGuards","children","useEffect","edgeGuards","document","querySelectorAll","body","insertAdjacentElement","createFocusGuard","forEach","node","remove","element","createElement","setAttribute","tabIndex","style","cssText","Root"],"sources":["../../src/FocusGuard.tsx"],"sourcesContent":[null],"mappings":"AAAA,YAAYA,KAAA,MAAW;AAGvB,IAAIC,KAAA,GAAQ;AAEZ,SAASC,YAAYC,KAAA,EAAY;EAC/BC,cAAA,CAAe;EACf,OAAOD,KAAA,CAAME,QAAA;AACf;AAMA,SAASD,eAAA,EAAiB;EACxBJ,KAAA,CAAMM,SAAA,CAAU,MAAM;IACpB,MAAMC,UAAA,GAAaC,QAAA,CAASC,gBAAA,CAAiB,4BAA4B;IACzED,QAAA,CAASE,IAAA,CAAKC,qBAAA,CAAsB,cAAcJ,UAAA,CAAW,CAAC,KAAKK,gBAAA,CAAiB,CAAC;IACrFJ,QAAA,CAASE,IAAA,CAAKC,qBAAA,CAAsB,aAAaJ,UAAA,CAAW,CAAC,KAAKK,gBAAA,CAAiB,CAAC;IACpFX,KAAA;IAEA,OAAO,MAAM;MACX,IAAIA,KAAA,KAAU,GAAG;QACfO,QAAA,CACGC,gBAAA,CAAiB,4BAA4B,EAC7CI,OAAA,CAASC,IAAA,IAASA,IAAA,CAAKC,MAAA,CAAO,CAAC;MACpC;MACAd,KAAA;IACF;EACF,GAAG,EAAE;AACP;AAEA,SAASW,iBAAA,EAAmB;EAC1B,MAAMI,OAAA,GAAUR,QAAA,CAASS,aAAA,CAAc,MAAM;EAC7CD,OAAA,CAAQE,YAAA,CAAa,4BAA4B,EAAE;EACnDF,OAAA,CAAQG,QAAA,GAAW;EACnBH,OAAA,CAAQI,KAAA,CAAMC,OAAA,GACZ;EACF,OAAOL,OAAA;AACT;AAEA,MAAMM,IAAA,GAAOpB,WAAA","ignoreList":[]}
@@ -5,20 +5,22 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
7
  var __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: !0
11
- });
12
- },
13
- __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: true
11
+ });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
15
16
  get: () => from[key],
16
17
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
18
  });
18
- return to;
19
- };
19
+ }
20
+ return to;
21
+ };
20
22
  var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
21
- value: !0
23
+ value: true
22
24
  }), mod);
23
25
  var FocusGuard_native_exports = {};
24
26
  __export(FocusGuard_native_exports, {
@@ -28,7 +30,8 @@ __export(FocusGuard_native_exports, {
28
30
  });
29
31
  module.exports = __toCommonJS(FocusGuard_native_exports);
30
32
  function FocusGuards(props) {
31
- return useFocusGuards(), props.children;
33
+ useFocusGuards();
34
+ return props.children;
32
35
  }
33
36
  function useFocusGuards() {
34
37
  return null;
@@ -1 +1 @@
1
- {"version":3,"names":["FocusGuard_native_exports","__export","FocusGuards","Root","useFocusGuards","module","exports","__toCommonJS","props","children"],"sources":["../../src/FocusGuard.native.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,yBAAA;AAAAC,QAAA,CAAAD,yBAAA;EAAAE,WAAA,EAAAA,CAAA,KAAAA,WAAA;EAAAC,IAAA,EAAAA,CAAA,KAAAA,IAAA;EAAAC,cAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAC,YAAA,CAAAP,yBAAA;AAAA,SAASE,YAAYM,KAAA,EAAO;EACxB,OAAAJ,cAAA,CAAe,GACRI,KAAA,CAAMC,QAAA;AACjB;AACA,SAASL,eAAA,EAAiB;EACtB,OAAO;AACX;AACA,IAAID,IAAA,GAAOD,WAAA","ignoreList":[]}
1
+ {"version":3,"names":["FocusGuard_native_exports","__export","FocusGuards","Root","useFocusGuards","module","exports","__toCommonJS","props","children"],"sources":["../../src/FocusGuard.native.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,yBAAA;AAAAC,QAAA,CAAAD,yBAAA;EAAAE,WAAA,EAAAA,CAAA,KAAAA,WAAA;EAAAC,IAAA,EAAAA,CAAA,KAAAA,IAAA;EAAAC,cAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAC,YAAA,CAAAP,yBAAA;AAAA,SAASE,YAAYM,KAAA,EAAO;EACxBJ,cAAA,CAAe;EACf,OAAOI,KAAA,CAAMC,QAAA;AACjB;AACA,SAASL,eAAA,EAAiB;EACtB,OAAO;AACX;AACA,IAAID,IAAA,GAAOD,WAAA","ignoreList":[]}
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
@@ -1,6 +1 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/index.tsx"],
4
- "mappings": "AAAA,cAAc;",
5
- "names": []
6
- }
1
+ {"version":3,"names":[],"sources":["../../src/index.tsx"],"sourcesContent":[null],"mappings":"AAAA,cAAc","ignoreList":[]}
@@ -5,15 +5,17 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
7
  var __copyProps = (to, from, except, desc) => {
8
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
8
+ if (from && typeof from === "object" || typeof from === "function") {
9
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
9
10
  get: () => from[key],
10
11
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
11
12
  });
12
- return to;
13
- },
14
- __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
13
+ }
14
+ return to;
15
+ };
16
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
17
  var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
16
- value: !0
18
+ value: true
17
19
  }), mod);
18
20
  var index_exports = {};
19
21
  module.exports = __toCommonJS(index_exports);
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@tamagui/focus-guard",
3
- "version": "2.0.0-rc.4",
3
+ "version": "2.0.0-rc.40",
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.4",
25
- "@tamagui/use-event": "2.0.0-rc.4"
36
+ "@tamagui/compose-refs": "2.0.0-rc.40",
37
+ "@tamagui/use-event": "2.0.0-rc.40"
26
38
  },
27
39
  "devDependencies": {
28
- "@tamagui/build": "2.0.0-rc.4",
40
+ "@tamagui/build": "2.0.0-rc.40",
29
41
  "react": ">=19"
30
42
  },
31
43
  "peerDependencies": {
@@ -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/cjs/index.js DELETED
@@ -1,15 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from == "object" || typeof from == "function")
7
- for (let key of __getOwnPropNames(from))
8
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
9
- return to;
10
- }, __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
11
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
12
- var index_exports = {};
13
- module.exports = __toCommonJS(index_exports);
14
- __reExport(index_exports, require("./FocusGuard"), module.exports);
15
- //# sourceMappingURL=index.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/index.tsx"],
4
- "mappings": ";;;;;;;;;;;AAAA;AAAA;AAAA,0BAAc,yBAAd;",
5
- "names": []
6
- }
@@ -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
- }
@@ -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
- }