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

@floating-ui/utils

Package Overview
Dependencies
Maintainers
2
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@floating-ui/utils - npm Package Compare versions

Comparing version 0.2.5 to 0.2.6

2

dist/floating-ui.utils.dom.d.ts

@@ -8,2 +8,4 @@ declare function getComputedStyle_2(element: Element): CSSStyleDeclaration;

export declare function getFrameElement(win: Window): Element | null;
export declare function getNearestOverflowAncestor(node: Node): HTMLElement;

@@ -10,0 +12,0 @@

8

dist/floating-ui.utils.dom.esm.js

@@ -133,7 +133,11 @@ function getNodeName(node) {

if (isBody) {
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], win.frameElement && traverseIframes ? getOverflowAncestors(win.frameElement) : []);
const frameElement = getFrameElement(win);
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
}
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
}
function getFrameElement(win) {
return Object.getPrototypeOf(win.parent) ? win.frameElement : null;
}
export { getComputedStyle, getContainingBlock, getDocumentElement, getNearestOverflowAncestor, getNodeName, getNodeScroll, getOverflowAncestors, getParentNode, getWindow, isContainingBlock, isElement, isHTMLElement, isLastTraversableNode, isNode, isOverflowElement, isShadowRoot, isTableElement, isTopLayer, isWebKit };
export { getComputedStyle, getContainingBlock, getDocumentElement, getFrameElement, getNearestOverflowAncestor, getNodeName, getNodeScroll, getOverflowAncestors, getParentNode, getWindow, isContainingBlock, isElement, isHTMLElement, isLastTraversableNode, isNode, isOverflowElement, isShadowRoot, isTableElement, isTopLayer, isWebKit };

@@ -139,6 +139,10 @@ (function (global, factory) {

if (isBody) {
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], win.frameElement && traverseIframes ? getOverflowAncestors(win.frameElement) : []);
const frameElement = getFrameElement(win);
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
}
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
}
function getFrameElement(win) {
return Object.getPrototypeOf(win.parent) ? win.frameElement : null;
}

@@ -148,2 +152,3 @@ exports.getComputedStyle = getComputedStyle;

exports.getDocumentElement = getDocumentElement;
exports.getFrameElement = getFrameElement;
exports.getNearestOverflowAncestor = getNearestOverflowAncestor;

@@ -150,0 +155,0 @@ exports.getNodeName = getNodeName;

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

