@floating-ui/dom
Advanced tools
Comparing version 0.4.5 to 0.5.0
@@ -28,2 +28,12 @@ import { rectToClientRect, computePosition as computePosition$1 } from '@floating-ui/core'; | ||
function getUAString() { | ||
const uaData = navigator.userAgentData; | ||
if (uaData != null && uaData.brands) { | ||
return uaData.brands.map(item => item.brand + "/" + item.version).join(' '); | ||
} | ||
return navigator.userAgent; | ||
} | ||
function isHTMLElement(value) { | ||
@@ -61,3 +71,3 @@ return value instanceof getWindow(value).HTMLElement; | ||
// TODO: Try and use feature detection here instead | ||
const isFirefox = navigator.userAgent.toLowerCase().includes('firefox'); | ||
const isFirefox = /firefox/i.test(getUAString()); | ||
const css = getComputedStyle$1(element); // This is non-exhaustive but covers the most common CSS properties that | ||
@@ -72,3 +82,3 @@ // create a containing block. | ||
// Not Safari | ||
return !/^((?!chrome|android).)*safari/i.test(navigator.userAgent); // Feature detection for this fails in various ways | ||
return !/^((?!chrome|android).)*safari/i.test(getUAString()); // Feature detection for this fails in various ways | ||
// • Always-visible scrollbar or not | ||
@@ -520,3 +530,3 @@ // • Width of <html>, etc. | ||
ancestorResize: _ancestorResize = true, | ||
elementResize: _elementResize = true, | ||
elementResize = true, | ||
animationFrame = false | ||
@@ -527,3 +537,2 @@ } = options; | ||
const ancestorResize = _ancestorResize && !animationFrame; | ||
const elementResize = _elementResize && !animationFrame; | ||
const ancestors = ancestorScroll || ancestorResize ? [...(isElement(reference) ? getOverflowAncestors(reference) : []), ...getOverflowAncestors(floating)] : []; | ||
@@ -540,3 +549,3 @@ ancestors.forEach(ancestor => { | ||
observer = new ResizeObserver(update); | ||
isElement(reference) && observer.observe(reference); | ||
isElement(reference) && !animationFrame && observer.observe(reference); | ||
observer.observe(floating); | ||
@@ -543,0 +552,0 @@ } |
{ | ||
"name": "@floating-ui/dom", | ||
"version": "0.4.5", | ||
"version": "0.5.0", | ||
"@rollingversions": { | ||
@@ -15,17 +15,20 @@ "baseVersion": [ | ||
}, | ||
"main": "dist/floating-ui.dom.js", | ||
"module": "dist/floating-ui.dom.esm.js", | ||
"unpkg": "dist/floating-ui.dom.min.js", | ||
"type": "module", | ||
"main": "./dist/floating-ui.dom.umd.js", | ||
"module": "./dist/floating-ui.dom.esm.js", | ||
"unpkg": "./dist/floating-ui.dom.umd.min.js", | ||
"types": "./index.d.ts", | ||
"exports": { | ||
".": { | ||
"types": "./index.d.ts", | ||
"import": { | ||
"development": "./dist/floating-ui.dom.esm.development.js", | ||
"production": "./dist/floating-ui.dom.esm.min.js", | ||
"default": "./dist/floating-ui.dom.esm.js" | ||
"browser": { | ||
"development": "./dist/floating-ui.dom.browser.mjs", | ||
"default": "./dist/floating-ui.dom.browser.min.mjs" | ||
}, | ||
"default": "./dist/floating-ui.dom.mjs" | ||
}, | ||
"require": "./dist/floating-ui.dom.cjs" | ||
"module": "./dist/floating-ui.dom.esm.js", | ||
"default": "./dist/floating-ui.dom.umd.js" | ||
}, | ||
"./package.json": "./package.json", | ||
"./src/index.ts": "./src/index.ts" | ||
"./package.json": "./package.json" | ||
}, | ||
@@ -62,3 +65,3 @@ "sideEffects": false, | ||
"dependencies": { | ||
"@floating-ui/core": "^0.6.2" | ||
"@floating-ui/core": "^0.7.0" | ||
}, | ||
@@ -65,0 +68,0 @@ "devDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
35
104998
2314
1
No
+ Added@floating-ui/core@0.7.3(transitive)
- Removed@floating-ui/core@0.6.2(transitive)
Updated@floating-ui/core@^0.7.0