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

@tippyjs/react

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tippyjs/react - npm Package Compare versions

Comparing version 4.2.3 to 4.2.4

16

dist/tippy-react.esm.js

@@ -51,14 +51,12 @@ import tippy, { createSingleton } from 'tippy.js';

}
function uniqueByName(arr) {
function uniqueByShape(arr) {
var output = [];
var lookup = Object.create(null);
for (var item in arr) {
if (lookup[arr[item].name] === undefined) {
output.push(arr[item]);
arr.forEach(function (item) {
if (lookup[JSON.stringify(item)] === undefined) {
output.push(item);
}
lookup[arr[item].name] = arr[item];
}
lookup[JSON.stringify(item)] = true;
});
return output;

@@ -71,3 +69,3 @@ }

popperOptions: Object.assign({}, instanceProps.popperOptions, componentProps.popperOptions, {
modifiers: uniqueByName([].concat(((_instanceProps$popper = instanceProps.popperOptions) == null ? void 0 : _instanceProps$popper.modifiers) || [], ((_componentProps$poppe = componentProps.popperOptions) == null ? void 0 : _componentProps$poppe.modifiers) || []))
modifiers: uniqueByShape([].concat(((_instanceProps$popper = instanceProps.popperOptions) == null ? void 0 : _instanceProps$popper.modifiers) || [], ((_componentProps$poppe = componentProps.popperOptions) == null ? void 0 : _componentProps$poppe.modifiers) || []))
})

@@ -74,0 +72,0 @@ });

