New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@zag-js/element-rect

Package Overview
Dependencies
Maintainers
1
Versions
720
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zag-js/element-rect - npm Package Compare versions

Comparing version 0.0.0-dev-20230706120929 to 0.0.0-dev-20230710092359

dist/index.d.mts

7

dist/index.d.ts

@@ -8,3 +8,3 @@ type Rect = {

type TrackScope = "size" | "position" | "rect";
export type ElementRectOptions = {
type ElementRectOptions = {
onChange: (rect: Rect) => void;

@@ -14,3 +14,4 @@ scope?: TrackScope;

};
export declare function trackElementRect(el: HTMLElement, options: ElementRectOptions): () => void;
export {};
declare function trackElementRect(el: HTMLElement, options: ElementRectOptions): () => void;
export { ElementRectOptions, trackElementRect };

@@ -1,8 +0,29 @@

'use strict';
"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);
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
let rafId;
const observedElements = /* @__PURE__ */ new Map();
const getRectFn = (el) => el.getBoundingClientRect();
// src/index.ts
var src_exports = {};
__export(src_exports, {
trackElementRect: () => trackElementRect
});
module.exports = __toCommonJS(src_exports);
var rafId;
var observedElements = /* @__PURE__ */ new Map();
var getRectFn = (el) => el.getBoundingClientRect();
function trackElementRect(el, options) {

@@ -58,5 +79,5 @@ const { scope = "rect", getRect = getRectFn, onChange } = options;

}
const isEqualSize = (a, b) => a.width === b.width && a.height === b.height;
const isEqualPosition = (a, b) => a.top === b.top && a.left === b.left;
const isEqualRect = (a, b) => isEqualSize(a, b) && isEqualPosition(a, b);
var isEqualSize = (a, b) => a.width === b.width && a.height === b.height;
var isEqualPosition = (a, b) => a.top === b.top && a.left === b.left;
var isEqualRect = (a, b) => isEqualSize(a, b) && isEqualPosition(a, b);
function getEqualityFn(scope) {

@@ -69,3 +90,6 @@ if (scope === "size")

}
exports.trackElementRect = trackElementRect;
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
trackElementRect
});
//# sourceMappingURL=index.js.map
{
"name": "@zag-js/element-rect",
"version": "0.0.0-dev-20230706120929",
"version": "0.0.0-dev-20230710092359",
"description": "observe element's rect over time",

@@ -41,3 +41,3 @@ "keywords": [

"scripts": {
"build": "vite build -c ../../../vite.config.ts",
"build": "tsup",
"lint": "eslint src --ext .ts,.tsx",

@@ -44,0 +44,0 @@ "typecheck": "tsc --noEmit"

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