Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@zag-js/dom-utils

Package Overview
Dependencies
Maintainers
1
Versions
227
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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

Comparing version 0.0.0-dev-20230102084517 to 0.0.0-dev-20230105173950

dist/chunk-2VBQCC6X.mjs

6

dist/get-point-relative-to-element.js

@@ -62,5 +62,5 @@ "use strict";

function getPointPercentRelativeToNode(point, element) {
const pt = getPointRelativeToNode(point, element);
const x = pt.x / element.offsetWidth * 100;
const y = pt.y / element.offsetHeight * 100;
const relativePoint = getPointRelativeToNode(point, element);
const x = relativePoint.x / element.offsetWidth * 100;
const y = relativePoint.y / element.offsetHeight * 100;
return { x: clampPercent(x), y: clampPercent(y) };

@@ -67,0 +67,0 @@ }

@@ -309,21 +309,3 @@ "use strict";

getActiveElement: (ctx) => dom.getDoc(ctx).activeElement,
getById: (ctx, id) => dom.getRootNode(ctx).getElementById(id),
createEmitter: (ctx, target) => {
const win = dom.getWin(ctx);
return function emit(evt, detail, options) {
const { bubbles = true, cancelable, composed = true } = options != null ? options : {};
const eventName = `zag:${evt}`;
const init = { bubbles, cancelable, composed, detail };
const event = new win.CustomEvent(eventName, init);
target.dispatchEvent(event);
};
},
createListener: (target) => {
return function listen(evt, handler) {
const eventName = `zag:${evt}`;
const listener = (e) => handler(e);
target.addEventListener(eventName, listener);
return () => target.removeEventListener(eventName, listener);
};
}
getById: (ctx, id) => dom.getRootNode(ctx).getElementById(id)
};

@@ -535,5 +517,5 @@ return {

function getPointPercentRelativeToNode(point, element) {
const pt2 = getPointRelativeToNode(point, element);
const x = pt2.x / element.offsetWidth * 100;
const y = pt2.y / element.offsetHeight * 100;
const relativePoint = getPointRelativeToNode(point, element);
const x = relativePoint.x / element.offsetWidth * 100;
const y = relativePoint.y / element.offsetHeight * 100;
return { x: clampPercent(x), y: clampPercent(y) };

@@ -887,3 +869,6 @@ }

return;
body.requestPointerLock();
try {
body.requestPointerLock();
} catch {
}
const cleanup = callAll(

@@ -890,0 +875,0 @@ addPointerlockChangeListener(doc, onPointerChange),

@@ -85,3 +85,6 @@ "use strict";

return;
body.requestPointerLock();
try {
body.requestPointerLock();
} catch {
}
const cleanup = callAll(

@@ -88,0 +91,0 @@ addPointerlockChangeListener(doc, onPointerChange),

@@ -25,4 +25,2 @@ declare function isDocument(el: any): el is Document;

getById: <T_1 = HTMLElement>(ctx: Ctx, id: string) => T_1 | null;
createEmitter: (ctx: Ctx, target: HTMLElement) => (evt: string, detail: Record<string, any>, options?: EventInit) => void;
createListener: (target: HTMLElement) => <T_2 = any>(evt: string, handler: (e: CustomEvent<T_2>) => void) => () => void;
} & T;

@@ -29,0 +27,0 @@ declare function contains(parent: HTMLElement | EventTarget | null | undefined, child: HTMLElement | EventTarget | null): boolean;

@@ -132,21 +132,3 @@ "use strict";

getActiveElement: (ctx) => dom.getDoc(ctx).activeElement,
getById: (ctx, id) => dom.getRootNode(ctx).getElementById(id),
createEmitter: (ctx, target) => {
const win = dom.getWin(ctx);
return function emit(evt, detail, options) {
const { bubbles = true, cancelable, composed = true } = options != null ? options : {};
const eventName = `zag:${evt}`;
const init = { bubbles, cancelable, composed, detail };
const event = new win.CustomEvent(eventName, init);
target.dispatchEvent(event);
};
},
createListener: (target) => {
return function listen(evt, handler) {
const eventName = `zag:${evt}`;
const listener = (e) => handler(e);
target.addEventListener(eventName, listener);
return () => target.removeEventListener(eventName, listener);
};
}
getById: (ctx, id) => dom.getRootNode(ctx).getElementById(id)
};

@@ -153,0 +135,0 @@ return {

{
"name": "@zag-js/dom-utils",
"version": "0.0.0-dev-20230102084517",
"version": "0.0.0-dev-20230105173950",
"description": "",

@@ -5,0 +5,0 @@ "keywords": [

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