@tamagui/use-window-dimensions 1.89.26 → 1.89.27-1708113113238
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.native.js
CHANGED
|
@@ -19,29 +19,31 @@ __export(src_exports, {
|
|
|
19
19
|
useWindowDimensions: () => useWindowDimensions
|
|
20
20
|
});
|
|
21
21
|
module.exports = __toCommonJS(src_exports);
|
|
22
|
-
var import_constants = require("@tamagui/constants"), import_react = require("react"), import_react_native = require("react-native")
|
|
23
|
-
const initialValue = {
|
|
22
|
+
var import_constants = require("@tamagui/constants"), import_react = require("react"), import_react_native = require("react-native"), initialValue = {
|
|
24
23
|
height: 800,
|
|
25
24
|
width: 600
|
|
26
25
|
};
|
|
27
26
|
function configureInitialWindowDimensions(next) {
|
|
28
27
|
Object.assign(initialValue, next);
|
|
29
28
|
}
|
|
30
|
-
import_react_native.Dimensions.addEventListener("change", ()
|
|
31
|
-
cbs.forEach((cb)
|
|
29
|
+
import_react_native.Dimensions.addEventListener("change", function() {
|
|
30
|
+
cbs.forEach(function(cb) {
|
|
31
|
+
return cb(window);
|
|
32
|
+
});
|
|
32
33
|
});
|
|
33
|
-
|
|
34
|
+
var cbs = /* @__PURE__ */ new Set();
|
|
34
35
|
function subscribe(cb) {
|
|
35
|
-
return cbs.add(cb), ()
|
|
36
|
+
return cbs.add(cb), function() {
|
|
37
|
+
return cbs.delete(cb);
|
|
38
|
+
};
|
|
36
39
|
}
|
|
37
|
-
function useWindowDimensions({
|
|
38
|
-
serverValue = initialValue
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
);
|
|
40
|
+
function useWindowDimensions() {
|
|
41
|
+
var _ref = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, _ref_serverValue = _ref.serverValue, serverValue = _ref_serverValue === void 0 ? initialValue : _ref_serverValue;
|
|
42
|
+
return (0, import_react.useSyncExternalStore)(subscribe, function() {
|
|
43
|
+
return import_react_native.Dimensions.get("window");
|
|
44
|
+
}, function() {
|
|
45
|
+
return import_constants.isWeb ? serverValue : import_react_native.Dimensions.get("window");
|
|
46
|
+
});
|
|
45
47
|
}
|
|
46
48
|
// Annotate the CommonJS export names for ESM import in node:
|
|
47
49
|
0 && (module.exports = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/index.ts"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;AAAA
|
|
5
|
-
"names": []
|
|
3
|
+
"sources": ["../../src/Users/n8/tamagui/packages/use-window-dimensions/src/index.ts"],
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;AAAA;;;;;;uBAAsB,+BACtB,eAAqC,kBAErC,sBAA2B,yBAWrBA,eAAqB;EACzBC,QAAQ;EACRC,OAAO;AACT;AAEO,SAASC,iCAAiCC,MAAU;AACzDC,SAAOC,OAAON,cAAcI,IAAAA;AAC9B;AAEAG,+BAAWC,iBAAiB,UAAU,WAAA;AACpCC,MAAIC,QAAQ,SAACC,IAAAA;WAAOA,GAAGC,MAAAA;;AACzB,CAAA;AAEA,IAAMH,MAAM,oBAAII,IAAAA;AAIhB,SAASC,UAAUH,IAAsB;AACvCF,aAAIM,IAAIJ,EAAAA,GACD,WAAA;WAAMF,IAAIO,OAAOL,EAAAA;;AAC1B;AAEO,SAASM,sBAAAA;MAAoB,OAAA,UAAA,SAAA,KAAA,UAAA,CAAA,MAAA,SAAA,UAAA,CAAA,IAER,CAAC,GAAA,mBAFO,KAClCC,aAAAA,cAAAA,qBAAAA,SAAclB,eAAAA;AAEd,aAAOmB,mCACLL,WACA,WAAA;WAAMP,+BAAWa,IAAI,QAAA;KACrB,WAAA;WAAOC,yBAAQH,cAAcX,+BAAWa,IAAI,QAAA;;AAEhD;",
|
|
5
|
+
"names": ["initialValue", "height", "width", "configureInitialWindowDimensions", "next", "Object", "assign", "Dimensions", "addEventListener", "cbs", "forEach", "cb", "window", "Set", "subscribe", "add", "delete", "useWindowDimensions", "serverValue", "useSyncExternalStore", "get", "isWeb"]
|
|
6
6
|
}
|
package/dist/esm/index.native.js
CHANGED
|
@@ -1,28 +1,31 @@
|
|
|
1
1
|
import { isWeb } from "@tamagui/constants";
|
|
2
2
|
import { useSyncExternalStore } from "react";
|
|
3
3
|
import { Dimensions } from "react-native";
|
|
4
|
-
|
|
4
|
+
var initialValue = {
|
|
5
5
|
height: 800,
|
|
6
6
|
width: 600
|
|
7
7
|
};
|
|
8
8
|
function configureInitialWindowDimensions(next) {
|
|
9
9
|
Object.assign(initialValue, next);
|
|
10
10
|
}
|
|
11
|
-
Dimensions.addEventListener("change", ()
|
|
12
|
-
cbs.forEach((cb)
|
|
11
|
+
Dimensions.addEventListener("change", function() {
|
|
12
|
+
cbs.forEach(function(cb) {
|
|
13
|
+
return cb(window);
|
|
14
|
+
});
|
|
13
15
|
});
|
|
14
|
-
|
|
16
|
+
var cbs = /* @__PURE__ */ new Set();
|
|
15
17
|
function subscribe(cb) {
|
|
16
|
-
return cbs.add(cb), ()
|
|
18
|
+
return cbs.add(cb), function() {
|
|
19
|
+
return cbs.delete(cb);
|
|
20
|
+
};
|
|
17
21
|
}
|
|
18
|
-
function useWindowDimensions({
|
|
19
|
-
serverValue = initialValue
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
);
|
|
22
|
+
function useWindowDimensions() {
|
|
23
|
+
var _ref = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, _ref_serverValue = _ref.serverValue, serverValue = _ref_serverValue === void 0 ? initialValue : _ref_serverValue;
|
|
24
|
+
return useSyncExternalStore(subscribe, function() {
|
|
25
|
+
return Dimensions.get("window");
|
|
26
|
+
}, function() {
|
|
27
|
+
return isWeb ? serverValue : Dimensions.get("window");
|
|
28
|
+
});
|
|
26
29
|
}
|
|
27
30
|
export {
|
|
28
31
|
configureInitialWindowDimensions,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/index.ts"],
|
|
4
|
-
"mappings": "AAAA,
|
|
5
|
-
"names": []
|
|
3
|
+
"sources": ["../../src/Users/n8/tamagui/packages/use-window-dimensions/src/index.ts"],
|
|
4
|
+
"mappings": "AAAA,SAASA,aAAa;AACtB,SAASC,4BAA4B;AAErC,SAASC,kBAAkB;AAW3B,IAAMC,eAAqB;EACzBC,QAAQ;EACRC,OAAO;AACT;AAEO,SAASC,iCAAiCC,MAAU;AACzDC,SAAOC,OAAON,cAAcI,IAAAA;AAC9B;AAEAL,WAAWQ,iBAAiB,UAAU,WAAA;AACpCC,MAAIC,QAAQ,SAACC,IAAAA;WAAOA,GAAGC,MAAAA;;AACzB,CAAA;AAEA,IAAMH,MAAM,oBAAII,IAAAA;AAIhB,SAASC,UAAUH,IAAsB;AACvCF,aAAIM,IAAIJ,EAAAA,GACD,WAAA;WAAMF,IAAIO,OAAOL,EAAAA;;AAC1B;AAEO,SAASM,sBAAAA;MAAoB,OAAA,UAAA,SAAA,KAAA,UAAA,CAAA,MAAA,SAAA,UAAA,CAAA,IAER,CAAC,GAAA,mBAFO,KAClCC,aAAAA,cAAAA,qBAAAA,SAAcjB,eAAAA;AAEd,SAAOF,qBACLe,WACA,WAAA;WAAMd,WAAWmB,IAAI,QAAA;KACrB,WAAA;WAAOrB,QAAQoB,cAAclB,WAAWmB,IAAI,QAAA;;AAEhD;",
|
|
5
|
+
"names": ["isWeb", "useSyncExternalStore", "Dimensions", "initialValue", "height", "width", "configureInitialWindowDimensions", "next", "Object", "assign", "addEventListener", "cbs", "forEach", "cb", "window", "Set", "subscribe", "add", "delete", "useWindowDimensions", "serverValue", "get"]
|
|
6
6
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/use-window-dimensions",
|
|
3
|
-
"version": "1.89.
|
|
3
|
+
"version": "1.89.27-1708113113238",
|
|
4
4
|
"types": "./types/index.d.ts",
|
|
5
5
|
"main": "dist/cjs",
|
|
6
6
|
"module": "dist/esm",
|
|
@@ -27,12 +27,12 @@
|
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@tamagui/constants": "1.89.
|
|
30
|
+
"@tamagui/constants": "1.89.27-1708113113238"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@tamagui/build": "1.89.
|
|
33
|
+
"@tamagui/build": "1.89.27-1708113113238",
|
|
34
34
|
"react": "^18.2.0",
|
|
35
|
-
"react-native": "^0.
|
|
35
|
+
"react-native": "^0.73.4"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"react": "*",
|