Socket
Socket
Sign inDemoInstall

@zag-js/dom-query

Package Overview
Dependencies
Maintainers
1
Versions
669
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zag-js/dom-query - npm Package Compare versions

Comparing version 0.10.2 to 0.10.3

7

dist/attrs.d.ts
type Booleanish = boolean | "true" | "false";
declare const dataAttr: (guard: boolean | undefined) => Booleanish;
declare const ariaAttr: (guard: boolean | undefined) => "true" | undefined;
export { ariaAttr, dataAttr };
export declare const dataAttr: (guard: boolean | undefined) => Booleanish;
export declare const ariaAttr: (guard: boolean | undefined) => "true" | undefined;
export {};

@@ -1,37 +0,13 @@

"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
'use strict';
// src/attrs.ts
var attrs_exports = {};
__export(attrs_exports, {
ariaAttr: () => ariaAttr,
dataAttr: () => dataAttr
});
module.exports = __toCommonJS(attrs_exports);
var dataAttr = (guard) => {
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const dataAttr = (guard) => {
return guard ? "" : void 0;
};
var ariaAttr = (guard) => {
const ariaAttr = (guard) => {
return guard ? "true" : void 0;
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
ariaAttr,
dataAttr
});
exports.ariaAttr = ariaAttr;
exports.dataAttr = dataAttr;
type Target = HTMLElement | EventTarget | null | undefined;
declare function contains(parent: Target, child: Target): boolean;
declare const isSelfEvent: (event: Pick<UIEvent, "currentTarget" | "target">) => boolean;
export { contains, isSelfEvent };
export declare function contains(parent: Target, child: Target): boolean;
export declare const isSelfEvent: (event: Pick<UIEvent, "currentTarget" | "target">) => boolean;
export {};

@@ -1,46 +0,17 @@

"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
'use strict';
// src/contains.ts
var contains_exports = {};
__export(contains_exports, {
contains: () => contains,
isSelfEvent: () => isSelfEvent
});
module.exports = __toCommonJS(contains_exports);
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
// src/is-html-element.ts
function isHTMLElement(value) {
return typeof value === "object" && value?.nodeType === Node.ELEMENT_NODE && typeof value?.nodeName === "string";
}
const isHtmlElement = require('./is-html-element.js');
// src/contains.ts
function contains(parent, child) {
if (!parent || !child)
return false;
if (!isHTMLElement(parent) || !isHTMLElement(child))
if (!isHtmlElement.isHTMLElement(parent) || !isHtmlElement.isHTMLElement(child))
return false;
return parent === child || parent.contains(child);
}
var isSelfEvent = (event) => contains(event.currentTarget, event.target);
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
contains,
isSelfEvent
});
const isSelfEvent = (event) => contains(event.currentTarget, event.target);
exports.contains = contains;
exports.isSelfEvent = isSelfEvent;
type Ctx = {
getRootNode?: () => Document | ShadowRoot | Node;
};
declare function createScope<T>(methods: T): {
export declare function createScope<T>(methods: T): {
getRootNode: (ctx: Ctx) => Document | ShadowRoot;

@@ -12,3 +12,2 @@ getDoc: (ctx: Ctx) => Document;

} & T;
export { createScope };
export {};

@@ -1,27 +0,6 @@

"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
'use strict';
// src/create-scope.ts
var create_scope_exports = {};
__export(create_scope_exports, {
createScope: () => createScope
});
module.exports = __toCommonJS(create_scope_exports);
var getDocument = (node) => {
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const getDocument = (node) => {
if (node.nodeType === Node.DOCUMENT_NODE)

@@ -47,5 +26,3 @@ return node;

}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
createScope
});
exports.createScope = createScope;

@@ -1,4 +0,2 @@

declare function getDocument(el: Element | Node | Document | null): Document;
declare function getWindow(el: HTMLElement): Window & typeof globalThis;
export { getDocument, getWindow };
export declare function getDocument(el: Element | Node | Document | null): Document;
export declare function getWindow(el: HTMLElement): Window & typeof globalThis;

@@ -1,28 +0,6 @@

"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
'use strict';
// src/env.ts
var env_exports = {};
__export(env_exports, {
getDocument: () => getDocument,
getWindow: () => getWindow
});
module.exports = __toCommonJS(env_exports);
var isDocument = (el) => el.nodeType === Node.DOCUMENT_NODE;
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const isDocument = (el) => el.nodeType === Node.DOCUMENT_NODE;
function getDocument(el) {

@@ -36,6 +14,4 @@ if (isDocument(el))

}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
getDocument,
getWindow
});
exports.getDocument = getDocument;
exports.getWindow = getWindow;

