@zag-js/dom-utils
Advanced tools
Comparing version 0.0.0-dev-20221103102301 to 0.0.0-dev-20221110172948
@@ -215,3 +215,3 @@ import { JSX } from '@zag-js/types'; | ||
declare const isDisabled: (el: HTMLElement | null) => boolean; | ||
declare function isElementEditable(el: HTMLElement | null): boolean; | ||
declare function isElementEditable(el: HTMLElement | EventTarget | null): boolean; | ||
declare function isVisible(el: Element): boolean; | ||
@@ -263,3 +263,5 @@ | ||
}; | ||
isValidEvent: typeof isValidTypeaheadEvent; | ||
}; | ||
declare function isValidTypeaheadEvent(event: Pick<KeyboardEvent, "key" | "ctrlKey" | "metaKey">): boolean; | ||
@@ -266,0 +268,0 @@ declare function trackDocumentVisibility(_doc: Document, callback: (hidden: boolean) => void): () => void; |
@@ -342,4 +342,5 @@ "use strict"; | ||
function isElementEditable(el) { | ||
if (el == null) | ||
if (el == null || !isHTMLElement(el)) { | ||
return false; | ||
} | ||
try { | ||
@@ -1014,4 +1015,8 @@ const win = getWindow(el); | ||
timer: -1 | ||
} | ||
}, | ||
isValidEvent: isValidTypeaheadEvent | ||
}); | ||
function isValidTypeaheadEvent(event) { | ||
return event.key.length === 1 && !event.ctrlKey && !event.metaKey; | ||
} | ||
@@ -1018,0 +1023,0 @@ // src/visibility-event.ts |
{ | ||
"name": "@zag-js/dom-utils", | ||
"version": "0.0.0-dev-20221103102301", | ||
"version": "0.0.0-dev-20221110172948", | ||
"description": "", | ||
@@ -28,6 +28,6 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@zag-js/types": "0.0.0-dev-20221103102301" | ||
"@zag-js/types": "0.0.0-dev-20221110172948" | ||
}, | ||
"devDependencies": { | ||
"@zag-js/utils": "0.0.0-dev-20221103102301" | ||
"@zag-js/utils": "0.0.0-dev-20221110172948" | ||
}, | ||
@@ -34,0 +34,0 @@ "scripts": { |
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
86267
2484
+ Added@zag-js/types@0.0.0-dev-20221110172948(transitive)
- Removed@zag-js/types@0.0.0-dev-20221103102301(transitive)