@eaze/copy-to-clipboard
Advanced tools
Comparing version 1.0.2 to 1.0.3-alpha.0
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -6,51 +6,62 @@ Object.defineProperty(exports, "__esModule", { | ||
}); | ||
exports["default"] = void 0; | ||
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; }; }(); | ||
var _styledBase = _interopRequireDefault(require("@emotion/styled-base")); | ||
var _react = require('react'); | ||
var _react = _interopRequireWildcard(require("react")); | ||
var _react2 = _interopRequireDefault(_react); | ||
var _copyToClipboard = _interopRequireDefault(require("copy-to-clipboard")); | ||
var _copyToClipboard = require('copy-to-clipboard'); | ||
var _propTypes = _interopRequireDefault(require("prop-types")); | ||
var _copyToClipboard2 = _interopRequireDefault(_copyToClipboard); | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } } | ||
var _propTypes = require('prop-types'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
var _propTypes2 = _interopRequireDefault(_propTypes); | ||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
var _reactEmotion = require('react-emotion'); | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
var _reactEmotion2 = _interopRequireDefault(_reactEmotion); | ||
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); } } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } | ||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** | ||
* Invite link is a special button that copies its own value into the memory when clicked as the user selected its content and copied it | ||
*/ | ||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
var CopyToClipboard = function (_PureComponent) { | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } | ||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
var CopyToClipboard = | ||
/*#__PURE__*/ | ||
function (_PureComponent) { | ||
_inherits(CopyToClipboard, _PureComponent); | ||
function CopyToClipboard() { | ||
var _ref; | ||
var _getPrototypeOf2; | ||
var _temp, _this, _ret; | ||
var _this; | ||
_classCallCheck(this, CopyToClipboard); | ||
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | ||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | ||
args[_key] = arguments[_key]; | ||
} | ||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = CopyToClipboard.__proto__ || Object.getPrototypeOf(CopyToClipboard)).call.apply(_ref, [this].concat(args))), _this), _this.state = { | ||
_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(CopyToClipboard)).call.apply(_getPrototypeOf2, [this].concat(args))); | ||
_defineProperty(_assertThisInitialized(_this), "state", { | ||
copied: false, | ||
confirmationVisible: false | ||
}, _this.copyLink = function () { | ||
(0, _copyToClipboard2.default)(_this.props.value); | ||
}); | ||
_defineProperty(_assertThisInitialized(_this), "copyLink", function () { | ||
(0, _copyToClipboard["default"])(_this.props.value); | ||
_this.setState({ | ||
@@ -66,27 +77,20 @@ copied: true, | ||
}, 2000); | ||
}, _temp), _possibleConstructorReturn(_this, _ret); | ||
}); | ||
return _this; | ||
} | ||
_createClass(CopyToClipboard, [{ | ||
key: 'render', | ||
key: "render", | ||
value: function render() { | ||
var _props = this.props, | ||
buttonStyle = _props.buttonStyle, | ||
copiedText = _props.copiedText, | ||
value = _props.value; | ||
return _react2.default.createElement( | ||
Container, | ||
null, | ||
_react2.default.createElement( | ||
'label', | ||
{ htmlFor: 'referralInput', onClick: this.copyLink }, | ||
_react2.default.createElement( | ||
'button', | ||
{ className: buttonStyle }, | ||
this.state.confirmationVisible ? copiedText : value | ||
) | ||
) | ||
); | ||
var _this$props = this.props, | ||
buttonStyle = _this$props.buttonStyle, | ||
copiedText = _this$props.copiedText, | ||
value = _this$props.value; | ||
return _react["default"].createElement(Container, null, _react["default"].createElement("label", { | ||
htmlFor: "referralInput", | ||
onClick: this.copyLink | ||
}, _react["default"].createElement("button", { | ||
className: buttonStyle | ||
}, this.state.confirmationVisible ? copiedText : value))); | ||
} | ||
@@ -98,12 +102,19 @@ }]); | ||
CopyToClipboard.propTypes = { | ||
buttonStyle: _propTypes2.default.oneOfType([_propTypes2.default.object, _propTypes2.default.string]), | ||
copiedText: _propTypes2.default.string, | ||
value: _propTypes2.default.string | ||
}; | ||
exports.default = CopyToClipboard; | ||
exports["default"] = CopyToClipboard; | ||
_defineProperty(CopyToClipboard, "propTypes", { | ||
buttonStyle: _propTypes["default"].oneOfType([_propTypes["default"].object, _propTypes["default"].string]), | ||
copiedText: _propTypes["default"].string, | ||
value: _propTypes["default"].string | ||
}); | ||
var Container = /*#__PURE__*/(0, _reactEmotion2.default)('div', { | ||
target: 'css-1b311qf0' | ||
})('position:relative;overflow:hidden;'); | ||
var Container = (0, _styledBase["default"])("div", { | ||
target: "ecflng60" | ||
})(process.env.NODE_ENV === "production" ? { | ||
name: "ohwg9z", | ||
styles: "position:relative;overflow:hidden;" | ||
} : { | ||
name: "ohwg9z", | ||
styles: "position:relative;overflow:hidden;", | ||
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3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F0aW9uVmlzaWJsZTogdHJ1ZVxuICAgIH0pXG5cbiAgICBzZXRUaW1lb3V0KCgpID0+IHtcbiAgICAgIHRoaXMuc2V0U3RhdGUoe1xuICAgICAgICBjb25maXJtYXRpb25WaXNpYmxlOiBmYWxzZVxuICAgICAgfSlcbiAgICB9LCAyMDAwKVxuICB9XG5cbiAgcmVuZGVyICgpIHtcbiAgICBjb25zdCB7IGJ1dHRvblN0eWxlLCBjb3BpZWRUZXh0LCB2YWx1ZSB9ID0gdGhpcy5wcm9wc1xuXG4gICAgcmV0dXJuIChcbiAgICAgIDxDb250YWluZXI+XG4gICAgICAgIDxsYWJlbCBodG1sRm9yPSdyZWZlcnJhbElucHV0JyBvbkNsaWNrPXt0aGlzLmNvcHlMaW5rfT5cbiAgICAgICAgICA8YnV0dG9uIGNsYXNzTmFtZT17YnV0dG9uU3R5bGV9PlxuICAgICAgICAgICAge3RoaXMuc3RhdGUuY29uZmlybWF0aW9uVmlzaWJsZSA/IGNvcGllZFRleHQgOiB2YWx1ZX1cbiAgICAgICAgICA8L2J1dHRvbj5cbiAgICAgICAgPC9sYWJlbD5cbiAgICAgIDwvQ29udGFpbmVyPlxuICAgIClcbiAgfVxufVxuXG5jb25zdCBDb250YWluZXIgPSBzdHlsZWQuZGl2YFxuICBwb3NpdGlvbjogcmVsYXRpdmU7XG4gIG92ZXJmbG93OiBoaWRkZW47XG5gXG4iXX0= */" | ||
}); |
{ | ||
"name": "@eaze/copy-to-clipboard", | ||
"version": "1.0.2", | ||
"version": "1.0.3-alpha.0", | ||
"description": "React components: index", | ||
@@ -19,24 +19,24 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@eaze/color": "^1.0.12", | ||
"copy-to-clipboard": "~3.0.8", | ||
"react-emotion": "~8.0.9" | ||
"@eaze/color": "^1.0.14-alpha.0", | ||
"copy-to-clipboard": "~3.2.0" | ||
}, | ||
"devDependencies": { | ||
"babel-cli": "~6.24.1", | ||
"babel-core": "~6.25.0", | ||
"babel-plugin-emotion": "~8.0.9", | ||
"babel-plugin-inline-import-data-uri": "~1.0.1", | ||
"babel-preset-es2015": "~6.24.1", | ||
"babel-preset-react": "~6.24.1", | ||
"babel-preset-stage-2": "~6.24.1" | ||
"@babel/cli": "~7.4.4", | ||
"@babel/core": "~7.4.5", | ||
"@babel/plugin-proposal-class-properties": "~7.4.4", | ||
"@babel/preset-env": "~7.4.5", | ||
"@babel/preset-react": "~7.0.0", | ||
"babel-plugin-emotion": "~10.0.9", | ||
"babel-plugin-inline-import-data-uri": "~1.0.1" | ||
}, | ||
"peerDependencies": { | ||
"emotion": "~8.0.9", | ||
"prop-types": "~16.0.0", | ||
"react": "~16.0.0", | ||
"react-dom": "~16.0.0" | ||
"@emotion/styled": "~10.0.12", | ||
"prop-types": "~15.7.2", | ||
"react": "~16.8.6", | ||
"react-dom": "~16.8.6" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
} | ||
}, | ||
"gitHead": "0358c72784f7ada9fb8eb6e022fda13d503b0113" | ||
} |
@@ -8,3 +8,3 @@ /** | ||
import PropTypes from 'prop-types' | ||
import styled from 'react-emotion' | ||
import styled from '@emotion/styled' | ||
@@ -11,0 +11,0 @@ export default class CopyToClipboard extends PureComponent { |
Sorry, the diff of this file is not supported yet
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
11652
6
210
2
3
1
+ Added@babel/code-frame@7.26.2(transitive)
+ Added@babel/generator@7.26.2(transitive)
+ Added@babel/helper-module-imports@7.25.9(transitive)
+ Added@babel/helper-string-parser@7.25.9(transitive)
+ Added@babel/helper-validator-identifier@7.25.9(transitive)
+ Added@babel/parser@7.26.2(transitive)
+ Added@babel/runtime@7.26.0(transitive)
+ Added@babel/template@7.25.9(transitive)
+ Added@babel/traverse@7.25.9(transitive)
+ Added@babel/types@7.26.0(transitive)
+ Added@eaze/color@1.0.14-node-10.0(transitive)
+ Added@emotion/cache@10.0.29(transitive)
+ Added@emotion/core@10.3.1(transitive)
+ Added@emotion/css@10.0.27(transitive)
+ Added@emotion/hash@0.8.0(transitive)
+ Added@emotion/is-prop-valid@0.8.8(transitive)
+ Added@emotion/memoize@0.7.4(transitive)
+ Added@emotion/serialize@0.11.16(transitive)
+ Added@emotion/sheet@0.9.4(transitive)
+ Added@emotion/styled@10.0.27(transitive)
+ Added@emotion/styled-base@10.3.0(transitive)
+ Added@emotion/stylis@0.8.5(transitive)
+ Added@emotion/unitless@0.7.5(transitive)
+ Added@emotion/utils@0.11.3(transitive)
+ Added@emotion/weak-memoize@0.2.5(transitive)
+ Added@jridgewell/gen-mapping@0.3.5(transitive)
+ Added@jridgewell/resolve-uri@3.1.2(transitive)
+ Added@jridgewell/set-array@1.2.1(transitive)
+ Added@jridgewell/sourcemap-codec@1.5.0(transitive)
+ Added@jridgewell/trace-mapping@0.3.25(transitive)
+ Added@types/parse-json@4.0.2(transitive)
+ Addedbabel-plugin-emotion@10.2.2(transitive)
+ Addedbabel-plugin-macros@2.8.0(transitive)
+ Addedcallsites@3.1.0(transitive)
+ Addedcopy-to-clipboard@3.2.1(transitive)
+ Addedcosmiconfig@6.0.0(transitive)
+ Addedcsstype@2.6.21(transitive)
+ Addeddebug@4.3.7(transitive)
+ Addedescape-string-regexp@1.0.5(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedglobals@11.12.0(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedimport-fresh@3.3.0(transitive)
+ Addedis-core-module@2.15.1(transitive)
+ Addedjsesc@3.0.2(transitive)
+ Addedjson-parse-even-better-errors@2.3.1(transitive)
+ Addedlines-and-columns@1.2.4(transitive)
+ Addedms@2.1.3(transitive)
+ Addedparent-module@1.0.1(transitive)
+ Addedparse-json@5.2.0(transitive)
+ Addedpath-parse@1.0.7(transitive)
+ Addedpath-type@4.0.0(transitive)
+ Addedpicocolors@1.1.1(transitive)
+ Addedprop-types@15.7.2(transitive)
+ Addedreact@16.3.216.8.6(transitive)
+ Addedreact-dom@16.3.316.8.6(transitive)
+ Addedregenerator-runtime@0.14.1(transitive)
+ Addedresolve@1.22.8(transitive)
+ Addedresolve-from@4.0.0(transitive)
+ Addedscheduler@0.13.6(transitive)
+ Addedsupports-preserve-symlinks-flag@1.0.0(transitive)
+ Addedyaml@1.10.2(transitive)
- Removedreact-emotion@~8.0.9
- Removed@babel/helper-module-imports@7.0.0-beta.32(transitive)
- Removed@babel/types@7.0.0-beta.32(transitive)
- Removed@eaze/color@1.0.13(transitive)
- Removedabbrev@1.1.1(transitive)
- Removedargparse@1.0.10(transitive)
- Removedbabel-macros@1.2.0(transitive)
- Removedbabel-plugin-emotion@8.0.12(transitive)
- Removedcopy-to-clipboard@3.0.9(transitive)
- Removedcosmiconfig@3.1.0(transitive)
- Removedcreate-react-class@15.7.0(transitive)
- Removedemotion@8.0.12(transitive)
- Removedemotion-utils@8.0.12(transitive)
- Removedesprima@4.0.1(transitive)
- Removedesutils@2.0.3(transitive)
- Removedis-directory@0.3.1(transitive)
- Removedjs-yaml@3.14.1(transitive)
- Removedlodash@4.17.21(transitive)
- Removednopt@1.0.10(transitive)
- Removedparse-json@3.0.0(transitive)
- Removedprop-types@15.8.1(transitive)
- Removedreact@15.6.216.0.0(transitive)
- Removedreact-dom@15.6.216.0.1(transitive)
- Removedreact-emotion@8.0.12(transitive)
- Removedrequire-from-string@2.0.2(transitive)
- Removedsprintf-js@1.0.3(transitive)
- Removedstylis@3.5.4(transitive)
- Removedstylis-rule-sheet@0.0.5(transitive)
- Removedto-fast-properties@2.0.0(transitive)
- Removedtouch@1.0.0(transitive)
Updated@eaze/color@^1.0.14-alpha.0
Updatedcopy-to-clipboard@~3.2.0