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.7 to 1.0.8

41

dist/floating-ui.dom.esm.js
import { rectToClientRect, computePosition as computePosition$1 } from '@floating-ui/core';
export { arrow, autoPlacement, detectOverflow, flip, hide, inline, limitShift, offset, shift, size } from '@floating-ui/core';
function isWindow(value) {
return value && value.document && value.location && value.alert && value.setInterval;
}
function getWindow(node) {
if (node == null) {
return window;
}
var _node$ownerDocument;
if (!isWindow(node)) {
const ownerDocument = node.ownerDocument;
return ownerDocument ? ownerDocument.defaultView || window : window;
}
return node;
return ((_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
}

@@ -25,3 +15,3 @@

function getNodeName(node) {
return isWindow(node) ? '' : node ? (node.nodeName || '').toLowerCase() : '';
return isNode(node) ? (node.nodeName || '').toLowerCase() : '';
}

@@ -112,10 +102,17 @@

const clientRect = element.getBoundingClientRect();
let contextRect = clientRect;
let elementToCheckForScale = element;
let scaleX = 1;
let scaleY = 1;
if (includeScale && isHTMLElement(element)) {
scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;
scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;
if (!isElement(element) && element.contextElement) {
contextRect = element.contextElement.getBoundingClientRect();
elementToCheckForScale = element.contextElement;
}
if (includeScale && isHTMLElement(elementToCheckForScale)) {
scaleX = elementToCheckForScale.offsetWidth > 0 ? round(contextRect.width) / elementToCheckForScale.offsetWidth || 1 : 1;
scaleY = elementToCheckForScale.offsetHeight > 0 ? round(contextRect.height) / elementToCheckForScale.offsetHeight || 1 : 1;
}
const win = isElement(element) ? getWindow(element) : window;

@@ -299,3 +296,3 @@ const addVisualOffsets = !isLayoutViewport() && isFixedStrategy;

if (isHTMLElement(offsetParent)) {
const offsetRect = getBoundingClientRect(offsetParent, true);
const offsetRect = getBoundingClientRect(offsetParent);
offsets.x = offsetRect.x + offsetParent.clientLeft;

@@ -394,6 +391,8 @@ offsets.y = offsetRect.y + offsetParent.clientTop;

const win = getWindow(scrollableAncestor);
const target = isBody ? [win].concat(win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : []) : scrollableAncestor;
const updatedList = list.concat(target);
return isBody ? updatedList : // @ts-ignore: isBody tells us target will be an HTMLElement here
updatedList.concat(getOverflowAncestors(target));
if (isBody) {
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : []);
}
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor));
}

@@ -400,0 +399,0 @@

