ds-one 0.1.11-alpha.12 → 0.1.11-alpha.13

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.
@@ -57,8 +57,15 @@ export function getDeviceInfo(): DeviceInfo {
57
57
  const touchPoints = (nav && nav.maxTouchPoints) || 0;
58
58
  const isTouchCapable = touchPoints > 1;
59
59
 
60
- const screenWidth = win?.innerWidth || 0;
61
- const screenHeight = win?.innerHeight || 0;
60
+ // Use clientWidth instead of innerWidth to exclude scrollbars
61
+ const screenWidth =
62
+ typeof document !== "undefined"
63
+ ? document.documentElement.clientWidth
64
+ : win?.innerWidth || 0;
65
+ const screenHeight =
66
+ typeof document !== "undefined"
67
+ ? document.documentElement.clientHeight
68
+ : win?.innerHeight || 0;
62
69
  const isTablet = isMobile && Math.min(screenWidth, screenHeight) >= 600;
63
70
 
64
71
  return {
@@ -1,4 +1,4 @@
1
- /* version 0.1.11-alpha.8 */
1
+ /* version 0.1.11-alpha.12 */
2
2
 
3
3
  input {
4
4
  padding: 0;
package/README.md CHANGED
@@ -27,7 +27,7 @@ npm install ds-one@alpha
27
27
  yarn add ds-one@alpha
28
28
  ```
29
29
 
30
- **Note**: Currently published as alpha version `0.1.11-alpha.12`. Use `@alpha` tag to install.
30
+ **Note**: Currently published as alpha version `0.1.11-alpha.13`. Use `@alpha` tag to install.
31
31
 
32
32
  ### Basic Usage
33
33
 
@@ -1 +1 @@
1
- {"version":3,"file":"2025-04-23-device.d.ts","sourceRoot":"","sources":["../../DS1/0-face/2025-04-23-device.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEzD,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,cAAc,EAAE,OAAO,CAAC;IACxB,UAAU,EAAE,UAAU,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CA0B5C;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,UAAU,CAsB1C;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,UAAU,CA8ChD"}
1
+ {"version":3,"file":"2025-04-23-device.d.ts","sourceRoot":"","sources":["../../DS1/0-face/2025-04-23-device.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEzD,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,cAAc,EAAE,OAAO,CAAC;IACxB,UAAU,EAAE,UAAU,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CA0B5C;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,UAAU,CA6B1C;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,UAAU,CA8ChD"}
@@ -31,8 +31,13 @@ export function getDeviceInfo() {
31
31
  const win = window;
32
32
  const touchPoints = (nav && nav.maxTouchPoints) || 0;
33
33
  const isTouchCapable = touchPoints > 1;
34
- const screenWidth = win?.innerWidth || 0;
35
- const screenHeight = win?.innerHeight || 0;
34
+ // Use clientWidth instead of innerWidth to exclude scrollbars
35
+ const screenWidth = typeof document !== "undefined"
36
+ ? document.documentElement.clientWidth
37
+ : win?.innerWidth || 0;
38
+ const screenHeight = typeof document !== "undefined"
39
+ ? document.documentElement.clientHeight
40
+ : win?.innerHeight || 0;
36
41
  const isTablet = isMobile && Math.min(screenWidth, screenHeight) >= 600;
37
42
  return {
38
43
  isMobile,
@@ -18,8 +18,8 @@ function getDeviceInfo() {
18
18
  const win = window;
19
19
  const touchPoints = nav && nav.maxTouchPoints || 0;
20
20
  const isTouchCapable = touchPoints > 1;
21
- const screenWidth = win?.innerWidth || 0;
22
- const screenHeight = win?.innerHeight || 0;
21
+ const screenWidth = typeof document !== "undefined" ? document.documentElement.clientWidth : win?.innerWidth || 0;
22
+ const screenHeight = typeof document !== "undefined" ? document.documentElement.clientHeight : win?.innerHeight || 0;
23
23
  const isTablet = isMobile && Math.min(screenWidth, screenHeight) >= 600;
24
24
  return {
25
25
  isMobile,