Socket
Socket
Sign inDemoInstall

@floating-ui/dom

Package Overview
Dependencies
Maintainers
2
Versions
75
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@floating-ui/dom - npm Package Compare versions

Comparing version 1.0.11 to 1.0.12

36

dist/floating-ui.dom.esm.js

@@ -91,2 +91,6 @@ import { rectToClientRect, computePosition as computePosition$1 } from '@floating-ui/core';

const min = Math.min;
const max = Math.max;
const round = Math.round;
const FALLBACK_SCALE = {

@@ -104,22 +108,19 @@ x: 1,

const rect = domElement.getBoundingClientRect();
const css = getComputedStyle(domElement);
const toNumber = parseFloat;
let width = toNumber(css.width);
let height = toNumber(css.height);
const css = getComputedStyle(domElement); // Would need to take into account borders, padding, and potential scrollbars
// which would require a lot of code. Fallback to the old technique to
// determine scale.
if (css.boxSizing !== 'border-box') {
const pl = toNumber(css.paddingLeft);
const pr = toNumber(css.paddingRight);
const pt = toNumber(css.paddingTop);
const pb = toNumber(css.paddingBottom);
const bl = toNumber(css.borderLeftWidth);
const br = toNumber(css.borderRightWidth);
const bt = toNumber(css.borderTopWidth);
const bb = toNumber(css.borderBottomWidth);
width += pl + pr + bl + br;
height += pt + pb + bt + bb;
if (!isHTMLElement(domElement)) {
return FALLBACK_SCALE;
}
return {
x: domElement.offsetWidth > 0 ? round(rect.width) / domElement.offsetWidth || 1 : 1,
y: domElement.offsetHeight > 0 ? round(rect.height) / domElement.offsetHeight || 1 : 1
};
}
let x = rect.width / width;
let y = rect.height / height; // 0, NaN, or Infinity should always fallback to 1.
let x = rect.width / parseFloat(css.width);
let y = rect.height / parseFloat(css.height); // 0, NaN, or Infinity should always fallback to 1.

@@ -387,5 +388,2 @@ if (!x || !Number.isFinite(x)) {

const min = Math.min;
const max = Math.max;
// of the `<html>` and `<body>` rect bounds if horizontally scrollable

@@ -392,0 +390,0 @@

@@ -94,2 +94,6 @@ (function (global, factory) {

const min = Math.min;
const max = Math.max;
const round = Math.round;
const FALLBACK_SCALE = {

@@ -107,22 +111,19 @@ x: 1,

const rect = domElement.getBoundingClientRect();
const css = getComputedStyle(domElement);
const toNumber = parseFloat;
let width = toNumber(css.width);
let height = toNumber(css.height);
const css = getComputedStyle(domElement); // Would need to take into account borders, padding, and potential scrollbars
// which would require a lot of code. Fallback to the old technique to
// determine scale.
if (css.boxSizing !== 'border-box') {
const pl = toNumber(css.paddingLeft);
const pr = toNumber(css.paddingRight);
const pt = toNumber(css.paddingTop);
const pb = toNumber(css.paddingBottom);
const bl = toNumber(css.borderLeftWidth);
const br = toNumber(css.borderRightWidth);
const bt = toNumber(css.borderTopWidth);
const bb = toNumber(css.borderBottomWidth);
width += pl + pr + bl + br;
height += pt + pb + bt + bb;
if (!isHTMLElement(domElement)) {
return FALLBACK_SCALE;
}
return {
x: domElement.offsetWidth > 0 ? round(rect.width) / domElement.offsetWidth || 1 : 1,
y: domElement.offsetHeight > 0 ? round(rect.height) / domElement.offsetHeight || 1 : 1
};
}
let x = rect.width / width;
let y = rect.height / height; // 0, NaN, or Infinity should always fallback to 1.
let x = rect.width / parseFloat(css.width);
let y = rect.height / parseFloat(css.height); // 0, NaN, or Infinity should always fallback to 1.

@@ -390,5 +391,2 @@ if (!x || !Number.isFinite(x)) {

const min = Math.min;
const max = Math.max;
// of the `<html>` and `<body>` rect bounds if horizontally scrollable

@@ -395,0 +393,0 @@

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

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@floating-ui/core")):"function"==typeof define&&define.amd?define(["exports","@floating-ui/core"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).FloatingUIDOM={},t.FloatingUICore)}(this,(function(t,e){"use strict";function n(t){var e;return(null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function o(t){return n(t).getComputedStyle(t)}function i(t){return s(t)?(t.nodeName||"").toLowerCase():""}let r;function l(){if(r)return r;const t=navigator.userAgentData;return t&&Array.isArray(t.brands)?(r=t.brands.map((t=>t.brand+"/"+t.version)).join(" "),r):navigator.userAgent}function c(t){return t instanceof n(t).HTMLElement}function f(t){return t instanceof n(t).Element}function s(t){return t instanceof n(t).Node}function u(t){if("undefined"==typeof ShadowRoot)return!1;return t instanceof n(t).ShadowRoot||t instanceof ShadowRoot}function d(t){const{overflow:e,overflowX:n,overflowY:i,display:r}=o(t);return/auto|scroll|overlay|hidden/.test(e+i+n)&&!["inline","contents"].includes(r)}function a(t){return["table","td","th"].includes(i(t))}function h(t){const e=/firefox/i.test(l()),n=o(t),i=n.backdropFilter||n.WebkitBackdropFilter;return"none"!==n.transform||"none"!==n.perspective||!!i&&"none"!==i||e&&"filter"===n.willChange||e&&!!n.filter&&"none"!==n.filter||["transform","perspective"].some((t=>n.willChange.includes(t)))||["paint","layout","strict","content"].some((t=>{const e=n.contain;return null!=e&&e.includes(t)}))}function p(){return!/^((?!chrome|android).)*safari/i.test(l())}function g(t){return["html","body","#document"].includes(i(t))}const m={x:1,y:1};function y(t){const e=!f(t)&&t.contextElement?t.contextElement:f(t)?t:null;if(!e)return m;const n=e.getBoundingClientRect(),i=o(e),r=parseFloat;let l=r(i.width),c=r(i.height);if("border-box"!==i.boxSizing){const t=r(i.paddingLeft),e=r(i.paddingRight),n=r(i.paddingTop),o=r(i.paddingBottom);l+=t+e+r(i.borderLeftWidth)+r(i.borderRightWidth),c+=n+o+r(i.borderTopWidth)+r(i.borderBottomWidth)}let s=n.width/l,u=n.height/c;return s&&Number.isFinite(s)||(s=1),u&&Number.isFinite(u)||(u=1),{x:s,y:u}}function b(t,e,o,i){var r,l,c,s;void 0===e&&(e=!1),void 0===o&&(o=!1);const u=t.getBoundingClientRect();let d=m;e&&(i?f(i)&&(d=y(i)):d=y(t));const a=f(t)?n(t):window,h=!p()&&o,g=(u.left+(h&&null!=(r=null==(l=a.visualViewport)?void 0:l.offsetLeft)?r:0))/d.x,b=(u.top+(h&&null!=(c=null==(s=a.visualViewport)?void 0:s.offsetTop)?c:0))/d.y,w=u.width/d.x,x=u.height/d.y;return{width:w,height:x,top:b,right:g+w,bottom:b+x,left:g,x:g,y:b}}function w(t){return((s(t)?t.ownerDocument:t.document)||window.document).documentElement}function x(t){return f(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function v(t){return b(w(t)).left+x(t).scrollLeft}function L(t,e,n){const o=c(e),r=w(e),l=b(t,!0,"fixed"===n,e);let f={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if(o||!o&&"fixed"!==n)if(("body"!==i(e)||d(r))&&(f=x(e)),c(e)){const t=b(e,!0);s.x=t.x+e.clientLeft,s.y=t.y+e.clientTop}else r&&(s.x=v(r));return{x:l.left+f.scrollLeft-s.x,y:l.top+f.scrollTop-s.y,width:l.width,height:l.height}}function T(t){if("html"===i(t))return t;const e=t.assignedSlot||t.parentNode||(u(t)?t.host:null)||w(t);return u(e)?e.host:e}function O(t){return c(t)&&"fixed"!==o(t).position?t.offsetParent:null}function R(t){const e=n(t);let r=O(t);for(;r&&a(r)&&"static"===o(r).position;)r=O(r);return r&&("html"===i(r)||"body"===i(r)&&"static"===o(r).position&&!h(r))?e:r||function(t){let e=T(t);for(;c(e)&&!g(e);){if(h(e))return e;e=T(e)}return null}(t)||e}const P=Math.min,E=Math.max;function W(t){const e=T(t);return g(e)?t.ownerDocument.body:c(e)&&d(e)?e:W(e)}function j(t,e){var o;void 0===e&&(e=[]);const i=W(t),r=i===(null==(o=t.ownerDocument)?void 0:o.body),l=n(i);return r?e.concat(l,l.visualViewport||[],d(i)?i:[]):e.concat(i,j(i))}function C(t,i,r){return"viewport"===i?e.rectToClientRect(function(t,e){const o=n(t),i=w(t),r=o.visualViewport;let l=i.clientWidth,c=i.clientHeight,f=0,s=0;if(r){l=r.width,c=r.height;const t=p();(t||!t&&"fixed"===e)&&(f=r.offsetLeft,s=r.offsetTop)}return{width:l,height:c,x:f,y:s}}(t,r)):f(i)?function(t,e){const n=b(t,!0,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=c(t)?y(t):{x:1,y:1},l=t.clientWidth*r.x,f=t.clientHeight*r.y,s=i*r.x,u=o*r.y;return{top:u,left:s,right:s+l,bottom:u+f,x:s,y:u,width:l,height:f}}(i,r):e.rectToClientRect(function(t){var e;const n=w(t),i=x(t),r=null==(e=t.ownerDocument)?void 0:e.body,l=E(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),c=E(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0);let f=-i.scrollLeft+v(t);const s=-i.scrollTop;return"rtl"===o(r||n).direction&&(f+=E(n.clientWidth,r?r.clientWidth:0)-l),{width:l,height:c,x:f,y:s}}(w(t)))}const D={getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:r,strategy:l}=t;const c="clippingAncestors"===n?function(t,e){const n=e.get(t);if(n)return n;let r=j(t).filter((t=>f(t)&&"body"!==i(t))),l=null;const c="fixed"===o(t).position;let s=c?T(t):t;for(;f(s)&&!g(s);){const t=o(s),e=h(s);(c?e||l:e||"static"!==t.position||!l||!["absolute","fixed"].includes(l.position))?l=t:r=r.filter((t=>t!==s)),s=T(s)}return e.set(t,r),r}(e,this._c):[].concat(n),s=[...c,r],u=s[0],d=s.reduce(((t,n)=>{const o=C(e,n,l);return t.top=E(o.top,t.top),t.right=P(o.right,t.right),t.bottom=P(o.bottom,t.bottom),t.left=E(o.left,t.left),t}),C(e,u,l));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{rect:e,offsetParent:n,strategy:o}=t;const r=c(n),l=w(n);if(n===l)return e;let f={scrollLeft:0,scrollTop:0},s={x:1,y:1};const u={x:0,y:0};if((r||!r&&"fixed"!==o)&&(("body"!==i(n)||d(l))&&(f=x(n)),c(n))){const t=b(n);s=y(n),u.x=t.x+n.clientLeft,u.y=t.y+n.clientTop}return{width:e.width*s.x,height:e.height*s.y,x:e.x*s.x-f.scrollLeft*s.x+u.x,y:e.y*s.y-f.scrollTop*s.y+u.y}},isElement:f,getDimensions:function(t){if(c(t))return{width:t.offsetWidth,height:t.offsetHeight};const e=b(t);return{width:e.width,height:e.height}},getOffsetParent:R,getDocumentElement:w,getScale:y,async getElementRects(t){let{reference:e,floating:n,strategy:o}=t;const i=this.getOffsetParent||R,r=this.getDimensions;return{reference:L(e,await i(n),o),floating:{x:0,y:0,...await r(n)}}},getClientRects:t=>Array.from(t.getClientRects()),isRTL:t=>"rtl"===o(t).direction};Object.defineProperty(t,"arrow",{enumerable:!0,get:function(){return e.arrow}}),Object.defineProperty(t,"autoPlacement",{enumerable:!0,get:function(){return e.autoPlacement}}),Object.defineProperty(t,"detectOverflow",{enumerable:!0,get:function(){return e.detectOverflow}}),Object.defineProperty(t,"flip",{enumerable:!0,get:function(){return e.flip}}),Object.defineProperty(t,"hide",{enumerable:!0,get:function(){return e.hide}}),Object.defineProperty(t,"inline",{enumerable:!0,get:function(){return e.inline}}),Object.defineProperty(t,"limitShift",{enumerable:!0,get:function(){return e.limitShift}}),Object.defineProperty(t,"offset",{enumerable:!0,get:function(){return e.offset}}),Object.defineProperty(t,"shift",{enumerable:!0,get:function(){return e.shift}}),Object.defineProperty(t,"size",{enumerable:!0,get:function(){return e.size}}),t.autoUpdate=function(t,e,n,o){void 0===o&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:l=!0,animationFrame:c=!1}=o,s=i&&!c,u=s||r?[...f(t)?j(t):t.contextElement?j(t.contextElement):[],...j(e)]:[];u.forEach((t=>{s&&t.addEventListener("scroll",n,{passive:!0}),r&&t.addEventListener("resize",n)}));let d,a=null;if(l){let o=!0;a=new ResizeObserver((()=>{o||n(),o=!1})),f(t)&&!c&&a.observe(t),f(t)||!t.contextElement||c||a.observe(t.contextElement),a.observe(e)}let h=c?b(t):null;return c&&function e(){const o=b(t);!h||o.x===h.x&&o.y===h.y&&o.width===h.width&&o.height===h.height||n();h=o,d=requestAnimationFrame(e)}(),n(),()=>{var t;u.forEach((t=>{s&&t.removeEventListener("scroll",n),r&&t.removeEventListener("resize",n)})),null==(t=a)||t.disconnect(),a=null,c&&cancelAnimationFrame(d)}},t.computePosition=(t,n,o)=>{const i=new Map,r={platform:D,...o},l={...r.platform,_c:i};return e.computePosition(t,n,{...r,platform:l})},t.getOverflowAncestors=j,t.platform=D,Object.defineProperty(t,"__esModule",{value:!0})}));
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@floating-ui/core")):"function"==typeof define&&define.amd?define(["exports","@floating-ui/core"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).FloatingUIDOM={},t.FloatingUICore)}(this,(function(t,e){"use strict";function n(t){var e;return(null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function o(t){return n(t).getComputedStyle(t)}function i(t){return s(t)?(t.nodeName||"").toLowerCase():""}let r;function l(){if(r)return r;const t=navigator.userAgentData;return t&&Array.isArray(t.brands)?(r=t.brands.map((t=>t.brand+"/"+t.version)).join(" "),r):navigator.userAgent}function c(t){return t instanceof n(t).HTMLElement}function f(t){return t instanceof n(t).Element}function s(t){return t instanceof n(t).Node}function u(t){if("undefined"==typeof ShadowRoot)return!1;return t instanceof n(t).ShadowRoot||t instanceof ShadowRoot}function a(t){const{overflow:e,overflowX:n,overflowY:i,display:r}=o(t);return/auto|scroll|overlay|hidden/.test(e+i+n)&&!["inline","contents"].includes(r)}function d(t){return["table","td","th"].includes(i(t))}function h(t){const e=/firefox/i.test(l()),n=o(t),i=n.backdropFilter||n.WebkitBackdropFilter;return"none"!==n.transform||"none"!==n.perspective||!!i&&"none"!==i||e&&"filter"===n.willChange||e&&!!n.filter&&"none"!==n.filter||["transform","perspective"].some((t=>n.willChange.includes(t)))||["paint","layout","strict","content"].some((t=>{const e=n.contain;return null!=e&&e.includes(t)}))}function g(){return!/^((?!chrome|android).)*safari/i.test(l())}function p(t){return["html","body","#document"].includes(i(t))}const m=Math.min,y=Math.max,b=Math.round,w={x:1,y:1};function x(t){const e=!f(t)&&t.contextElement?t.contextElement:f(t)?t:null;if(!e)return w;const n=e.getBoundingClientRect(),i=o(e);if("border-box"!==i.boxSizing)return c(e)?{x:e.offsetWidth>0&&b(n.width)/e.offsetWidth||1,y:e.offsetHeight>0&&b(n.height)/e.offsetHeight||1}:w;let r=n.width/parseFloat(i.width),l=n.height/parseFloat(i.height);return r&&Number.isFinite(r)||(r=1),l&&Number.isFinite(l)||(l=1),{x:r,y:l}}function v(t,e,o,i){var r,l,c,s;void 0===e&&(e=!1),void 0===o&&(o=!1);const u=t.getBoundingClientRect();let a=w;e&&(i?f(i)&&(a=x(i)):a=x(t));const d=f(t)?n(t):window,h=!g()&&o,p=(u.left+(h&&null!=(r=null==(l=d.visualViewport)?void 0:l.offsetLeft)?r:0))/a.x,m=(u.top+(h&&null!=(c=null==(s=d.visualViewport)?void 0:s.offsetTop)?c:0))/a.y,y=u.width/a.x,b=u.height/a.y;return{width:y,height:b,top:m,right:p+y,bottom:m+b,left:p,x:p,y:m}}function L(t){return((s(t)?t.ownerDocument:t.document)||window.document).documentElement}function O(t){return f(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function P(t){return v(L(t)).left+O(t).scrollLeft}function T(t,e,n){const o=c(e),r=L(e),l=v(t,!0,"fixed"===n,e);let f={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if(o||!o&&"fixed"!==n)if(("body"!==i(e)||a(r))&&(f=O(e)),c(e)){const t=v(e,!0);s.x=t.x+e.clientLeft,s.y=t.y+e.clientTop}else r&&(s.x=P(r));return{x:l.left+f.scrollLeft-s.x,y:l.top+f.scrollTop-s.y,width:l.width,height:l.height}}function R(t){if("html"===i(t))return t;const e=t.assignedSlot||t.parentNode||(u(t)?t.host:null)||L(t);return u(e)?e.host:e}function E(t){return c(t)&&"fixed"!==o(t).position?t.offsetParent:null}function j(t){const e=n(t);let r=E(t);for(;r&&d(r)&&"static"===o(r).position;)r=E(r);return r&&("html"===i(r)||"body"===i(r)&&"static"===o(r).position&&!h(r))?e:r||function(t){let e=R(t);for(;c(e)&&!p(e);){if(h(e))return e;e=R(e)}return null}(t)||e}function C(t){const e=R(t);return p(e)?t.ownerDocument.body:c(e)&&a(e)?e:C(e)}function W(t,e){var o;void 0===e&&(e=[]);const i=C(t),r=i===(null==(o=t.ownerDocument)?void 0:o.body),l=n(i);return r?e.concat(l,l.visualViewport||[],a(i)?i:[]):e.concat(i,W(i))}function F(t,i,r){return"viewport"===i?e.rectToClientRect(function(t,e){const o=n(t),i=L(t),r=o.visualViewport;let l=i.clientWidth,c=i.clientHeight,f=0,s=0;if(r){l=r.width,c=r.height;const t=g();(t||!t&&"fixed"===e)&&(f=r.offsetLeft,s=r.offsetTop)}return{width:l,height:c,x:f,y:s}}(t,r)):f(i)?function(t,e){const n=v(t,!0,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=c(t)?x(t):{x:1,y:1},l=t.clientWidth*r.x,f=t.clientHeight*r.y,s=i*r.x,u=o*r.y;return{top:u,left:s,right:s+l,bottom:u+f,x:s,y:u,width:l,height:f}}(i,r):e.rectToClientRect(function(t){var e;const n=L(t),i=O(t),r=null==(e=t.ownerDocument)?void 0:e.body,l=y(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),c=y(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0);let f=-i.scrollLeft+P(t);const s=-i.scrollTop;return"rtl"===o(r||n).direction&&(f+=y(n.clientWidth,r?r.clientWidth:0)-l),{width:l,height:c,x:f,y:s}}(L(t)))}const D={getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:r,strategy:l}=t;const c="clippingAncestors"===n?function(t,e){const n=e.get(t);if(n)return n;let r=W(t).filter((t=>f(t)&&"body"!==i(t))),l=null;const c="fixed"===o(t).position;let s=c?R(t):t;for(;f(s)&&!p(s);){const t=o(s),e=h(s);(c?e||l:e||"static"!==t.position||!l||!["absolute","fixed"].includes(l.position))?l=t:r=r.filter((t=>t!==s)),s=R(s)}return e.set(t,r),r}(e,this._c):[].concat(n),s=[...c,r],u=s[0],a=s.reduce(((t,n)=>{const o=F(e,n,l);return t.top=y(o.top,t.top),t.right=m(o.right,t.right),t.bottom=m(o.bottom,t.bottom),t.left=y(o.left,t.left),t}),F(e,u,l));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{rect:e,offsetParent:n,strategy:o}=t;const r=c(n),l=L(n);if(n===l)return e;let f={scrollLeft:0,scrollTop:0},s={x:1,y:1};const u={x:0,y:0};if((r||!r&&"fixed"!==o)&&(("body"!==i(n)||a(l))&&(f=O(n)),c(n))){const t=v(n);s=x(n),u.x=t.x+n.clientLeft,u.y=t.y+n.clientTop}return{width:e.width*s.x,height:e.height*s.y,x:e.x*s.x-f.scrollLeft*s.x+u.x,y:e.y*s.y-f.scrollTop*s.y+u.y}},isElement:f,getDimensions:function(t){if(c(t))return{width:t.offsetWidth,height:t.offsetHeight};const e=v(t);return{width:e.width,height:e.height}},getOffsetParent:j,getDocumentElement:L,getScale:x,async getElementRects(t){let{reference:e,floating:n,strategy:o}=t;const i=this.getOffsetParent||j,r=this.getDimensions;return{reference:T(e,await i(n),o),floating:{x:0,y:0,...await r(n)}}},getClientRects:t=>Array.from(t.getClientRects()),isRTL:t=>"rtl"===o(t).direction};Object.defineProperty(t,"arrow",{enumerable:!0,get:function(){return e.arrow}}),Object.defineProperty(t,"autoPlacement",{enumerable:!0,get:function(){return e.autoPlacement}}),Object.defineProperty(t,"detectOverflow",{enumerable:!0,get:function(){return e.detectOverflow}}),Object.defineProperty(t,"flip",{enumerable:!0,get:function(){return e.flip}}),Object.defineProperty(t,"hide",{enumerable:!0,get:function(){return e.hide}}),Object.defineProperty(t,"inline",{enumerable:!0,get:function(){return e.inline}}),Object.defineProperty(t,"limitShift",{enumerable:!0,get:function(){return e.limitShift}}),Object.defineProperty(t,"offset",{enumerable:!0,get:function(){return e.offset}}),Object.defineProperty(t,"shift",{enumerable:!0,get:function(){return e.shift}}),Object.defineProperty(t,"size",{enumerable:!0,get:function(){return e.size}}),t.autoUpdate=function(t,e,n,o){void 0===o&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:l=!0,animationFrame:c=!1}=o,s=i&&!c,u=s||r?[...f(t)?W(t):t.contextElement?W(t.contextElement):[],...W(e)]:[];u.forEach((t=>{s&&t.addEventListener("scroll",n,{passive:!0}),r&&t.addEventListener("resize",n)}));let a,d=null;if(l){let o=!0;d=new ResizeObserver((()=>{o||n(),o=!1})),f(t)&&!c&&d.observe(t),f(t)||!t.contextElement||c||d.observe(t.contextElement),d.observe(e)}let h=c?v(t):null;return c&&function e(){const o=v(t);!h||o.x===h.x&&o.y===h.y&&o.width===h.width&&o.height===h.height||n();h=o,a=requestAnimationFrame(e)}(),n(),()=>{var t;u.forEach((t=>{s&&t.removeEventListener("scroll",n),r&&t.removeEventListener("resize",n)})),null==(t=d)||t.disconnect(),d=null,c&&cancelAnimationFrame(a)}},t.computePosition=(t,n,o)=>{const i=new Map,r={platform:D,...o},l={...r.platform,_c:i};return e.computePosition(t,n,{...r,platform:l})},t.getOverflowAncestors=W,t.platform=D,Object.defineProperty(t,"__esModule",{value:!0})}));
{
"name": "@floating-ui/dom",
"version": "1.0.11",
"version": "1.0.12",
"@rollingversions": {

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

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