@@ -7,16 +7,6 @@ (function (global, factory) {

function isWindow(value) {
return value && value.document && value.location && value.alert && value.setInterval;
}
function getWindow(node) {
if (node == null) {
return window;
}
var _node$ownerDocument;
if (!isWindow(node)) {
const ownerDocument = node.ownerDocument;
return ownerDocument ? ownerDocument.defaultView || window : window;
}
return node;
return ((_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
}

@@ -29,3 +19,3 @@

function getNodeName(node) {
return isWindow(node) ? '' : node ? (node.nodeName || '').toLowerCase() : '';
return isNode(node) ? (node.nodeName || '').toLowerCase() : '';
}

@@ -116,10 +106,17 @@

const clientRect = element.getBoundingClientRect();
let contextRect = clientRect;
let elementToCheckForScale = element;
let scaleX = 1;
let scaleY = 1;
if (includeScale && isHTMLElement(element)) {
scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;
scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;
if (!isElement(element) && element.contextElement) {
contextRect = element.contextElement.getBoundingClientRect();
elementToCheckForScale = element.contextElement;
}
if (includeScale && isHTMLElement(elementToCheckForScale)) {
scaleX = elementToCheckForScale.offsetWidth > 0 ? round(contextRect.width) / elementToCheckForScale.offsetWidth || 1 : 1;
scaleY = elementToCheckForScale.offsetHeight > 0 ? round(contextRect.height) / elementToCheckForScale.offsetHeight || 1 : 1;
}
const win = isElement(element) ? getWindow(element) : window;

@@ -303,3 +300,3 @@ const addVisualOffsets = !isLayoutViewport() && isFixedStrategy;

if (isHTMLElement(offsetParent)) {
const offsetRect = getBoundingClientRect(offsetParent, true);
const offsetRect = getBoundingClientRect(offsetParent);
offsets.x = offsetRect.x + offsetParent.clientLeft;

@@ -398,6 +395,8 @@ offsets.y = offsetRect.y + offsetParent.clientTop;

const win = getWindow(scrollableAncestor);
const target = isBody ? [win].concat(win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : []) : scrollableAncestor;
const updatedList = list.concat(target);
return isBody ? updatedList : // @ts-ignore: isBody tells us target will be an HTMLElement here
updatedList.concat(getOverflowAncestors(target));
if (isBody) {
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : []);
}
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor));
}

@@ -404,0 +403,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){return t&&t.document&&t.location&&t.alert&&t.setInterval}function o(t){if(null==t)return window;if(!n(t)){const e=t.ownerDocument;return e&&e.defaultView||window}return t}function i(t){return o(t).getComputedStyle(t)}function r(t){return n(t)?"":t?(t.nodeName||"").toLowerCase():""}function l(){const t=navigator.userAgentData;return t&&Array.isArray(t.brands)?t.brands.map((t=>t.brand+"/"+t.version)).join(" "):navigator.userAgent}function c(t){return t instanceof o(t).HTMLElement}function f(t){return t instanceof o(t).Element}function s(t){if("undefined"==typeof ShadowRoot)return!1;return t instanceof o(t).ShadowRoot||t instanceof ShadowRoot}function u(t){const{overflow:e,overflowX:n,overflowY:o,display:r}=i(t);return/auto|scroll|overlay|hidden/.test(e+o+n)&&!["inline","contents"].includes(r)}function a(t){return["table","td","th"].includes(r(t))}function d(t){const e=/firefox/i.test(l()),n=i(t),o=n.backdropFilter||n.WebkitBackdropFilter;return"none"!==n.transform||"none"!==n.perspective||!!o&&"none"!==o||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 h(){return!/^((?!chrome|android).)*safari/i.test(l())}function p(t){return["html","body","#document"].includes(r(t))}const g=Math.min,m=Math.max,y=Math.round;function w(t,e,n){var i,r,l,s;void 0===e&&(e=!1),void 0===n&&(n=!1);const u=t.getBoundingClientRect();let a=1,d=1;e&&c(t)&&(a=t.offsetWidth>0&&y(u.width)/t.offsetWidth||1,d=t.offsetHeight>0&&y(u.height)/t.offsetHeight||1);const p=f(t)?o(t):window,g=!h()&&n,m=(u.left+(g&&null!=(i=null==(r=p.visualViewport)?void 0:r.offsetLeft)?i:0))/a,w=(u.top+(g&&null!=(l=null==(s=p.visualViewport)?void 0:s.offsetTop)?l:0))/d,b=u.width/a,v=u.height/d;return{width:b,height:v,top:w,right:m+b,bottom:w+v,left:m,x:m,y:w}}function b(t){return(e=t,(e instanceof o(e).Node?t.ownerDocument:t.document)||window.document).documentElement;var e}function v(t){return f(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function x(t){return w(b(t)).left+v(t).scrollLeft}function L(t,e,n){const o=c(e),i=b(e),l=w(t,o&&function(t){const e=w(t);return y(e.width)!==t.offsetWidth||y(e.height)!==t.offsetHeight}(e),"fixed"===n);let f={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if(o||!o&&"fixed"!==n)if(("body"!==r(e)||u(i))&&(f=v(e)),c(e)){const t=w(e,!0);s.x=t.x+e.clientLeft,s.y=t.y+e.clientTop}else i&&(s.x=x(i));return{x:l.left+f.scrollLeft-s.x,y:l.top+f.scrollTop-s.y,width:l.width,height:l.height}}function O(t){if("html"===r(t))return t;const e=t.assignedSlot||t.parentNode||(s(t)?t.host:null)||b(t);return s(e)?e.host:e}function P(t){return c(t)&&"fixed"!==i(t).position?t.offsetParent:null}function T(t){const e=o(t);let n=P(t);for(;n&&a(n)&&"static"===i(n).position;)n=P(n);return n&&("html"===r(n)||"body"===r(n)&&"static"===i(n).position&&!d(n))?e:n||function(t){let e=O(t);for(;c(e)&&!p(e);){if(d(e))return e;e=O(e)}return null}(t)||e}function R(t){const e=O(t);return p(e)?t.ownerDocument.body:c(e)&&u(e)?e:R(e)}function E(t,e){var n;void 0===e&&(e=[]);const i=R(t),r=i===(null==(n=t.ownerDocument)?void 0:n.body),l=o(i),c=r?[l].concat(l.visualViewport||[],u(i)?i:[]):i,f=e.concat(c);return r?f:f.concat(E(c))}function W(t,n,r){return"viewport"===n?e.rectToClientRect(function(t,e){const n=o(t),i=b(t),r=n.visualViewport;let l=i.clientWidth,c=i.clientHeight,f=0,s=0;if(r){l=r.width,c=r.height;const t=h();(t||!t&&"fixed"===e)&&(f=r.offsetLeft,s=r.offsetTop)}return{width:l,height:c,x:f,y:s}}(t,r)):f(n)?function(t,e){const n=w(t,!1,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft;return{top:o,left:i,x:i,y:o,right:i+t.clientWidth,bottom:o+t.clientHeight,width:t.clientWidth,height:t.clientHeight}}(n,r):e.rectToClientRect(function(t){var e;const n=b(t),o=v(t),r=null==(e=t.ownerDocument)?void 0:e.body,l=m(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),c=m(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0);let f=-o.scrollLeft+x(t);const s=-o.scrollTop;return"rtl"===i(r||n).direction&&(f+=m(n.clientWidth,r?r.clientWidth:0)-l),{width:l,height:c,x:f,y:s}}(b(t)))}const j={getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:o,strategy:l}=t;const c="clippingAncestors"===n?function(t){let e=E(t).filter((t=>f(t)&&"body"!==r(t))),n=null;const o="fixed"===i(t).position;let l=o?O(t):t;for(;f(l)&&!p(l);){const t=i(l),r=d(l);(o?r||n:r||"static"!==t.position||!n||!["absolute","fixed"].includes(n.position))?n=t:e=e.filter((t=>t!==l)),l=O(l)}return e}(e):[].concat(n),s=[...c,o],u=s[0],a=s.reduce(((t,n)=>{const o=W(e,n,l);return t.top=m(o.top,t.top),t.right=g(o.right,t.right),t.bottom=g(o.bottom,t.bottom),t.left=m(o.left,t.left),t}),W(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 i=c(n),l=b(n);if(n===l)return e;let f={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if((i||!i&&"fixed"!==o)&&(("body"!==r(n)||u(l))&&(f=v(n)),c(n))){const t=w(n,!0);s.x=t.x+n.clientLeft,s.y=t.y+n.clientTop}return{...e,x:e.x-f.scrollLeft+s.x,y:e.y-f.scrollTop+s.y}},isElement:f,getDimensions:function(t){if(c(t))return{width:t.offsetWidth,height:t.offsetHeight};const e=w(t);return{width:e.width,height:e.height}},getOffsetParent:T,getDocumentElement:b,async getElementRects(t){let{reference:e,floating:n,strategy:o}=t;const i=this.getOffsetParent||T,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"===i(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)?E(t):t.contextElement?E(t.contextElement):[],...E(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?w(t):null;return c&&function e(){const o=w(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)=>e.computePosition(t,n,{platform:j,...o}),t.getOverflowAncestors=E,t.platform=j,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 f(t)?(t.nodeName||"").toLowerCase():""}function r(){const t=navigator.userAgentData;return t&&Array.isArray(t.brands)?t.brands.map((t=>t.brand+"/"+t.version)).join(" "):navigator.userAgent}function l(t){return t instanceof n(t).HTMLElement}function c(t){return t instanceof n(t).Element}function f(t){return t instanceof n(t).Node}function s(t){if("undefined"==typeof ShadowRoot)return!1;return t instanceof n(t).ShadowRoot||t instanceof ShadowRoot}function u(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 a(t){const e=/firefox/i.test(r()),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 h(){return!/^((?!chrome|android).)*safari/i.test(r())}function g(t){return["html","body","#document"].includes(i(t))}const p=Math.min,m=Math.max,y=Math.round;function w(t,e,o){var i,r,f,s;void 0===e&&(e=!1),void 0===o&&(o=!1);const u=t.getBoundingClientRect();let d=u,a=t,g=1,p=1;!c(t)&&t.contextElement&&(d=t.contextElement.getBoundingClientRect(),a=t.contextElement),e&&l(a)&&(g=a.offsetWidth>0&&y(d.width)/a.offsetWidth||1,p=a.offsetHeight>0&&y(d.height)/a.offsetHeight||1);const m=c(t)?n(t):window,w=!h()&&o,b=(u.left+(w&&null!=(i=null==(r=m.visualViewport)?void 0:r.offsetLeft)?i:0))/g,v=(u.top+(w&&null!=(f=null==(s=m.visualViewport)?void 0:s.offsetTop)?f:0))/p,x=u.width/g,L=u.height/p;return{width:x,height:L,top:v,right:b+x,bottom:v+L,left:b,x:b,y:v}}function b(t){return((f(t)?t.ownerDocument:t.document)||window.document).documentElement}function v(t){return c(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function x(t){return w(b(t)).left+v(t).scrollLeft}function L(t,e,n){const o=l(e),r=b(e),c=w(t,o&&function(t){const e=w(t);return y(e.width)!==t.offsetWidth||y(e.height)!==t.offsetHeight}(e),"fixed"===n);let f={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if(o||!o&&"fixed"!==n)if(("body"!==i(e)||u(r))&&(f=v(e)),l(e)){const t=w(e,!0);s.x=t.x+e.clientLeft,s.y=t.y+e.clientTop}else r&&(s.x=x(r));return{x:c.left+f.scrollLeft-s.x,y:c.top+f.scrollTop-s.y,width:c.width,height:c.height}}function O(t){if("html"===i(t))return t;const e=t.assignedSlot||t.parentNode||(s(t)?t.host:null)||b(t);return s(e)?e.host:e}function P(t){return l(t)&&"fixed"!==o(t).position?t.offsetParent:null}function T(t){const e=n(t);let r=P(t);for(;r&&d(r)&&"static"===o(r).position;)r=P(r);return r&&("html"===i(r)||"body"===i(r)&&"static"===o(r).position&&!a(r))?e:r||function(t){let e=O(t);for(;l(e)&&!g(e);){if(a(e))return e;e=O(e)}return null}(t)||e}function E(t){const e=O(t);return g(e)?t.ownerDocument.body:l(e)&&u(e)?e:E(e)}function R(t,e){var o;void 0===e&&(e=[]);const i=E(t),r=i===(null==(o=t.ownerDocument)?void 0:o.body),l=n(i);return r?e.concat(l,l.visualViewport||[],u(i)?i:[]):e.concat(i,R(i))}function W(t,i,r){return"viewport"===i?e.rectToClientRect(function(t,e){const o=n(t),i=b(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=h();(t||!t&&"fixed"===e)&&(f=r.offsetLeft,s=r.offsetTop)}return{width:l,height:c,x:f,y:s}}(t,r)):c(i)?function(t,e){const n=w(t,!1,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft;return{top:o,left:i,x:i,y:o,right:i+t.clientWidth,bottom:o+t.clientHeight,width:t.clientWidth,height:t.clientHeight}}(i,r):e.rectToClientRect(function(t){var e;const n=b(t),i=v(t),r=null==(e=t.ownerDocument)?void 0:e.body,l=m(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),c=m(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0);let f=-i.scrollLeft+x(t);const s=-i.scrollTop;return"rtl"===o(r||n).direction&&(f+=m(n.clientWidth,r?r.clientWidth:0)-l),{width:l,height:c,x:f,y:s}}(b(t)))}const j={getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:r,strategy:l}=t;const f="clippingAncestors"===n?function(t){let e=R(t).filter((t=>c(t)&&"body"!==i(t))),n=null;const r="fixed"===o(t).position;let l=r?O(t):t;for(;c(l)&&!g(l);){const t=o(l),i=a(l);(r?i||n:i||"static"!==t.position||!n||!["absolute","fixed"].includes(n.position))?n=t:e=e.filter((t=>t!==l)),l=O(l)}return e}(e):[].concat(n),s=[...f,r],u=s[0],d=s.reduce(((t,n)=>{const o=W(e,n,l);return t.top=m(o.top,t.top),t.right=p(o.right,t.right),t.bottom=p(o.bottom,t.bottom),t.left=m(o.left,t.left),t}),W(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=l(n),c=b(n);if(n===c)return e;let f={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if((r||!r&&"fixed"!==o)&&(("body"!==i(n)||u(c))&&(f=v(n)),l(n))){const t=w(n);s.x=t.x+n.clientLeft,s.y=t.y+n.clientTop}return{...e,x:e.x-f.scrollLeft+s.x,y:e.y-f.scrollTop+s.y}},isElement:c,getDimensions:function(t){if(l(t))return{width:t.offsetWidth,height:t.offsetHeight};const e=w(t);return{width:e.width,height:e.height}},getOffsetParent:T,getDocumentElement:b,async getElementRects(t){let{reference:e,floating:n,strategy:o}=t;const i=this.getOffsetParent||T,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:f=!1}=o,s=i&&!f,u=s||r?[...c(t)?R(t):t.contextElement?R(t.contextElement):[],...R(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})),c(t)&&!f&&a.observe(t),c(t)||!t.contextElement||f||a.observe(t.contextElement),a.observe(e)}let h=f?w(t):null;return f&&function e(){const o=w(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,f&&cancelAnimationFrame(d)}},t.computePosition=(t,n,o)=>e.computePosition(t,n,{platform:j,...o}),t.getOverflowAncestors=R,t.platform=j,Object.defineProperty(t,"__esModule",{value:!0})}));
{
"name": "@floating-ui/dom",
"version": "1.0.7",
"version": "1.0.8",
"@rollingversions": {

@@ -64,3 +64,3 @@ "baseVersion": [

"dependencies": {
"@floating-ui/core": "^1.0.2"
"@floating-ui/core": "^1.0.3"
},

@@ -67,0 +67,0 @@ "devDependencies": {

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

export declare function getOverflowAncestors(node: Node, list?: Array<Element | Window>): Array<Element | Window | VisualViewport>;
declare type OverflowAncestors = Array<Element | Window | VisualViewport>;
export declare function getOverflowAncestors(node: Node, list?: OverflowAncestors): OverflowAncestors;
export {};

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

export declare function isWindow(value: any): value is Window;
export declare function getWindow(node: Node | Window): Window;
export declare function getWindow(node: Node): Window;

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