@@ -1,3 +0,1 @@

declare function getActiveElement(el: HTMLElement): HTMLElement | null;
export { getActiveElement };
export declare function getActiveElement(el: HTMLElement): HTMLElement | null;

@@ -1,26 +0,5 @@

"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
'use strict';
// src/get-active-element.ts
var get_active_element_exports = {};
__export(get_active_element_exports, {
getActiveElement: () => getActiveElement
});
module.exports = __toCommonJS(get_active_element_exports);
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
function getActiveElement(el) {

@@ -37,5 +16,3 @@ let activeElement = el.ownerDocument.activeElement;

}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
getActiveElement
});
exports.getActiveElement = getActiveElement;

@@ -1,6 +0,4 @@

declare function itemById<T extends HTMLElement>(v: T[], id: string): T | undefined;
declare function indexOfId<T extends HTMLElement>(v: T[], id: string): number;
declare function nextById<T extends HTMLElement>(v: T[], id: string, loop?: boolean): T;
declare function prevById<T extends HTMLElement>(v: T[], id: string, loop?: boolean): T | null;
export { indexOfId, itemById, nextById, prevById };
export declare function itemById<T extends HTMLElement>(v: T[], id: string): T | undefined;
export declare function indexOfId<T extends HTMLElement>(v: T[], id: string): number;
export declare function nextById<T extends HTMLElement>(v: T[], id: string, loop?: boolean): T;
export declare function prevById<T extends HTMLElement>(v: T[], id: string, loop?: boolean): T | null;

@@ -1,29 +0,5 @@

"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
'use strict';
// src/get-by-id.ts
var get_by_id_exports = {};
__export(get_by_id_exports, {
indexOfId: () => indexOfId,
itemById: () => itemById,
nextById: () => nextById,
prevById: () => prevById
});
module.exports = __toCommonJS(get_by_id_exports);
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
function itemById(v, id) {

@@ -48,8 +24,6 @@ return v.find((node) => node.id === id);

}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
indexOfId,
itemById,
nextById,
prevById
});
exports.indexOfId = indexOfId;
exports.itemById = itemById;
exports.nextById = nextById;
exports.prevById = prevById;

@@ -1,3 +0,1 @@

declare function getByText<T extends HTMLElement>(v: T[], text: string, currentId?: string | null): T | undefined;
export { getByText };
export declare function getByText<T extends HTMLElement>(v: T[], text: string, currentId?: string | null): T | undefined;

@@ -1,44 +0,14 @@

"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
'use strict';
// src/get-by-text.ts
var get_by_text_exports = {};
__export(get_by_text_exports, {
getByText: () => getByText
});
module.exports = __toCommonJS(get_by_text_exports);
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
// src/get-by-id.ts
function itemById(v, id) {
return v.find((node) => node.id === id);
}
function indexOfId(v, id) {
const item = itemById(v, id);
return item ? v.indexOf(item) : -1;
}
const getById = require('./get-by-id.js');
// src/get-by-text.ts
var getValueText = (item) => item.dataset.valuetext ?? item.textContent ?? "";
var match = (valueText, query) => valueText.toLowerCase().startsWith(query.toLowerCase());
var wrap = (v, idx) => {
const getValueText = (item) => item.dataset.valuetext ?? item.textContent ?? "";
const match = (valueText, query) => valueText.toLowerCase().startsWith(query.toLowerCase());
const wrap = (v, idx) => {
return v.map((_, index) => v[(Math.max(idx, 0) + index) % v.length]);
};
function getByText(v, text, currentId) {
const index = currentId ? indexOfId(v, currentId) : -1;
const index = currentId ? getById.indexOfId(v, currentId) : -1;
let items = currentId ? wrap(v, index) : v;

@@ -51,5 +21,3 @@ const isSingleKey = text.length === 1;

}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
getByText
});
exports.getByText = getByText;

@@ -1,6 +0,6 @@

