@zag-js/remove-scroll
Advanced tools
Comparing version 0.2.2 to 0.2.3
@@ -26,17 +26,4 @@ "use strict"; | ||
module.exports = __toCommonJS(src_exports); | ||
// ../dom/src/platform.ts | ||
var isDom = () => typeof window !== "undefined"; | ||
function getPlatform() { | ||
const agent = navigator.userAgentData; | ||
return agent?.platform ?? navigator.platform; | ||
} | ||
var pt = (v) => isDom() && v.test(getPlatform()); | ||
var isTouchDevice = () => isDom() && !!navigator.maxTouchPoints; | ||
var isMac = () => pt(/^Mac/) && !isTouchDevice; | ||
var isApple = () => pt(/mac|iphone|ipad|ipod/i); | ||
var isIos = () => isApple() && !isMac(); | ||
// src/index.ts | ||
var LOCK_CLASSNAME = "data-scroll-lock"; | ||
var import_dom_query = require("@zag-js/dom-query"); | ||
var LOCK_CLASSNAME = "data-zag-scroll-lock"; | ||
function assignStyle(el, style) { | ||
@@ -103,3 +90,3 @@ if (!el) | ||
}; | ||
const cleanups = [setScrollbarWidthProperty(), isIos() ? setIOSStyle() : setStyle()]; | ||
const cleanups = [setScrollbarWidthProperty(), (0, import_dom_query.isIos)() ? setIOSStyle() : setStyle()]; | ||
return () => { | ||
@@ -106,0 +93,0 @@ cleanups.forEach((cleanup) => cleanup()); |
{ | ||
"name": "@zag-js/remove-scroll", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"description": "JavaScript utility to remove scroll on body", | ||
@@ -21,5 +21,7 @@ "keywords": [ | ||
}, | ||
"dependencies": { | ||
"@zag-js/dom-query": "0.1.3" | ||
}, | ||
"devDependencies": { | ||
"clean-package": "2.2.0", | ||
"@zag-js/dom-utils": "0.2.4" | ||
"clean-package": "2.2.0" | ||
}, | ||
@@ -26,0 +28,0 @@ "bugs": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1
8673
1
172
+ Added@zag-js/dom-query@0.1.3
+ Added@zag-js/dom-query@0.1.3(transitive)