@tamagui/use-window-dimensions 1.114.3 → 1.115.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.
|
@@ -2,31 +2,42 @@ 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,
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf,
|
|
6
|
+
__hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
7
|
var __export = (target, all) => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: !0
|
|
11
|
+
});
|
|
12
|
+
},
|
|
13
|
+
__copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
15
|
+
get: () => from[key],
|
|
16
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
+
});
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
15
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
16
21
|
// If the importer is in node compatibility mode or this is not an ESM
|
|
17
22
|
// file that has been converted to a CommonJS file using a Babel-
|
|
18
23
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
19
24
|
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
21
|
-
|
|
22
|
-
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
26
|
+
value: mod,
|
|
27
|
+
enumerable: !0
|
|
28
|
+
}) : target, mod)),
|
|
29
|
+
__toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
30
|
+
value: !0
|
|
31
|
+
}), mod);
|
|
23
32
|
var src_exports = {};
|
|
24
33
|
__export(src_exports, {
|
|
25
34
|
configureInitialWindowDimensions: () => configureInitialWindowDimensions,
|
|
26
35
|
useWindowDimensions: () => useWindowDimensions
|
|
27
36
|
});
|
|
28
37
|
module.exports = __toCommonJS(src_exports);
|
|
29
|
-
var import_react = __toESM(require("react")),
|
|
38
|
+
var import_react = __toESM(require("react")),
|
|
39
|
+
import_constants = require("@tamagui/constants"),
|
|
40
|
+
import_react_native = require("react-native-web");
|
|
30
41
|
const initialValue = {
|
|
31
42
|
height: 800,
|
|
32
43
|
width: 600
|
|
@@ -35,19 +46,14 @@ function configureInitialWindowDimensions(next) {
|
|
|
35
46
|
Object.assign(initialValue, next);
|
|
36
47
|
}
|
|
37
48
|
import_react_native.Dimensions.addEventListener("change", () => {
|
|
38
|
-
cbs.forEach(
|
|
49
|
+
cbs.forEach(cb => cb(window));
|
|
39
50
|
});
|
|
40
|
-
const cbs = /* @__PURE__ */
|
|
51
|
+
const cbs = /* @__PURE__ */new Set();
|
|
41
52
|
function subscribe(cb) {
|
|
42
53
|
return cbs.add(cb), () => cbs.delete(cb);
|
|
43
54
|
}
|
|
44
55
|
function useWindowDimensions({
|
|
45
56
|
serverValue = initialValue
|
|
46
57
|
} = {}) {
|
|
47
|
-
return import_react.default.useSyncExternalStore(
|
|
48
|
-
|
|
49
|
-
() => import_react_native.Dimensions.get("window"),
|
|
50
|
-
() => import_constants.isWeb ? serverValue : import_react_native.Dimensions.get("window")
|
|
51
|
-
);
|
|
52
|
-
}
|
|
53
|
-
//# sourceMappingURL=index.js.map
|
|
58
|
+
return import_react.default.useSyncExternalStore(subscribe, () => import_react_native.Dimensions.get("window"), () => import_constants.isWeb ? serverValue : import_react_native.Dimensions.get("window"));
|
|
59
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/use-window-dimensions",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.115.0",
|
|
4
4
|
"types": "./types/index.d.ts",
|
|
5
5
|
"main": "dist/cjs",
|
|
6
6
|
"module": "dist/esm",
|
|
@@ -24,14 +24,15 @@
|
|
|
24
24
|
"react-native": "./dist/cjs/index.native.js",
|
|
25
25
|
"types": "./types/index.d.ts",
|
|
26
26
|
"import": "./dist/esm/index.mjs",
|
|
27
|
-
"require": "./dist/cjs/index.
|
|
27
|
+
"require": "./dist/cjs/index.cjs",
|
|
28
|
+
"default": "./dist/cjs/index.native.js"
|
|
28
29
|
}
|
|
29
30
|
},
|
|
30
31
|
"dependencies": {
|
|
31
|
-
"@tamagui/constants": "1.
|
|
32
|
+
"@tamagui/constants": "1.115.0"
|
|
32
33
|
},
|
|
33
34
|
"devDependencies": {
|
|
34
|
-
"@tamagui/build": "1.
|
|
35
|
+
"@tamagui/build": "1.115.0",
|
|
35
36
|
"react": "^18.2.0 || ^19.0.0",
|
|
36
37
|
"react-native": "0.74.1"
|
|
37
38
|
},
|
|
File without changes
|