@vxrn/safe-area 2.0.0-beta.33.1 → 2.0.0-beta.46.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/.turbo/turbo-build.log +1 -1
- package/dist/cjs/InitialWindow.cjs +15 -17
- package/dist/cjs/InitialWindow.native.cjs +30 -0
- package/dist/cjs/InitialWindow.native.js +15 -16
- package/dist/cjs/InitialWindow.native.js.map +1 -1
- package/dist/cjs/NativeSafeAreaProvider.cjs +109 -135
- package/dist/cjs/NativeSafeAreaProvider.native.cjs +141 -0
- package/dist/cjs/NativeSafeAreaProvider.native.js +111 -141
- package/dist/cjs/NativeSafeAreaProvider.native.js.map +1 -1
- package/dist/cjs/SafeArea-types.cjs +9 -11
- package/dist/cjs/SafeArea-types.native.cjs +18 -0
- package/dist/cjs/SafeArea-types.native.js +9 -10
- package/dist/cjs/SafeArea-types.native.js.map +1 -1
- package/dist/cjs/SafeAreaContext.cjs +85 -106
- package/dist/cjs/SafeAreaContext.native.cjs +132 -0
- package/dist/cjs/SafeAreaContext.native.js +88 -108
- package/dist/cjs/SafeAreaContext.native.js.map +1 -1
- package/dist/cjs/SafeAreaView.cjs +67 -100
- package/dist/cjs/SafeAreaView.native.cjs +99 -0
- package/dist/cjs/SafeAreaView.native.js +74 -106
- package/dist/cjs/SafeAreaView.native.js.map +1 -1
- package/dist/cjs/getWindowFrame.cjs +20 -24
- package/dist/cjs/getWindowFrame.native.cjs +35 -0
- package/dist/cjs/getWindowFrame.native.js +21 -27
- package/dist/cjs/getWindowFrame.native.js.map +1 -1
- package/dist/cjs/index.cjs +9 -11
- package/dist/cjs/index.native.cjs +22 -0
- package/dist/cjs/index.native.js +9 -10
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/esm/InitialWindow.mjs +1 -0
- package/dist/esm/InitialWindow.mjs.map +1 -1
- package/dist/esm/InitialWindow.native.js +1 -0
- package/dist/esm/InitialWindow.native.js.map +1 -1
- package/dist/esm/NativeSafeAreaProvider.mjs +94 -109
- package/dist/esm/NativeSafeAreaProvider.mjs.map +1 -1
- package/dist/esm/NativeSafeAreaProvider.native.js +96 -116
- package/dist/esm/NativeSafeAreaProvider.native.js.map +1 -1
- package/dist/esm/SafeArea-types.mjs +0 -2
- package/dist/esm/SafeArea-types.native.js +0 -2
- package/dist/esm/SafeAreaContext.mjs +62 -74
- package/dist/esm/SafeAreaContext.mjs.map +1 -1
- package/dist/esm/SafeAreaContext.native.js +66 -78
- package/dist/esm/SafeAreaContext.native.js.map +1 -1
- package/dist/esm/SafeAreaView.mjs +52 -74
- package/dist/esm/SafeAreaView.mjs.map +1 -1
- package/dist/esm/SafeAreaView.native.js +60 -82
- package/dist/esm/SafeAreaView.native.js.map +1 -1
- package/dist/esm/getWindowFrame.mjs +7 -6
- package/dist/esm/getWindowFrame.mjs.map +1 -1
- package/dist/esm/getWindowFrame.native.js +9 -10
- package/dist/esm/getWindowFrame.native.js.map +1 -1
- package/dist/esm/index.js +5 -4
- package/dist/esm/index.mjs +5 -4
- package/dist/esm/index.native.js +5 -4
- package/package.json +2 -2
- package/dist/esm/SafeArea-types.mjs.map +0 -1
- package/dist/esm/SafeArea-types.native.js.map +0 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/index.mjs.map +0 -1
- package/dist/esm/index.native.js.map +0 -1
|
@@ -3,33 +3,29 @@ 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
|
-
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: true
|
|
9
|
+
});
|
|
10
10
|
};
|
|
11
11
|
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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, {
|
|
14
|
+
get: () => from[key],
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
19
|
};
|
|
20
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
21
|
-
value: true
|
|
22
|
-
}), mod);
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
23
21
|
var getWindowFrame_exports = {};
|
|
24
|
-
__export(getWindowFrame_exports, {
|
|
25
|
-
getWindowFrame: () => getWindowFrame
|
|
26
|
-
});
|
|
22
|
+
__export(getWindowFrame_exports, { getWindowFrame: () => getWindowFrame });
|
|
27
23
|
module.exports = __toCommonJS(getWindowFrame_exports);
|
|
28
24
|
function getWindowFrame() {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
25
|
+
return {
|
|
26
|
+
x: 0,
|
|
27
|
+
y: 0,
|
|
28
|
+
width: typeof window === "undefined" ? 0 : window.innerWidth,
|
|
29
|
+
height: typeof window === "undefined" ? 0 : window.innerHeight
|
|
30
|
+
};
|
|
31
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
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, {
|
|
16
|
+
get: () => from[key],
|
|
17
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
23
|
+
var getWindowFrame_native_exports = {};
|
|
24
|
+
__export(getWindowFrame_native_exports, { getWindowFrame: () => getWindowFrame });
|
|
25
|
+
module.exports = __toCommonJS(getWindowFrame_native_exports);
|
|
26
|
+
var import_react_native = require("react-native");
|
|
27
|
+
function getWindowFrame() {
|
|
28
|
+
var { width, height } = import_react_native.Dimensions.get("window");
|
|
29
|
+
return {
|
|
30
|
+
x: 0,
|
|
31
|
+
y: 0,
|
|
32
|
+
width,
|
|
33
|
+
height
|
|
34
|
+
};
|
|
35
|
+
}
|
|
@@ -5,39 +5,33 @@ 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
|
-
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true
|
|
11
|
+
});
|
|
12
12
|
};
|
|
13
13
|
var __copyProps = (to, from, except, desc) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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, {
|
|
16
|
+
get: () => from[key],
|
|
17
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
21
|
};
|
|
22
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
23
|
-
value: true
|
|
24
|
-
}), mod);
|
|
22
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
23
|
var getWindowFrame_native_exports = {};
|
|
26
|
-
__export(getWindowFrame_native_exports, {
|
|
27
|
-
getWindowFrame: () => getWindowFrame
|
|
28
|
-
});
|
|
24
|
+
__export(getWindowFrame_native_exports, { getWindowFrame: () => getWindowFrame });
|
|
29
25
|
module.exports = __toCommonJS(getWindowFrame_native_exports);
|
|
30
26
|
var import_react_native = require("react-native");
|
|
31
27
|
function getWindowFrame() {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
width,
|
|
40
|
-
height
|
|
41
|
-
};
|
|
28
|
+
var { width, height } = import_react_native.Dimensions.get("window");
|
|
29
|
+
return {
|
|
30
|
+
x: 0,
|
|
31
|
+
y: 0,
|
|
32
|
+
width,
|
|
33
|
+
height
|
|
34
|
+
};
|
|
42
35
|
}
|
|
36
|
+
|
|
43
37
|
//# sourceMappingURL=getWindowFrame.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"getWindowFrame.native.js","names":[],"sources":["cjs/getWindowFrame.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar getWindowFrame_native_exports = {};\n__export(getWindowFrame_native_exports, {\n getWindowFrame: () => getWindowFrame\n});\nmodule.exports = __toCommonJS(getWindowFrame_native_exports);\nvar import_react_native = require(\"react-native\");\nfunction getWindowFrame() {\n var { width, height } = import_react_native.Dimensions.get(\"window\");\n return {\n x: 0,\n y: 0,\n width,\n height\n };\n}\n//# sourceMappingURL=getWindowFrame.native.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,gCAAgC,CAAC;AACrC,SAAS,+BAA+B,EACtC,sBAAsB,eACxB,CAAC;AACD,OAAO,UAAU,aAAa,6BAA6B;AAC3D,IAAI,sBAAsB,QAAQ,cAAc;AAChD,SAAS,iBAAiB;CACxB,IAAI,EAAE,OAAO,WAAW,oBAAoB,WAAW,IAAI,QAAQ;CACnE,OAAO;EACL,GAAG;EACH,GAAG;EACH;EACA;CACF;AACF"}
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -3,20 +3,18 @@ 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
|
-
|
|
12
|
-
|
|
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, {
|
|
8
|
+
get: () => from[key],
|
|
9
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
13
|
};
|
|
14
14
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
16
|
-
value: true
|
|
17
|
-
}), mod);
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
16
|
var index_exports = {};
|
|
19
17
|
module.exports = __toCommonJS(index_exports);
|
|
20
18
|
__reExport(index_exports, require("./SafeAreaContext.cjs"), module.exports);
|
|
21
19
|
__reExport(index_exports, require("./SafeAreaView.cjs"), module.exports);
|
|
22
|
-
__reExport(index_exports, require("./InitialWindow.cjs"), module.exports);
|
|
20
|
+
__reExport(index_exports, require("./InitialWindow.cjs"), module.exports);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __copyProps = (to, from, except, desc) => {
|
|
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, {
|
|
10
|
+
get: () => from[key],
|
|
11
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
return to;
|
|
15
|
+
};
|
|
16
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var index_exports = {};
|
|
19
|
+
module.exports = __toCommonJS(index_exports);
|
|
20
|
+
__reExport(index_exports, require("./SafeAreaContext.native.js"), module.exports);
|
|
21
|
+
__reExport(index_exports, require("./SafeAreaView.native.js"), module.exports);
|
|
22
|
+
__reExport(index_exports, require("./InitialWindow.native.js"), module.exports);
|
package/dist/cjs/index.native.js
CHANGED
|
@@ -5,21 +5,20 @@ 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
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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, {
|
|
10
|
+
get: () => from[key],
|
|
11
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
return to;
|
|
15
15
|
};
|
|
16
16
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
17
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
18
|
-
value: true
|
|
19
|
-
}), mod);
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
18
|
var index_exports = {};
|
|
21
19
|
module.exports = __toCommonJS(index_exports);
|
|
22
20
|
__reExport(index_exports, require("./SafeAreaContext.native.js"), module.exports);
|
|
23
21
|
__reExport(index_exports, require("./SafeAreaView.native.js"), module.exports);
|
|
24
22
|
__reExport(index_exports, require("./InitialWindow.native.js"), module.exports);
|
|
23
|
+
|
|
25
24
|
//# sourceMappingURL=index.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.native.js","names":[],"sources":["cjs/index.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, \"default\"), secondTarget && __copyProps(secondTarget, mod, \"default\"));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar index_exports = {};\nmodule.exports = __toCommonJS(index_exports);\n__reExport(index_exports, require(\"./SafeAreaContext\"), module.exports);\n__reExport(index_exports, require(\"./SafeAreaView\"), module.exports);\n__reExport(index_exports, require(\"./InitialWindow\"), module.exports);\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,cAAc,QAAQ,KAAK,kBAAkB,YAAY,QAAQ,KAAK,SAAS,GAAG,gBAAgB,YAAY,cAAc,KAAK,SAAS;AAC9I,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,gBAAgB,CAAC;AACrB,OAAO,UAAU,aAAa,aAAa;AAC3C,WAAW,eAAe,QAAQ,6BAAmB,GAAG,OAAO,OAAO;AACtE,WAAW,eAAe,QAAQ,0BAAgB,GAAG,OAAO,OAAO;AACnE,WAAW,eAAe,QAAQ,2BAAiB,GAAG,OAAO,OAAO"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"InitialWindow.js","names":[],"sources":["esm/InitialWindow.js"],"sourcesContent":["const initialWindowMetrics = null;\nconst initialWindowSafeAreaInsets = null;\nexport {\n initialWindowMetrics,\n initialWindowSafeAreaInsets\n};\n//# sourceMappingURL=InitialWindow.js.map\n"],"mappings":";AAAA,MAAM,uBAAuB;AAC7B,MAAM,8BAA8B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"InitialWindow.native.js","names":[],"sources":["esm/InitialWindow.native.js"],"sourcesContent":["var initialWindowMetrics = null;\nvar initialWindowSafeAreaInsets = null;\nexport {\n initialWindowMetrics,\n initialWindowSafeAreaInsets\n};\n//# sourceMappingURL=InitialWindow.js.map\n"],"mappings":";AAAA,IAAI,uBAAuB;AAC3B,IAAI,8BAA8B"}
|
|
@@ -1,126 +1,111 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
|
|
3
4
|
const CSSTransitions = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
WebkitTransition: "webkitTransitionEnd",
|
|
6
|
+
Transition: "transitionEnd",
|
|
7
|
+
MozTransition: "transitionend",
|
|
8
|
+
MSTransition: "msTransitionEnd",
|
|
9
|
+
OTransition: "oTransitionEnd"
|
|
9
10
|
};
|
|
10
|
-
function NativeSafeAreaProvider({
|
|
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
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
const styleValues = Array.isArray(styleValue) ? styleValue.flat(Number.POSITIVE_INFINITY) : [styleValue];
|
|
57
|
-
const flattenedStyle = styleValues.reduce((result, value) => value && typeof value === "object" ? Object.assign(result, value) : result, {});
|
|
58
|
-
return /* @__PURE__ */jsx("div", {
|
|
59
|
-
style: flattenedStyle,
|
|
60
|
-
children
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
return /* @__PURE__ */jsx("div", {
|
|
64
|
-
style: {
|
|
65
|
-
display: "contents"
|
|
66
|
-
},
|
|
67
|
-
children
|
|
68
|
-
});
|
|
11
|
+
function NativeSafeAreaProvider({ children, style, onInsetsChange }) {
|
|
12
|
+
React.useEffect(() => {
|
|
13
|
+
if (typeof document === "undefined") {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
const element = createContextElement();
|
|
17
|
+
document.body.appendChild(element);
|
|
18
|
+
const onEnd = () => {
|
|
19
|
+
const { paddingTop, paddingBottom, paddingLeft, paddingRight } = window.getComputedStyle(element);
|
|
20
|
+
const insets = {
|
|
21
|
+
top: paddingTop ? Number.parseInt(paddingTop, 10) : 0,
|
|
22
|
+
bottom: paddingBottom ? Number.parseInt(paddingBottom, 10) : 0,
|
|
23
|
+
left: paddingLeft ? Number.parseInt(paddingLeft, 10) : 0,
|
|
24
|
+
right: paddingRight ? Number.parseInt(paddingRight, 10) : 0
|
|
25
|
+
};
|
|
26
|
+
const frame = {
|
|
27
|
+
x: 0,
|
|
28
|
+
y: 0,
|
|
29
|
+
width: document.documentElement.offsetWidth,
|
|
30
|
+
height: document.documentElement.offsetHeight
|
|
31
|
+
};
|
|
32
|
+
onInsetsChange({ nativeEvent: {
|
|
33
|
+
insets,
|
|
34
|
+
frame
|
|
35
|
+
} });
|
|
36
|
+
};
|
|
37
|
+
element.addEventListener(getSupportedTransitionEvent(), onEnd);
|
|
38
|
+
onEnd();
|
|
39
|
+
return () => {
|
|
40
|
+
document.body.removeChild(element);
|
|
41
|
+
element.removeEventListener(getSupportedTransitionEvent(), onEnd);
|
|
42
|
+
};
|
|
43
|
+
}, [onInsetsChange]);
|
|
44
|
+
if (style) {
|
|
45
|
+
const styleValue = style;
|
|
46
|
+
const styleValues = Array.isArray(styleValue) ? styleValue.flat(Number.POSITIVE_INFINITY) : [styleValue];
|
|
47
|
+
const flattenedStyle = styleValues.reduce((result, value) => value && typeof value === "object" ? Object.assign(result, value) : result, {});
|
|
48
|
+
return /* @__PURE__ */ jsx("div", {
|
|
49
|
+
style: flattenedStyle,
|
|
50
|
+
children
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
return /* @__PURE__ */ jsx("div", {
|
|
54
|
+
style: { display: "contents" },
|
|
55
|
+
children
|
|
56
|
+
});
|
|
69
57
|
}
|
|
70
58
|
let _supportedTransitionEvent = null;
|
|
71
59
|
function getSupportedTransitionEvent() {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
60
|
+
if (_supportedTransitionEvent != null) {
|
|
61
|
+
return _supportedTransitionEvent;
|
|
62
|
+
}
|
|
63
|
+
const element = document.createElement("invalidtype");
|
|
64
|
+
_supportedTransitionEvent = CSSTransitions.Transition;
|
|
65
|
+
for (const key in CSSTransitions) {
|
|
66
|
+
if (element.style[key] !== void 0) {
|
|
67
|
+
_supportedTransitionEvent = CSSTransitions[key];
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return _supportedTransitionEvent;
|
|
84
72
|
}
|
|
85
73
|
let _supportedEnv = null;
|
|
86
74
|
function getSupportedEnv() {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}
|
|
98
|
-
return _supportedEnv;
|
|
75
|
+
if (_supportedEnv !== null) {
|
|
76
|
+
return _supportedEnv;
|
|
77
|
+
}
|
|
78
|
+
const { CSS } = window;
|
|
79
|
+
if (CSS && CSS.supports && CSS.supports("top: constant(safe-area-inset-top)")) {
|
|
80
|
+
_supportedEnv = "constant";
|
|
81
|
+
} else {
|
|
82
|
+
_supportedEnv = "env";
|
|
83
|
+
}
|
|
84
|
+
return _supportedEnv;
|
|
99
85
|
}
|
|
100
86
|
function getInset(side) {
|
|
101
|
-
|
|
87
|
+
return `${getSupportedEnv()}(safe-area-inset-${side})`;
|
|
102
88
|
}
|
|
103
89
|
function createContextElement() {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
style.paddingRight = getInset("right");
|
|
123
|
-
return element;
|
|
90
|
+
const element = document.createElement("div");
|
|
91
|
+
const { style } = element;
|
|
92
|
+
style.position = "fixed";
|
|
93
|
+
style.left = "0";
|
|
94
|
+
style.top = "0";
|
|
95
|
+
style.width = "0";
|
|
96
|
+
style.height = "0";
|
|
97
|
+
style.zIndex = "-1";
|
|
98
|
+
style.overflow = "hidden";
|
|
99
|
+
style.visibility = "hidden";
|
|
100
|
+
style.transitionDuration = "0.05s";
|
|
101
|
+
style.transitionProperty = "padding";
|
|
102
|
+
style.transitionDelay = "0s";
|
|
103
|
+
style.paddingTop = getInset("top");
|
|
104
|
+
style.paddingBottom = getInset("bottom");
|
|
105
|
+
style.paddingLeft = getInset("left");
|
|
106
|
+
style.paddingRight = getInset("right");
|
|
107
|
+
return element;
|
|
124
108
|
}
|
|
109
|
+
|
|
125
110
|
export { NativeSafeAreaProvider };
|
|
126
111
|
//# sourceMappingURL=NativeSafeAreaProvider.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"file":"NativeSafeAreaProvider.js","names":[],"sources":["esm/NativeSafeAreaProvider.js"],"sourcesContent":["import * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nconst CSSTransitions = {\n WebkitTransition: \"webkitTransitionEnd\",\n Transition: \"transitionEnd\",\n MozTransition: \"transitionend\",\n MSTransition: \"msTransitionEnd\",\n OTransition: \"oTransitionEnd\"\n};\nfunction NativeSafeAreaProvider({\n children,\n style,\n onInsetsChange\n}) {\n React.useEffect(() => {\n if (typeof document === \"undefined\") {\n return;\n }\n const element = createContextElement();\n document.body.appendChild(element);\n const onEnd = () => {\n const { paddingTop, paddingBottom, paddingLeft, paddingRight } = window.getComputedStyle(element);\n const insets = {\n top: paddingTop ? Number.parseInt(paddingTop, 10) : 0,\n bottom: paddingBottom ? Number.parseInt(paddingBottom, 10) : 0,\n left: paddingLeft ? Number.parseInt(paddingLeft, 10) : 0,\n right: paddingRight ? Number.parseInt(paddingRight, 10) : 0\n };\n const frame = {\n x: 0,\n y: 0,\n width: document.documentElement.offsetWidth,\n height: document.documentElement.offsetHeight\n };\n onInsetsChange({ nativeEvent: { insets, frame } });\n };\n element.addEventListener(getSupportedTransitionEvent(), onEnd);\n onEnd();\n return () => {\n document.body.removeChild(element);\n element.removeEventListener(getSupportedTransitionEvent(), onEnd);\n };\n }, [onInsetsChange]);\n if (style) {\n const styleValue = style;\n const styleValues = Array.isArray(styleValue) ? styleValue.flat(Number.POSITIVE_INFINITY) : [styleValue];\n const flattenedStyle = styleValues.reduce(\n (result, value) => value && typeof value === \"object\" ? Object.assign(result, value) : result,\n {}\n );\n return /* @__PURE__ */ jsx(\"div\", { style: flattenedStyle, children });\n }\n return /* @__PURE__ */ jsx(\"div\", { style: { display: \"contents\" }, children });\n}\nlet _supportedTransitionEvent = null;\nfunction getSupportedTransitionEvent() {\n if (_supportedTransitionEvent != null) {\n return _supportedTransitionEvent;\n }\n const element = document.createElement(\"invalidtype\");\n _supportedTransitionEvent = CSSTransitions.Transition;\n for (const key in CSSTransitions) {\n if (element.style[key] !== void 0) {\n _supportedTransitionEvent = CSSTransitions[key];\n break;\n }\n }\n return _supportedTransitionEvent;\n}\nlet _supportedEnv = null;\nfunction getSupportedEnv() {\n if (_supportedEnv !== null) {\n return _supportedEnv;\n }\n const { CSS } = window;\n if (CSS && CSS.supports && CSS.supports(\"top: constant(safe-area-inset-top)\")) {\n _supportedEnv = \"constant\";\n } else {\n _supportedEnv = \"env\";\n }\n return _supportedEnv;\n}\nfunction getInset(side) {\n return `${getSupportedEnv()}(safe-area-inset-${side})`;\n}\nfunction createContextElement() {\n const element = document.createElement(\"div\");\n const { style } = element;\n style.position = \"fixed\";\n style.left = \"0\";\n style.top = \"0\";\n style.width = \"0\";\n style.height = \"0\";\n style.zIndex = \"-1\";\n style.overflow = \"hidden\";\n style.visibility = \"hidden\";\n style.transitionDuration = \"0.05s\";\n style.transitionProperty = \"padding\";\n style.transitionDelay = \"0s\";\n style.paddingTop = getInset(\"top\");\n style.paddingBottom = getInset(\"bottom\");\n style.paddingLeft = getInset(\"left\");\n style.paddingRight = getInset(\"right\");\n return element;\n}\nexport {\n NativeSafeAreaProvider\n};\n//# sourceMappingURL=NativeSafeAreaProvider.js.map\n"],"mappings":";;;;AAEA,MAAM,iBAAiB;CACrB,kBAAkB;CAClB,YAAY;CACZ,eAAe;CACf,cAAc;CACd,aAAa;AACf;AACA,SAAS,uBAAuB,EAC9B,UACA,OACA,kBACC;CACD,MAAM,gBAAgB;EACpB,IAAI,OAAO,aAAa,aAAa;GACnC;EACF;EACA,MAAM,UAAU,qBAAqB;EACrC,SAAS,KAAK,YAAY,OAAO;EACjC,MAAM,cAAc;GAClB,MAAM,EAAE,YAAY,eAAe,aAAa,iBAAiB,OAAO,iBAAiB,OAAO;GAChG,MAAM,SAAS;IACb,KAAK,aAAa,OAAO,SAAS,YAAY,EAAE,IAAI;IACpD,QAAQ,gBAAgB,OAAO,SAAS,eAAe,EAAE,IAAI;IAC7D,MAAM,cAAc,OAAO,SAAS,aAAa,EAAE,IAAI;IACvD,OAAO,eAAe,OAAO,SAAS,cAAc,EAAE,IAAI;GAC5D;GACA,MAAM,QAAQ;IACZ,GAAG;IACH,GAAG;IACH,OAAO,SAAS,gBAAgB;IAChC,QAAQ,SAAS,gBAAgB;GACnC;GACA,eAAe,EAAE,aAAa;IAAE;IAAQ;GAAM,EAAE,CAAC;EACnD;EACA,QAAQ,iBAAiB,4BAA4B,GAAG,KAAK;EAC7D,MAAM;EACN,aAAa;GACX,SAAS,KAAK,YAAY,OAAO;GACjC,QAAQ,oBAAoB,4BAA4B,GAAG,KAAK;EAClE;CACF,GAAG,CAAC,cAAc,CAAC;CACnB,IAAI,OAAO;EACT,MAAM,aAAa;EACnB,MAAM,cAAc,MAAM,QAAQ,UAAU,IAAI,WAAW,KAAK,OAAO,iBAAiB,IAAI,CAAC,UAAU;EACvG,MAAM,iBAAiB,YAAY,QAChC,QAAQ,UAAU,SAAS,OAAO,UAAU,WAAW,OAAO,OAAO,QAAQ,KAAK,IAAI,QACvF,CAAC,CACH;EACA,OAAuB,oBAAI,OAAO;GAAE,OAAO;GAAgB;EAAS,CAAC;CACvE;CACA,OAAuB,oBAAI,OAAO;EAAE,OAAO,EAAE,SAAS,WAAW;EAAG;CAAS,CAAC;AAChF;AACA,IAAI,4BAA4B;AAChC,SAAS,8BAA8B;CACrC,IAAI,6BAA6B,MAAM;EACrC,OAAO;CACT;CACA,MAAM,UAAU,SAAS,cAAc,aAAa;CACpD,4BAA4B,eAAe;CAC3C,KAAK,MAAM,OAAO,gBAAgB;EAChC,IAAI,QAAQ,MAAM,SAAS,KAAK,GAAG;GACjC,4BAA4B,eAAe;GAC3C;EACF;CACF;CACA,OAAO;AACT;AACA,IAAI,gBAAgB;AACpB,SAAS,kBAAkB;CACzB,IAAI,kBAAkB,MAAM;EAC1B,OAAO;CACT;CACA,MAAM,EAAE,QAAQ;CAChB,IAAI,OAAO,IAAI,YAAY,IAAI,SAAS,oCAAoC,GAAG;EAC7E,gBAAgB;CAClB,OAAO;EACL,gBAAgB;CAClB;CACA,OAAO;AACT;AACA,SAAS,SAAS,MAAM;CACtB,OAAO,GAAG,gBAAgB,EAAE,mBAAmB,KAAK;AACtD;AACA,SAAS,uBAAuB;CAC9B,MAAM,UAAU,SAAS,cAAc,KAAK;CAC5C,MAAM,EAAE,UAAU;CAClB,MAAM,WAAW;CACjB,MAAM,OAAO;CACb,MAAM,MAAM;CACZ,MAAM,QAAQ;CACd,MAAM,SAAS;CACf,MAAM,SAAS;CACf,MAAM,WAAW;CACjB,MAAM,aAAa;CACnB,MAAM,qBAAqB;CAC3B,MAAM,qBAAqB;CAC3B,MAAM,kBAAkB;CACxB,MAAM,aAAa,SAAS,KAAK;CACjC,MAAM,gBAAgB,SAAS,QAAQ;CACvC,MAAM,cAAc,SAAS,MAAM;CACnC,MAAM,eAAe,SAAS,OAAO;CACrC,OAAO;AACT"}
|