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

@eaze/copy-to-clipboard

Package Overview
Dependencies
Maintainers
50
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@eaze/copy-to-clipboard - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3-alpha.0

117

dist/index.js

@@ -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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFtRDRCIiwiZmlsZSI6Ii4uL3NyYy9pbmRleC5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogSW52aXRlIGxpbmsgaXMgYSBzcGVjaWFsIGJ1dHRvbiB0aGF0IGNvcGllcyBpdHMgb3duIHZhbHVlIGludG8gdGhlIG1lbW9yeSB3aGVuIGNsaWNrZWQgYXMgdG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0LCB2YWx1ZSB9ID0gdGhpcy5wcm9wc1xuXG4gICAgcmV0dXJuIChcbiAgICAgIDxDb250YWluZXI+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

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