type TypeaheadState = {
export type TypeaheadState = {
keysSoFar: string;
timer: number;
};
type TypeaheadOptions = {
export type TypeaheadOptions = {
state: TypeaheadState;

@@ -12,3 +12,3 @@ activeId: string | null;

declare function getByTypeaheadImpl<T extends HTMLElement>(_items: T[], options: TypeaheadOptions): T | undefined;
declare const getByTypeahead: typeof getByTypeaheadImpl & {
export declare const getByTypeahead: typeof getByTypeaheadImpl & {
defaultOptions: {

@@ -21,3 +21,2 @@ keysSoFar: string;

declare function isValidTypeaheadEvent(event: Pick<KeyboardEvent, "key" | "ctrlKey" | "metaKey">): boolean;
export { TypeaheadOptions, TypeaheadState, getByTypeahead };
export {};

@@ -1,53 +0,7 @@

"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
'use strict';
// src/get-by-typeahead.ts
var get_by_typeahead_exports = {};
__export(get_by_typeahead_exports, {
getByTypeahead: () => getByTypeahead
});
module.exports = __toCommonJS(get_by_typeahead_exports);
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
// src/get-by-id.ts
function itemById(v, id) {
return v.find((node) => node.id === id);
}
function indexOfId(v, id) {
const item = itemById(v, id);
return item ? v.indexOf(item) : -1;
}
const getByText = require('./get-by-text.js');
// src/get-by-text.ts
var getValueText = (item) => item.dataset.valuetext ?? item.textContent ?? "";
var match = (valueText, query) => valueText.toLowerCase().startsWith(query.toLowerCase());
var wrap = (v, idx) => {
return v.map((_, index) => v[(Math.max(idx, 0) + index) % v.length]);
};
function getByText(v, text, currentId) {
const index = currentId ? indexOfId(v, currentId) : -1;
let items = currentId ? wrap(v, index) : v;
const isSingleKey = text.length === 1;
if (isSingleKey) {
items = items.filter((item) => item.id !== currentId);
}
return items.find((item) => match(getValueText(item), text));
}
// src/get-by-typeahead.ts
function getByTypeaheadImpl(_items, options) {

@@ -59,3 +13,3 @@ const { state, activeId, key, timeout = 350 } = options;

let items = _items.slice();
const next = getByText(items, query, activeId);
const next = getByText.getByText(items, query, activeId);
function cleanup() {

@@ -78,3 +32,3 @@ clearTimeout(state.timer);

}
var getByTypeahead = /* @__PURE__ */ Object.assign(getByTypeaheadImpl, {
const getByTypeahead = /* @__PURE__ */ Object.assign(getByTypeaheadImpl, {
defaultOptions: { keysSoFar: "", timer: -1 },

@@ -86,5 +40,3 @@ isValidEvent: isValidTypeaheadEvent

}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
getByTypeahead
});
exports.getByTypeahead = getByTypeahead;

@@ -1,3 +0,1 @@

declare function getComputedStyle(el: HTMLElement): any;
export { getComputedStyle };
export declare function getComputedStyle(el: HTMLElement): any;

@@ -1,27 +0,6 @@

"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
'use strict';
// src/get-computed-style.ts
var get_computed_style_exports = {};
__export(get_computed_style_exports, {
getComputedStyle: () => getComputedStyle
});
module.exports = __toCommonJS(get_computed_style_exports);
var styleCache = /* @__PURE__ */ new WeakMap();
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const styleCache = /* @__PURE__ */ new WeakMap();
function getComputedStyle(el) {

@@ -34,5 +13,3 @@ if (!styleCache.has(el)) {

}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
getComputedStyle
});
exports.getComputedStyle = getComputedStyle;

@@ -1,3 +0,1 @@

declare function getEventTarget<T extends EventTarget>(event: Event): T | null;
export { getEventTarget };
export declare function getEventTarget<T extends EventTarget>(event: Event): T | null;

@@ -1,32 +0,9 @@

"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
'use strict';
// src/get-event-target.ts
var get_event_target_exports = {};
__export(get_event_target_exports, {
getEventTarget: () => getEventTarget
});
module.exports = __toCommonJS(get_event_target_exports);
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
function getEventTarget(event) {
return event.composedPath?.()[0] ?? event.target;
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
getEventTarget
});
exports.getEventTarget = getEventTarget;

@@ -1,6 +0,5 @@

declare function getParent(el: HTMLElement): HTMLElement;
declare function getScrollParent(el: HTMLElement): HTMLElement;
export declare function getParent(el: HTMLElement): HTMLElement;
export declare function getScrollParent(el: HTMLElement): HTMLElement;
type Target = Array<VisualViewport | Window | HTMLElement | null>;
declare function getScrollParents(el: HTMLElement, list?: Target): Target;
export { getParent, getScrollParent, getScrollParents };
export declare function getScrollParents(el: HTMLElement, list?: Target): Target;
export {};

@@ -1,35 +0,7 @@

"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
'use strict';
// src/get-scroll-parent.ts
var get_scroll_parent_exports = {};
__export(get_scroll_parent_exports, {
getParent: () => getParent,
getScrollParent: () => getScrollParent,
getScrollParents: () => getScrollParents
});
module.exports = __toCommonJS(get_scroll_parent_exports);
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
// src/is-html-element.ts
function isHTMLElement(value) {
return typeof value === "object" && value?.nodeType === Node.ELEMENT_NODE && typeof value?.nodeName === "string";
}
const isHtmlElement = require('./is-html-element.js');
// src/get-scroll-parent.ts
function isScrollParent(el) {

@@ -49,3 +21,3 @@ const win = el.ownerDocument.defaultView || window;

}
if (isHTMLElement(el) && isScrollParent(el)) {
if (isHtmlElement.isHTMLElement(el) && isScrollParent(el)) {
return el;

@@ -63,7 +35,5 @@ }

}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
getParent,
getScrollParent,
getScrollParents
});
exports.getParent = getParent;
exports.getScrollParent = getScrollParent;
exports.getScrollParents = getScrollParents;

@@ -1,20 +0,17 @@

export { ariaAttr, dataAttr } from './attrs.js';
export { contains, isSelfEvent } from './contains.js';
export { createScope } from './create-scope.js';
export { getDocument, getWindow } from './env.js';
export { getActiveElement } from './get-active-element.js';
export { indexOfId, itemById, nextById, prevById } from './get-by-id.js';
export { getByText } from './get-by-text.js';
export { TypeaheadOptions, TypeaheadState, getByTypeahead } from './get-by-typeahead.js';
export { getComputedStyle } from './get-computed-style.js';
export { getEventTarget } from './get-event-target.js';
export { getParent, getScrollParent, getScrollParents } from './get-scroll-parent.js';
export { isEditableElement } from './is-editable-element.js';
export { isHTMLElement } from './is-html-element.js';
export { getPlatform, isApple, isDom, isFirefox, isIPhone, isIos, isMac, isSafari, isTouchDevice } from './platform.js';
export { query, queryAll } from './query.js';
export { nextTick, raf } from './raf.js';
declare const MAX_Z_INDEX = 2147483647;
export { MAX_Z_INDEX };
export * from "./attrs";
export * from "./contains";
export * from "./create-scope";
export * from "./env";
export * from "./get-active-element";
export * from "./get-by-id";
export * from "./get-by-text";
export * from "./get-by-typeahead";
export * from "./get-computed-style";
export * from "./get-event-target";
export * from "./get-scroll-parent";
export * from "./is-editable-element";
export * from "./is-html-element";
export * from "./platform";
export * from "./query";
export * from "./raf";
export declare const MAX_Z_INDEX = 2147483647;

@@ -1,341 +0,58 @@

"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
'use strict';
// src/index.ts
var src_exports = {};
__export(src_exports, {
MAX_Z_INDEX: () => MAX_Z_INDEX,
ariaAttr: () => ariaAttr,
contains: () => contains,
createScope: () => createScope,
dataAttr: () => dataAttr,
getActiveElement: () => getActiveElement,
getByText: () => getByText,
getByTypeahead: () => getByTypeahead,
getComputedStyle: () => getComputedStyle,
getDocument: () => getDocument2,
getEventTarget: () => getEventTarget,
getParent: () => getParent,
getPlatform: () => getPlatform,
getScrollParent: () => getScrollParent,
getScrollParents: () => getScrollParents,
getWindow: () => getWindow,
indexOfId: () => indexOfId,
isApple: () => isApple,
isDom: () => isDom,
isEditableElement: () => isEditableElement,
isFirefox: () => isFirefox,
isHTMLElement: () => isHTMLElement,
isIPhone: () => isIPhone,
isIos: () => isIos,
isMac: () => isMac,
isSafari: () => isSafari,
isSelfEvent: () => isSelfEvent,
isTouchDevice: () => isTouchDevice,
itemById: () => itemById,
nextById: () => nextById,
nextTick: () => nextTick,
prevById: () => prevById,
query: () => query,
queryAll: () => queryAll,
raf: () => raf
});
module.exports = __toCommonJS(src_exports);
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
// src/attrs.ts
var dataAttr = (guard) => {
return guard ? "" : void 0;
};
var ariaAttr = (guard) => {
return guard ? "true" : void 0;
};
const attrs = require('./attrs.js');
const contains = require('./contains.js');
const createScope = require('./create-scope.js');
const env = require('./env.js');
const getActiveElement = require('./get-active-element.js');
const getById = require('./get-by-id.js');
const getByText = require('./get-by-text.js');
const getByTypeahead = require('./get-by-typeahead.js');
const getComputedStyle = require('./get-computed-style.js');
const getEventTarget = require('./get-event-target.js');
const getScrollParent = require('./get-scroll-parent.js');
const isEditableElement = require('./is-editable-element.js');
const isHtmlElement = require('./is-html-element.js');
const platform = require('./platform.js');
const query = require('./query.js');
const raf = require('./raf.js');
// src/is-html-element.ts
function isHTMLElement(value) {
return typeof value === "object" && value?.nodeType === Node.ELEMENT_NODE && typeof value?.nodeName === "string";
}
const MAX_Z_INDEX = 2147483647;
// src/contains.ts
function contains(parent, child) {
if (!parent || !child)
return false;
if (!isHTMLElement(parent) || !isHTMLElement(child))
return false;
return parent === child || parent.contains(child);
}
var isSelfEvent = (event) => contains(event.currentTarget, event.target);
// src/create-scope.ts
var getDocument = (node) => {
if (node.nodeType === Node.DOCUMENT_NODE)
return node;
return node.ownerDocument ?? document;
};
function createScope(methods) {
const screen = {
getRootNode: (ctx) => ctx.getRootNode?.() ?? document,
getDoc: (ctx) => getDocument(screen.getRootNode(ctx)),
getWin: (ctx) => screen.getDoc(ctx).defaultView ?? window,
getActiveElement: (ctx) => screen.getDoc(ctx).activeElement,
getById: (ctx, id) => screen.getRootNode(ctx).getElementById(id),
queryById: (ctx, id) => {
const el = screen.getById(ctx, id);
if (!el)
throw new Error(`Element with id "${id}" not found.`);
return el;
}
};
return { ...screen, ...methods };
}
// src/env.ts
var isDocument = (el) => el.nodeType === Node.DOCUMENT_NODE;
function getDocument2(el) {
if (isDocument(el))
return el;
return el?.ownerDocument ?? document;
}
function getWindow(el) {
return el?.ownerDocument.defaultView ?? window;
}
// src/get-active-element.ts
function getActiveElement(el) {
let activeElement = el.ownerDocument.activeElement;
while (activeElement?.shadowRoot) {
const el2 = activeElement.shadowRoot.activeElement;
if (el2 === activeElement)
break;
else
activeElement = el2;
}
return activeElement;
}
// src/get-by-id.ts
function itemById(v, id) {
return v.find((node) => node.id === id);
}
function indexOfId(v, id) {
const item = itemById(v, id);
return item ? v.indexOf(item) : -1;
}
function nextById(v, id, loop = true) {
let idx = indexOfId(v, id);
idx = loop ? (idx + 1) % v.length : Math.min(idx + 1, v.length - 1);
return v[idx];
}
function prevById(v, id, loop = true) {
let idx = indexOfId(v, id);
if (idx === -1)
return loop ? v[v.length - 1] : null;
idx = loop ? (idx - 1 + v.length) % v.length : Math.max(0, idx - 1);
return v[idx];
}
// src/get-by-text.ts
var getValueText = (item) => item.dataset.valuetext ?? item.textContent ?? "";
var match = (valueText, query2) => valueText.toLowerCase().startsWith(query2.toLowerCase());
var wrap = (v, idx) => {
return v.map((_, index) => v[(Math.max(idx, 0) + index) % v.length]);
};
function getByText(v, text, currentId) {
const index = currentId ? indexOfId(v, currentId) : -1;
let items = currentId ? wrap(v, index) : v;
const isSingleKey = text.length === 1;
if (isSingleKey) {
items = items.filter((item) => item.id !== currentId);
}
return items.find((item) => match(getValueText(item), text));
}
// src/get-by-typeahead.ts
function getByTypeaheadImpl(_items, options) {
const { state, activeId, key, timeout = 350 } = options;
const search = state.keysSoFar + key;
const isRepeated = search.length > 1 && Array.from(search).every((char) => char === search[0]);
const query2 = isRepeated ? search[0] : search;
let items = _items.slice();
const next = getByText(items, query2, activeId);
function cleanup() {
clearTimeout(state.timer);
state.timer = -1;
}
function update(value) {
state.keysSoFar = value;
cleanup();
if (value !== "") {
state.timer = +setTimeout(() => {
update("");
cleanup();
}, timeout);
}
}
update(search);
return next;
}
var getByTypeahead = /* @__PURE__ */ Object.assign(getByTypeaheadImpl, {
defaultOptions: { keysSoFar: "", timer: -1 },
isValidEvent: isValidTypeaheadEvent
});
function isValidTypeaheadEvent(event) {
return event.key.length === 1 && !event.ctrlKey && !event.metaKey;
}
// src/get-computed-style.ts
var styleCache = /* @__PURE__ */ new WeakMap();
function getComputedStyle(el) {
if (!styleCache.has(el)) {
const win = el.ownerDocument.defaultView || window;
styleCache.set(el, win.getComputedStyle(el));
}
return styleCache.get(el);
}
// src/get-event-target.ts
function getEventTarget(event) {
return event.composedPath?.()[0] ?? event.target;
}
// src/get-scroll-parent.ts
function isScrollParent(el) {
const win = el.ownerDocument.defaultView || window;
const { overflow, overflowX, overflowY } = win.getComputedStyle(el);
return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
}
function getParent(el) {
if (el.localName === "html")
return el;
return el.assignedSlot || el.parentElement || el.ownerDocument.documentElement;
}
function getScrollParent(el) {
if (["html", "body", "#document"].includes(el.localName)) {
return el.ownerDocument.body;
}
if (isHTMLElement(el) && isScrollParent(el)) {
return el;
}
return getScrollParent(getParent(el));
}
function getScrollParents(el, list = []) {
const parent = getScrollParent(el);
const isBody = parent === el.ownerDocument.body;
const win = parent.ownerDocument.defaultView || window;
const target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(parent) ? parent : []) : parent;
const parents = list.concat(target);
return isBody ? parents : parents.concat(getScrollParents(getParent(target)));
}
// src/is-editable-element.ts
function isEditableElement(el) {
if (el == null || !isHTMLElement(el)) {
return false;
}
try {
const win = el.ownerDocument.defaultView || window;
return el instanceof win.HTMLInputElement && el.selectionStart != null || /(textarea|select)/.test(el.localName) || el.isContentEditable;
} catch {
return false;
}
}
// 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 ua = (v) => isDom() && v.test(navigator.userAgent);
var vn = (v) => isDom() && v.test(navigator.vendor);
var isTouchDevice = () => isDom() && !!navigator.maxTouchPoints;
var isMac = () => pt(/^Mac/) && !isTouchDevice();
var isIPhone = () => pt(/^iPhone/);
var isSafari = () => isApple() && vn(/apple/i);
var isFirefox = () => ua(/firefox\//i);
var isApple = () => pt(/mac|iphone|ipad|ipod/i);
var isIos = () => isApple() && !isMac();
// src/query.ts
function queryAll(root, selector) {
return Array.from(root?.querySelectorAll(selector) ?? []);
}
function query(root, selector) {
return root?.querySelector(selector);
}
// src/raf.ts
function nextTick(fn) {
const set = /* @__PURE__ */ new Set();
function raf2(fn2) {
const id = globalThis.requestAnimationFrame(fn2);
set.add(() => globalThis.cancelAnimationFrame(id));
}
raf2(() => raf2(fn));
return function cleanup() {
set.forEach((fn2) => fn2());
};
}
function raf(fn) {
const id = globalThis.requestAnimationFrame(fn);
return () => {
globalThis.cancelAnimationFrame(id);
};
}
// src/index.ts
var MAX_Z_INDEX = 2147483647;
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
MAX_Z_INDEX,
ariaAttr,
contains,
createScope,
dataAttr,
getActiveElement,
getByText,
getByTypeahead,
getComputedStyle,
getDocument,
getEventTarget,
getParent,
getPlatform,
getScrollParent,
getScrollParents,
getWindow,
indexOfId,
isApple,
isDom,
isEditableElement,
isFirefox,
isHTMLElement,
isIPhone,
isIos,
isMac,
isSafari,
isSelfEvent,
isTouchDevice,
itemById,
nextById,
nextTick,
prevById,
query,
queryAll,
raf
});
exports.ariaAttr = attrs.ariaAttr;
exports.dataAttr = attrs.dataAttr;
exports.contains = contains.contains;
exports.isSelfEvent = contains.isSelfEvent;
exports.createScope = createScope.createScope;
exports.getDocument = env.getDocument;
exports.getWindow = env.getWindow;
exports.getActiveElement = getActiveElement.getActiveElement;
exports.indexOfId = getById.indexOfId;
exports.itemById = getById.itemById;
exports.nextById = getById.nextById;
exports.prevById = getById.prevById;
exports.getByText = getByText.getByText;
exports.getByTypeahead = getByTypeahead.getByTypeahead;
exports.getComputedStyle = getComputedStyle.getComputedStyle;
exports.getEventTarget = getEventTarget.getEventTarget;
exports.getParent = getScrollParent.getParent;
exports.getScrollParent = getScrollParent.getScrollParent;
exports.getScrollParents = getScrollParent.getScrollParents;
exports.isEditableElement = isEditableElement.isEditableElement;
exports.isHTMLElement = isHtmlElement.isHTMLElement;
exports.getPlatform = platform.getPlatform;
exports.isApple = platform.isApple;
exports.isDom = platform.isDom;
exports.isFirefox = platform.isFirefox;
exports.isIPhone = platform.isIPhone;
exports.isIos = platform.isIos;
exports.isMac = platform.isMac;
exports.isSafari = platform.isSafari;
exports.isTouchDevice = platform.isTouchDevice;
exports.query = query.query;
exports.queryAll = query.queryAll;
exports.nextTick = raf.nextTick;
exports.raf = raf.raf;
exports.MAX_Z_INDEX = MAX_Z_INDEX;

@@ -1,3 +0,1 @@

declare function isEditableElement(el: HTMLElement | EventTarget | null): boolean;
export { isEditableElement };
export declare function isEditableElement(el: HTMLElement | EventTarget | null): boolean;

@@ -1,35 +0,9 @@

"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
'use strict';
// src/is-editable-element.ts
var is_editable_element_exports = {};
__export(is_editable_element_exports, {
isEditableElement: () => isEditableElement
});
module.exports = __toCommonJS(is_editable_element_exports);
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
// src/is-html-element.ts
function isHTMLElement(value) {
return typeof value === "object" && value?.nodeType === Node.ELEMENT_NODE && typeof value?.nodeName === "string";
}
const isHtmlElement = require('./is-html-element.js');
// src/is-editable-element.ts
function isEditableElement(el) {
if (el == null || !isHTMLElement(el)) {
if (el == null || !isHtmlElement.isHTMLElement(el)) {
return false;

@@ -44,5 +18,3 @@ }

}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
isEditableElement
});
exports.isEditableElement = isEditableElement;

@@ -1,3 +0,1 @@

declare function isHTMLElement(value: any): value is HTMLElement;
export { isHTMLElement };
export declare function isHTMLElement(value: any): value is HTMLElement;

@@ -1,32 +0,9 @@

"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
'use strict';
// src/is-html-element.ts
var is_html_element_exports = {};
__export(is_html_element_exports, {
isHTMLElement: () => isHTMLElement
});
module.exports = __toCommonJS(is_html_element_exports);
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
function isHTMLElement(value) {
return typeof value === "object" && value?.nodeType === Node.ELEMENT_NODE && typeof value?.nodeName === "string";
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
isHTMLElement
});
exports.isHTMLElement = isHTMLElement;