@@ -55,14 +55,12 @@ (function (global, factory) {

}
function uniqueByName(arr) {
function uniqueByShape(arr) {
var output = [];
var lookup = Object.create(null);
for (var item in arr) {
if (lookup[arr[item].name] === undefined) {
output.push(arr[item]);
arr.forEach(function (item) {
if (lookup[JSON.stringify(item)] === undefined) {
output.push(item);
}
lookup[arr[item].name] = arr[item];
}
lookup[JSON.stringify(item)] = true;
});
return output;

@@ -75,3 +73,3 @@ }

popperOptions: Object.assign({}, instanceProps.popperOptions, componentProps.popperOptions, {
modifiers: uniqueByName([].concat(((_instanceProps$popper = instanceProps.popperOptions) == null ? void 0 : _instanceProps$popper.modifiers) || [], ((_componentProps$poppe = componentProps.popperOptions) == null ? void 0 : _componentProps$poppe.modifiers) || []))
modifiers: uniqueByShape([].concat(((_instanceProps$popper = instanceProps.popperOptions) == null ? void 0 : _instanceProps$popper.modifiers) || [], ((_componentProps$poppe = componentProps.popperOptions) == null ? void 0 : _componentProps$poppe.modifiers) || []))
})

@@ -78,0 +76,0 @@ });

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

!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("tippy.js"),require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["exports","tippy.js","react","react-dom"],n):n((e=e||self).Tippy={},e.tippy,e.React,e.ReactDOM)}(this,(function(e,n,t,r){"use strict";var i="default"in n?n.default:n,o="default"in t?t.default:t;function c(e,n){if(null==e)return{};var t,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)t=o[r],n.indexOf(t)>=0||(i[t]=e[t]);return i}var a="undefined"!=typeof window&&"undefined"!=typeof document;function s(e,n){e&&("function"==typeof e&&e(n),{}.hasOwnProperty.call(e,"current")&&(e.current=n))}function u(){return a&&document.createElement("div")}function p(e){var n=[],t=Object.create(null);for(var r in e)void 0===t[e[r].name]&&n.push(e[r]),t[e[r].name]=e[r];return n}function d(e,n){var t,r;return Object.assign({},n,{popperOptions:Object.assign({},e.popperOptions,n.popperOptions,{modifiers:p([].concat((null==(t=e.popperOptions)?void 0:t.modifiers)||[],(null==(r=n.popperOptions)?void 0:r.modifiers)||[]))})})}var f=a?t.useLayoutEffect:t.useEffect;function l(e){var n=t.useRef();return n.current||(n.current="function"==typeof e?e():e),n.current}function v(e,n,t){t.split(/\s+/).forEach((function(t){t&&e.classList[n](t)}))}var m={name:"className",defaultValue:"",fn:function(e){var n=e.popper.firstElementChild,t=function(){var n;return!!(null==(n=e.props.render)?void 0:n.$$tippy)};function r(){e.props.className&&!t()||v(n,"add",e.props.className)}return{onCreate:r,onBeforeUpdate:function(){t()&&v(n,"remove",e.props.className)},onAfterUpdate:r}}};function h(e){return function(n){var i=n.children,a=n.content,p=n.visible,v=n.singleton,h=n.render,b=n.reference,g=n.disabled,O=void 0!==g&&g,y=n.ignoreAttributes,j=void 0===y||y,E=(n.__source,n.__self,c(n,["children","content","visible","singleton","render","reference","disabled","ignoreAttributes","__source","__self"])),_=void 0!==p,P=void 0!==v,R=t.useState(!1),w=R[0],D=R[1],S=t.useState({}),k=S[0],H=S[1],$=t.useState(),q=$[0],x=$[1],A=l((function(){return{container:u(),renders:1}})),N=Object.assign({ignoreAttributes:j},E,{content:A.container});_&&(N.trigger="manual",N.hideOnClick=!1),P&&(O=!0);var C=N,M=N.plugins||[];h&&(C=Object.assign({},N,{plugins:P?[].concat(M,[{fn:function(){return{onTrigger:function(e,n){var t=v.data.children.find((function(e){return e.instance.reference===n.currentTarget})).content;x(t)}}}}]):M,render:function(){return{popper:A.container}}}));var T=[b].concat(i?[i.type]:[]);return f((function(){var n=b;b&&b.hasOwnProperty("current")&&(n=b.current);var t=e(n||A.ref||u(),Object.assign({},C,{plugins:[m].concat(N.plugins||[])}));return A.instance=t,O&&t.disable(),p&&t.show(),P&&v.hook({instance:t,content:a,props:C}),D(!0),function(){t.destroy(),null==v||v.cleanup(t)}}),T),f((function(){var e;if(1!==A.renders){var n=A.instance;n.setProps(d(n.props,C)),null==(e=n.popperInstance)||e.forceUpdate(),O?n.disable():n.enable(),_&&(p?n.show():n.hide()),P&&v.hook({instance:n,content:a,props:C})}else A.renders++})),f((function(){var e;if(h){var n=A.instance;n.setProps({popperOptions:Object.assign({},n.props.popperOptions,{modifiers:[].concat(((null==(e=n.props.popperOptions)?void 0:e.modifiers)||[]).filter((function(e){return"$$tippyReact"!==e.name})),[{name:"$$tippyReact",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var n,t=e.state,r=null==(n=t.modifiersData)?void 0:n.hide;k.placement===t.placement&&k.referenceHidden===(null==r?void 0:r.isReferenceHidden)&&k.escaped===(null==r?void 0:r.hasPopperEscaped)||H({placement:t.placement,referenceHidden:null==r?void 0:r.isReferenceHidden,escaped:null==r?void 0:r.hasPopperEscaped}),t.attributes.popper={}}}])})})}}),[k.placement,k.referenceHidden,k.escaped].concat(T)),o.createElement(o.Fragment,null,i?t.cloneElement(i,{ref:function(e){A.ref=e,s(i.ref,e)}}):null,w&&r.createPortal(h?h(function(e){var n={"data-placement":e.placement};return e.referenceHidden&&(n["data-reference-hidden"]=""),e.escaped&&(n["data-escaped"]=""),n}(k),q,A.instance):a,A.container))}}function b(e){return function(n){var r=void 0===n?{}:n,i=r.disabled,o=void 0!==i&&i,a=r.overrides,s=void 0===a?[]:a,u=t.useState(!1),p=u[0],v=u[1],h=l({children:[],renders:1});return f((function(){if(p){var n=h.children,t=h.sourceData;if(t){var r=e(n.map((function(e){return e.instance})),Object.assign({},t.props,{popperOptions:t.instance.props.popperOptions,overrides:s,plugins:[m].concat(t.props.plugins||[])}));return h.instance=r,o&&r.disable(),function(){r.destroy(),h.children=n.filter((function(e){return!e.instance.state.isDestroyed}))}}}else v(!0)}),[p]),f((function(){if(p)if(1!==h.renders){var e=h.children,n=h.instance,t=h.sourceData;if(n&&t){var r=t.props,i=(r.content,c(r,["content"]));n.setProps(d(n.props,Object.assign({},i,{overrides:s}))),n.setInstances(e.map((function(e){return e.instance}))),o?n.disable():n.enable()}}else h.renders++})),t.useMemo((function(){return[{data:h,hook:function(e){h.sourceData=e},cleanup:function(){h.sourceData=null}},{hook:function(e){h.children.find((function(n){var t=n.instance;return e.instance===t}))||h.children.push(e)},cleanup:function(e){h.children=h.children.filter((function(n){return n.instance!==e}))}}]}),[])}}var g=function(e,n){return t.forwardRef((function(r,i){var a=r.children,u=c(r,["children"]);return o.createElement(e,Object.assign({},n,u),a?t.cloneElement(a,{ref:function(e){s(i,e),s(a.ref,e)}}):null)}))},O=b(n.createSingleton),y=g(h(i));e.tippy=i,e.default=y,e.useSingleton=O,Object.defineProperty(e,"__esModule",{value:!0})}));
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("tippy.js"),require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["exports","tippy.js","react","react-dom"],n):n((e=e||self).Tippy={},e.tippy,e.React,e.ReactDOM)}(this,(function(e,n,t,r){"use strict";var i="default"in n?n.default:n,o="default"in t?t.default:t;function c(e,n){if(null==e)return{};var t,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)t=o[r],n.indexOf(t)>=0||(i[t]=e[t]);return i}var a="undefined"!=typeof window&&"undefined"!=typeof document;function s(e,n){e&&("function"==typeof e&&e(n),{}.hasOwnProperty.call(e,"current")&&(e.current=n))}function u(){return a&&document.createElement("div")}function p(e,n){var t,r,i,o,c;return Object.assign({},n,{popperOptions:Object.assign({},e.popperOptions,n.popperOptions,{modifiers:(i=[].concat((null==(t=e.popperOptions)?void 0:t.modifiers)||[],(null==(r=n.popperOptions)?void 0:r.modifiers)||[]),o=[],c=Object.create(null),i.forEach((function(e){void 0===c[JSON.stringify(e)]&&o.push(e),c[JSON.stringify(e)]=!0})),o)})})}var f=a?t.useLayoutEffect:t.useEffect;function d(e){var n=t.useRef();return n.current||(n.current="function"==typeof e?e():e),n.current}function l(e,n,t){t.split(/\s+/).forEach((function(t){t&&e.classList[n](t)}))}var v={name:"className",defaultValue:"",fn:function(e){var n=e.popper.firstElementChild,t=function(){var n;return!!(null==(n=e.props.render)?void 0:n.$$tippy)};function r(){e.props.className&&!t()||l(n,"add",e.props.className)}return{onCreate:r,onBeforeUpdate:function(){t()&&l(n,"remove",e.props.className)},onAfterUpdate:r}}};function m(e){return function(n){var i=n.children,a=n.content,l=n.visible,m=n.singleton,h=n.render,g=n.reference,b=n.disabled,O=void 0!==b&&b,y=n.ignoreAttributes,j=void 0===y||y,E=(n.__source,n.__self,c(n,["children","content","visible","singleton","render","reference","disabled","ignoreAttributes","__source","__self"])),_=void 0!==l,P=void 0!==m,S=t.useState(!1),R=S[0],w=S[1],D=t.useState({}),k=D[0],H=D[1],N=t.useState(),$=N[0],q=N[1],x=d((function(){return{container:u(),renders:1}})),A=Object.assign({ignoreAttributes:j},E,{content:x.container});_&&(A.trigger="manual",A.hideOnClick=!1),P&&(O=!0);var C=A,M=A.plugins||[];h&&(C=Object.assign({},A,{plugins:P?[].concat(M,[{fn:function(){return{onTrigger:function(e,n){var t=m.data.children.find((function(e){return e.instance.reference===n.currentTarget})).content;q(t)}}}}]):M,render:function(){return{popper:x.container}}}));var T=[g].concat(i?[i.type]:[]);return f((function(){var n=g;g&&g.hasOwnProperty("current")&&(n=g.current);var t=e(n||x.ref||u(),Object.assign({},C,{plugins:[v].concat(A.plugins||[])}));return x.instance=t,O&&t.disable(),l&&t.show(),P&&m.hook({instance:t,content:a,props:C}),w(!0),function(){t.destroy(),null==m||m.cleanup(t)}}),T),f((function(){var e;if(1!==x.renders){var n=x.instance;n.setProps(p(n.props,C)),null==(e=n.popperInstance)||e.forceUpdate(),O?n.disable():n.enable(),_&&(l?n.show():n.hide()),P&&m.hook({instance:n,content:a,props:C})}else x.renders++})),f((function(){var e;if(h){var n=x.instance;n.setProps({popperOptions:Object.assign({},n.props.popperOptions,{modifiers:[].concat(((null==(e=n.props.popperOptions)?void 0:e.modifiers)||[]).filter((function(e){return"$$tippyReact"!==e.name})),[{name:"$$tippyReact",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var n,t=e.state,r=null==(n=t.modifiersData)?void 0:n.hide;k.placement===t.placement&&k.referenceHidden===(null==r?void 0:r.isReferenceHidden)&&k.escaped===(null==r?void 0:r.hasPopperEscaped)||H({placement:t.placement,referenceHidden:null==r?void 0:r.isReferenceHidden,escaped:null==r?void 0:r.hasPopperEscaped}),t.attributes.popper={}}}])})})}}),[k.placement,k.referenceHidden,k.escaped].concat(T)),o.createElement(o.Fragment,null,i?t.cloneElement(i,{ref:function(e){x.ref=e,s(i.ref,e)}}):null,R&&r.createPortal(h?h(function(e){var n={"data-placement":e.placement};return e.referenceHidden&&(n["data-reference-hidden"]=""),e.escaped&&(n["data-escaped"]=""),n}(k),$,x.instance):a,x.container))}}function h(e){return function(n){var r=void 0===n?{}:n,i=r.disabled,o=void 0!==i&&i,a=r.overrides,s=void 0===a?[]:a,u=t.useState(!1),l=u[0],m=u[1],h=d({children:[],renders:1});return f((function(){if(l){var n=h.children,t=h.sourceData;if(t){var r=e(n.map((function(e){return e.instance})),Object.assign({},t.props,{popperOptions:t.instance.props.popperOptions,overrides:s,plugins:[v].concat(t.props.plugins||[])}));return h.instance=r,o&&r.disable(),function(){r.destroy(),h.children=n.filter((function(e){return!e.instance.state.isDestroyed}))}}}else m(!0)}),[l]),f((function(){if(l)if(1!==h.renders){var e=h.children,n=h.instance,t=h.sourceData;if(n&&t){var r=t.props,i=(r.content,c(r,["content"]));n.setProps(p(n.props,Object.assign({},i,{overrides:s}))),n.setInstances(e.map((function(e){return e.instance}))),o?n.disable():n.enable()}}else h.renders++})),t.useMemo((function(){return[{data:h,hook:function(e){h.sourceData=e},cleanup:function(){h.sourceData=null}},{hook:function(e){h.children.find((function(n){var t=n.instance;return e.instance===t}))||h.children.push(e)},cleanup:function(e){h.children=h.children.filter((function(n){return n.instance!==e}))}}]}),[])}}var g=function(e,n){return t.forwardRef((function(r,i){var a=r.children,u=c(r,["children"]);return o.createElement(e,Object.assign({},n,u),a?t.cloneElement(a,{ref:function(e){s(i,e),s(a.ref,e)}}):null)}))},b=h(n.createSingleton),O=g(m(i));e.tippy=i,e.default=O,e.useSingleton=b,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=tippy-react.umd.min.js.map

@@ -51,14 +51,12 @@ import tippy, { createSingleton } from 'tippy.js/headless';

}
function uniqueByName(arr) {
function uniqueByShape(arr) {
var output = [];
var lookup = Object.create(null);
for (var item in arr) {
if (lookup[arr[item].name] === undefined) {
output.push(arr[item]);
arr.forEach(function (item) {
if (lookup[JSON.stringify(item)] === undefined) {
output.push(item);
}
lookup[arr[item].name] = arr[item];
}
lookup[JSON.stringify(item)] = true;
});
return output;

@@ -71,3 +69,3 @@ }

popperOptions: Object.assign({}, instanceProps.popperOptions, componentProps.popperOptions, {
modifiers: uniqueByName([].concat(((_instanceProps$popper = instanceProps.popperOptions) == null ? void 0 : _instanceProps$popper.modifiers) || [], ((_componentProps$poppe = componentProps.popperOptions) == null ? void 0 : _componentProps$poppe.modifiers) || []))
modifiers: uniqueByShape([].concat(((_instanceProps$popper = instanceProps.popperOptions) == null ? void 0 : _instanceProps$popper.modifiers) || [], ((_componentProps$poppe = componentProps.popperOptions) == null ? void 0 : _componentProps$poppe.modifiers) || []))
})

@@ -74,0 +72,0 @@ });

