@tamagui/use-window-dimensions 2.7.7 → 3.0.0-beta.637.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/helpers.cjs +48 -48
- package/dist/cjs/helpers.native.cjs +52 -0
- package/dist/cjs/helpers.native.js +32 -34
- package/dist/cjs/helpers.native.js.map +1 -1
- package/dist/cjs/index.cjs +21 -29
- package/dist/cjs/index.native.cjs +46 -0
- package/dist/cjs/index.native.js +23 -30
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/initialValue.cjs +21 -22
- package/dist/cjs/initialValue.native.cjs +38 -0
- package/dist/cjs/initialValue.native.js +21 -21
- package/dist/cjs/initialValue.native.js.map +1 -1
- package/dist/cjs/types.cjs +10 -11
- package/dist/cjs/types.native.cjs +19 -0
- package/dist/cjs/types.native.js +10 -10
- package/dist/cjs/types.native.js.map +1 -1
- package/dist/esm/helpers.mjs +34 -31
- package/dist/esm/helpers.mjs.map +1 -1
- package/dist/esm/helpers.native.js +18 -18
- package/dist/esm/helpers.native.js.map +1 -1
- package/dist/esm/index.js +5 -6
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.mjs +5 -6
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/index.native.js +7 -8
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/initialValue.mjs +6 -5
- package/dist/esm/initialValue.mjs.map +1 -1
- package/dist/esm/initialValue.native.js +6 -5
- package/dist/esm/initialValue.native.js.map +1 -1
- package/dist/esm/types.mjs +0 -2
- package/dist/esm/types.native.js +0 -2
- package/package.json +4 -4
- package/dist/esm/types.mjs.map +0 -1
- package/dist/esm/types.native.js.map +0 -1
package/dist/cjs/helpers.cjs
CHANGED
|
@@ -1,68 +1,68 @@
|
|
|
1
|
+
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
6
|
var __export = (target, all) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
for (var name in all) __defProp(target, name, {
|
|
8
|
+
get: all[name],
|
|
9
|
+
enumerable: true
|
|
10
|
+
});
|
|
10
11
|
};
|
|
11
12
|
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
15
|
+
get: () => from[key],
|
|
16
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
19
20
|
};
|
|
20
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
21
|
-
value: true
|
|
22
|
-
}), mod);
|
|
21
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
23
22
|
var helpers_exports = {};
|
|
24
23
|
__export(helpers_exports, {
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
getWindowSize: () => getWindowSize,
|
|
25
|
+
subscribe: () => subscribe
|
|
27
26
|
});
|
|
28
27
|
module.exports = __toCommonJS(helpers_exports);
|
|
29
28
|
var import_constants = require("@tamagui/constants");
|
|
30
29
|
let lastSize = require("./initialValue.cjs").initialValue;
|
|
31
30
|
let docEl = null;
|
|
32
31
|
function getWindowSize() {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
32
|
+
docEl ||= window.document.documentElement;
|
|
33
|
+
const nextSize = {
|
|
34
|
+
fontScale: 1,
|
|
35
|
+
height: docEl.clientHeight,
|
|
36
|
+
scale: window.devicePixelRatio || 1,
|
|
37
|
+
width: docEl.clientWidth
|
|
38
|
+
};
|
|
39
|
+
if (nextSize.height !== lastSize.height || nextSize.width !== lastSize.width || nextSize.scale !== lastSize.scale) {
|
|
40
|
+
lastSize = nextSize;
|
|
41
|
+
return nextSize;
|
|
42
|
+
}
|
|
43
|
+
return lastSize;
|
|
45
44
|
}
|
|
46
|
-
const cbs = /* @__PURE__ */new Set();
|
|
45
|
+
const cbs = /* @__PURE__ */ new Set();
|
|
47
46
|
if (import_constants.isClient && typeof window !== "undefined" && typeof window.addEventListener === "function") {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
47
|
+
let flushUpdate = function() {
|
|
48
|
+
lastUpdate = Date.now();
|
|
49
|
+
cbs.forEach((cb) => cb(getWindowSize()));
|
|
50
|
+
};
|
|
51
|
+
let lastUpdate = Date.now();
|
|
52
|
+
let tm;
|
|
53
|
+
const USER_MAX_MS = process.env.TAMAGUI_USE_WINDOW_DIMENSIONS_MAX_UPDATE_MS;
|
|
54
|
+
const updateMaxMs = USER_MAX_MS ? +USER_MAX_MS : 100;
|
|
55
|
+
const onResize = () => {
|
|
56
|
+
clearTimeout(tm);
|
|
57
|
+
const timeSinceLast = Date.now() - lastUpdate;
|
|
58
|
+
if (timeSinceLast < updateMaxMs) tm = setTimeout(() => {
|
|
59
|
+
flushUpdate();
|
|
60
|
+
}, updateMaxMs - timeSinceLast);
|
|
61
|
+
else flushUpdate();
|
|
62
|
+
};
|
|
63
|
+
window.addEventListener("resize", onResize);
|
|
64
64
|
}
|
|
65
65
|
function subscribe(cb) {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
66
|
+
cbs.add(cb);
|
|
67
|
+
return () => cbs.delete(cb);
|
|
68
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all) __defProp(target, name, {
|
|
10
|
+
get: all[name],
|
|
11
|
+
enumerable: true
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
var __copyProps = (to, from, except, desc) => {
|
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
17
|
+
get: () => from[key],
|
|
18
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
24
|
+
var helpers_native_exports = {};
|
|
25
|
+
__export(helpers_native_exports, {
|
|
26
|
+
getWindowSize: () => getWindowSize,
|
|
27
|
+
subscribe: () => subscribe
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(helpers_native_exports);
|
|
30
|
+
var import_react_native = require("react-native");
|
|
31
|
+
function getWindowSize() {
|
|
32
|
+
return import_react_native.Dimensions.get("window");
|
|
33
|
+
}
|
|
34
|
+
var cbs = /* @__PURE__ */ new Set();
|
|
35
|
+
var isListening = false;
|
|
36
|
+
var ensureListening = function() {
|
|
37
|
+
if (isListening) return;
|
|
38
|
+
isListening = true;
|
|
39
|
+
import_react_native.Dimensions.addEventListener("change", function(param) {
|
|
40
|
+
var { window } = param;
|
|
41
|
+
cbs.forEach(function(cb) {
|
|
42
|
+
return cb(window);
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
function subscribe(cb) {
|
|
47
|
+
ensureListening();
|
|
48
|
+
cbs.add(cb);
|
|
49
|
+
return function() {
|
|
50
|
+
return cbs.delete(cb);
|
|
51
|
+
};
|
|
52
|
+
}
|
|
@@ -1,56 +1,54 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
|
|
3
4
|
var __defProp = Object.defineProperty;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
8
|
var __export = (target, all) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
for (var name in all) __defProp(target, name, {
|
|
10
|
+
get: all[name],
|
|
11
|
+
enumerable: true
|
|
12
|
+
});
|
|
12
13
|
};
|
|
13
14
|
var __copyProps = (to, from, except, desc) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
17
|
+
get: () => from[key],
|
|
18
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
21
22
|
};
|
|
22
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
23
|
-
value: true
|
|
24
|
-
}), mod);
|
|
23
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
24
|
var helpers_native_exports = {};
|
|
26
25
|
__export(helpers_native_exports, {
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
getWindowSize: () => getWindowSize,
|
|
27
|
+
subscribe: () => subscribe
|
|
29
28
|
});
|
|
30
29
|
module.exports = __toCommonJS(helpers_native_exports);
|
|
31
30
|
var import_react_native = require("react-native");
|
|
32
31
|
function getWindowSize() {
|
|
33
|
-
|
|
32
|
+
return import_react_native.Dimensions.get("window");
|
|
34
33
|
}
|
|
35
|
-
var cbs = /* @__PURE__ */new Set();
|
|
34
|
+
var cbs = /* @__PURE__ */ new Set();
|
|
36
35
|
var isListening = false;
|
|
37
|
-
var ensureListening = function
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
});
|
|
47
|
-
});
|
|
36
|
+
var ensureListening = function() {
|
|
37
|
+
if (isListening) return;
|
|
38
|
+
isListening = true;
|
|
39
|
+
import_react_native.Dimensions.addEventListener("change", function(param) {
|
|
40
|
+
var { window } = param;
|
|
41
|
+
cbs.forEach(function(cb) {
|
|
42
|
+
return cb(window);
|
|
43
|
+
});
|
|
44
|
+
});
|
|
48
45
|
};
|
|
49
46
|
function subscribe(cb) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
47
|
+
ensureListening();
|
|
48
|
+
cbs.add(cb);
|
|
49
|
+
return function() {
|
|
50
|
+
return cbs.delete(cb);
|
|
51
|
+
};
|
|
55
52
|
}
|
|
53
|
+
|
|
56
54
|
//# sourceMappingURL=helpers.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"helpers.native.js","names":[],"sources":["cjs/helpers.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 helpers_native_exports = {};\n__export(helpers_native_exports, {\n getWindowSize: () => getWindowSize,\n subscribe: () => subscribe\n});\nmodule.exports = __toCommonJS(helpers_native_exports);\nvar import_react_native = require(\"react-native\");\nfunction getWindowSize() {\n return import_react_native.Dimensions.get(\"window\");\n}\nvar cbs = /* @__PURE__ */ new Set();\nvar isListening = false;\nvar ensureListening = function() {\n if (isListening) return;\n isListening = true;\n import_react_native.Dimensions.addEventListener(\"change\", function(param) {\n var { window } = param;\n cbs.forEach(function(cb) {\n return cb(window);\n });\n });\n};\nfunction subscribe(cb) {\n ensureListening();\n cbs.add(cb);\n return function() {\n return cbs.delete(cb);\n };\n}\n//# sourceMappingURL=helpers.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,yBAAyB,CAAC;AAC9B,SAAS,wBAAwB;CAC/B,qBAAqB;CACrB,iBAAiB;AACnB,CAAC;AACD,OAAO,UAAU,aAAa,sBAAsB;AACpD,IAAI,sBAAsB,QAAQ,cAAc;AAChD,SAAS,gBAAgB;CACvB,OAAO,oBAAoB,WAAW,IAAI,QAAQ;AACpD;AACA,IAAI,sBAAsB,IAAI,IAAI;AAClC,IAAI,cAAc;AAClB,IAAI,kBAAkB,WAAW;CAC/B,IAAI,aAAa;CACjB,cAAc;CACd,oBAAoB,WAAW,iBAAiB,UAAU,SAAS,OAAO;EACxE,IAAI,EAAE,WAAW;EACjB,IAAI,QAAQ,SAAS,IAAI;GACvB,OAAO,GAAG,MAAM;EAClB,CAAC;CACH,CAAC;AACH;AACA,SAAS,UAAU,IAAI;CACrB,gBAAgB;CAChB,IAAI,IAAI,EAAE;CACV,OAAO,WAAW;EAChB,OAAO,IAAI,OAAO,EAAE;CACtB;AACF"}
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
|
|
1
2
|
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -5,36 +6,29 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
|
5
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
8
|
var __export = (target, all) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
for (var name in all) __defProp(target, name, {
|
|
10
|
+
get: all[name],
|
|
11
|
+
enumerable: true
|
|
12
|
+
});
|
|
12
13
|
};
|
|
13
14
|
var __copyProps = (to, from, except, desc) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
17
|
+
get: () => from[key],
|
|
18
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
21
22
|
};
|
|
22
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
23
|
-
|
|
24
|
-
|
|
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
|
|
23
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
24
|
+
value: mod,
|
|
25
|
+
enumerable: true
|
|
30
26
|
}) : target, mod));
|
|
31
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
32
|
-
value: true
|
|
33
|
-
}), mod);
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
34
28
|
var index_exports = {};
|
|
35
29
|
__export(index_exports, {
|
|
36
|
-
|
|
37
|
-
|
|
30
|
+
configureInitialWindowDimensions: () => import_initialValue2.configureInitialWindowDimensions,
|
|
31
|
+
useWindowDimensions: () => useWindowDimensions
|
|
38
32
|
});
|
|
39
33
|
module.exports = __toCommonJS(index_exports);
|
|
40
34
|
var import_react = __toESM(require("react"), 1);
|
|
@@ -42,8 +36,6 @@ var import_constants = require("@tamagui/constants");
|
|
|
42
36
|
var import_helpers = require("./helpers.cjs");
|
|
43
37
|
var import_initialValue = require("./initialValue.cjs");
|
|
44
38
|
var import_initialValue2 = require("./initialValue.cjs");
|
|
45
|
-
function useWindowDimensions({
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
return import_react.default.useSyncExternalStore(import_helpers.subscribe, import_helpers.getWindowSize, () => import_constants.isWeb ? serverValue : (0, import_helpers.getWindowSize)());
|
|
49
|
-
}
|
|
39
|
+
function useWindowDimensions({ serverValue = import_initialValue.initialValue } = {}) {
|
|
40
|
+
return import_react.default.useSyncExternalStore(import_helpers.subscribe, import_helpers.getWindowSize, () => import_constants.isWeb ? serverValue : (0, import_helpers.getWindowSize)());
|
|
41
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var __create = Object.create;
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __export = (target, all) => {
|
|
11
|
+
for (var name in all) __defProp(target, name, {
|
|
12
|
+
get: all[name],
|
|
13
|
+
enumerable: true
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
var __copyProps = (to, from, except, desc) => {
|
|
17
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
18
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
19
|
+
get: () => from[key],
|
|
20
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
return to;
|
|
24
|
+
};
|
|
25
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
26
|
+
value: mod,
|
|
27
|
+
enumerable: true
|
|
28
|
+
}) : target, mod));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
var index_exports = {};
|
|
31
|
+
__export(index_exports, {
|
|
32
|
+
configureInitialWindowDimensions: () => import_initialValue2.configureInitialWindowDimensions,
|
|
33
|
+
useWindowDimensions: () => useWindowDimensions
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(index_exports);
|
|
36
|
+
var import_react = __toESM(require("react"), 1);
|
|
37
|
+
var import_constants = require("@tamagui/constants");
|
|
38
|
+
var import_helpers = require("./helpers.native.js");
|
|
39
|
+
var import_initialValue = require("./initialValue.native.js");
|
|
40
|
+
var import_initialValue2 = require("./initialValue.native.js");
|
|
41
|
+
function useWindowDimensions() {
|
|
42
|
+
var { serverValue = import_initialValue.initialValue } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
43
|
+
return import_react.default.useSyncExternalStore(import_helpers.subscribe, import_helpers.getWindowSize, function() {
|
|
44
|
+
return import_constants.isWeb ? serverValue : (0, import_helpers.getWindowSize)();
|
|
45
|
+
});
|
|
46
|
+
}
|
package/dist/cjs/index.native.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
|
|
3
4
|
var __create = Object.create;
|
|
4
5
|
var __defProp = Object.defineProperty;
|
|
5
6
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -7,36 +8,29 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
|
7
8
|
var __getProtoOf = Object.getPrototypeOf;
|
|
8
9
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
10
|
var __export = (target, all) => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
for (var name in all) __defProp(target, name, {
|
|
12
|
+
get: all[name],
|
|
13
|
+
enumerable: true
|
|
14
|
+
});
|
|
14
15
|
};
|
|
15
16
|
var __copyProps = (to, from, except, desc) => {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
18
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
19
|
+
get: () => from[key],
|
|
20
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
return to;
|
|
23
24
|
};
|
|
24
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
25
|
-
|
|
26
|
-
|
|
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
|
|
25
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
26
|
+
value: mod,
|
|
27
|
+
enumerable: true
|
|
32
28
|
}) : target, mod));
|
|
33
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
34
|
-
value: true
|
|
35
|
-
}), mod);
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
36
30
|
var index_exports = {};
|
|
37
31
|
__export(index_exports, {
|
|
38
|
-
|
|
39
|
-
|
|
32
|
+
configureInitialWindowDimensions: () => import_initialValue2.configureInitialWindowDimensions,
|
|
33
|
+
useWindowDimensions: () => useWindowDimensions
|
|
40
34
|
});
|
|
41
35
|
module.exports = __toCommonJS(index_exports);
|
|
42
36
|
var import_react = __toESM(require("react"), 1);
|
|
@@ -45,11 +39,10 @@ var import_helpers = require("./helpers.native.js");
|
|
|
45
39
|
var import_initialValue = require("./initialValue.native.js");
|
|
46
40
|
var import_initialValue2 = require("./initialValue.native.js");
|
|
47
41
|
function useWindowDimensions() {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
return import_constants.isWeb ? serverValue : (0, import_helpers.getWindowSize)();
|
|
53
|
-
});
|
|
42
|
+
var { serverValue = import_initialValue.initialValue } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
43
|
+
return import_react.default.useSyncExternalStore(import_helpers.subscribe, import_helpers.getWindowSize, function() {
|
|
44
|
+
return import_constants.isWeb ? serverValue : (0, import_helpers.getWindowSize)();
|
|
45
|
+
});
|
|
54
46
|
}
|
|
47
|
+
|
|
55
48
|
//# 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 __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\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 __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar index_exports = {};\n__export(index_exports, {\n configureInitialWindowDimensions: () => import_initialValue2.configureInitialWindowDimensions,\n useWindowDimensions: () => useWindowDimensions\n});\nmodule.exports = __toCommonJS(index_exports);\nvar import_react = __toESM(require(\"react\"), 1);\nvar import_constants = require(\"@tamagui/constants\");\nvar import_helpers = require(\"./helpers\");\nvar import_initialValue = require(\"./initialValue\");\nvar import_initialValue2 = require(\"./initialValue\");\nfunction useWindowDimensions() {\n var { serverValue = import_initialValue.initialValue } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};\n return import_react.default.useSyncExternalStore(import_helpers.subscribe, import_helpers.getWindowSize, function() {\n return import_constants.isWeb ? serverValue : (0, import_helpers.getWindowSize)();\n });\n}\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,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,WAAW,KAAK,YAAY,YAAY,SAAS,OAAO,OAAO,SAAS,aAAa,GAAG,CAAC,IAAI,CAAC,GAAG,YAKnG,cAAc,CAAC,OAAO,CAAC,IAAI,aAAa,UAAU,QAAQ,WAAW;CAAE,OAAO;CAAK,YAAY;AAAK,CAAC,IAAI,QACzG,GACF;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,gBAAgB,CAAC;AACrB,SAAS,eAAe;CACtB,wCAAwC,qBAAqB;CAC7D,2BAA2B;AAC7B,CAAC;AACD,OAAO,UAAU,aAAa,aAAa;AAC3C,IAAI,eAAe,QAAQ,QAAQ,OAAO,GAAG,CAAC;AAC9C,IAAI,mBAAmB,QAAQ,oBAAoB;AACnD,IAAI,iBAAiB,QAAQ,qBAAW;AACxC,IAAI,sBAAsB,QAAQ,0BAAgB;AAClD,IAAI,uBAAuB,QAAQ,0BAAgB;AACnD,SAAS,sBAAsB;CAC7B,IAAI,EAAE,cAAc,oBAAoB,iBAAiB,UAAU,SAAS,KAAK,UAAU,OAAO,KAAK,IAAI,UAAU,KAAK,CAAC;CAC3H,OAAO,aAAa,QAAQ,qBAAqB,eAAe,WAAW,eAAe,eAAe,WAAW;EAClH,OAAO,iBAAiB,QAAQ,eAAe,GAAG,eAAe,eAAe;CAClF,CAAC;AACH"}
|
|
@@ -1,37 +1,36 @@
|
|
|
1
|
+
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
6
|
var __export = (target, all) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
for (var name in all) __defProp(target, name, {
|
|
8
|
+
get: all[name],
|
|
9
|
+
enumerable: true
|
|
10
|
+
});
|
|
10
11
|
};
|
|
11
12
|
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
15
|
+
get: () => from[key],
|
|
16
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
19
20
|
};
|
|
20
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
21
|
-
value: true
|
|
22
|
-
}), mod);
|
|
21
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
23
22
|
var initialValue_exports = {};
|
|
24
23
|
__export(initialValue_exports, {
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
configureInitialWindowDimensions: () => configureInitialWindowDimensions,
|
|
25
|
+
initialValue: () => initialValue
|
|
27
26
|
});
|
|
28
27
|
module.exports = __toCommonJS(initialValue_exports);
|
|
29
28
|
const initialValue = {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
width: 800,
|
|
30
|
+
height: 600,
|
|
31
|
+
scale: 1,
|
|
32
|
+
fontScale: 1
|
|
34
33
|
};
|
|
35
34
|
function configureInitialWindowDimensions(next) {
|
|
36
|
-
|
|
37
|
-
}
|
|
35
|
+
Object.assign(initialValue, next);
|
|
36
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all) __defProp(target, name, {
|
|
10
|
+
get: all[name],
|
|
11
|
+
enumerable: true
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
var __copyProps = (to, from, except, desc) => {
|
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
17
|
+
get: () => from[key],
|
|
18
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
24
|
+
var initialValue_exports = {};
|
|
25
|
+
__export(initialValue_exports, {
|
|
26
|
+
configureInitialWindowDimensions: () => configureInitialWindowDimensions,
|
|
27
|
+
initialValue: () => initialValue
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(initialValue_exports);
|
|
30
|
+
var initialValue = {
|
|
31
|
+
width: 800,
|
|
32
|
+
height: 600,
|
|
33
|
+
scale: 1,
|
|
34
|
+
fontScale: 1
|
|
35
|
+
};
|
|
36
|
+
function configureInitialWindowDimensions(next) {
|
|
37
|
+
Object.assign(initialValue, next);
|
|
38
|
+
}
|
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
|
|
3
4
|
var __defProp = Object.defineProperty;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
8
|
var __export = (target, all) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
for (var name in all) __defProp(target, name, {
|
|
10
|
+
get: all[name],
|
|
11
|
+
enumerable: true
|
|
12
|
+
});
|
|
12
13
|
};
|
|
13
14
|
var __copyProps = (to, from, except, desc) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
17
|
+
get: () => from[key],
|
|
18
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
21
22
|
};
|
|
22
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
23
|
-
value: true
|
|
24
|
-
}), mod);
|
|
23
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
24
|
var initialValue_exports = {};
|
|
26
25
|
__export(initialValue_exports, {
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
configureInitialWindowDimensions: () => configureInitialWindowDimensions,
|
|
27
|
+
initialValue: () => initialValue
|
|
29
28
|
});
|
|
30
29
|
module.exports = __toCommonJS(initialValue_exports);
|
|
31
30
|
var initialValue = {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
width: 800,
|
|
32
|
+
height: 600,
|
|
33
|
+
scale: 1,
|
|
34
|
+
fontScale: 1
|
|
36
35
|
};
|
|
37
36
|
function configureInitialWindowDimensions(next) {
|
|
38
|
-
|
|
37
|
+
Object.assign(initialValue, next);
|
|
39
38
|
}
|
|
39
|
+
|
|
40
40
|
//# sourceMappingURL=initialValue.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"initialValue.native.js","names":[],"sources":["cjs/initialValue.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 initialValue_exports = {};\n__export(initialValue_exports, {\n configureInitialWindowDimensions: () => configureInitialWindowDimensions,\n initialValue: () => initialValue\n});\nmodule.exports = __toCommonJS(initialValue_exports);\nvar initialValue = {\n width: 800,\n height: 600,\n scale: 1,\n fontScale: 1\n};\nfunction configureInitialWindowDimensions(next) {\n Object.assign(initialValue, next);\n}\n//# sourceMappingURL=initialValue.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,uBAAuB,CAAC;AAC5B,SAAS,sBAAsB;CAC7B,wCAAwC;CACxC,oBAAoB;AACtB,CAAC;AACD,OAAO,UAAU,aAAa,oBAAoB;AAClD,IAAI,eAAe;CACjB,OAAO;CACP,QAAQ;CACR,OAAO;CACP,WAAW;AACb;AACA,SAAS,iCAAiC,MAAM;CAC9C,OAAO,OAAO,cAAc,IAAI;AAClC"}
|
package/dist/cjs/types.cjs
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
|
+
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
6
|
var __copyProps = (to, from, except, desc) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
9
|
+
get: () => from[key],
|
|
10
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
return to;
|
|
13
14
|
};
|
|
14
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
15
|
-
value: true
|
|
16
|
-
}), mod);
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
17
16
|
var types_exports = {};
|
|
18
|
-
module.exports = __toCommonJS(types_exports);
|
|
17
|
+
module.exports = __toCommonJS(types_exports);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
11
|
+
get: () => from[key],
|
|
12
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var types_exports = {};
|
|
19
|
+
module.exports = __toCommonJS(types_exports);
|
package/dist/cjs/types.native.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
|
|
3
4
|
var __defProp = Object.defineProperty;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
8
|
var __copyProps = (to, from, except, desc) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
11
|
+
get: () => from[key],
|
|
12
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
15
16
|
};
|
|
16
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
17
|
-
value: true
|
|
18
|
-
}), mod);
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
18
|
var types_exports = {};
|
|
20
19
|
module.exports = __toCommonJS(types_exports);
|
|
20
|
+
|
|
21
21
|
//# sourceMappingURL=types.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"types.native.js","names":[],"sources":["cjs/types.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 __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar types_exports = {};\nmodule.exports = __toCommonJS(types_exports);\n//# sourceMappingURL=types.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,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,gBAAgB,CAAC;AACrB,OAAO,UAAU,aAAa,aAAa"}
|
package/dist/esm/helpers.mjs
CHANGED
|
@@ -1,43 +1,46 @@
|
|
|
1
1
|
import { isClient } from "@tamagui/constants";
|
|
2
2
|
import { initialValue } from "./initialValue.mjs";
|
|
3
|
+
|
|
3
4
|
let lastSize = initialValue;
|
|
4
5
|
let docEl = null;
|
|
5
6
|
function getWindowSize() {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
7
|
+
docEl ||= window.document.documentElement;
|
|
8
|
+
const nextSize = {
|
|
9
|
+
fontScale: 1,
|
|
10
|
+
height: docEl.clientHeight,
|
|
11
|
+
scale: window.devicePixelRatio || 1,
|
|
12
|
+
width: docEl.clientWidth
|
|
13
|
+
};
|
|
14
|
+
if (nextSize.height !== lastSize.height || nextSize.width !== lastSize.width || nextSize.scale !== lastSize.scale) {
|
|
15
|
+
lastSize = nextSize;
|
|
16
|
+
return nextSize;
|
|
17
|
+
}
|
|
18
|
+
return lastSize;
|
|
18
19
|
}
|
|
19
|
-
const cbs = /* @__PURE__ */new Set();
|
|
20
|
+
const cbs = /* @__PURE__ */ new Set();
|
|
20
21
|
if (isClient && typeof window !== "undefined" && typeof window.addEventListener === "function") {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
22
|
+
let flushUpdate = function() {
|
|
23
|
+
lastUpdate = Date.now();
|
|
24
|
+
cbs.forEach((cb) => cb(getWindowSize()));
|
|
25
|
+
};
|
|
26
|
+
let lastUpdate = Date.now();
|
|
27
|
+
let tm;
|
|
28
|
+
const USER_MAX_MS = process.env.TAMAGUI_USE_WINDOW_DIMENSIONS_MAX_UPDATE_MS;
|
|
29
|
+
const updateMaxMs = USER_MAX_MS ? +USER_MAX_MS : 100;
|
|
30
|
+
const onResize = () => {
|
|
31
|
+
clearTimeout(tm);
|
|
32
|
+
const timeSinceLast = Date.now() - lastUpdate;
|
|
33
|
+
if (timeSinceLast < updateMaxMs) tm = setTimeout(() => {
|
|
34
|
+
flushUpdate();
|
|
35
|
+
}, updateMaxMs - timeSinceLast);
|
|
36
|
+
else flushUpdate();
|
|
37
|
+
};
|
|
38
|
+
window.addEventListener("resize", onResize);
|
|
37
39
|
}
|
|
38
40
|
function subscribe(cb) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
+
cbs.add(cb);
|
|
42
|
+
return () => cbs.delete(cb);
|
|
41
43
|
}
|
|
44
|
+
|
|
42
45
|
export { getWindowSize, subscribe };
|
|
43
46
|
//# sourceMappingURL=helpers.mjs.map
|
package/dist/esm/helpers.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"helpers.js","names":[],"sources":["esm/helpers.js"],"sourcesContent":["import { isClient } from \"@tamagui/constants\";\nimport { initialValue } from \"./initialValue\";\n\nlet lastSize = initialValue;\nlet docEl = null;\nfunction getWindowSize() {\n\tdocEl ||= window.document.documentElement;\n\tconst nextSize = {\n\t\tfontScale: 1,\n\t\theight: docEl.clientHeight,\n\t\tscale: window.devicePixelRatio || 1,\n\t\twidth: docEl.clientWidth\n\t};\n\tif (nextSize.height !== lastSize.height || nextSize.width !== lastSize.width || nextSize.scale !== lastSize.scale) {\n\t\tlastSize = nextSize;\n\t\treturn nextSize;\n\t}\n\treturn lastSize;\n}\nconst cbs = /* @__PURE__ */ new Set();\nif (isClient && typeof window !== \"undefined\" && typeof window.addEventListener === \"function\") {\n\tlet flushUpdate = function() {\n\t\tlastUpdate = Date.now();\n\t\tcbs.forEach((cb) => cb(getWindowSize()));\n\t};\n\tlet lastUpdate = Date.now();\n\tlet tm;\n\tconst USER_MAX_MS = process.env.TAMAGUI_USE_WINDOW_DIMENSIONS_MAX_UPDATE_MS;\n\tconst updateMaxMs = USER_MAX_MS ? +USER_MAX_MS : 100;\n\tconst onResize = () => {\n\t\tclearTimeout(tm);\n\t\tconst timeSinceLast = Date.now() - lastUpdate;\n\t\tif (timeSinceLast < updateMaxMs) tm = setTimeout(() => {\n\t\t\tflushUpdate();\n\t\t}, updateMaxMs - timeSinceLast);\n\t\telse flushUpdate();\n\t};\n\twindow.addEventListener(\"resize\", onResize);\n}\nfunction subscribe(cb) {\n\tcbs.add(cb);\n\treturn () => cbs.delete(cb);\n}\n\nexport { getWindowSize, subscribe };"],"mappings":";;;;AAGA,IAAI,WAAW;AACf,IAAI,QAAQ;AACZ,SAAS,gBAAgB;CACxB,UAAU,OAAO,SAAS;CAC1B,MAAM,WAAW;EAChB,WAAW;EACX,QAAQ,MAAM;EACd,OAAO,OAAO,oBAAoB;EAClC,OAAO,MAAM;CACd;CACA,IAAI,SAAS,WAAW,SAAS,UAAU,SAAS,UAAU,SAAS,SAAS,SAAS,UAAU,SAAS,OAAO;EAClH,WAAW;EACX,OAAO;CACR;CACA,OAAO;AACR;AACA,MAAM,sBAAsB,IAAI,IAAI;AACpC,IAAI,YAAY,OAAO,WAAW,eAAe,OAAO,OAAO,qBAAqB,YAAY;CAC/F,IAAI,cAAc,WAAW;EAC5B,aAAa,KAAK,IAAI;EACtB,IAAI,SAAS,OAAO,GAAG,cAAc,CAAC,CAAC;CACxC;CACA,IAAI,aAAa,KAAK,IAAI;CAC1B,IAAI;CACJ,MAAM,cAAc,QAAQ,IAAI;CAChC,MAAM,cAAc,cAAc,CAAC,cAAc;CACjD,MAAM,iBAAiB;EACtB,aAAa,EAAE;EACf,MAAM,gBAAgB,KAAK,IAAI,IAAI;EACnC,IAAI,gBAAgB,aAAa,KAAK,iBAAiB;GACtD,YAAY;EACb,GAAG,cAAc,aAAa;OACzB,YAAY;CAClB;CACA,OAAO,iBAAiB,UAAU,QAAQ;AAC3C;AACA,SAAS,UAAU,IAAI;CACtB,IAAI,IAAI,EAAE;CACV,aAAa,IAAI,OAAO,EAAE;AAC3B"}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import { Dimensions } from "react-native";
|
|
2
|
+
|
|
2
3
|
function getWindowSize() {
|
|
3
|
-
|
|
4
|
+
return Dimensions.get("window");
|
|
4
5
|
}
|
|
5
|
-
var cbs = /* @__PURE__ */new Set();
|
|
6
|
+
var cbs = /* @__PURE__ */ new Set();
|
|
6
7
|
var isListening = false;
|
|
7
|
-
var ensureListening = function
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
});
|
|
17
|
-
});
|
|
8
|
+
var ensureListening = function() {
|
|
9
|
+
if (isListening) return;
|
|
10
|
+
isListening = true;
|
|
11
|
+
Dimensions.addEventListener("change", function(param) {
|
|
12
|
+
var { window } = param;
|
|
13
|
+
cbs.forEach(function(cb) {
|
|
14
|
+
return cb(window);
|
|
15
|
+
});
|
|
16
|
+
});
|
|
18
17
|
};
|
|
19
18
|
function subscribe(cb) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
ensureListening();
|
|
20
|
+
cbs.add(cb);
|
|
21
|
+
return function() {
|
|
22
|
+
return cbs.delete(cb);
|
|
23
|
+
};
|
|
25
24
|
}
|
|
25
|
+
|
|
26
26
|
export { getWindowSize, subscribe };
|
|
27
27
|
//# sourceMappingURL=helpers.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"helpers.native.js","names":[],"sources":["esm/helpers.native.js"],"sourcesContent":["import { Dimensions } from \"react-native\";\nfunction getWindowSize() {\n return Dimensions.get(\"window\");\n}\nvar cbs = /* @__PURE__ */ new Set();\nvar isListening = false;\nvar ensureListening = function() {\n if (isListening) return;\n isListening = true;\n Dimensions.addEventListener(\"change\", function(param) {\n var { window } = param;\n cbs.forEach(function(cb) {\n return cb(window);\n });\n });\n};\nfunction subscribe(cb) {\n ensureListening();\n cbs.add(cb);\n return function() {\n return cbs.delete(cb);\n };\n}\nexport {\n getWindowSize,\n subscribe\n};\n//# sourceMappingURL=helpers.native.js.map\n"],"mappings":";;;AACA,SAAS,gBAAgB;CACvB,OAAO,WAAW,IAAI,QAAQ;AAChC;AACA,IAAI,sBAAsB,IAAI,IAAI;AAClC,IAAI,cAAc;AAClB,IAAI,kBAAkB,WAAW;CAC/B,IAAI,aAAa;CACjB,cAAc;CACd,WAAW,iBAAiB,UAAU,SAAS,OAAO;EACpD,IAAI,EAAE,WAAW;EACjB,IAAI,QAAQ,SAAS,IAAI;GACvB,OAAO,GAAG,MAAM;EAClB,CAAC;CACH,CAAC;AACH;AACA,SAAS,UAAU,IAAI;CACrB,gBAAgB;CAChB,IAAI,IAAI,EAAE;CACV,OAAO,WAAW;EAChB,OAAO,IAAI,OAAO,EAAE;CACtB;AACF"}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { isWeb } from "@tamagui/constants";
|
|
3
3
|
import { getWindowSize, subscribe } from "./helpers.mjs";
|
|
4
|
-
import { initialValue } from "./initialValue.mjs";
|
|
5
|
-
|
|
6
|
-
function useWindowDimensions({
|
|
7
|
-
|
|
8
|
-
} = {}) {
|
|
9
|
-
return React.useSyncExternalStore(subscribe, getWindowSize, () => isWeb ? serverValue : getWindowSize());
|
|
4
|
+
import { configureInitialWindowDimensions, initialValue } from "./initialValue.mjs";
|
|
5
|
+
|
|
6
|
+
function useWindowDimensions({ serverValue = initialValue } = {}) {
|
|
7
|
+
return React.useSyncExternalStore(subscribe, getWindowSize, () => isWeb ? serverValue : getWindowSize());
|
|
10
8
|
}
|
|
9
|
+
|
|
11
10
|
export { configureInitialWindowDimensions, useWindowDimensions };
|
|
12
11
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["esm/index.js"],"sourcesContent":["import React from \"react\";\nimport { isWeb } from \"@tamagui/constants\";\nimport { getWindowSize, subscribe } from \"./helpers\";\nimport { initialValue } from \"./initialValue\";\nimport { configureInitialWindowDimensions } from \"./initialValue\";\nfunction useWindowDimensions({\n serverValue = initialValue\n} = {}) {\n return React.useSyncExternalStore(\n subscribe,\n getWindowSize,\n () => isWeb ? serverValue : getWindowSize()\n );\n}\nexport {\n configureInitialWindowDimensions,\n useWindowDimensions\n};\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;;;;AAKA,SAAS,oBAAoB,EAC3B,cAAc,iBACZ,CAAC,GAAG;CACN,OAAO,MAAM,qBACX,WACA,qBACM,QAAQ,cAAc,cAAc,CAC5C;AACF"}
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { isWeb } from "@tamagui/constants";
|
|
3
3
|
import { getWindowSize, subscribe } from "./helpers.mjs";
|
|
4
|
-
import { initialValue } from "./initialValue.mjs";
|
|
5
|
-
|
|
6
|
-
function useWindowDimensions({
|
|
7
|
-
|
|
8
|
-
} = {}) {
|
|
9
|
-
return React.useSyncExternalStore(subscribe, getWindowSize, () => isWeb ? serverValue : getWindowSize());
|
|
4
|
+
import { configureInitialWindowDimensions, initialValue } from "./initialValue.mjs";
|
|
5
|
+
|
|
6
|
+
function useWindowDimensions({ serverValue = initialValue } = {}) {
|
|
7
|
+
return React.useSyncExternalStore(subscribe, getWindowSize, () => isWeb ? serverValue : getWindowSize());
|
|
10
8
|
}
|
|
9
|
+
|
|
11
10
|
export { configureInitialWindowDimensions, useWindowDimensions };
|
|
12
11
|
//# sourceMappingURL=index.mjs.map
|
package/dist/esm/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["esm/index.js"],"sourcesContent":["import React from \"react\";\nimport { isWeb } from \"@tamagui/constants\";\nimport { getWindowSize, subscribe } from \"./helpers\";\nimport { initialValue } from \"./initialValue\";\nimport { configureInitialWindowDimensions } from \"./initialValue\";\nfunction useWindowDimensions({\n serverValue = initialValue\n} = {}) {\n return React.useSyncExternalStore(\n subscribe,\n getWindowSize,\n () => isWeb ? serverValue : getWindowSize()\n );\n}\nexport {\n configureInitialWindowDimensions,\n useWindowDimensions\n};\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;;;;AAKA,SAAS,oBAAoB,EAC3B,cAAc,iBACZ,CAAC,GAAG;CACN,OAAO,MAAM,qBACX,WACA,qBACM,QAAQ,cAAc,cAAc,CAC5C;AACF"}
|
package/dist/esm/index.native.js
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { isWeb } from "@tamagui/constants";
|
|
3
3
|
import { getWindowSize, subscribe } from "./helpers.native.js";
|
|
4
|
-
import { initialValue } from "./initialValue.native.js";
|
|
5
|
-
|
|
4
|
+
import { configureInitialWindowDimensions, initialValue } from "./initialValue.native.js";
|
|
5
|
+
|
|
6
6
|
function useWindowDimensions() {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
return isWeb ? serverValue : getWindowSize();
|
|
12
|
-
});
|
|
7
|
+
var { serverValue = initialValue } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
8
|
+
return React.useSyncExternalStore(subscribe, getWindowSize, function() {
|
|
9
|
+
return isWeb ? serverValue : getWindowSize();
|
|
10
|
+
});
|
|
13
11
|
}
|
|
12
|
+
|
|
14
13
|
export { configureInitialWindowDimensions, useWindowDimensions };
|
|
15
14
|
//# sourceMappingURL=index.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.native.js","names":[],"sources":["esm/index.native.js"],"sourcesContent":["import React from \"react\";\nimport { isWeb } from \"@tamagui/constants\";\nimport { getWindowSize, subscribe } from \"./helpers\";\nimport { initialValue } from \"./initialValue\";\nimport { configureInitialWindowDimensions } from \"./initialValue\";\nfunction useWindowDimensions() {\n var { serverValue = initialValue } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};\n return React.useSyncExternalStore(subscribe, getWindowSize, function() {\n return isWeb ? serverValue : getWindowSize();\n });\n}\nexport {\n configureInitialWindowDimensions,\n useWindowDimensions\n};\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;;;;AAKA,SAAS,sBAAsB;CAC7B,IAAI,EAAE,cAAc,iBAAiB,UAAU,SAAS,KAAK,UAAU,OAAO,KAAK,IAAI,UAAU,KAAK,CAAC;CACvG,OAAO,MAAM,qBAAqB,WAAW,eAAe,WAAW;EACrE,OAAO,QAAQ,cAAc,cAAc;CAC7C,CAAC;AACH"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
const initialValue = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
width: 800,
|
|
3
|
+
height: 600,
|
|
4
|
+
scale: 1,
|
|
5
|
+
fontScale: 1
|
|
6
6
|
};
|
|
7
7
|
function configureInitialWindowDimensions(next) {
|
|
8
|
-
|
|
8
|
+
Object.assign(initialValue, next);
|
|
9
9
|
}
|
|
10
|
+
|
|
10
11
|
export { configureInitialWindowDimensions, initialValue };
|
|
11
12
|
//# sourceMappingURL=initialValue.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"initialValue.js","names":[],"sources":["esm/initialValue.js"],"sourcesContent":["const initialValue = {\n width: 800,\n height: 600,\n scale: 1,\n fontScale: 1\n};\nfunction configureInitialWindowDimensions(next) {\n Object.assign(initialValue, next);\n}\nexport {\n configureInitialWindowDimensions,\n initialValue\n};\n//# sourceMappingURL=initialValue.js.map\n"],"mappings":";AAAA,MAAM,eAAe;CACnB,OAAO;CACP,QAAQ;CACR,OAAO;CACP,WAAW;AACb;AACA,SAAS,iCAAiC,MAAM;CAC9C,OAAO,OAAO,cAAc,IAAI;AAClC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
var initialValue = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
width: 800,
|
|
3
|
+
height: 600,
|
|
4
|
+
scale: 1,
|
|
5
|
+
fontScale: 1
|
|
6
6
|
};
|
|
7
7
|
function configureInitialWindowDimensions(next) {
|
|
8
|
-
|
|
8
|
+
Object.assign(initialValue, next);
|
|
9
9
|
}
|
|
10
|
+
|
|
10
11
|
export { configureInitialWindowDimensions, initialValue };
|
|
11
12
|
//# sourceMappingURL=initialValue.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"initialValue.native.js","names":[],"sources":["esm/initialValue.native.js"],"sourcesContent":["var initialValue = {\n width: 800,\n height: 600,\n scale: 1,\n fontScale: 1\n};\nfunction configureInitialWindowDimensions(next) {\n Object.assign(initialValue, next);\n}\nexport {\n configureInitialWindowDimensions,\n initialValue\n};\n//# sourceMappingURL=initialValue.js.map\n"],"mappings":";AAAA,IAAI,eAAe;CACjB,OAAO;CACP,QAAQ;CACR,OAAO;CACP,WAAW;AACb;AACA,SAAS,iCAAiC,MAAM;CAC9C,OAAO,OAAO,cAAc,IAAI;AAClC"}
|
package/dist/esm/types.mjs
CHANGED
package/dist/esm/types.native.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/use-window-dimensions",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-beta.637.1",
|
|
4
4
|
"gitHead": "a49cc7ea6b93ba384e77a4880ae48ac4a5635c14",
|
|
5
5
|
"files": [
|
|
6
6
|
"src",
|
|
@@ -34,12 +34,12 @@
|
|
|
34
34
|
"clean:build": "tamagui-build clean:build"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@tamagui/constants": "
|
|
37
|
+
"@tamagui/constants": "3.0.0-beta.637.1"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@tamagui/build": "
|
|
40
|
+
"@tamagui/build": "3.0.0-beta.637.1",
|
|
41
41
|
"react": ">=19",
|
|
42
|
-
"react-native": "0.
|
|
42
|
+
"react-native": "0.86.2"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"react": ">=19"
|
package/dist/esm/types.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":[],"sourcesContent":[],"mappings":"","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":[],"sourcesContent":[],"mappings":"","ignoreList":[]}
|