@@ -1,11 +0,9 @@

declare const isDom: () => boolean;
declare function getPlatform(): any;
declare const isTouchDevice: () => boolean;
declare const isMac: () => boolean;
declare const isIPhone: () => boolean;
declare const isSafari: () => boolean;
declare const isFirefox: () => boolean;
declare const isApple: () => boolean;
declare const isIos: () => boolean;
export { getPlatform, isApple, isDom, isFirefox, isIPhone, isIos, isMac, isSafari, isTouchDevice };
export declare const isDom: () => boolean;
export declare function getPlatform(): any;
export declare const isTouchDevice: () => boolean;
export declare const isMac: () => boolean;
export declare const isIPhone: () => boolean;
export declare const isSafari: () => boolean;
export declare const isFirefox: () => boolean;
export declare const isApple: () => boolean;
export declare const isIos: () => boolean;

@@ -1,35 +0,6 @@

"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
'use strict';
// src/platform.ts
var platform_exports = {};
__export(platform_exports, {
getPlatform: () => getPlatform,
isApple: () => isApple,
isDom: () => isDom,
isFirefox: () => isFirefox,
isIPhone: () => isIPhone,
isIos: () => isIos,
isMac: () => isMac,
isSafari: () => isSafari,
isTouchDevice: () => isTouchDevice
});
module.exports = __toCommonJS(platform_exports);
var isDom = () => typeof window !== "undefined";
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const isDom = () => typeof document !== "undefined";
function getPlatform() {

@@ -39,23 +10,21 @@ const agent = navigator.userAgentData;

}
var pt = (v) => isDom() && v.test(getPlatform());
var ua = (v) => isDom() && v.test(navigator.userAgent);
var vn = (v) => isDom() && v.test(navigator.vendor);
var isTouchDevice = () => isDom() && !!navigator.maxTouchPoints;
var isMac = () => pt(/^Mac/) && !isTouchDevice();
var isIPhone = () => pt(/^iPhone/);
var isSafari = () => isApple() && vn(/apple/i);
var isFirefox = () => ua(/firefox\//i);
var isApple = () => pt(/mac|iphone|ipad|ipod/i);
var isIos = () => isApple() && !isMac();
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
getPlatform,
isApple,
isDom,
isFirefox,
isIPhone,
isIos,
isMac,
isSafari,
isTouchDevice
});
const pt = (v) => isDom() && v.test(getPlatform());
const ua = (v) => isDom() && v.test(navigator.userAgent);
const vn = (v) => isDom() && v.test(navigator.vendor);
const isTouchDevice = () => isDom() && !!navigator.maxTouchPoints;
const isMac = () => pt(/^Mac/) && !isTouchDevice();
const isIPhone = () => pt(/^iPhone/);
const isSafari = () => isApple() && vn(/apple/i);
const isFirefox = () => ua(/firefox\//i);
const isApple = () => pt(/mac|iphone|ipad|ipod/i);
const isIos = () => isApple() && !isMac();
exports.getPlatform = getPlatform;
exports.isApple = isApple;
exports.isDom = isDom;
exports.isFirefox = isFirefox;
exports.isIPhone = isIPhone;
exports.isIos = isIos;
exports.isMac = isMac;
exports.isSafari = isSafari;
exports.isTouchDevice = isTouchDevice;
type Root = Document | Element | null | undefined;
declare function queryAll<T extends HTMLElement = HTMLElement>(root: Root, selector: string): T[];
declare function query<T extends HTMLElement = HTMLElement>(root: Root, selector: string): T | null | undefined;
export { query, queryAll };
export declare function queryAll<T extends HTMLElement = HTMLElement>(root: Root, selector: string): T[];
export declare function query<T extends HTMLElement = HTMLElement>(root: Root, selector: string): T | null | undefined;
export {};

@@ -1,27 +0,5 @@

"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
'use strict';
// src/query.ts
var query_exports = {};
__export(query_exports, {
query: () => query,
queryAll: () => queryAll
});
module.exports = __toCommonJS(query_exports);
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
function queryAll(root, selector) {

@@ -33,6 +11,4 @@ return Array.from(root?.querySelectorAll(selector) ?? []);

}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
query,
queryAll
});
exports.query = query;
exports.queryAll = queryAll;