@@ -55,14 +55,12 @@ (function (global, factory) {

}
function uniqueByName(arr) {
function uniqueByShape(arr) {
var output = [];
var lookup = Object.create(null);
for (var item in arr) {
if (lookup[arr[item].name] === undefined) {
output.push(arr[item]);
arr.forEach(function (item) {
if (lookup[JSON.stringify(item)] === undefined) {
output.push(item);
}
lookup[arr[item].name] = arr[item];
}
lookup[JSON.stringify(item)] = true;
});
return output;

@@ -75,3 +73,3 @@ }

popperOptions: Object.assign({}, instanceProps.popperOptions, componentProps.popperOptions, {
modifiers: uniqueByName([].concat(((_instanceProps$popper = instanceProps.popperOptions) == null ? void 0 : _instanceProps$popper.modifiers) || [], ((_componentProps$poppe = componentProps.popperOptions) == null ? void 0 : _componentProps$poppe.modifiers) || []))
modifiers: uniqueByShape([].concat(((_instanceProps$popper = instanceProps.popperOptions) == null ? void 0 : _instanceProps$popper.modifiers) || [], ((_componentProps$poppe = componentProps.popperOptions) == null ? void 0 : _componentProps$poppe.modifiers) || []))
})

@@ -78,0 +76,0 @@ });

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

!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("tippy.js/headless"),require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["exports","tippy.js/headless","react","react-dom"],n):n((e=e||self).Tippy={},e.tippy,e.React,e.ReactDOM)}(this,(function(e,n,t,r){"use strict";var i="default"in n?n.default:n,o="default"in t?t.default:t;function c(e,n){if(null==e)return{};var t,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)t=o[r],n.indexOf(t)>=0||(i[t]=e[t]);return i}var a="undefined"!=typeof window&&"undefined"!=typeof document;function s(e,n){e&&("function"==typeof e&&e(n),{}.hasOwnProperty.call(e,"current")&&(e.current=n))}function u(){return a&&document.createElement("div")}function p(e){var n=[],t=Object.create(null);for(var r in e)void 0===t[e[r].name]&&n.push(e[r]),t[e[r].name]=e[r];return n}function d(e,n){var t,r;return Object.assign({},n,{popperOptions:Object.assign({},e.popperOptions,n.popperOptions,{modifiers:p([].concat((null==(t=e.popperOptions)?void 0:t.modifiers)||[],(null==(r=n.popperOptions)?void 0:r.modifiers)||[]))})})}var f=a?t.useLayoutEffect:t.useEffect;function l(e){var n=t.useRef();return n.current||(n.current="function"==typeof e?e():e),n.current}function v(e,n,t){t.split(/\s+/).forEach((function(t){t&&e.classList[n](t)}))}var m={name:"className",defaultValue:"",fn:function(e){var n=e.popper.firstElementChild,t=function(){var n;return!!(null==(n=e.props.render)?void 0:n.$$tippy)};function r(){e.props.className&&!t()||v(n,"add",e.props.className)}return{onCreate:r,onBeforeUpdate:function(){t()&&v(n,"remove",e.props.className)},onAfterUpdate:r}}};function h(e){return function(n){var i=n.children,a=n.content,p=n.visible,v=n.singleton,h=n.render,b=n.reference,g=n.disabled,O=void 0!==g&&g,y=n.ignoreAttributes,j=void 0===y||y,E=(n.__source,n.__self,c(n,["children","content","visible","singleton","render","reference","disabled","ignoreAttributes","__source","__self"])),_=void 0!==p,P=void 0!==v,R=t.useState(!1),w=R[0],D=R[1],S=t.useState({}),k=S[0],H=S[1],$=t.useState(),q=$[0],x=$[1],A=l((function(){return{container:u(),renders:1}})),N=Object.assign({ignoreAttributes:j},E,{content:A.container});_&&(N.trigger="manual",N.hideOnClick=!1),P&&(O=!0);var C=N,M=N.plugins||[];h&&(C=Object.assign({},N,{plugins:P?[].concat(M,[{fn:function(){return{onTrigger:function(e,n){var t=v.data.children.find((function(e){return e.instance.reference===n.currentTarget})).content;x(t)}}}}]):M,render:function(){return{popper:A.container}}}));var T=[b].concat(i?[i.type]:[]);return f((function(){var n=b;b&&b.hasOwnProperty("current")&&(n=b.current);var t=e(n||A.ref||u(),Object.assign({},C,{plugins:[m].concat(N.plugins||[])}));return A.instance=t,O&&t.disable(),p&&t.show(),P&&v.hook({instance:t,content:a,props:C}),D(!0),function(){t.destroy(),null==v||v.cleanup(t)}}),T),f((function(){var e;if(1!==A.renders){var n=A.instance;n.setProps(d(n.props,C)),null==(e=n.popperInstance)||e.forceUpdate(),O?n.disable():n.enable(),_&&(p?n.show():n.hide()),P&&v.hook({instance:n,content:a,props:C})}else A.renders++})),f((function(){var e;if(h){var n=A.instance;n.setProps({popperOptions:Object.assign({},n.props.popperOptions,{modifiers:[].concat(((null==(e=n.props.popperOptions)?void 0:e.modifiers)||[]).filter((function(e){return"$$tippyReact"!==e.name})),[{name:"$$tippyReact",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var n,t=e.state,r=null==(n=t.modifiersData)?void 0:n.hide;k.placement===t.placement&&k.referenceHidden===(null==r?void 0:r.isReferenceHidden)&&k.escaped===(null==r?void 0:r.hasPopperEscaped)||H({placement:t.placement,referenceHidden:null==r?void 0:r.isReferenceHidden,escaped:null==r?void 0:r.hasPopperEscaped}),t.attributes.popper={}}}])})})}}),[k.placement,k.referenceHidden,k.escaped].concat(T)),o.createElement(o.Fragment,null,i?t.cloneElement(i,{ref:function(e){A.ref=e,s(i.ref,e)}}):null,w&&r.createPortal(h?h(function(e){var n={"data-placement":e.placement};return e.referenceHidden&&(n["data-reference-hidden"]=""),e.escaped&&(n["data-escaped"]=""),n}(k),q,A.instance):a,A.container))}}function b(e){return function(n){var r=void 0===n?{}:n,i=r.disabled,o=void 0!==i&&i,a=r.overrides,s=void 0===a?[]:a,u=t.useState(!1),p=u[0],v=u[1],h=l({children:[],renders:1});return f((function(){if(p){var n=h.children,t=h.sourceData;if(t){var r=e(n.map((function(e){return e.instance})),Object.assign({},t.props,{popperOptions:t.instance.props.popperOptions,overrides:s,plugins:[m].concat(t.props.plugins||[])}));return h.instance=r,o&&r.disable(),function(){r.destroy(),h.children=n.filter((function(e){return!e.instance.state.isDestroyed}))}}}else v(!0)}),[p]),f((function(){if(p)if(1!==h.renders){var e=h.children,n=h.instance,t=h.sourceData;if(n&&t){var r=t.props,i=(r.content,c(r,["content"]));n.setProps(d(n.props,Object.assign({},i,{overrides:s}))),n.setInstances(e.map((function(e){return e.instance}))),o?n.disable():n.enable()}}else h.renders++})),t.useMemo((function(){return[{data:h,hook:function(e){h.sourceData=e},cleanup:function(){h.sourceData=null}},{hook:function(e){h.children.find((function(n){var t=n.instance;return e.instance===t}))||h.children.push(e)},cleanup:function(e){h.children=h.children.filter((function(n){return n.instance!==e}))}}]}),[])}}var g=function(e,n){return t.forwardRef((function(r,i){var a=r.children,u=c(r,["children"]);return o.createElement(e,Object.assign({},n,u),a?t.cloneElement(a,{ref:function(e){s(i,e),s(a.ref,e)}}):null)}))},O=b(n.createSingleton),y=g(h(i),{render:function(){return""}});e.tippy=i,e.default=y,e.useSingleton=O,Object.defineProperty(e,"__esModule",{value:!0})}));
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("tippy.js/headless"),require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["exports","tippy.js/headless","react","react-dom"],n):n((e=e||self).Tippy={},e.tippy,e.React,e.ReactDOM)}(this,(function(e,n,t,r){"use strict";var i="default"in n?n.default:n,o="default"in t?t.default:t;function c(e,n){if(null==e)return{};var t,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)t=o[r],n.indexOf(t)>=0||(i[t]=e[t]);return i}var s="undefined"!=typeof window&&"undefined"!=typeof document;function a(e,n){e&&("function"==typeof e&&e(n),{}.hasOwnProperty.call(e,"current")&&(e.current=n))}function u(){return s&&document.createElement("div")}function p(e,n){var t,r,i,o,c;return Object.assign({},n,{popperOptions:Object.assign({},e.popperOptions,n.popperOptions,{modifiers:(i=[].concat((null==(t=e.popperOptions)?void 0:t.modifiers)||[],(null==(r=n.popperOptions)?void 0:r.modifiers)||[]),o=[],c=Object.create(null),i.forEach((function(e){void 0===c[JSON.stringify(e)]&&o.push(e),c[JSON.stringify(e)]=!0})),o)})})}var d=s?t.useLayoutEffect:t.useEffect;function f(e){var n=t.useRef();return n.current||(n.current="function"==typeof e?e():e),n.current}function l(e,n,t){t.split(/\s+/).forEach((function(t){t&&e.classList[n](t)}))}var v={name:"className",defaultValue:"",fn:function(e){var n=e.popper.firstElementChild,t=function(){var n;return!!(null==(n=e.props.render)?void 0:n.$$tippy)};function r(){e.props.className&&!t()||l(n,"add",e.props.className)}return{onCreate:r,onBeforeUpdate:function(){t()&&l(n,"remove",e.props.className)},onAfterUpdate:r}}};function m(e){return function(n){var i=n.children,s=n.content,l=n.visible,m=n.singleton,h=n.render,g=n.reference,b=n.disabled,O=void 0!==b&&b,y=n.ignoreAttributes,j=void 0===y||y,E=(n.__source,n.__self,c(n,["children","content","visible","singleton","render","reference","disabled","ignoreAttributes","__source","__self"])),_=void 0!==l,P=void 0!==m,S=t.useState(!1),R=S[0],w=S[1],D=t.useState({}),k=D[0],H=D[1],N=t.useState(),$=N[0],q=N[1],x=f((function(){return{container:u(),renders:1}})),A=Object.assign({ignoreAttributes:j},E,{content:x.container});_&&(A.trigger="manual",A.hideOnClick=!1),P&&(O=!0);var C=A,M=A.plugins||[];h&&(C=Object.assign({},A,{plugins:P?[].concat(M,[{fn:function(){return{onTrigger:function(e,n){var t=m.data.children.find((function(e){return e.instance.reference===n.currentTarget})).content;q(t)}}}}]):M,render:function(){return{popper:x.container}}}));var T=[g].concat(i?[i.type]:[]);return d((function(){var n=g;g&&g.hasOwnProperty("current")&&(n=g.current);var t=e(n||x.ref||u(),Object.assign({},C,{plugins:[v].concat(A.plugins||[])}));return x.instance=t,O&&t.disable(),l&&t.show(),P&&m.hook({instance:t,content:s,props:C}),w(!0),function(){t.destroy(),null==m||m.cleanup(t)}}),T),d((function(){var e;if(1!==x.renders){var n=x.instance;n.setProps(p(n.props,C)),null==(e=n.popperInstance)||e.forceUpdate(),O?n.disable():n.enable(),_&&(l?n.show():n.hide()),P&&m.hook({instance:n,content:s,props:C})}else x.renders++})),d((function(){var e;if(h){var n=x.instance;n.setProps({popperOptions:Object.assign({},n.props.popperOptions,{modifiers:[].concat(((null==(e=n.props.popperOptions)?void 0:e.modifiers)||[]).filter((function(e){return"$$tippyReact"!==e.name})),[{name:"$$tippyReact",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var n,t=e.state,r=null==(n=t.modifiersData)?void 0:n.hide;k.placement===t.placement&&k.referenceHidden===(null==r?void 0:r.isReferenceHidden)&&k.escaped===(null==r?void 0:r.hasPopperEscaped)||H({placement:t.placement,referenceHidden:null==r?void 0:r.isReferenceHidden,escaped:null==r?void 0:r.hasPopperEscaped}),t.attributes.popper={}}}])})})}}),[k.placement,k.referenceHidden,k.escaped].concat(T)),o.createElement(o.Fragment,null,i?t.cloneElement(i,{ref:function(e){x.ref=e,a(i.ref,e)}}):null,R&&r.createPortal(h?h(function(e){var n={"data-placement":e.placement};return e.referenceHidden&&(n["data-reference-hidden"]=""),e.escaped&&(n["data-escaped"]=""),n}(k),$,x.instance):s,x.container))}}function h(e){return function(n){var r=void 0===n?{}:n,i=r.disabled,o=void 0!==i&&i,s=r.overrides,a=void 0===s?[]:s,u=t.useState(!1),l=u[0],m=u[1],h=f({children:[],renders:1});return d((function(){if(l){var n=h.children,t=h.sourceData;if(t){var r=e(n.map((function(e){return e.instance})),Object.assign({},t.props,{popperOptions:t.instance.props.popperOptions,overrides:a,plugins:[v].concat(t.props.plugins||[])}));return h.instance=r,o&&r.disable(),function(){r.destroy(),h.children=n.filter((function(e){return!e.instance.state.isDestroyed}))}}}else m(!0)}),[l]),d((function(){if(l)if(1!==h.renders){var e=h.children,n=h.instance,t=h.sourceData;if(n&&t){var r=t.props,i=(r.content,c(r,["content"]));n.setProps(p(n.props,Object.assign({},i,{overrides:a}))),n.setInstances(e.map((function(e){return e.instance}))),o?n.disable():n.enable()}}else h.renders++})),t.useMemo((function(){return[{data:h,hook:function(e){h.sourceData=e},cleanup:function(){h.sourceData=null}},{hook:function(e){h.children.find((function(n){var t=n.instance;return e.instance===t}))||h.children.push(e)},cleanup:function(e){h.children=h.children.filter((function(n){return n.instance!==e}))}}]}),[])}}var g=function(e,n){return t.forwardRef((function(r,i){var s=r.children,u=c(r,["children"]);return o.createElement(e,Object.assign({},n,u),s?t.cloneElement(s,{ref:function(e){a(i,e),a(s.ref,e)}}):null)}))},b=h(n.createSingleton),O=g(m(i),{render:function(){return""}});e.tippy=i,e.default=O,e.useSingleton=b,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=tippy-react-headless.umd.min.js.map
{
"name": "@tippyjs/react",
"version": "4.2.3",
"version": "4.2.4",
"description": "React component for Tippy.js",

@@ -5,0 +5,0 @@ "main": "dist/tippy-react.umd.js",

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

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