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

react-point

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-point - npm Package Compare versions

Comparing version 2.0.1 to 2.1.0

13

lib/index.js
'use strict';
exports.__esModule = true;
exports.PointTarget = undefined;
var _PointTarget = require('./PointTarget');
var _PointTarget2 = require('./PointTarget');
var _PointTarget2 = _interopRequireDefault(_PointTarget);
var _PointTarget3 = _interopRequireDefault(_PointTarget2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.PointTarget = _PointTarget3.default;
// TODO: Remove in next major release.
_PointTarget2.default.PointTarget = _PointTarget2.default; /* eslint-env node */
module.exports = _PointTarget2.default;
{
"name": "react-point",
"version": "2.0.1",
"version": "2.1.0",
"description": "A minimal click/tap component for React",

@@ -47,3 +47,3 @@ "repository": "ReactTraining/react-point",

"karma-webpack": "^1.7.0",
"mocha": "^2.5.3",
"mocha": "^3.0.0",
"pretty-bytes": "^3.0.1",

@@ -50,0 +50,0 @@ "react": "^15.3.0",

@@ -59,13 +59,14 @@ (function webpackUniversalModuleDefinition(root, factory) {

exports.__esModule = true;
exports.PointTarget = undefined;
var _PointTarget = __webpack_require__(1);
var _PointTarget2 = __webpack_require__(1);
var _PointTarget2 = _interopRequireDefault(_PointTarget);
var _PointTarget3 = _interopRequireDefault(_PointTarget2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.PointTarget = _PointTarget3.default;
// TODO: Remove in next major release.
_PointTarget2.default.PointTarget = _PointTarget2.default; /* eslint-env node */
module.exports = _PointTarget2.default;
/***/ },

@@ -72,0 +73,0 @@ /* 1 */

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

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):"object"==typeof exports?exports.ReactPoint=e(require("react")):t.ReactPoint=e(t.React)}(this,function(t){return function(t){function e(n){if(o[n])return o[n].exports;var r=o[n]={exports:{},id:n,loaded:!1};return t[n].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var o={};return e.m=t,e.c=o,e.p="",e(0)}([function(t,e,o){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0,e.PointTarget=void 0;var r=o(1),u=n(r);e.PointTarget=u["default"]},function(t,e,o){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(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 c(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)}e.__esModule=!0;var a=o(2),i=n(a),l=function(t){return t.touches[0].clientX},s=function(t){return t.touches[0].clientY},p=function(t){function e(){var o,n,c;r(this,e);for(var a=arguments.length,i=Array(a),p=0;p<a;p++)i[p]=arguments[p];return o=n=u(this,t.call.apply(t,[this].concat(i))),n.handleClick=function(){!n.usingTouch&&n.props.onPoint&&n.props.onPoint()},n.handleTouchStart=function(t){n.usingTouch=!0,n.touchStarted||(n.touchStarted=!0,n.touchMoved=!1,n.startX=l(t),n.startY=s(t))},n.handleTouchMove=function(t){if(!n.touchMoved){var e=n.props.tolerance;n.touchMoved=Math.abs(n.startX-l(t))>e||Math.abs(n.startY-s(t))>e}},n.handleTouchCancel=function(){n.touchStarted=n.touchMoved=!1,n.startX=n.startY=0},n.handleTouchEnd=function(){n.touchStarted=!1,!n.touchMoved&&n.props.onPoint&&n.props.onPoint()},c=o,u(n,c)}return c(e,t),e.prototype.componentWillMount=function(){this.usingTouch=!1},e.prototype.render=function(){var t=this.props.children,e=t?i["default"].Children.only(t):i["default"].createElement("button",null);return i["default"].cloneElement(e,{onClick:this.handleClick,onTouchStart:this.handleTouchStart,onTouchMove:this.handleTouchMove,onTouchCancel:this.handleTouchCancel,onTouchEnd:this.handleTouchEnd})},e}(i["default"].Component);p.propTypes={children:a.PropTypes.node,tolerance:a.PropTypes.number,onPoint:a.PropTypes.func},p.defaultProps={tolerance:10},e["default"]=p},function(e,o){e.exports=t}])});
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):"object"==typeof exports?exports.ReactPoint=e(require("react")):t.ReactPoint=e(t.React)}(this,function(t){return function(t){function e(n){if(o[n])return o[n].exports;var r=o[n]={exports:{},id:n,loaded:!1};return t[n].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var o={};return e.m=t,e.c=o,e.p="",e(0)}([function(t,e,o){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}var r=o(1),u=n(r);u["default"].PointTarget=u["default"],t.exports=u["default"]},function(t,e,o){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(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 c(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)}e.__esModule=!0;var a=o(2),i=n(a),l=function(t){return t.touches[0].clientX},s=function(t){return t.touches[0].clientY},f=function(t){function e(){var o,n,c;r(this,e);for(var a=arguments.length,i=Array(a),f=0;f<a;f++)i[f]=arguments[f];return o=n=u(this,t.call.apply(t,[this].concat(i))),n.handleClick=function(){!n.usingTouch&&n.props.onPoint&&n.props.onPoint()},n.handleTouchStart=function(t){n.usingTouch=!0,n.touchStarted||(n.touchStarted=!0,n.touchMoved=!1,n.startX=l(t),n.startY=s(t))},n.handleTouchMove=function(t){if(!n.touchMoved){var e=n.props.tolerance;n.touchMoved=Math.abs(n.startX-l(t))>e||Math.abs(n.startY-s(t))>e}},n.handleTouchCancel=function(){n.touchStarted=n.touchMoved=!1,n.startX=n.startY=0},n.handleTouchEnd=function(){n.touchStarted=!1,!n.touchMoved&&n.props.onPoint&&n.props.onPoint()},c=o,u(n,c)}return c(e,t),e.prototype.componentWillMount=function(){this.usingTouch=!1},e.prototype.render=function(){var t=this.props.children,e=t?i["default"].Children.only(t):i["default"].createElement("button",null);return i["default"].cloneElement(e,{onClick:this.handleClick,onTouchStart:this.handleTouchStart,onTouchMove:this.handleTouchMove,onTouchCancel:this.handleTouchCancel,onTouchEnd:this.handleTouchEnd})},e}(i["default"].Component);f.propTypes={children:a.PropTypes.node,tolerance:a.PropTypes.number,onPoint:a.PropTypes.func},f.defaultProps={tolerance:10},e["default"]=f},function(e,o){e.exports=t}])});
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