@zag-js/dom-utils
Advanced tools
Comparing version 0.0.0-dev-20220709135250 to 0.0.0-dev-20220709145914
@@ -51,2 +51,3 @@ "use strict"; | ||
dataAttr: () => dataAttr, | ||
defineDomHelpers: () => defineDomHelpers, | ||
disableTextSelection: () => disableTextSelection, | ||
@@ -161,4 +162,3 @@ dispatchInputCheckedEvent: () => dispatchInputCheckedEvent, | ||
whenMouse: () => whenMouse, | ||
whenTouchOrPen: () => whenTouchOrPen, | ||
withRootHelpers: () => withRootHelpers | ||
whenTouchOrPen: () => whenTouchOrPen | ||
}); | ||
@@ -324,3 +324,3 @@ module.exports = __toCommonJS(src_exports); | ||
} | ||
function withRootHelpers(domUtils) { | ||
function defineDomHelpers(domUtils) { | ||
const roots = { | ||
@@ -335,3 +335,4 @@ getRootNode: (ctx) => { | ||
return (_a = roots.getDoc(ctx).defaultView) != null ? _a : window; | ||
} | ||
}, | ||
getActiveElement: (ctx) => roots.getDoc(ctx).activeElement | ||
}; | ||
@@ -338,0 +339,0 @@ return __spreadValues(__spreadValues({}, roots), domUtils); |
@@ -19,6 +19,7 @@ export declare function isDocument(el: any): el is Document; | ||
}; | ||
export declare function withRootHelpers<T>(domUtils: T): { | ||
export declare function defineDomHelpers<T>(domUtils: T): { | ||
getRootNode: (ctx: Ctx) => Document | ShadowRoot; | ||
getDoc: (ctx: Ctx) => Document; | ||
getWin: (ctx: Ctx) => Window & typeof globalThis; | ||
getActiveElement: (ctx: Ctx) => HTMLElement; | ||
} & T; | ||
@@ -25,0 +26,0 @@ export declare function contains(parent: HTMLElement | EventTarget | null | undefined, child: HTMLElement | EventTarget | null): boolean; |
{ | ||
"name": "@zag-js/dom-utils", | ||
"version": "0.0.0-dev-20220709135250", | ||
"version": "0.0.0-dev-20220709145914", | ||
"description": "", | ||
@@ -28,3 +28,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@zag-js/types": "0.0.0-dev-20220709135250", | ||
"@zag-js/types": "0.0.0-dev-20220709145914", | ||
"@zag-js/utils": "0.1.2" | ||
@@ -31,0 +31,0 @@ }, |
Sorry, the diff of this file is not supported yet
94198
2721
+ Added@zag-js/types@0.0.0-dev-20220709145914(transitive)
- Removed@zag-js/types@0.0.0-dev-20220709135250(transitive)