@@ -1,4 +0,2 @@

declare function nextTick(fn: VoidFunction): () => void;
declare function raf(fn: VoidFunction): () => void;
export { nextTick, raf };
export declare function nextTick(fn: VoidFunction): () => void;
export declare function raf(fn: VoidFunction): () => void;

@@ -1,27 +0,5 @@

"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
'use strict';
// src/raf.ts
var raf_exports = {};
__export(raf_exports, {
nextTick: () => nextTick,
raf: () => raf
});
module.exports = __toCommonJS(raf_exports);
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
function nextTick(fn) {

@@ -44,6 +22,4 @@ const set = /* @__PURE__ */ new Set();

}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
nextTick,
raf
});
exports.nextTick = nextTick;
exports.raf = raf;
{
"name": "@zag-js/dom-query",
"version": "0.10.2",
"version": "0.10.3",
"description": "The dom helper library for zag.js machines",

@@ -42,11 +42,6 @@ "keywords": [

"scripts": {
"build-fast": "tsup src",
"start": "pnpm build --watch",
"build": "tsup src --dts",
"test": "jest --config ../../../jest.config.js --rootDir . --passWithNoTests",
"build": "vite build -c ../../../vite.config.ts",
"lint": "eslint src --ext .ts,.tsx",
"test-ci": "pnpm test --ci --runInBand",
"test-watch": "pnpm test --watch -u",
"typecheck": "tsc --noEmit"
}
}

@@ -1,2 +0,2 @@

export const isDom = () => typeof window !== "undefined"
export const isDom = () => typeof document !== "undefined"

@@ -3,0 +3,0 @@ export function getPlatform() {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc