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

react-super-components

Package Overview
Dependencies
Maintainers
2
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-super-components - npm Package Compare versions

Comparing version 0.0.1 to 0.1.0

65

dist/SuperImage.js

@@ -7,22 +7,4 @@ 'use strict';

var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');
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 _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
var _createClass2 = require('babel-runtime/helpers/createClass');
var _createClass3 = _interopRequireDefault(_createClass2);
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
var _inherits2 = require('babel-runtime/helpers/inherits');
var _inherits3 = _interopRequireDefault(_inherits2);
var _react = require('react');

@@ -44,9 +26,15 @@

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
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 _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; }
var SuperImage = function (_React$Component) {
(0, _inherits3.default)(SuperImage, _React$Component);
_inherits(SuperImage, _React$Component);
function SuperImage(props) {
(0, _classCallCheck3.default)(this, SuperImage);
_classCallCheck(this, SuperImage);
var _this = (0, _possibleConstructorReturn3.default)(this, (0, _getPrototypeOf2.default)(SuperImage).call(this, props));
var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(SuperImage).call(this, props));

@@ -57,3 +45,3 @@ _this.state = { status: 'NOT_IN_VIEW' };

(0, _createClass3.default)(SuperImage, [{
_createClass(SuperImage, [{
key: 'componentDidMount',

@@ -90,2 +78,4 @@ value: function componentDidMount() {

var style = _props.style;
var loadingComponent = _props.loadingComponent;
var errorComponent = _props.errorComponent;
var status = this.state.status;

@@ -96,5 +86,5 @@

case 'NOT_IN_VIEW':
return _react2.default.createElement(ImageLoading, null);
return loadingComponent || _react2.default.createElement(ImageLoading, null);
case 'ERROR':
return _react2.default.createElement(ImageError, null);
return errorComponent || _react2.default.createElement(ImageError, null);
case 'SHOW':

@@ -107,2 +97,3 @@ return _react2.default.createElement('img', { style: style, src: src });

}]);
return SuperImage;

@@ -116,14 +107,17 @@ }(_react2.default.Component);

src: _react.PropTypes.string,
style: _react.PropTypes.object
style: _react.PropTypes.object,
loadingComponent: _react.PropTypes.object,
errorComponent: _react.PropTypes.object
};
var ImageLoading = function (_React$Component2) {
(0, _inherits3.default)(ImageLoading, _React$Component2);
_inherits(ImageLoading, _React$Component2);
function ImageLoading() {
(0, _classCallCheck3.default)(this, ImageLoading);
return (0, _possibleConstructorReturn3.default)(this, (0, _getPrototypeOf2.default)(ImageLoading).apply(this, arguments));
_classCallCheck(this, ImageLoading);
return _possibleConstructorReturn(this, Object.getPrototypeOf(ImageLoading).apply(this, arguments));
}
(0, _createClass3.default)(ImageLoading, [{
_createClass(ImageLoading, [{
key: 'render',

@@ -138,2 +132,3 @@ value: function render() {

}]);
return ImageLoading;

@@ -143,10 +138,11 @@ }(_react2.default.Component);

var ImageError = function (_React$Component3) {
(0, _inherits3.default)(ImageError, _React$Component3);
_inherits(ImageError, _React$Component3);
function ImageError() {
(0, _classCallCheck3.default)(this, ImageError);
return (0, _possibleConstructorReturn3.default)(this, (0, _getPrototypeOf2.default)(ImageError).apply(this, arguments));
_classCallCheck(this, ImageError);
return _possibleConstructorReturn(this, Object.getPrototypeOf(ImageError).apply(this, arguments));
}
(0, _createClass3.default)(ImageError, [{
_createClass(ImageError, [{
key: 'render',

@@ -161,2 +157,3 @@ value: function render() {

}]);
return ImageError;

@@ -163,0 +160,0 @@ }(_react2.default.Component);

{
"name": "react-super-components",
"version": "0.0.1",
"version": "0.1.0",
"description": "react super components",

@@ -10,15 +10,13 @@ "repository": {

"license": "MIT",
"options": {
"mocha": "--require scripts/mocha_runner lib/**/__tests__/**/*.js"
},
"scripts": {
"prepublish": ". ./scripts/prepublish.sh",
"prepublish": "babel lib --ignore __tests__ --out-dir ./dist",
"lint": "eslint ./lib",
"lintfix": "eslint ./lib --fix",
"testonly": "mocha $npm_package_options_mocha",
"testonly": "mocha",
"test": "npm run lint && npm run testonly",
"test-watch": "npm run testonly -- --watch"
"watch": "mocha --watch"
},
"react-native": "./dist/index.js",
"devDependencies": {
"babel-runtime": "6.x.x",
"nodemon": "1.7.x",

@@ -51,3 +49,2 @@ "mocha": "2.x.x",

"dependencies": {
"babel-runtime": "6.x.x",
"jquery": "^2.2.2",

@@ -54,0 +51,0 @@ "jquery-inview": "^1.1.2"

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