@zag-js/rect-utils 0.1.6 → 0.1.8

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/index.js CHANGED
@@ -409,8 +409,8 @@ function getWindowRect(win, opts = {}) {
409
409
  function getViewportRect(win, opts) {
410
410
  const { excludeScrollbar = false } = opts;
411
411
  const { innerWidth: innerWidth2, innerHeight: innerHeight2, document: doc, visualViewport } = win;
412
- const width = visualViewport.width || innerWidth2;
413
- const height = visualViewport.height || innerHeight2;
412
+ const width = (visualViewport == null ? void 0 : visualViewport.width) || innerWidth2;
413
+ const height = (visualViewport == null ? void 0 : visualViewport.height) || innerHeight2;
414
414
  const rect = { x: 0, y: 0, width, height };
415
415
  if (excludeScrollbar) {
416
416
  const scrollbarWidth = innerWidth2 - doc.documentElement.clientWidth;
package/dist/index.mjs CHANGED
@@ -348,8 +348,8 @@ function getWindowRect(win, opts = {}) {
348
348
  function getViewportRect(win, opts) {
349
349
  const { excludeScrollbar = false } = opts;
350
350
  const { innerWidth: innerWidth2, innerHeight: innerHeight2, document: doc, visualViewport } = win;
351
- const width = visualViewport.width || innerWidth2;
352
- const height = visualViewport.height || innerHeight2;
351
+ const width = (visualViewport == null ? void 0 : visualViewport.width) || innerWidth2;
352
+ const height = (visualViewport == null ? void 0 : visualViewport.height) || innerHeight2;
353
353
  const rect = { x: 0, y: 0, width, height };
354
354
  if (excludeScrollbar) {
355
355
  const scrollbarWidth = innerWidth2 - doc.documentElement.clientWidth;
package/package.json CHANGED
@@ -1,7 +1,10 @@
1
1
  {
2
2
  "name": "@zag-js/rect-utils",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "description": "",
5
+ "main": "dist/index.js",
6
+ "module": "dist/index.mjs",
7
+ "types": "dist/index.d.ts",
5
8
  "keywords": [
6
9
  "js",
7
10
  "utils",
@@ -10,9 +13,6 @@
10
13
  "author": "Segun Adebayo <sage@adebayosegun.com>",
11
14
  "homepage": "https://github.com/chakra-ui/zag#readme",
12
15
  "license": "MIT",
13
- "main": "dist/index.js",
14
- "module": "dist/index.mjs",
15
- "types": "dist/index.d.ts",
16
16
  "repository": "https://github.com/chakra-ui/zag/tree/main/packages/utilities/rect",
17
17
  "sideEffects": false,
18
18
  "files": [
@@ -25,8 +25,8 @@
25
25
  "url": "https://github.com/chakra-ui/zag/issues"
26
26
  },
27
27
  "devDependencies": {
28
- "@zag-js/dom-utils": "0.1.11",
29
- "@zag-js/utils": "0.1.4"
28
+ "@zag-js/dom-utils": "0.1.13",
29
+ "@zag-js/utils": "0.1.6"
30
30
  },
31
31
  "scripts": {
32
32
  "build-fast": "tsup src/index.ts --format=esm,cjs",