@tamagui/use-keyboard-visible 2.0.0-rc.9 → 2.0.0
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/index.cjs +12 -10
- package/dist/cjs/index.native.js +12 -10
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/useKeyboardVisible.cjs +37 -33
- package/dist/cjs/useKeyboardVisible.native.js +42 -38
- package/dist/cjs/useKeyboardVisible.native.js.map +1 -1
- package/dist/esm/index.js +2 -4
- package/dist/esm/index.js.map +1 -6
- package/dist/esm/useKeyboardVisible.mjs +11 -9
- package/dist/esm/useKeyboardVisible.mjs.map +1 -1
- package/dist/esm/useKeyboardVisible.native.js +11 -9
- package/dist/esm/useKeyboardVisible.native.js.map +1 -1
- package/package.json +6 -6
- package/types/index.d.ts.map +2 -2
- package/types/useKeyboardVisible.d.ts.map +2 -2
- package/dist/cjs/index.js +0 -21
- package/dist/cjs/index.js.map +0 -6
- package/dist/cjs/useKeyboardVisible.js +0 -42
- package/dist/cjs/useKeyboardVisible.js.map +0 -6
- package/dist/esm/useKeyboardVisible.js +0 -19
- package/dist/esm/useKeyboardVisible.js.map +0 -6
package/dist/cjs/index.cjs
CHANGED
|
@@ -3,20 +3,22 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
5
|
var __export = (target, all) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: true
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
13
14
|
get: () => from[key],
|
|
14
15
|
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
16
|
});
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
18
20
|
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
19
|
-
value:
|
|
21
|
+
value: true
|
|
20
22
|
}), mod);
|
|
21
23
|
var index_exports = {};
|
|
22
24
|
__export(index_exports, {
|
package/dist/cjs/index.native.js
CHANGED
|
@@ -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
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
|
|
19
|
-
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
20
22
|
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
21
|
-
value:
|
|
23
|
+
value: true
|
|
22
24
|
}), mod);
|
|
23
25
|
var index_exports = {};
|
|
24
26
|
__export(index_exports, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","index_exports","__export","useKeyboardVisible","import_useKeyboardVisible","module","exports"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"
|
|
1
|
+
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","index_exports","__export","useKeyboardVisible","import_useKeyboardVisible","module","exports"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,aAAA;AAAAC,QAAA,CAAAD,aAAA;EAAAE,kBAAA,EAAAA,CAAA,KAAAC,yBAAA,CAAAD;AAAA;AAAAE,MAAA,CAAAC,OAAA,GAAAV,YAAA,CAAAK,aAAmC","ignoreList":[]}
|
|
@@ -2,51 +2,55 @@ 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
|
-
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
7
|
var __export = (target, all) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
|
|
19
|
-
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
20
22
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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 useKeyboardVisible_exports = {};
|
|
33
35
|
__export(useKeyboardVisible_exports, {
|
|
34
36
|
useKeyboardVisible: () => useKeyboardVisible
|
|
35
37
|
});
|
|
36
38
|
module.exports = __toCommonJS(useKeyboardVisible_exports);
|
|
37
|
-
var import_react = __toESM(require("react"), 1)
|
|
38
|
-
|
|
39
|
+
var import_react = __toESM(require("react"), 1);
|
|
40
|
+
var import_react_native = require("react-native-web");
|
|
39
41
|
const useKeyboardVisible = () => {
|
|
40
|
-
const [isKeyboardVisible, setKeyboardVisible] = import_react.default.useState(
|
|
41
|
-
|
|
42
|
+
const [isKeyboardVisible, setKeyboardVisible] = import_react.default.useState(false);
|
|
43
|
+
import_react.default.useEffect(() => {
|
|
42
44
|
const keyboardDidShowListener = import_react_native.Keyboard.addListener("keyboardDidShow", () => {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
setKeyboardVisible(true);
|
|
46
|
+
});
|
|
47
|
+
const keyboardDidHideListener = import_react_native.Keyboard.addListener("keyboardDidHide", () => {
|
|
48
|
+
setKeyboardVisible(false);
|
|
49
|
+
});
|
|
48
50
|
return () => {
|
|
49
|
-
keyboardDidHideListener.remove()
|
|
51
|
+
keyboardDidHideListener.remove();
|
|
52
|
+
keyboardDidShowListener.remove();
|
|
50
53
|
};
|
|
51
|
-
}, [])
|
|
54
|
+
}, []);
|
|
55
|
+
return isKeyboardVisible;
|
|
52
56
|
};
|
|
@@ -4,52 +4,56 @@ var __create = Object.create;
|
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getProtoOf = Object.getPrototypeOf
|
|
8
|
-
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
9
|
var __export = (target, all) => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
for (var name in all) __defProp(target, name, {
|
|
11
|
+
get: all[name],
|
|
12
|
+
enumerable: true
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
var __copyProps = (to, from, except, desc) => {
|
|
16
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
17
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
17
18
|
get: () => from[key],
|
|
18
19
|
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
20
|
});
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
}
|
|
22
|
+
return to;
|
|
23
|
+
};
|
|
22
24
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
25
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
26
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
27
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
28
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
29
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
30
|
+
value: mod,
|
|
31
|
+
enumerable: true
|
|
32
|
+
}) : target, mod));
|
|
33
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
34
|
+
value: true
|
|
35
|
+
}), mod);
|
|
34
36
|
var useKeyboardVisible_exports = {};
|
|
35
37
|
__export(useKeyboardVisible_exports, {
|
|
36
38
|
useKeyboardVisible: () => useKeyboardVisible
|
|
37
39
|
});
|
|
38
40
|
module.exports = __toCommonJS(useKeyboardVisible_exports);
|
|
39
|
-
var import_react = __toESM(require("react"), 1)
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
};
|
|
41
|
+
var import_react = __toESM(require("react"), 1);
|
|
42
|
+
var import_react_native = require("react-native");
|
|
43
|
+
var useKeyboardVisible = function () {
|
|
44
|
+
var [isKeyboardVisible, setKeyboardVisible] = import_react.default.useState(false);
|
|
45
|
+
import_react.default.useEffect(function () {
|
|
46
|
+
var keyboardDidShowListener = import_react_native.Keyboard.addListener("keyboardDidShow", function () {
|
|
47
|
+
setKeyboardVisible(true);
|
|
48
|
+
});
|
|
49
|
+
var keyboardDidHideListener = import_react_native.Keyboard.addListener("keyboardDidHide", function () {
|
|
50
|
+
setKeyboardVisible(false);
|
|
51
|
+
});
|
|
52
|
+
return function () {
|
|
53
|
+
keyboardDidHideListener.remove();
|
|
54
|
+
keyboardDidShowListener.remove();
|
|
55
|
+
};
|
|
56
|
+
}, []);
|
|
57
|
+
return isKeyboardVisible;
|
|
58
|
+
};
|
|
55
59
|
//# sourceMappingURL=useKeyboardVisible.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","useKeyboardVisible_exports","__export","useKeyboardVisible","module","exports","import_react","__toESM","require","import_react_native","isKeyboardVisible","setKeyboardVisible","default","useState","useEffect","keyboardDidShowListener","Keyboard","addListener","keyboardDidHideListener","remove"],"sources":["../../src/useKeyboardVisible.ts"],"sourcesContent":[null],"mappings":"
|
|
1
|
+
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","useKeyboardVisible_exports","__export","useKeyboardVisible","module","exports","import_react","__toESM","require","import_react_native","isKeyboardVisible","setKeyboardVisible","default","useState","useEffect","keyboardDidShowListener","Keyboard","addListener","keyboardDidHideListener","remove"],"sources":["../../src/useKeyboardVisible.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,0BAAA;AAAAC,QAAA,CAAAD,0BAAA;EAAAE,kBAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAT,YAAkB,CAAAK,0BAAA;AAClB,IAAAK,YAAA,GAAAC,OAAyB,CAAAC,OAAA;AAElB,IAAAC,mBAAM,GAAAD,OAAoC;AAC/C,IAAAL,kBAAO,YAAAA,CAAA,EAAmB;EAE1B,KAAAO,iBAAM,EAAAC,kBAAgB,IAAAL,YAAA,CAAAM,OAAA,CAAAC,QAAA;EACpBP,YAAM,CAAAM,OAAA,CAAAE,SAAA,aAA0B;IAC9B,IAAAC,uBAAuB,GAAAN,mBAAA,CAAAO,QAAA,CAAAC,WAAA;MACxBN,kBAAA;IACD;IACE,IAAAO,uBAAwB,GAAAT,mBAAA,CAAAO,QAAA,CAAAC,WAAA;MACzBN,kBAAA;IAED;IACE;MACAO,uBAAA,CAAwBC,MAAA,CAAO;MACjCJ,uBAAA,CAAAI,MAAA;IACF,CAAG;EAEH;EACF,OAAAT,iBAAA","ignoreList":[]}
|
package/dist/esm/index.js
CHANGED
package/dist/esm/index.js.map
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Keyboard } from "react-native-web";
|
|
3
3
|
const useKeyboardVisible = () => {
|
|
4
|
-
const [isKeyboardVisible, setKeyboardVisible] = React.useState(
|
|
5
|
-
|
|
4
|
+
const [isKeyboardVisible, setKeyboardVisible] = React.useState(false);
|
|
5
|
+
React.useEffect(() => {
|
|
6
6
|
const keyboardDidShowListener = Keyboard.addListener("keyboardDidShow", () => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
setKeyboardVisible(true);
|
|
8
|
+
});
|
|
9
|
+
const keyboardDidHideListener = Keyboard.addListener("keyboardDidHide", () => {
|
|
10
|
+
setKeyboardVisible(false);
|
|
11
|
+
});
|
|
12
12
|
return () => {
|
|
13
|
-
keyboardDidHideListener.remove()
|
|
13
|
+
keyboardDidHideListener.remove();
|
|
14
|
+
keyboardDidShowListener.remove();
|
|
14
15
|
};
|
|
15
|
-
}, [])
|
|
16
|
+
}, []);
|
|
17
|
+
return isKeyboardVisible;
|
|
16
18
|
};
|
|
17
19
|
export { useKeyboardVisible };
|
|
18
20
|
//# sourceMappingURL=useKeyboardVisible.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Keyboard","useKeyboardVisible","isKeyboardVisible","setKeyboardVisible","useState","useEffect","keyboardDidShowListener","addListener","keyboardDidHideListener","remove"],"sources":["../../src/useKeyboardVisible.ts"],"sourcesContent":[null],"mappings":"AAAA,OAAOA,KAAA,MAAW;AAClB,SAASC,QAAA,QAAgB;AAElB,MAAMC,kBAAA,GAAqBA,CAAA,KAAe;EAC/C,MAAM,CAACC,iBAAA,EAAmBC,kBAAkB,IAAIJ,KAAA,CAAMK,QAAA,CAAS,
|
|
1
|
+
{"version":3,"names":["React","Keyboard","useKeyboardVisible","isKeyboardVisible","setKeyboardVisible","useState","useEffect","keyboardDidShowListener","addListener","keyboardDidHideListener","remove"],"sources":["../../src/useKeyboardVisible.ts"],"sourcesContent":[null],"mappings":"AAAA,OAAOA,KAAA,MAAW;AAClB,SAASC,QAAA,QAAgB;AAElB,MAAMC,kBAAA,GAAqBA,CAAA,KAAe;EAC/C,MAAM,CAACC,iBAAA,EAAmBC,kBAAkB,IAAIJ,KAAA,CAAMK,QAAA,CAAS,KAAK;EAEpEL,KAAA,CAAMM,SAAA,CAAU,MAAM;IACpB,MAAMC,uBAAA,GAA0BN,QAAA,CAASO,WAAA,CAAY,mBAAmB,MAAM;MAC5EJ,kBAAA,CAAmB,IAAI;IACzB,CAAC;IACD,MAAMK,uBAAA,GAA0BR,QAAA,CAASO,WAAA,CAAY,mBAAmB,MAAM;MAC5EJ,kBAAA,CAAmB,KAAK;IAC1B,CAAC;IAED,OAAO,MAAM;MACXK,uBAAA,CAAwBC,MAAA,CAAO;MAC/BH,uBAAA,CAAwBG,MAAA,CAAO;IACjC;EACF,GAAG,EAAE;EAEL,OAAOP,iBAAA;AACT","ignoreList":[]}
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Keyboard } from "react-native";
|
|
3
3
|
var useKeyboardVisible = function () {
|
|
4
|
-
var [isKeyboardVisible, setKeyboardVisible] = React.useState(
|
|
5
|
-
|
|
4
|
+
var [isKeyboardVisible, setKeyboardVisible] = React.useState(false);
|
|
5
|
+
React.useEffect(function () {
|
|
6
6
|
var keyboardDidShowListener = Keyboard.addListener("keyboardDidShow", function () {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
setKeyboardVisible(true);
|
|
8
|
+
});
|
|
9
|
+
var keyboardDidHideListener = Keyboard.addListener("keyboardDidHide", function () {
|
|
10
|
+
setKeyboardVisible(false);
|
|
11
|
+
});
|
|
12
12
|
return function () {
|
|
13
|
-
keyboardDidHideListener.remove()
|
|
13
|
+
keyboardDidHideListener.remove();
|
|
14
|
+
keyboardDidShowListener.remove();
|
|
14
15
|
};
|
|
15
|
-
}, [])
|
|
16
|
+
}, []);
|
|
17
|
+
return isKeyboardVisible;
|
|
16
18
|
};
|
|
17
19
|
export { useKeyboardVisible };
|
|
18
20
|
//# sourceMappingURL=useKeyboardVisible.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Keyboard","useKeyboardVisible","isKeyboardVisible","setKeyboardVisible","useState","useEffect","keyboardDidShowListener","addListener","keyboardDidHideListener","remove"],"sources":["../../src/useKeyboardVisible.ts"],"sourcesContent":[null],"mappings":"AAAA,OAAOA,KAAA,MAAW;AAClB,SAASC,QAAA,QAAgB;AAElB,IAAAC,kBAAM,YAAAA,CAAA,EAAoC;EAC/C,KAAAC,iBAAO,EAAAC,kBAAmB,IAAkBJ,KAAI,CAAAK,QAAM,
|
|
1
|
+
{"version":3,"names":["React","Keyboard","useKeyboardVisible","isKeyboardVisible","setKeyboardVisible","useState","useEffect","keyboardDidShowListener","addListener","keyboardDidHideListener","remove"],"sources":["../../src/useKeyboardVisible.ts"],"sourcesContent":[null],"mappings":"AAAA,OAAOA,KAAA,MAAW;AAClB,SAASC,QAAA,QAAgB;AAElB,IAAAC,kBAAM,YAAAA,CAAA,EAAoC;EAC/C,KAAAC,iBAAO,EAAAC,kBAAmB,IAAkBJ,KAAI,CAAAK,QAAM,MAAS;EAE/DL,KAAA,CAAMM,SAAA,CAAU,YAAM;IACpB,IAAAC,uBAAM,GAAAN,QAA0B,CAAAO,WAAS,kBAAY,cAAyB;MAC5EJ,kBAAA,CAAmB,IAAI;IACzB,CAAC;IACD,IAAAK,uBAAM,GAAAR,QAA0B,CAAAO,WAAS,kBAAY,cAAyB;MAC5EJ,kBAAA,CAAmB,KAAK;IAC1B,CAAC;IAED,OAAO,YAAM;MACXK,uBAAA,CAAwBC,MAAA,CAAO;MAC/BH,uBAAA,CAAwBG,MAAA,CAAO;IACjC;EACF,GAAG,EAAE;EAEL,OAAOP,iBAAA;AACT","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/use-keyboard-visible",
|
|
3
|
-
"version": "2.0.0
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"gitHead": "a49cc7ea6b93ba384e77a4880ae48ac4a5635c14",
|
|
5
5
|
"files": [
|
|
6
6
|
"src",
|
|
@@ -17,10 +17,11 @@
|
|
|
17
17
|
".": {
|
|
18
18
|
"types": "./types/index.d.ts",
|
|
19
19
|
"react-native": "./dist/esm/index.native.js",
|
|
20
|
+
"browser": "./dist/esm/index.mjs",
|
|
20
21
|
"module": "./dist/esm/index.mjs",
|
|
21
22
|
"import": "./dist/esm/index.mjs",
|
|
22
23
|
"require": "./dist/cjs/index.cjs",
|
|
23
|
-
"default": "./dist/
|
|
24
|
+
"default": "./dist/esm/index.mjs"
|
|
24
25
|
}
|
|
25
26
|
},
|
|
26
27
|
"publishConfig": {
|
|
@@ -33,12 +34,11 @@
|
|
|
33
34
|
"clean:build": "tamagui-build clean:build"
|
|
34
35
|
},
|
|
35
36
|
"devDependencies": {
|
|
36
|
-
"@tamagui/build": "2.0.0
|
|
37
|
+
"@tamagui/build": "2.0.0",
|
|
37
38
|
"react": ">=19",
|
|
38
|
-
"react-native": "0.
|
|
39
|
+
"react-native": "0.83.2"
|
|
39
40
|
},
|
|
40
41
|
"peerDependencies": {
|
|
41
|
-
"react": ">=19"
|
|
42
|
-
"react-native": "*"
|
|
42
|
+
"react": ">=19"
|
|
43
43
|
}
|
|
44
44
|
}
|
package/types/index.d.ts.map
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
"sources": [
|
|
5
5
|
"src/useKeyboardVisible.ts"
|
|
6
6
|
],
|
|
7
|
+
"version": 3,
|
|
7
8
|
"sourcesContent": [
|
|
8
9
|
"import React from 'react'\nimport { Keyboard } from 'react-native'\n\nexport const useKeyboardVisible = (): boolean => {\n const [isKeyboardVisible, setKeyboardVisible] = React.useState(false)\n\n React.useEffect(() => {\n const keyboardDidShowListener = Keyboard.addListener('keyboardDidShow', () => {\n setKeyboardVisible(true)\n })\n const keyboardDidHideListener = Keyboard.addListener('keyboardDidHide', () => {\n setKeyboardVisible(false)\n })\n\n return () => {\n keyboardDidHideListener.remove()\n keyboardDidShowListener.remove()\n }\n }, [])\n\n return isKeyboardVisible\n}\n"
|
|
9
|
-
]
|
|
10
|
-
"version": 3
|
|
10
|
+
]
|
|
11
11
|
}
|
package/dist/cjs/index.js
DELETED
|
@@ -1,21 +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 __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
8
|
-
}, __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
10
|
-
for (let key of __getOwnPropNames(from))
|
|
11
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
15
|
-
var index_exports = {};
|
|
16
|
-
__export(index_exports, {
|
|
17
|
-
useKeyboardVisible: () => import_useKeyboardVisible.useKeyboardVisible
|
|
18
|
-
});
|
|
19
|
-
module.exports = __toCommonJS(index_exports);
|
|
20
|
-
var import_useKeyboardVisible = require("./useKeyboardVisible");
|
|
21
|
-
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
DELETED
|
@@ -1,42 +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 useKeyboardVisible_exports = {};
|
|
24
|
-
__export(useKeyboardVisible_exports, {
|
|
25
|
-
useKeyboardVisible: () => useKeyboardVisible
|
|
26
|
-
});
|
|
27
|
-
module.exports = __toCommonJS(useKeyboardVisible_exports);
|
|
28
|
-
var import_react = __toESM(require("react"), 1), import_react_native = require("react-native-web");
|
|
29
|
-
const useKeyboardVisible = () => {
|
|
30
|
-
const [isKeyboardVisible, setKeyboardVisible] = import_react.default.useState(!1);
|
|
31
|
-
return import_react.default.useEffect(() => {
|
|
32
|
-
const keyboardDidShowListener = import_react_native.Keyboard.addListener("keyboardDidShow", () => {
|
|
33
|
-
setKeyboardVisible(!0);
|
|
34
|
-
}), keyboardDidHideListener = import_react_native.Keyboard.addListener("keyboardDidHide", () => {
|
|
35
|
-
setKeyboardVisible(!1);
|
|
36
|
-
});
|
|
37
|
-
return () => {
|
|
38
|
-
keyboardDidHideListener.remove(), keyboardDidShowListener.remove();
|
|
39
|
-
};
|
|
40
|
-
}, []), isKeyboardVisible;
|
|
41
|
-
};
|
|
42
|
-
//# sourceMappingURL=useKeyboardVisible.js.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/useKeyboardVisible.ts"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB,8BAClB,sBAAyB;AAElB,MAAM,qBAAqB,MAAe;AAC/C,QAAM,CAAC,mBAAmB,kBAAkB,IAAI,aAAAA,QAAM,SAAS,EAAK;AAEpE,sBAAAA,QAAM,UAAU,MAAM;AACpB,UAAM,0BAA0B,6BAAS,YAAY,mBAAmB,MAAM;AAC5E,yBAAmB,EAAI;AAAA,IACzB,CAAC,GACK,0BAA0B,6BAAS,YAAY,mBAAmB,MAAM;AAC5E,yBAAmB,EAAK;AAAA,IAC1B,CAAC;AAED,WAAO,MAAM;AACX,8BAAwB,OAAO,GAC/B,wBAAwB,OAAO;AAAA,IACjC;AAAA,EACF,GAAG,CAAC,CAAC,GAEE;AACT;",
|
|
5
|
-
"names": ["React"]
|
|
6
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Keyboard } from "react-native-web";
|
|
3
|
-
const useKeyboardVisible = () => {
|
|
4
|
-
const [isKeyboardVisible, setKeyboardVisible] = React.useState(!1);
|
|
5
|
-
return React.useEffect(() => {
|
|
6
|
-
const keyboardDidShowListener = Keyboard.addListener("keyboardDidShow", () => {
|
|
7
|
-
setKeyboardVisible(!0);
|
|
8
|
-
}), keyboardDidHideListener = Keyboard.addListener("keyboardDidHide", () => {
|
|
9
|
-
setKeyboardVisible(!1);
|
|
10
|
-
});
|
|
11
|
-
return () => {
|
|
12
|
-
keyboardDidHideListener.remove(), keyboardDidShowListener.remove();
|
|
13
|
-
};
|
|
14
|
-
}, []), isKeyboardVisible;
|
|
15
|
-
};
|
|
16
|
-
export {
|
|
17
|
-
useKeyboardVisible
|
|
18
|
-
};
|
|
19
|
-
//# sourceMappingURL=useKeyboardVisible.js.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/useKeyboardVisible.ts"],
|
|
4
|
-
"mappings": "AAAA,OAAO,WAAW;AAClB,SAAS,gBAAgB;AAElB,MAAM,qBAAqB,MAAe;AAC/C,QAAM,CAAC,mBAAmB,kBAAkB,IAAI,MAAM,SAAS,EAAK;AAEpE,eAAM,UAAU,MAAM;AACpB,UAAM,0BAA0B,SAAS,YAAY,mBAAmB,MAAM;AAC5E,yBAAmB,EAAI;AAAA,IACzB,CAAC,GACK,0BAA0B,SAAS,YAAY,mBAAmB,MAAM;AAC5E,yBAAmB,EAAK;AAAA,IAC1B,CAAC;AAED,WAAO,MAAM;AACX,8BAAwB,OAAO,GAC/B,wBAAwB,OAAO;AAAA,IACjC;AAAA,EACF,GAAG,CAAC,CAAC,GAEE;AACT;",
|
|
5
|
-
"names": []
|
|
6
|
-
}
|