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

react-hint

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

react-hint - npm Package Compare versions

Comparing version 2.0.2 to 2.0.3

2

lib/index.js

@@ -127,2 +127,3 @@ 'use strict';

document.addEventListener('mouseover', this.mouseOver);
document.addEventListener('touchstart', this.mouseOver);
};

@@ -132,2 +133,3 @@

document.removeEventListener('mouseover', this.mouseOver);
document.removeEventListener('touchstart', this.mouseOver);
clearTimeout(this._timeout);

@@ -134,0 +136,0 @@ };

2

package.json
{
"name": "react-hint",
"version": "2.0.2",
"version": "2.0.3",
"license": "MIT",

@@ -5,0 +5,0 @@ "description": "Tooltip component for React, Preact, Inferno",

@@ -16,2 +16,3 @@ export const ReactHintFactory = ({Component, createElement}) =>

document.addEventListener('mouseover', this.mouseOver)
document.addEventListener('touchstart', this.mouseOver)
}

@@ -21,2 +22,3 @@

document.removeEventListener('mouseover', this.mouseOver)
document.removeEventListener('touchstart', this.mouseOver)
clearTimeout(this._timeout)

@@ -23,0 +25,0 @@ }

/*!
* react-hint v2.0.2 - https://react-hint.js.org
* react-hint v2.0.3 - https://react-hint.js.org
* MIT Licensed

@@ -216,2 +216,3 @@ */

document.addEventListener('mouseover', this.mouseOver);
document.addEventListener('touchstart', this.mouseOver);
};

@@ -221,2 +222,3 @@

document.removeEventListener('mouseover', this.mouseOver);
document.removeEventListener('touchstart', this.mouseOver);
clearTimeout(this._timeout);

@@ -223,0 +225,0 @@ };

