N°7331 - Fix cleanup script to remove all denied folders

This commit is contained in:
Molkobain
2024-03-22 11:38:02 +01:00
parent 3a990f46d3
commit e7a04e0e70
26 changed files with 2216 additions and 594 deletions

View File

@@ -1,6 +1,6 @@
/**!
* tippy.js v6.2.5
* (c) 2017-2020 atomiks
* tippy.js v6.3.7
* (c) 2017-2021 atomiks
* MIT License
*/
(function (global, factory) {
@@ -9,7 +9,7 @@
(global = global || self, global.tippy = factory(global.Popper));
}(this, (function (core) { 'use strict';
var css = ".tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{position:relative;background-color:#333;color:#fff;border-radius:4px;font-size:14px;line-height:1.4;outline:0;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{bottom:-7px;left:0;border-width:8px 8px 0;border-top-color:initial;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{top:-7px;left:0;border-width:0 8px 8px;border-bottom-color:initial;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-width:8px 0 8px 8px;border-left-color:initial;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{left:-7px;border-width:8px 8px 8px 0;border-right-color:initial;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{width:16px;height:16px;color:#333}.tippy-arrow:before{content:\"\";position:absolute;border-color:transparent;border-style:solid}.tippy-content{position:relative;padding:5px 9px;z-index:1}";
var css = ".tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{position:relative;background-color:#333;color:#fff;border-radius:4px;font-size:14px;line-height:1.4;white-space:normal;outline:0;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{bottom:-7px;left:0;border-width:8px 8px 0;border-top-color:initial;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{top:-7px;left:0;border-width:0 8px 8px;border-bottom-color:initial;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-width:8px 0 8px 8px;border-left-color:initial;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{left:-7px;border-width:8px 8px 8px 0;border-right-color:initial;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{width:16px;height:16px;color:#333}.tippy-arrow:before{content:\"\";position:absolute;border-color:transparent;border-style:solid}.tippy-content{position:relative;padding:5px 9px;z-index:1}";
function injectCSS(css) {
var style = document.createElement('style');
@@ -26,8 +26,8 @@
}
var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined';
var ua = isBrowser ? navigator.userAgent : '';
var isIE = /MSIE |Trident\//.test(ua);
var isIE11 = isBrowser ? // @ts-ignore
!!window.msCrypto : false;
var ROUND_ARROW = '<svg width="16" height="6" xmlns="http://www.w3.org/2000/svg"><path d="M0 6s1.796-.013 4.67-3.615C5.851.9 6.93.006 8 0c1.07-.006 2.148.887 3.343 2.385C14.233 6.005 16 6 16 6H0z"></svg>';
var BOX_CLASS = "tippy-box";
@@ -39,6 +39,9 @@
passive: true,
capture: true
};
var TIPPY_DEFAULT_APPEND_TO = function TIPPY_DEFAULT_APPEND_TO() {
return document.body;
};
function hasOwnProperty(obj, key) {
return {}.hasOwnProperty.call(obj, key);
@@ -158,10 +161,13 @@
});
}
function getOwnerDocument(elementOrElements) {
var _normalizeToArray = normalizeToArray(elementOrElements),
element = _normalizeToArray[0];
var _element$ownerDocumen;
return element ? element.ownerDocument || document : document;
var _normalizeToArray = normalizeToArray(elementOrElements),
element = _normalizeToArray[0]; // Elements created via a <template> have an ownerDocument with no reference to the body
return element != null && (_element$ownerDocumen = element.ownerDocument) != null && _element$ownerDocumen.body ? element.ownerDocument : document;
}
function isCursorOutsideInteractiveBorder(popperTreeData, event) {
var clientX = event.clientX,
@@ -197,6 +203,26 @@
box[method](event, listener);
});
}
/**
* Compared to xxx.contains, this function works for dom structures with shadow
* dom
*/
function actualContains(parent, child) {
var target = child;
while (target) {
var _target$getRootNode;
if (parent.contains(target)) {
return true;
}
target = target.getRootNode == null ? void 0 : (_target$getRootNode = target.getRootNode()) == null ? void 0 : _target$getRootNode.host;
}
return false;
}
var currentInput = {
isTouch: false
@@ -332,9 +358,7 @@
zIndex: 9999
};
var defaultProps = Object.assign({
appendTo: function appendTo() {
return document.body;
},
appendTo: TIPPY_DEFAULT_APPEND_TO,
aria: {
content: 'auto',
expanded: 'auto'
@@ -369,7 +393,7 @@
touch: true,
trigger: 'mouseenter focus',
triggerTarget: null
}, pluginProps, {}, renderProps);
}, pluginProps, renderProps);
var defaultKeys = Object.keys(defaultProps);
var setDefaultProps = function setDefaultProps(partialProps) {
/* istanbul ignore else */
@@ -389,12 +413,14 @@
defaultValue = plugin.defaultValue;
if (name) {
acc[name] = passedProps[name] !== undefined ? passedProps[name] : defaultValue;
var _name;
acc[name] = passedProps[name] !== undefined ? passedProps[name] : (_name = defaultProps[name]) != null ? _name : defaultValue;
}
return acc;
}, {});
return Object.assign({}, passedProps, {}, pluginProps);
return Object.assign({}, passedProps, pluginProps);
}
function getDataAttributeProps(reference, plugins) {
var propKeys = plugins ? Object.keys(getExtendedPassedProps(Object.assign({}, defaultProps, {
@@ -425,7 +451,7 @@
var out = Object.assign({}, props, {
content: invokeWithArgsOrReturn(props.content, [reference])
}, props.ignoreAttributes ? {} : getDataAttributeProps(reference, props.plugins));
out.aria = Object.assign({}, defaultProps.aria, {}, out.aria);
out.aria = Object.assign({}, defaultProps.aria, out.aria);
out.aria = {
expanded: out.aria.expanded === 'auto' ? props.interactive : out.aria.expanded,
content: out.aria.content === 'auto' ? props.interactive ? null : 'describedby' : out.aria.content
@@ -586,7 +612,7 @@
var mountedInstances = [];
function createTippy(reference, passedProps) {
var props = evaluateProps(reference, Object.assign({}, defaultProps, {}, getExtendedPassedProps(removeUndefinedProps(passedProps)))); // ===========================================================================
var props = evaluateProps(reference, Object.assign({}, defaultProps, getExtendedPassedProps(removeUndefinedProps(passedProps)))); // ===========================================================================
// 🔒 Private members
// ===========================================================================
@@ -602,8 +628,7 @@
var onFirstUpdate;
var listeners = [];
var debouncedOnMouseMove = debounce(onMouseMove, props.interactiveDebounce);
var currentTarget;
var doc = getOwnerDocument(props.triggerTarget || reference); // ===========================================================================
var currentTarget; // ===========================================================================
// 🔑 Public members
// ===========================================================================
@@ -687,10 +712,9 @@
instance.clearDelayTimeouts();
}
});
popper.addEventListener('mouseleave', function (event) {
popper.addEventListener('mouseleave', function () {
if (instance.props.interactive && instance.props.trigger.indexOf('mouseenter') >= 0) {
doc.addEventListener('mousemove', debouncedOnMouseMove);
debouncedOnMouseMove(event);
getDocument().addEventListener('mousemove', debouncedOnMouseMove);
}
});
return instance; // ===========================================================================
@@ -710,13 +734,18 @@
var _instance$props$rende;
// @ts-ignore
return !!((_instance$props$rende = instance.props.render) == null ? void 0 : _instance$props$rende.$$tippy);
return !!((_instance$props$rende = instance.props.render) != null && _instance$props$rende.$$tippy);
}
function getCurrentTarget() {
return currentTarget || reference;
}
function getDocument() {
var parent = getCurrentTarget().parentNode;
return parent ? getOwnerDocument(parent) : document;
}
function getDefaultTemplateChildren() {
return getChildren(popper);
}
@@ -732,8 +761,12 @@
return getValueAtIndexOrReturn(instance.props.delay, isShow ? 0 : 1, defaultProps.delay);
}
function handleStyles() {
popper.style.pointerEvents = instance.props.interactive && instance.state.isVisible ? '' : 'none';
function handleStyles(fromHide) {
if (fromHide === void 0) {
fromHide = false;
}
popper.style.pointerEvents = instance.props.interactive && !fromHide ? '' : 'none';
popper.style.zIndex = "" + instance.props.zIndex;
}
@@ -744,7 +777,7 @@
pluginsHooks.forEach(function (pluginHooks) {
if (pluginHooks[hook]) {
pluginHooks[hook].apply(void 0, args);
pluginHooks[hook].apply(pluginHooks, args);
}
});
@@ -798,7 +831,7 @@
}
function cleanupInteractiveMouseListeners() {
doc.removeEventListener('mousemove', debouncedOnMouseMove);
getDocument().removeEventListener('mousemove', debouncedOnMouseMove);
mouseMoveListeners = mouseMoveListeners.filter(function (listener) {
return listener !== debouncedOnMouseMove;
});
@@ -810,15 +843,18 @@
if (didTouchMove || event.type === 'mousedown') {
return;
}
} // Clicked on interactive popper
}
var actualTarget = event.composedPath && event.composedPath()[0] || event.target; // Clicked on interactive popper
if (instance.props.interactive && popper.contains(event.target)) {
if (instance.props.interactive && actualContains(popper, actualTarget)) {
return;
} // Clicked on the event listeners target
if (getCurrentTarget().contains(event.target)) {
if (normalizeToArray(instance.props.triggerTarget || reference).some(function (el) {
return actualContains(el, actualTarget);
})) {
if (currentInput.isTouch) {
return;
}
@@ -831,7 +867,6 @@
}
if (instance.props.hideOnClick === true) {
isVisibleFromClick = false;
instance.clearDelayTimeouts();
instance.hide(); // `mousedown` event is fired right before `focus` if pressing the
// currentTarget. This lets a tippy with `focus` trigger know that it
@@ -859,6 +894,7 @@
}
function addDocumentPress() {
var doc = getDocument();
doc.addEventListener('mousedown', onDocumentPress, true);
doc.addEventListener('touchend', onDocumentPress, TOUCH_OPTIONS);
doc.addEventListener('touchstart', onTouchStart, TOUCH_OPTIONS);
@@ -866,6 +902,7 @@
}
function removeDocumentPress() {
var doc = getDocument();
doc.removeEventListener('mousedown', onDocumentPress, true);
doc.removeEventListener('touchend', onDocumentPress, TOUCH_OPTIONS);
doc.removeEventListener('touchstart', onTouchStart, TOUCH_OPTIONS);
@@ -945,7 +982,7 @@
break;
case 'focus':
on(isIE ? 'focusout' : 'blur', onBlurOrFocusOut);
on(isIE11 ? 'focusout' : 'blur', onBlurOrFocusOut);
break;
case 'focusin':
@@ -1008,7 +1045,7 @@
function onMouseMove(event) {
var target = event.target;
var isCursorOverReferenceOrPopper = reference.contains(target) || popper.contains(target);
var isCursorOverReferenceOrPopper = getCurrentTarget().contains(target) || popper.contains(target);
if (event.type === 'mousemove' && isCursorOverReferenceOrPopper) {
return;
@@ -1171,7 +1208,7 @@
var node = getCurrentTarget();
if (instance.props.interactive && appendTo === defaultProps.appendTo || appendTo === 'parent') {
if (instance.props.interactive && appendTo === TIPPY_DEFAULT_APPEND_TO || appendTo === 'parent') {
parentNode = node.parentNode;
} else {
parentNode = invokeWithArgsOrReturn(appendTo, [node]);
@@ -1183,6 +1220,7 @@
parentNode.appendChild(popper);
}
instance.state.isMounted = true;
createPopperInstance();
/* istanbul ignore else */
@@ -1290,7 +1328,7 @@
invokeHook('onBeforeUpdate', [instance, partialProps]);
removeListeners();
var prevProps = instance.props;
var nextProps = evaluateProps(reference, Object.assign({}, instance.props, {}, partialProps, {
var nextProps = evaluateProps(reference, Object.assign({}, prevProps, removeUndefinedProps(partialProps), {
ignoreAttributes: true
}));
instance.props = nextProps;
@@ -1393,6 +1431,8 @@
}
onFirstUpdate = function onFirstUpdate() {
var _instance$popperInsta2;
if (!instance.state.isVisible || ignoreOnFirstUpdate) {
return;
}
@@ -1413,8 +1453,10 @@
handleAriaContentAttribute();
handleAriaExpandedAttribute();
pushIfUnique(mountedInstances, instance);
instance.state.isMounted = true;
pushIfUnique(mountedInstances, instance); // certain modifiers (e.g. `maxSize`) require a second update after the
// popper has been positioned for the first time
(_instance$popperInsta2 = instance.popperInstance) == null ? void 0 : _instance$popperInsta2.forceUpdate();
invokeHook('onMount', [instance]);
if (instance.props.animation && getIsDefaultRenderFn()) {
@@ -1453,6 +1495,7 @@
instance.state.isVisible = false;
instance.state.isShown = false;
ignoreOnFirstUpdate = false;
isVisibleFromClick = false;
if (getIsDefaultRenderFn()) {
popper.style.visibility = 'hidden';
@@ -1460,7 +1503,7 @@
cleanupInteractiveMouseListeners();
removeDocumentPress();
handleStyles();
handleStyles(true);
if (getIsDefaultRenderFn()) {
var _getDefaultTemplateCh4 = getDefaultTemplateChildren(),
@@ -1491,7 +1534,7 @@
warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('hideWithInteractivity'));
}
doc.addEventListener('mousemove', debouncedOnMouseMove);
getDocument().addEventListener('mousemove', debouncedOnMouseMove);
pushIfUnique(mouseMoveListeners, debouncedOnMouseMove);
debouncedOnMouseMove(event);
}
@@ -1617,7 +1660,39 @@
});
};
// every time the popper is destroyed (i.e. a new target), removing the styles
// and causing transitions to break for singletons when the console is open, but
// most notably for non-transform styles being used, `gpuAcceleration: false`.
var applyStylesModifier = Object.assign({}, core.applyStyles, {
effect: function effect(_ref) {
var state = _ref.state;
var initialStyles = {
popper: {
position: state.options.strategy,
left: '0',
top: '0',
margin: '0'
},
arrow: {
position: 'absolute'
},
reference: {}
};
Object.assign(state.elements.popper.style, initialStyles.popper);
state.styles = initialStyles;
if (state.elements.arrow) {
Object.assign(state.elements.arrow.style, initialStyles.arrow);
} // intentionally return no cleanup function
// return () => { ... }
}
});
var createSingleton = function createSingleton(tippyInstances, optionalProps) {
var _optionalProps$popper;
if (optionalProps === void 0) {
optionalProps = {};
}
@@ -1627,19 +1702,30 @@
errorWhen(!Array.isArray(tippyInstances), ['The first argument passed to createSingleton() must be an array of', 'tippy instances. The passed value was', String(tippyInstances)].join(' '));
}
var mutTippyInstances = tippyInstances;
var individualInstances = tippyInstances;
var references = [];
var triggerTargets = [];
var currentTarget;
var overrides = optionalProps.overrides;
var interceptSetPropsCleanups = [];
var shownOnCreate = false;
function setTriggerTargets() {
triggerTargets = individualInstances.map(function (instance) {
return normalizeToArray(instance.props.triggerTarget || instance.reference);
}).reduce(function (acc, item) {
return acc.concat(item);
}, []);
}
function setReferences() {
references = mutTippyInstances.map(function (instance) {
references = individualInstances.map(function (instance) {
return instance.reference;
});
}
function enableInstances(isEnabled) {
mutTippyInstances.forEach(function (instance) {
individualInstances.forEach(function (instance) {
if (isEnabled) {
instance.enable();
} else {
@@ -1648,58 +1734,163 @@
});
}
function interceptSetProps(singleton) {
return individualInstances.map(function (instance) {
var originalSetProps = instance.setProps;
instance.setProps = function (props) {
originalSetProps(props);
if (instance.reference === currentTarget) {
singleton.setProps(props);
}
};
return function () {
instance.setProps = originalSetProps;
};
});
} // have to pass singleton, as it maybe undefined on first call
function prepareInstance(singleton, target) {
var index = triggerTargets.indexOf(target); // bail-out
if (target === currentTarget) {
return;
}
currentTarget = target;
var overrideProps = (overrides || []).concat('content').reduce(function (acc, prop) {
acc[prop] = individualInstances[index].props[prop];
return acc;
}, {});
singleton.setProps(Object.assign({}, overrideProps, {
getReferenceClientRect: typeof overrideProps.getReferenceClientRect === 'function' ? overrideProps.getReferenceClientRect : function () {
var _references$index;
return (_references$index = references[index]) == null ? void 0 : _references$index.getBoundingClientRect();
}
}));
}
enableInstances(false);
setReferences();
var singleton = {
setTriggerTargets();
var plugin = {
fn: function fn() {
return {
onDestroy: function onDestroy() {
enableInstances(true);
},
onTrigger: function onTrigger(instance, event) {
var target = event.currentTarget;
var index = references.indexOf(target); // bail-out
if (target === currentTarget) {
return;
onHidden: function onHidden() {
currentTarget = null;
},
onClickOutside: function onClickOutside(instance) {
if (instance.props.showOnCreate && !shownOnCreate) {
shownOnCreate = true;
currentTarget = null;
}
currentTarget = target;
var overrideProps = (overrides || []).concat('content').reduce(function (acc, prop) {
acc[prop] = mutTippyInstances[index].props[prop];
return acc;
}, {});
instance.setProps(Object.assign({}, overrideProps, {
getReferenceClientRect: function getReferenceClientRect() {
return target.getBoundingClientRect();
}
}));
},
onShow: function onShow(instance) {
if (instance.props.showOnCreate && !shownOnCreate) {
shownOnCreate = true;
prepareInstance(instance, references[0]);
}
},
onTrigger: function onTrigger(instance, event) {
prepareInstance(instance, event.currentTarget);
}
};
}
};
var instance = tippy(div(), Object.assign({}, removeProperties(optionalProps, ['overrides']), {
plugins: [singleton].concat(optionalProps.plugins || []),
triggerTarget: references
var singleton = tippy(div(), Object.assign({}, removeProperties(optionalProps, ['overrides']), {
plugins: [plugin].concat(optionalProps.plugins || []),
triggerTarget: triggerTargets,
popperOptions: Object.assign({}, optionalProps.popperOptions, {
modifiers: [].concat(((_optionalProps$popper = optionalProps.popperOptions) == null ? void 0 : _optionalProps$popper.modifiers) || [], [applyStylesModifier])
})
}));
var originalSetProps = instance.setProps;
var originalShow = singleton.show;
instance.setProps = function (props) {
singleton.show = function (target) {
originalShow(); // first time, showOnCreate or programmatic call with no params
// default to showing first instance
if (!currentTarget && target == null) {
return prepareInstance(singleton, references[0]);
} // triggered from event (do nothing as prepareInstance already called by onTrigger)
// programmatic call with no params when already visible (do nothing again)
if (currentTarget && target == null) {
return;
} // target is index of instance
if (typeof target === 'number') {
return references[target] && prepareInstance(singleton, references[target]);
} // target is a child tippy instance
if (individualInstances.indexOf(target) >= 0) {
var ref = target.reference;
return prepareInstance(singleton, ref);
} // target is a ReferenceElement
if (references.indexOf(target) >= 0) {
return prepareInstance(singleton, target);
}
};
singleton.showNext = function () {
var first = references[0];
if (!currentTarget) {
return singleton.show(0);
}
var index = references.indexOf(currentTarget);
singleton.show(references[index + 1] || first);
};
singleton.showPrevious = function () {
var last = references[references.length - 1];
if (!currentTarget) {
return singleton.show(last);
}
var index = references.indexOf(currentTarget);
var target = references[index - 1] || last;
singleton.show(target);
};
var originalSetProps = singleton.setProps;
singleton.setProps = function (props) {
overrides = props.overrides || overrides;
originalSetProps(props);
};
instance.setInstances = function (nextInstances) {
singleton.setInstances = function (nextInstances) {
enableInstances(true);
mutTippyInstances = nextInstances;
interceptSetPropsCleanups.forEach(function (fn) {
return fn();
});
individualInstances = nextInstances;
enableInstances(false);
setReferences();
instance.setProps({
triggerTarget: references
setTriggerTargets();
interceptSetPropsCleanups = interceptSetProps(singleton);
singleton.setProps({
triggerTarget: triggerTargets
});
};
return instance;
interceptSetPropsCleanups = interceptSetProps(singleton);
return singleton;
};
var BUBBLING_EVENTS_MAP = {
@@ -1720,20 +1911,23 @@
var listeners = [];
var childTippyInstances = [];
var disabled = false;
var target = props.target;
var nativeProps = removeProperties(props, ['target']);
var parentProps = Object.assign({}, nativeProps, {
trigger: 'manual',
touch: false
});
var childProps = Object.assign({}, nativeProps, {
var childProps = Object.assign({
touch: defaultProps.touch
}, nativeProps, {
showOnCreate: true
});
var returnValue = tippy(targets, parentProps);
var normalizedReturnValue = normalizeToArray(returnValue);
function onTrigger(event) {
if (!event.target) {
if (!event.target || disabled) {
return;
}
@@ -1757,7 +1951,7 @@
return;
}
if (event.type !== 'touchstart' && trigger.indexOf(BUBBLING_EVENTS_MAP[event.type])) {
if (event.type !== 'touchstart' && trigger.indexOf(BUBBLING_EVENTS_MAP[event.type]) < 0) {
return;
}
@@ -1784,7 +1978,7 @@
function addEventListeners(instance) {
var reference = instance.reference;
on(reference, 'touchstart', onTrigger);
on(reference, 'touchstart', onTrigger, TOUCH_OPTIONS);
on(reference, 'mouseover', onTrigger);
on(reference, 'focusin', onTrigger);
on(reference, 'click', onTrigger);
@@ -1803,6 +1997,8 @@
function applyMutations(instance) {
var originalDestroy = instance.destroy;
var originalEnable = instance.enable;
var originalDisable = instance.disable;
instance.destroy = function (shouldDestroyChildInstances) {
if (shouldDestroyChildInstances === void 0) {
@@ -1820,6 +2016,22 @@
originalDestroy();
};
instance.enable = function () {
originalEnable();
childTippyInstances.forEach(function (instance) {
return instance.enable();
});
disabled = false;
};
instance.disable = function () {
originalDisable();
childTippyInstances.forEach(function (instance) {
return instance.disable();
});
disabled = true;
};
addEventListeners(instance);
}
@@ -1834,7 +2046,7 @@
var _instance$props$rende;
// @ts-ignore
if (!((_instance$props$rende = instance.props.render) == null ? void 0 : _instance$props$rende.$$tippy)) {
if (!((_instance$props$rende = instance.props.render) != null && _instance$props$rende.$$tippy)) {
{
errorWhen(instance.props.animateFill, 'The `animateFill` plugin requires the default render function.');
}
@@ -1959,6 +2171,7 @@
if (isCursorOverReference || !instance.props.interactive) {
instance.setProps({
// @ts-ignore - unneeded DOMRect properties
getReferenceClientRect: function getReferenceClientRect() {
var rect = reference.getBoundingClientRect();
var x = clientX;
@@ -2037,20 +2250,26 @@
}
},
onMount: function onMount() {
if (instance.props.followCursor) {
if (instance.props.followCursor && !wasFocusEvent) {
if (isUnmounted) {
onMouseMove(mouseCoords);
isUnmounted = false;
}
if (!wasFocusEvent && !getIsInitialBehavior()) {
if (!getIsInitialBehavior()) {
addListener();
}
}
},
onTrigger: function onTrigger(_, _ref3) {
var type = _ref3.type;
wasFocusEvent = type === 'focus';
onTrigger: function onTrigger(_, event) {
if (isMouseEvent(event)) {
mouseCoords = {
clientX: event.clientX,
clientY: event.clientY
};
}
wasFocusEvent = event.type === 'focus';
},
onHidden: function onHidden() {
if (instance.props.followCursor) {
@@ -2089,6 +2308,7 @@
var placement;
var cursorRectIndex = -1;
var isInternalUpdate = false;
var triedPlacements = [];
var modifier = {
name: 'tippyInlinePositioning',
enabled: true,
@@ -2097,8 +2317,14 @@
var state = _ref2.state;
if (isEnabled()) {
if (placement !== state.placement) {
if (triedPlacements.indexOf(state.placement) !== -1) {
triedPlacements = [];
}
if (placement !== state.placement && triedPlacements.indexOf(state.placement) === -1) {
triedPlacements.push(state.placement);
instance.setProps({
// @ts-ignore - unneeded DOMRect properties
getReferenceClientRect: function getReferenceClientRect() {
return _getReferenceClientRect(state.placement);
}
@@ -2135,10 +2361,11 @@
var cursorRect = rects.find(function (rect) {
return rect.left - 2 <= event.clientX && rect.right + 2 >= event.clientX && rect.top - 2 <= event.clientY && rect.bottom + 2 >= event.clientY;
});
cursorRectIndex = rects.indexOf(cursorRect);
var index = rects.indexOf(cursorRect);
cursorRectIndex = index > -1 ? index : cursorRectIndex;
}
},
onUntrigger: function onUntrigger() {
onHidden: function onHidden() {
cursorRectIndex = -1;
}
};