!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).FloatingUIUtilsDOM={})}(this,(function(e){"use strict";function n(e){return r(e)?(e.nodeName||"").toLowerCase():"#document"}function t(e){var n;return(null==e||null==(n=e.ownerDocument)?void 0:n.defaultView)||window}function o(e){var n;return null==(n=(r(e)?e.ownerDocument:e.document)||window.document)?void 0:n.documentElement}function r(e){return e instanceof Node||e instanceof t(e).Node}function i(e){return e instanceof Element||e instanceof t(e).Element}function l(e){return e instanceof HTMLElement||e instanceof t(e).HTMLElement}function c(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof t(e).ShadowRoot)}function u(e){const{overflow:n,overflowX:t,overflowY:o,display:r}=m(e);return/auto|scroll|overlay|hidden|clip/.test(n+o+t)&&!["inline","contents"].includes(r)}function s(e){return[":popover-open",":modal"].some((n=>{try{return e.matches(n)}catch(e){return!1}}))}function f(e){const n=d(),t=i(e)?m(e):e;return"none"!==t.transform||"none"!==t.perspective||!!t.containerType&&"normal"!==t.containerType||!n&&!!t.backdropFilter&&"none"!==t.backdropFilter||!n&&!!t.filter&&"none"!==t.filter||["transform","perspective","filter"].some((e=>(t.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(t.contain||"").includes(e)))}function d(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function a(e){return["html","body","#document"].includes(n(e))}function m(e){return t(e).getComputedStyle(e)}function p(e){if("html"===n(e))return e;const t=e.assignedSlot||e.parentNode||c(e)&&e.host||o(e);return c(t)?t.host:t}function w(e){const n=p(e);return a(n)?e.ownerDocument?e.ownerDocument.body:e.body:l(n)&&u(n)?n:w(n)}e.getComputedStyle=m,e.getContainingBlock=function(e){let n=p(e);for(;l(n)&&!a(n);){if(f(n))return n;if(s(n))return null;n=p(n)}return null},e.getDocumentElement=o,e.getNearestOverflowAncestor=w,e.getNodeName=n,e.getNodeScroll=function(e){return i(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}},e.getOverflowAncestors=function e(n,o,r){var i;void 0===o&&(o=[]),void 0===r&&(r=!0);const l=w(n),c=l===(null==(i=n.ownerDocument)?void 0:i.body),s=t(l);return c?o.concat(s,s.visualViewport||[],u(l)?l:[],s.frameElement&&r?e(s.frameElement):[]):o.concat(l,e(l,[],r))},e.getParentNode=p,e.getWindow=t,e.isContainingBlock=f,e.isElement=i,e.isHTMLElement=l,e.isLastTraversableNode=a,e.isNode=r,e.isOverflowElement=u,e.isShadowRoot=c,e.isTableElement=function(e){return["table","td","th"].includes(n(e))},e.isTopLayer=s,e.isWebKit=d}));
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).FloatingUIUtilsDOM={})}(this,(function(e){"use strict";function n(e){return r(e)?(e.nodeName||"").toLowerCase():"#document"}function t(e){var n;return(null==e||null==(n=e.ownerDocument)?void 0:n.defaultView)||window}function o(e){var n;return null==(n=(r(e)?e.ownerDocument:e.document)||window.document)?void 0:n.documentElement}function r(e){return e instanceof Node||e instanceof t(e).Node}function i(e){return e instanceof Element||e instanceof t(e).Element}function l(e){return e instanceof HTMLElement||e instanceof t(e).HTMLElement}function c(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof t(e).ShadowRoot)}function u(e){const{overflow:n,overflowX:t,overflowY:o,display:r}=m(e);return/auto|scroll|overlay|hidden|clip/.test(n+o+t)&&!["inline","contents"].includes(r)}function s(e){return[":popover-open",":modal"].some((n=>{try{return e.matches(n)}catch(e){return!1}}))}function f(e){const n=d(),t=i(e)?m(e):e;return"none"!==t.transform||"none"!==t.perspective||!!t.containerType&&"normal"!==t.containerType||!n&&!!t.backdropFilter&&"none"!==t.backdropFilter||!n&&!!t.filter&&"none"!==t.filter||["transform","perspective","filter"].some((e=>(t.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(t.contain||"").includes(e)))}function d(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function a(e){return["html","body","#document"].includes(n(e))}function m(e){return t(e).getComputedStyle(e)}function p(e){if("html"===n(e))return e;const t=e.assignedSlot||e.parentNode||c(e)&&e.host||o(e);return c(t)?t.host:t}function w(e){const n=p(e);return a(n)?e.ownerDocument?e.ownerDocument.body:e.body:l(n)&&u(n)?n:w(n)}function v(e){return Object.getPrototypeOf(e.parent)?e.frameElement:null}e.getComputedStyle=m,e.getContainingBlock=function(e){let n=p(e);for(;l(n)&&!a(n);){if(f(n))return n;if(s(n))return null;n=p(n)}return null},e.getDocumentElement=o,e.getFrameElement=v,e.getNearestOverflowAncestor=w,e.getNodeName=n,e.getNodeScroll=function(e){return i(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}},e.getOverflowAncestors=function e(n,o,r){var i;void 0===o&&(o=[]),void 0===r&&(r=!0);const l=w(n),c=l===(null==(i=n.ownerDocument)?void 0:i.body),s=t(l);if(c){const n=v(s);return o.concat(s,s.visualViewport||[],u(l)?l:[],n&&r?e(n):[])}return o.concat(l,e(l,[],r))},e.getParentNode=p,e.getWindow=t,e.isContainingBlock=f,e.isElement=i,e.isHTMLElement=l,e.isLastTraversableNode=a,e.isNode=r,e.isOverflowElement=u,e.isShadowRoot=c,e.isTableElement=function(e){return["table","td","th"].includes(n(e))},e.isTopLayer=s,e.isWebKit=d}));

@@ -8,2 +8,4 @@ declare function getComputedStyle_2(element: Element): CSSStyleDeclaration;

export declare function getFrameElement(win: Window): Element | null;
export declare function getNearestOverflowAncestor(node: Node): HTMLElement;

@@ -10,0 +12,0 @@

@@ -133,7 +133,11 @@ function getNodeName(node) {

if (isBody) {
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], win.frameElement && traverseIframes ? getOverflowAncestors(win.frameElement) : []);
const frameElement = getFrameElement(win);
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
}
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
}
function getFrameElement(win) {
return Object.getPrototypeOf(win.parent) ? win.frameElement : null;
}
export { getComputedStyle, getContainingBlock, getDocumentElement, getNearestOverflowAncestor, getNodeName, getNodeScroll, getOverflowAncestors, getParentNode, getWindow, isContainingBlock, isElement, isHTMLElement, isLastTraversableNode, isNode, isOverflowElement, isShadowRoot, isTableElement, isTopLayer, isWebKit };
export { getComputedStyle, getContainingBlock, getDocumentElement, getFrameElement, getNearestOverflowAncestor, getNodeName, getNodeScroll, getOverflowAncestors, getParentNode, getWindow, isContainingBlock, isElement, isHTMLElement, isLastTraversableNode, isNode, isOverflowElement, isShadowRoot, isTableElement, isTopLayer, isWebKit };

@@ -139,6 +139,10 @@ (function (global, factory) {

if (isBody) {
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], win.frameElement && traverseIframes ? getOverflowAncestors(win.frameElement) : []);
const frameElement = getFrameElement(win);
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
}
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
}
function getFrameElement(win) {
return Object.getPrototypeOf(win.parent) ? win.frameElement : null;
}

@@ -148,2 +152,3 @@ exports.getComputedStyle = getComputedStyle;

exports.getDocumentElement = getDocumentElement;
exports.getFrameElement = getFrameElement;
exports.getNearestOverflowAncestor = getNearestOverflowAncestor;

@@ -150,0 +155,0 @@ exports.getNodeName = getNodeName;

{
"name": "@floating-ui/utils",
"version": "0.2.5",
"version": "0.2.6",
"description": "Utilities for Floating UI",

@@ -5,0 +5,0 @@ "publishConfig": {

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