react-stickerpipe
Advanced tools
Comparing version 2.0.0 to 3.0.0
@@ -1,2 +0,2 @@ | ||
"use strict"; | ||
'use strict'; | ||
@@ -7,6 +7,10 @@ Object.defineProperty(exports, "__esModule", { | ||
var _react = require("react"); | ||
var _react = require('react'); | ||
var _react2 = _interopRequireDefault(_react); | ||
var _propTypes = require('prop-types'); | ||
var _propTypes2 = _interopRequireDefault(_propTypes); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -18,8 +22,8 @@ | ||
return _react2.default.createElement( | ||
"svg", | ||
{ width: "24px", height: "24px", viewBox: "0 0 24 24" }, | ||
'svg', | ||
{ width: '24px', height: '24px', viewBox: '0 0 24 24' }, | ||
_react2.default.createElement( | ||
"g", | ||
{ id: "icon-purchase", transform: "translate(5.000000, 5.000000)", fill: color }, | ||
_react2.default.createElement("polygon", { id: "Shape", points: "14 8 8 8 8 14 6 14 6 8 0 8 0 6 6 6 6 0 8 0 8 6 14 6" }) | ||
'g', | ||
{ id: 'icon-purchase', transform: 'translate(5.000000, 5.000000)', fill: color }, | ||
_react2.default.createElement('polygon', { id: 'Shape', points: '14 8 8 8 8 14 6 14 6 8 0 8 0 6 6 6 6 0 8 0 8 6 14 6' }) | ||
) | ||
@@ -30,3 +34,3 @@ ); | ||
IconPurchase.propTypes = { | ||
color: _react2.default.PropTypes.string | ||
color: _propTypes2.default.string | ||
}; | ||
@@ -39,2 +43,2 @@ | ||
exports.default = IconPurchase; | ||
module.exports = exports["default"]; | ||
module.exports = exports['default']; |
@@ -84,5 +84,5 @@ 'use strict'; | ||
})).isRequired, | ||
showPack: _react2.default.PropTypes.func.isRequired, | ||
toggleShop: _react2.default.PropTypes.func.isRequired, | ||
shop: _react2.default.PropTypes.bool.isRequired, | ||
showPack: _propTypes2.default.func.isRequired, | ||
toggleShop: _propTypes2.default.func.isRequired, | ||
shop: _propTypes2.default.bool.isRequired, | ||
colors: _propTypes2.default.shape({ | ||
@@ -89,0 +89,0 @@ primary: _propTypes2.default.string.isRequired |
@@ -7,2 +7,4 @@ 'use strict'; | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
@@ -18,2 +20,6 @@ | ||
var _reactOnclickoutside = require('react-onclickoutside'); | ||
var _reactOnclickoutside2 = _interopRequireDefault(_reactOnclickoutside); | ||
var _client = require('./client'); | ||
@@ -49,2 +55,4 @@ | ||
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
@@ -65,2 +73,9 @@ | ||
_this.handleClickOutside = function () { | ||
var hideMenu = _this.props.hideMenu; | ||
hideMenu(); | ||
}; | ||
_this.state = { | ||
@@ -191,3 +206,15 @@ stickerPacks: [], | ||
toggleButton = _props.toggleButton, | ||
colors = _props.colors; | ||
colors = _props.colors, | ||
open = _props.open, | ||
eventTypes = _props.eventTypes, | ||
outsideClickIgnoreClass = _props.outsideClickIgnoreClass, | ||
preventDefault = _props.preventDefault, | ||
stopPropagation = _props.stopPropagation, | ||
disableOnClickOutside = _props.disableOnClickOutside, | ||
enableOnClickOutside = _props.enableOnClickOutside, | ||
hideMenu = _props.hideMenu, | ||
apiKey = _props.apiKey, | ||
userId = _props.userId, | ||
custom = _objectWithoutProperties(_props, ['sendSticker', 'toggleButton', 'colors', 'open', 'eventTypes', 'outsideClickIgnoreClass', 'preventDefault', 'stopPropagation', 'disableOnClickOutside', 'enableOnClickOutside', 'hideMenu', 'apiKey', 'userId']); | ||
var _state = this.state, | ||
@@ -199,2 +226,6 @@ stickerPacks = _state.stickerPacks, | ||
if (!open) { | ||
return false; | ||
} | ||
var mergedColors = Object.assign(_defaultColors2.default, colors); | ||
@@ -204,3 +235,3 @@ | ||
'section', | ||
{ className: 'sticker-menu' }, | ||
_extends({ className: 'sticker-menu' }, custom), | ||
toggleButton ? _react2.default.createElement( | ||
@@ -231,11 +262,16 @@ 'header', | ||
sendSticker: _propTypes2.default.func.isRequired, | ||
toggleButton: _react2.default.PropTypes.element, | ||
toggleButton: _propTypes2.default.element, | ||
colors: _propTypes2.default.shape({ | ||
primary: _propTypes2.default.string, | ||
secondary: _propTypes2.default.string | ||
}) | ||
}), | ||
/** Toggle the StickerMenu's visibility */ | ||
open: _propTypes2.default.bool, | ||
/** Function to hide the menu */ | ||
hideMenu: _propTypes2.default.func.isRequired | ||
}; | ||
StickerMenu.defaultProps = { | ||
colors: _defaultColors2.default, | ||
toggleButton: null | ||
toggleButton: null, | ||
open: false | ||
}; | ||
@@ -252,3 +288,3 @@ StickerMenu.childContextTypes = { | ||
}; | ||
exports.default = StickerMenu; | ||
exports.default = (0, _reactOnclickoutside2.default)(StickerMenu); | ||
module.exports = exports['default']; |
{ | ||
"name": "react-stickerpipe", | ||
"version": "2.0.0", | ||
"version": "3.0.0", | ||
"description": "React Component for StickerPipe API", | ||
@@ -76,2 +76,3 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"react-onclickoutside": "^6.1.1", | ||
"superagent": "^3.0.0" | ||
@@ -78,0 +79,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
42519
907
4
+ Addedreact-onclickoutside@^6.1.1
+ Addedreact@18.3.1(transitive)
+ Addedreact-dom@18.3.1(transitive)
+ Addedreact-onclickoutside@6.13.1(transitive)
+ Addedscheduler@0.23.2(transitive)