react-iframe
Advanced tools
Comparing version 1.0.7 to 1.0.8
@@ -5,5 +5,3 @@ { | ||
"extends": [ | ||
"acando", | ||
"acando/rules/react", | ||
"acando/rules/jsx" | ||
"prettier" | ||
], | ||
@@ -10,0 +8,0 @@ "plugins": [ |
63
index.js
@@ -1,30 +0,45 @@ | ||
import React, {PureComponent} from "react" | ||
import { createElement, PureComponent } from "react" | ||
import PropTypes from "prop-types" | ||
import objectAssign from "object-assign" | ||
const Iframe = class extends PureComponent { | ||
render() { | ||
return React.createElement("iframe", { | ||
frameBorder: "0", | ||
src: this.props.url, | ||
target: "_parent", | ||
allowFullScreen: this.props.allowFullScreen || false, | ||
style: Object.assign({}, { | ||
position: this.props.position || "absolute", | ||
display: this.props.display || "block", | ||
height: this.props.height || "100%", | ||
width: this.props.width || "100%" | ||
}, this.props.styles || {}), | ||
height: this.props.height || "100%", | ||
width: this.props.width || "100%" | ||
}) | ||
} | ||
render() { | ||
const props = { | ||
ref: "iframe", | ||
frameBorder: "0", | ||
src: this.props.url, | ||
target: "_parent", | ||
allowFullScreen: this.props.allowFullScreen || false, | ||
style: Object.assign( | ||
{}, | ||
{ | ||
position: this.props.position || "absolute", | ||
display: this.props.display || "block", | ||
height: this.props.height || "100%", | ||
width: this.props.width || "100%" | ||
}, | ||
this.props.styles || {} | ||
), | ||
height: this.props.height || "100%", | ||
name: this.props.name || "", | ||
width: this.props.width || "100%" | ||
} | ||
return createElement( | ||
"iframe", | ||
objectAssign(props, this.props.id ? { id: this.props.id } : {}, this.props.className ? { className: this.props.className } : {}) | ||
) | ||
} | ||
} | ||
Iframe.propTypes = { | ||
url: PropTypes.string.isRequired, | ||
width: PropTypes.string, | ||
position: PropTypes.string, | ||
display: PropTypes.string, | ||
height: PropTypes.string, | ||
styles: PropTypes.object, | ||
allowFullScreen: PropTypes.bool | ||
url: PropTypes.string.isRequired, | ||
id: PropTypes.string, | ||
className: PropTypes.string, | ||
width: PropTypes.string, | ||
position: PropTypes.string, | ||
display: PropTypes.string, | ||
name: PropTypes.string, | ||
height: PropTypes.string, | ||
styles: PropTypes.object, | ||
allowFullScreen: PropTypes.bool | ||
} | ||
export default Iframe |
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:true});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 _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}}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 Iframe=function(_PureComponent){_inherits(Iframe,_PureComponent);function Iframe(){_classCallCheck(this,Iframe);return _possibleConstructorReturn(this,(Iframe.__proto__||Object.getPrototypeOf(Iframe)).apply(this,arguments))}_createClass(Iframe,[{key:"render",value:function render(){return _react2.default.createElement("iframe",{frameBorder:"0",src:this.props.url,target:"_parent",allowFullScreen:this.props.allowFullScreen||false,style:Object.assign({},{position:this.props.position||"absolute",display:this.props.display||"block",height:this.props.height||"100%",width:this.props.width||"100%"},this.props.styles||{}),height:this.props.height||"100%",width:this.props.width||"100%"})}}]);return Iframe}(_react.PureComponent);Iframe.propTypes={url:_propTypes2.default.string.isRequired,width:_propTypes2.default.string,position:_propTypes2.default.string,display:_propTypes2.default.string,height:_propTypes2.default.string,styles:_propTypes2.default.object,allowFullScreen:_propTypes2.default.bool};exports.default=Iframe; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:true});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 _react=require("react");var _propTypes=require("prop-types");var _propTypes2=_interopRequireDefault(_propTypes);var _objectAssign=require("object-assign");var _objectAssign2=_interopRequireDefault(_objectAssign);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}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 Iframe=function(_PureComponent){_inherits(Iframe,_PureComponent);function Iframe(){_classCallCheck(this,Iframe);return _possibleConstructorReturn(this,(Iframe.__proto__||Object.getPrototypeOf(Iframe)).apply(this,arguments))}_createClass(Iframe,[{key:"render",value:function render(){var props={ref:"iframe",frameBorder:"0",src:this.props.url,target:"_parent",allowFullScreen:this.props.allowFullScreen||false,style:Object.assign({},{position:this.props.position||"absolute",display:this.props.display||"block",height:this.props.height||"100%",width:this.props.width||"100%"},this.props.styles||{}),height:this.props.height||"100%",name:this.props.name||"",width:this.props.width||"100%"};return(0,_react.createElement)("iframe",(0,_objectAssign2.default)(props,this.props.id?{id:this.props.id}:{},this.props.className?{className:this.props.className}:{}))}}]);return Iframe}(_react.PureComponent);Iframe.propTypes={url:_propTypes2.default.string.isRequired,id:_propTypes2.default.string,className:_propTypes2.default.string,width:_propTypes2.default.string,position:_propTypes2.default.string,display:_propTypes2.default.string,name:_propTypes2.default.string,height:_propTypes2.default.string,styles:_propTypes2.default.object,allowFullScreen:_propTypes2.default.bool};exports.default=Iframe; |
{ | ||
"name": "react-iframe", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "Easy iframes with react", | ||
"main": "index.min.js", | ||
"pperDependencies": { | ||
"react": ">=15.x.x" | ||
"peerDependencies": { | ||
"react": ">=16.x.x" | ||
}, | ||
"dependencies": { | ||
"prop-types": "^15.5.x" | ||
}, | ||
"devDependencies": { | ||
"babel-cli": "6.22.x", | ||
"babel-eslint": "7.2.x", | ||
"babel-preset-es2015": "6.22.x", | ||
"cross-env": "4.0.x", | ||
"eslint": "3.19.x", | ||
"eslint-config-acando": "1.1.x", | ||
"eslint-plugin-react": "6.10.x", | ||
"uglify-js": "^3.0.15" | ||
"babel-cli": "6.26.0", | ||
"babel-core": "^6.26.0", | ||
"babel-eslint": "8.0.2", | ||
"babel-polyfill": "^6.26.0", | ||
"babel-preset-env": "^1.6.1", | ||
"babel-preset-es2015": "6.24.1", | ||
"babel-preset-react": "^6.24.1", | ||
"chai": "^4.1.2", | ||
"cross-env": "5.1.1", | ||
"enzyme": "^3.1.1", | ||
"enzyme-adapter-react-16": "^1.0.4", | ||
"eslint": "4.10.0", | ||
"eslint-config-acando": "1.3.7", | ||
"eslint-plugin-react": "7.4.0", | ||
"husky": "^0.14.3", | ||
"lint-staged": "^4.3.0", | ||
"mocha": "^4.0.1", | ||
"object-assign": "^4.1.1", | ||
"prettier": "^1.8.0", | ||
"prop-types": "^15.6.x", | ||
"react": "^16.0.0", | ||
"react-dom": "^16.0.0", | ||
"react-test-renderer": "^16.0.0", | ||
"standard-version": "^4.2.0", | ||
"uglify-js": "^3.1.8" | ||
}, | ||
"lint-staged": { | ||
"*.js": [ | ||
"prettier --semi false --single-quote false --write", | ||
"npm run prerelease", | ||
"git add" | ||
] | ||
}, | ||
"repository": { | ||
@@ -38,8 +59,11 @@ "type": "git", | ||
"scripts": { | ||
"test": "mocha --require babel-register test/", | ||
"lint": "eslint index.js --config .eslintrc.json", | ||
"predist": "npm run lint", | ||
"babel": "cross-env ./node_modules/.bin/babel --presets \"es2015\" index.js | uglifyjs -o ./index.min.js", | ||
"preversion": "npm run babel" | ||
"release": "standard-version", | ||
"prerelease": "babel --minified index.js -o index.min.js", | ||
"preversion": "npm run prerelease", | ||
"precommit": "lint-staged" | ||
}, | ||
"license": "ISC" | ||
} |
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
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
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
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
324168
23
138
25
87796
+ Addedreact@19.0.0(transitive)
- Removedprop-types@^15.5.x
- Removedjs-tokens@4.0.0(transitive)
- Removedloose-envify@1.4.0(transitive)
- Removedobject-assign@4.1.1(transitive)
- Removedprop-types@15.8.1(transitive)
- Removedreact-is@16.13.1(transitive)