DEV: updates popper to 2.10.2 (#14986)

This commit is contained in:
Joffrey JAFFEUX 2021-11-17 13:47:55 +01:00 committed by GitHub
parent 113ecab7a6
commit 439cd68e0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 78 additions and 63 deletions

View File

@ -21,7 +21,7 @@
"@ember/optional-features": "^1.1.0", "@ember/optional-features": "^1.1.0",
"@ember/test-helpers": "^2.2.0", "@ember/test-helpers": "^2.2.0",
"@glimmer/component": "^1.0.0", "@glimmer/component": "^1.0.0",
"@popperjs/core": "2.9.3", "@popperjs/core": "2.10.2",
"@uppy/aws-s3": "^2.0.4", "@uppy/aws-s3": "^2.0.4",
"@uppy/aws-s3-multipart": "^2.1.0", "@uppy/aws-s3-multipart": "^2.1.0",
"@uppy/core": "^2.1.0", "@uppy/core": "^2.1.0",

View File

@ -1274,10 +1274,10 @@
"@nodelib/fs.scandir" "2.1.4" "@nodelib/fs.scandir" "2.1.4"
fastq "^1.6.0" fastq "^1.6.0"
"@popperjs/core@2.9.3": "@popperjs/core@2.10.2":
version "2.9.3" version "2.10.2"
resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.9.3.tgz#8b68da1ebd7fc603999cf6ebee34a4899a14b88e" resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.10.2.tgz#0798c03351f0dea1a5a4cabddf26a55a7cbee590"
integrity sha512-xDu17cEfh7Kid/d95kB6tZsLOmSWKCZKtprnhVepjsSaCij+lM3mItSJDuuHDMbCWTh8Ejmebwb+KONcCJ0eXQ== integrity sha512-IXf3XA7+XyN7CP9gGh/XB0UxVMlvARGEgGXLubFICsUMGz6Q+DU+i4gGlpOxTjKvXjkJDJC8YdqdKkDj9qZHEQ==
"@simple-dom/interface@^1.4.0": "@simple-dom/interface@^1.4.0":
version "1.4.0" version "1.4.0"

View File

@ -10,7 +10,7 @@
"@fortawesome/fontawesome-free": "5.11.2", "@fortawesome/fontawesome-free": "5.11.2",
"@highlightjs/cdn-assets": "^10.7.0", "@highlightjs/cdn-assets": "^10.7.0",
"@json-editor/json-editor": "^2.5.2", "@json-editor/json-editor": "^2.5.2",
"@popperjs/core": "v2.9.3", "@popperjs/core": "v2.10.2",
"@uppy/aws-s3": "^2.0.4", "@uppy/aws-s3": "^2.0.4",
"@uppy/aws-s3-multipart": "^2.1.0", "@uppy/aws-s3-multipart": "^2.1.0",
"@uppy/core": "^2.1.0", "@uppy/core": "^2.1.0",

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
/** /**
* @popperjs/core v2.9.3 - MIT License * @popperjs/core v2.10.2 - MIT License
*/ */
(function (global, factory) { (function (global, factory) {
@ -8,6 +8,42 @@
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Popper = {})); (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Popper = {}));
}(this, (function (exports) { 'use strict'; }(this, (function (exports) { 'use strict';
// import { isHTMLElement } from './instanceOf';
function getBoundingClientRect(element, // eslint-disable-next-line unused-imports/no-unused-vars
includeScale) {
var rect = element.getBoundingClientRect();
var scaleX = 1;
var scaleY = 1; // FIXME:
// `offsetWidth` returns an integer while `getBoundingClientRect`
// returns a float. This results in `scaleX` or `scaleY` being
// non-1 when it should be for elements that aren't a full pixel in
// width or height.
// if (isHTMLElement(element) && includeScale) {
// const offsetHeight = element.offsetHeight;
// const offsetWidth = element.offsetWidth;
// // Do not attempt to divide by 0, otherwise we get `Infinity` as scale
// // Fallback to 1 in case both values are `0`
// if (offsetWidth > 0) {
// scaleX = rect.width / offsetWidth || 1;
// }
// if (offsetHeight > 0) {
// scaleY = rect.height / offsetHeight || 1;
// }
// }
return {
width: rect.width / scaleX,
height: rect.height / scaleY,
top: rect.top / scaleY,
right: rect.right / scaleX,
bottom: rect.bottom / scaleY,
left: rect.left / scaleX,
x: rect.left / scaleX,
y: rect.top / scaleY
};
}
function getWindow(node) { function getWindow(node) {
if (node == null) { if (node == null) {
return window; return window;
@ -21,6 +57,16 @@
return node; return node;
} }
function getWindowScroll(node) {
var win = getWindow(node);
var scrollLeft = win.pageXOffset;
var scrollTop = win.pageYOffset;
return {
scrollLeft: scrollLeft,
scrollTop: scrollTop
};
}
function isElement(node) { function isElement(node) {
var OwnElement = getWindow(node).Element; var OwnElement = getWindow(node).Element;
return node instanceof OwnElement || node instanceof Element; return node instanceof OwnElement || node instanceof Element;
@ -41,44 +87,6 @@
return node instanceof OwnElement || node instanceof ShadowRoot; return node instanceof OwnElement || node instanceof ShadowRoot;
} }
var round$1 = Math.round;
function getBoundingClientRect(element, includeScale) {
if (includeScale === void 0) {
includeScale = false;
}
var rect = element.getBoundingClientRect();
var scaleX = 1;
var scaleY = 1;
if (isHTMLElement(element) && includeScale) {
// Fallback to 1 in case both values are `0`
scaleX = rect.width / element.offsetWidth || 1;
scaleY = rect.height / element.offsetHeight || 1;
}
return {
width: round$1(rect.width / scaleX),
height: round$1(rect.height / scaleY),
top: round$1(rect.top / scaleY),
right: round$1(rect.right / scaleX),
bottom: round$1(rect.bottom / scaleY),
left: round$1(rect.left / scaleX),
x: round$1(rect.left / scaleX),
y: round$1(rect.top / scaleY)
};
}
function getWindowScroll(node) {
var win = getWindow(node);
var scrollLeft = win.pageXOffset;
var scrollTop = win.pageYOffset;
return {
scrollLeft: scrollLeft,
scrollTop: scrollTop
};
}
function getHTMLElementScroll(element) { function getHTMLElementScroll(element) {
return { return {
scrollLeft: element.scrollLeft, scrollLeft: element.scrollLeft,
@ -144,9 +152,9 @@
} }
var isOffsetParentAnElement = isHTMLElement(offsetParent); var isOffsetParentAnElement = isHTMLElement(offsetParent);
var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent); isHTMLElement(offsetParent) && isElementScaled(offsetParent);
var documentElement = getDocumentElement(offsetParent); var documentElement = getDocumentElement(offsetParent);
var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled); var rect = getBoundingClientRect(elementOrVirtualElement);
var scroll = { var scroll = {
scrollLeft: 0, scrollLeft: 0,
scrollTop: 0 scrollTop: 0
@ -163,7 +171,7 @@
} }
if (isHTMLElement(offsetParent)) { if (isHTMLElement(offsetParent)) {
offsets = getBoundingClientRect(offsetParent, true); offsets = getBoundingClientRect(offsetParent);
offsets.x += offsetParent.clientLeft; offsets.x += offsetParent.clientLeft;
offsets.y += offsetParent.clientTop; offsets.y += offsetParent.clientTop;
} else if (documentElement) { } else if (documentElement) {
@ -425,7 +433,10 @@
var VALID_PROPERTIES = ['name', 'enabled', 'phase', 'fn', 'effect', 'requires', 'options']; var VALID_PROPERTIES = ['name', 'enabled', 'phase', 'fn', 'effect', 'requires', 'options'];
function validateModifiers(modifiers) { function validateModifiers(modifiers) {
modifiers.forEach(function (modifier) { modifiers.forEach(function (modifier) {
Object.keys(modifier).forEach(function (key) { [].concat(Object.keys(modifier), VALID_PROPERTIES) // IE11-compatible replacement for `new Set(iterable)`
.filter(function (value, index, self) {
return self.indexOf(value) === index;
}).forEach(function (key) {
switch (key) { switch (key) {
case 'name': case 'name':
if (typeof modifier.name !== 'string') { if (typeof modifier.name !== 'string') {
@ -439,6 +450,8 @@
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"enabled"', '"boolean"', "\"" + String(modifier.enabled) + "\"")); console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"enabled"', '"boolean"', "\"" + String(modifier.enabled) + "\""));
} }
break;
case 'phase': case 'phase':
if (modifierPhases.indexOf(modifier.phase) < 0) { if (modifierPhases.indexOf(modifier.phase) < 0) {
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"phase"', "either " + modifierPhases.join(', '), "\"" + String(modifier.phase) + "\"")); console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"phase"', "either " + modifierPhases.join(', '), "\"" + String(modifier.phase) + "\""));
@ -454,14 +467,14 @@
break; break;
case 'effect': case 'effect':
if (typeof modifier.effect !== 'function') { if (modifier.effect != null && typeof modifier.effect !== 'function') {
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"effect"', '"function"', "\"" + String(modifier.fn) + "\"")); console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"effect"', '"function"', "\"" + String(modifier.fn) + "\""));
} }
break; break;
case 'requires': case 'requires':
if (!Array.isArray(modifier.requires)) { if (modifier.requires != null && !Array.isArray(modifier.requires)) {
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"requires"', '"array"', "\"" + String(modifier.requires) + "\"")); console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"requires"', '"array"', "\"" + String(modifier.requires) + "\""));
} }
@ -794,11 +807,10 @@
padding = _options$padding === void 0 ? 0 : _options$padding; padding = _options$padding === void 0 ? 0 : _options$padding;
var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements)); var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));
var altContext = elementContext === popper ? reference : popper; var altContext = elementContext === popper ? reference : popper;
var referenceElement = state.elements.reference;
var popperRect = state.rects.popper; var popperRect = state.rects.popper;
var element = state.elements[altBoundary ? altContext : elementContext]; var element = state.elements[altBoundary ? altContext : elementContext];
var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary); var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary);
var referenceClientRect = getBoundingClientRect(referenceElement); var referenceClientRect = getBoundingClientRect(state.elements.reference);
var popperOffsets = computeOffsets({ var popperOffsets = computeOffsets({
reference: referenceClientRect, reference: referenceClientRect,
element: popperRect, element: popperRect,
@ -878,7 +890,8 @@
var isDestroyed = false; var isDestroyed = false;
var instance = { var instance = {
state: state, state: state,
setOptions: function setOptions(options) { setOptions: function setOptions(setOptionsAction) {
var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction;
cleanupModifierEffects(); cleanupModifierEffects();
state.options = Object.assign({}, defaultOptions, state.options, options); state.options = Object.assign({}, defaultOptions, state.options, options);
state.scrollParents = { state.scrollParents = {
@ -1169,6 +1182,7 @@
var popper = _ref2.popper, var popper = _ref2.popper,
popperRect = _ref2.popperRect, popperRect = _ref2.popperRect,
placement = _ref2.placement, placement = _ref2.placement,
variation = _ref2.variation,
offsets = _ref2.offsets, offsets = _ref2.offsets,
position = _ref2.position, position = _ref2.position,
gpuAcceleration = _ref2.gpuAcceleration, gpuAcceleration = _ref2.gpuAcceleration,
@ -1195,7 +1209,7 @@
if (offsetParent === getWindow(popper)) { if (offsetParent === getWindow(popper)) {
offsetParent = getDocumentElement(popper); offsetParent = getDocumentElement(popper);
if (getComputedStyle(offsetParent).position !== 'static') { if (getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') {
heightProp = 'scrollHeight'; heightProp = 'scrollHeight';
widthProp = 'scrollWidth'; widthProp = 'scrollWidth';
} }
@ -1204,14 +1218,14 @@
offsetParent = offsetParent; offsetParent = offsetParent;
if (placement === top) { if (placement === top || (placement === left || placement === right) && variation === end) {
sideY = bottom; // $FlowFixMe[prop-missing] sideY = bottom; // $FlowFixMe[prop-missing]
y -= offsetParent[heightProp] - popperRect.height; y -= offsetParent[heightProp] - popperRect.height;
y *= gpuAcceleration ? 1 : -1; y *= gpuAcceleration ? 1 : -1;
} }
if (placement === left) { if (placement === left || (placement === top || placement === bottom) && variation === end) {
sideX = right; // $FlowFixMe[prop-missing] sideX = right; // $FlowFixMe[prop-missing]
x -= offsetParent[widthProp] - popperRect.width; x -= offsetParent[widthProp] - popperRect.width;
@ -1226,7 +1240,7 @@
if (gpuAcceleration) { if (gpuAcceleration) {
var _Object$assign; var _Object$assign;
return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) < 2 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign)); return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign));
} }
return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2)); return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2));
@ -1254,6 +1268,7 @@
var commonStyles = { var commonStyles = {
placement: getBasePlacement(state.placement), placement: getBasePlacement(state.placement),
variation: getVariation(state.placement),
popper: state.elements.popper, popper: state.elements.popper,
popperRect: state.rects.popper, popperRect: state.rects.popper,
gpuAcceleration: gpuAcceleration gpuAcceleration: gpuAcceleration

View File

@ -198,10 +198,10 @@
"@nodelib/fs.scandir" "2.1.3" "@nodelib/fs.scandir" "2.1.3"
fastq "^1.6.0" fastq "^1.6.0"
"@popperjs/core@v2.9.3": "@popperjs/core@v2.10.2":
version "2.9.3" version "2.10.2"
resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.9.3.tgz#8b68da1ebd7fc603999cf6ebee34a4899a14b88e" resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.10.2.tgz#0798c03351f0dea1a5a4cabddf26a55a7cbee590"
integrity sha512-xDu17cEfh7Kid/d95kB6tZsLOmSWKCZKtprnhVepjsSaCij+lM3mItSJDuuHDMbCWTh8Ejmebwb+KONcCJ0eXQ== integrity sha512-IXf3XA7+XyN7CP9gGh/XB0UxVMlvARGEgGXLubFICsUMGz6Q+DU+i4gGlpOxTjKvXjkJDJC8YdqdKkDj9qZHEQ==
"@simple-dom/interface@^1.4.0": "@simple-dom/interface@^1.4.0":
version "1.4.0" version "1.4.0"