/*!
* react-hint v2.0.2 - https://react-hint.js.org
* react-hint v2.0.3 - https://react-hint.js.org
* MIT Licensed
*/
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ReactHintFactory=e():t.ReactHintFactory=e()}(this,function(){return function(t){function e(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,o){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:o})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=0)}([function(t,e,n){t.exports=n(1)},function(t,e,n){"use strict";function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),n.d(e,"ReactHintFactory",function(){return u});var u=function(t){var e,n,u=t.Component,a=t.createElement;return n=e=function(t){function e(){var n,i,u;o(this,e);for(var c=arguments.length,s=Array(c),f=0;f<c;f++)s[f]=arguments[f];return n=i=r(this,t.call.apply(t,[this].concat(s))),i.state={target:null},i.shouldComponentUpdate=function(t,e){return!i.shallowEqual(e,i.state)||!i.shallowEqual(t,i.props)},i.shallowEqual=function(t,e){var n=Object.keys(t);return n.length===Object.keys(e).length&&n.reduce(function(n,o){return n&&("function"==typeof t[o]||t[o]===e[o])},!0)},i.findHint=function(t){for(var e=i.props,n=e.attribute,o=e.hover,r=i.state.target;t&&t!==document;){if(o&&t===i._hint)return r;if(t.hasAttribute(n))return t;t=t.parentNode}return null},i.getHintData=function(t,e){var n=t.target,o=e.attribute,r=e.position,u=n.getAttribute(o)||"",a=n.getAttribute(o+"-at")||r,c=i._container.getBoundingClientRect(),s=c.top,f=c.left,l=i._hint.getBoundingClientRect(),p=l.width,d=l.height,h=n.getBoundingClientRect(),m=h.top,y=h.left,v=h.width,b=h.height,g=void 0,_=void 0;switch(a){case"left":g=b-d>>1,_=-p;break;case"right":g=b-d>>1,_=v;break;case"bottom":g=b,_=v-p>>1;break;case"top":default:g=-d,_=v-p>>1}return{content:u,at:a,top:g+m-s,left:_+y-f}},i.mouseOver=function(t){var e=t.target,n=i.props,o=n.delay;n.events&&(clearTimeout(i._timeout),i._timeout=setTimeout(function(){return i.setState(function(){return{target:i.findHint(e)}})},o))},i.renderContent=function(t){if("#"===String(t)[0]){var e=document.getElementById(t.slice(1));if(e)return a("div",{dangerouslySetInnerHTML:{__html:e.innerHTML}})}return t},u=n,r(i,u)}return i(e,t),e.prototype.componentDidMount=function(){document.addEventListener("mouseover",this.mouseOver)},e.prototype.componentWillUnmount=function(){document.removeEventListener("mouseover",this.mouseOver),clearTimeout(this._timeout)},e.prototype.componentDidUpdate=function(){this.state.target&&this.setState(this.getHintData)},e.prototype.render=function(){var t=this,e=this.props.className,n=this.state,o=n.target,r=n.content,i=n.at,u=n.top,c=n.left;return a("div",{ref:function(e){return t._container=e},style:{position:"relative"}},o&&a("div",{className:e+" "+e+"--"+i,ref:function(e){return t._hint=e},style:{top:u,left:c}},a("div",{className:e+"__content"},this.renderContent(r))))},e}(u),e.defaultProps={attribute:"data-rh",className:"react-hint",delay:0,events:!1,hover:!1,position:"top"},n}}])});
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ReactHintFactory=e():t.ReactHintFactory=e()}(this,function(){return function(t){function e(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,o){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:o})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=0)}([function(t,e,n){t.exports=n(1)},function(t,e,n){"use strict";function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),n.d(e,"ReactHintFactory",function(){return u});var u=function(t){var e,n,u=t.Component,a=t.createElement;return n=e=function(t){function e(){var n,i,u;o(this,e);for(var c=arguments.length,s=Array(c),f=0;f<c;f++)s[f]=arguments[f];return n=i=r(this,t.call.apply(t,[this].concat(s))),i.state={target:null},i.shouldComponentUpdate=function(t,e){return!i.shallowEqual(e,i.state)||!i.shallowEqual(t,i.props)},i.shallowEqual=function(t,e){var n=Object.keys(t);return n.length===Object.keys(e).length&&n.reduce(function(n,o){return n&&("function"==typeof t[o]||t[o]===e[o])},!0)},i.findHint=function(t){for(var e=i.props,n=e.attribute,o=e.hover,r=i.state.target;t&&t!==document;){if(o&&t===i._hint)return r;if(t.hasAttribute(n))return t;t=t.parentNode}return null},i.getHintData=function(t,e){var n=t.target,o=e.attribute,r=e.position,u=n.getAttribute(o)||"",a=n.getAttribute(o+"-at")||r,c=i._container.getBoundingClientRect(),s=c.top,f=c.left,l=i._hint.getBoundingClientRect(),p=l.width,d=l.height,h=n.getBoundingClientRect(),m=h.top,v=h.left,y=h.width,b=h.height,g=void 0,_=void 0;switch(a){case"left":g=b-d>>1,_=-p;break;case"right":g=b-d>>1,_=y;break;case"bottom":g=b,_=y-p>>1;break;case"top":default:g=-d,_=y-p>>1}return{content:u,at:a,top:g+m-s,left:_+v-f}},i.mouseOver=function(t){var e=t.target,n=i.props,o=n.delay;n.events&&(clearTimeout(i._timeout),i._timeout=setTimeout(function(){return i.setState(function(){return{target:i.findHint(e)}})},o))},i.renderContent=function(t){if("#"===String(t)[0]){var e=document.getElementById(t.slice(1));if(e)return a("div",{dangerouslySetInnerHTML:{__html:e.innerHTML}})}return t},u=n,r(i,u)}return i(e,t),e.prototype.componentDidMount=function(){document.addEventListener("mouseover",this.mouseOver),document.addEventListener("touchstart",this.mouseOver)},e.prototype.componentWillUnmount=function(){document.removeEventListener("mouseover",this.mouseOver),document.removeEventListener("touchstart",this.mouseOver),clearTimeout(this._timeout)},e.prototype.componentDidUpdate=function(){this.state.target&&this.setState(this.getHintData)},e.prototype.render=function(){var t=this,e=this.props.className,n=this.state,o=n.target,r=n.content,i=n.at,u=n.top,c=n.left;return a("div",{ref:function(e){return t._container=e},style:{position:"relative"}},o&&a("div",{className:e+" "+e+"--"+i,ref:function(e){return t._hint=e},style:{top:u,left:c}},a("div",{className:e+"__content"},this.renderContent(r))))},e}(u),e.defaultProps={attribute:"data-rh",className:"react-hint",delay:0,events:!1,hover:!1,position:"top"},n}}])});
//# sourceMappingURL=react-hint.min.js.map

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