react-inlinesvg
Advanced tools
Comparing version 0.5.3 to 0.5.4
@@ -84,3 +84,3 @@ 'use strict'; | ||
var isSupportedEnvironment = (0, _once2.default)(function () { | ||
return ((typeof window !== 'undefined' && window !== null ? window.XMLHttpRequest : void 0) || (typeof window !== 'undefined' && window !== null ? window.XDomainRequest : void 0)) && supportsInlineSVG(); | ||
return ((typeof window !== 'undefined' && window !== null ? window.XMLHttpRequest : false) || (typeof window !== 'undefined' && window !== null ? window.XDomainRequest : false)) && supportsInlineSVG(); | ||
}); | ||
@@ -118,3 +118,3 @@ | ||
var j = void 0; | ||
var len = void 0; | ||
var ref = void 0; | ||
@@ -125,7 +125,8 @@ if (!str) { | ||
for (i = 0, j = 0, len = str.length; len <= 0 ? j < len : j > len; i = len <= 0 ? ++j : --j) { | ||
for (i = j = 0, ref = str.length; ref >= 0 ? j < ref : j > ref; i = ref >= 0 ? ++j : --j) { | ||
chr = str.charCodeAt(i); | ||
hash = (hash << 5) - hash + chr; | ||
hash = hash & hash; | ||
hash &= hash; | ||
} | ||
return hash; | ||
@@ -142,3 +143,3 @@ }; | ||
var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(InlineSVGError).call(this)); | ||
var _this = _possibleConstructorReturn(this, (InlineSVGError.__proto__ || Object.getPrototypeOf(InlineSVGError)).call(this)); | ||
@@ -192,3 +193,3 @@ _this.name = 'InlineSVGError'; | ||
var _this2 = _possibleConstructorReturn(this, Object.getPrototypeOf(InlineSVG).call(this, props)); | ||
var _this2 = _possibleConstructorReturn(this, (InlineSVG.__proto__ || Object.getPrototypeOf(InlineSVG)).call(this, props)); | ||
@@ -207,10 +208,8 @@ _this2.shouldComponentUpdate = _shouldComponentUpdate.shouldComponentUpdate; | ||
_createClass(InlineSVG, [{ | ||
key: 'componentWillMount', | ||
value: function componentWillMount() { | ||
key: 'componentDidMount', | ||
value: function componentDidMount() { | ||
if (this.state.status === Status.PENDING) { | ||
if (this.props.supportTest()) { | ||
if (this.props.src) { | ||
this.setState({ | ||
status: Status.LOADING | ||
}, this.load); | ||
this.startLoad(); | ||
} else { | ||
@@ -254,2 +253,9 @@ this.fail(configurationError('Missing source')); | ||
}, { | ||
key: 'startLoad', | ||
value: function startLoad() { | ||
this.setState({ | ||
status: Status.LOADING | ||
}, this.load); | ||
} | ||
}, { | ||
key: 'load', | ||
@@ -294,2 +300,3 @@ value: function load() { | ||
case Status.UNSUPPORTED: | ||
case Status.FAILED: | ||
return this.props.children; | ||
@@ -296,0 +303,0 @@ default: |
{ | ||
"name": "react-inlinesvg", | ||
"version": "0.5.3", | ||
"version": "0.5.4", | ||
"description": "An SVG loader for React", | ||
@@ -23,37 +23,38 @@ "repository": { | ||
"httpplease": "^0.16", | ||
"once": "^1.3", | ||
"once": "^1.4", | ||
"fbjs": "^0.8" | ||
}, | ||
"devDependencies": { | ||
"babel-core": "^6.9", | ||
"babel-eslint": "^6.0", | ||
"babel-core": "^6.17", | ||
"babel-eslint": "^7.0", | ||
"babel-plugin-add-module-exports": "^0.2", | ||
"babel-preset-es2015": "^6.9", | ||
"babel-preset-react": "^6.5", | ||
"babel-preset-stage-1": "^6.5", | ||
"babel-register": "^6.9", | ||
"babelify": "^7.3.0", | ||
"browserify": "^13.0.1", | ||
"browserify-shim": "^3.8.12", | ||
"cors": "^2.7", | ||
"eslint": "^2.10", | ||
"eslint-config-airbnb": "^9.0", | ||
"eslint-plugin-import": "^1.7", | ||
"eslint-plugin-jsx-a11y": "^1.2", | ||
"eslint-plugin-react": "^5.1", | ||
"babel-plugin-rewire": "1.0.0", | ||
"babel-preset-es2015": "^6.16", | ||
"babel-preset-react": "^6.16", | ||
"babel-preset-stage-1": "^6.16", | ||
"babel-register": "^6.16", | ||
"babelify": "^7.3", | ||
"browserify": "^13.1", | ||
"browserify-shim": "^3.8", | ||
"cors": "^2.8", | ||
"enzyme": "^2.4", | ||
"eslint": "^3.7", | ||
"eslint-config-airbnb": "^12.0", | ||
"eslint-plugin-import": "^2.0", | ||
"eslint-plugin-jsx-a11y": "^2.2", | ||
"eslint-plugin-react": "^6.3", | ||
"expect": "^1.20", | ||
"gulp": "^3.9", | ||
"gulp-babel": "^6.1", | ||
"gulp-bump": "^2.1.0", | ||
"gulp-connect": "^4.0", | ||
"gulp-load-plugins": "^1.2", | ||
"gulp-bump": "^2.4", | ||
"gulp-connect": "^5.0", | ||
"gulp-load-plugins": "^1.3", | ||
"gulp-rename": "^1.2", | ||
"gulp-util": "^3.0", | ||
"jsdom": "^9.1", | ||
"mocha": "^2.4", | ||
"babel-plugin-rewire": "1.0.0-rc-3", | ||
"react": "^15.1", | ||
"react-addons-test-utils": "^15.1", | ||
"react-dom": "^15.1", | ||
"vinyl-source-stream": "^1.1.0" | ||
"jsdom": "^9.6", | ||
"mocha": "^3.1", | ||
"react": "^15.3", | ||
"react-addons-test-utils": "^15.3", | ||
"react-dom": "^15.3", | ||
"vinyl-source-stream": "^1.1" | ||
}, | ||
@@ -69,12 +70,2 @@ "peerDependencies": { | ||
}, | ||
"babel": { | ||
"presets": [ | ||
"es2015", | ||
"react", | ||
"stage-1" | ||
], | ||
"plugins": [ | ||
"add-module-exports" | ||
] | ||
}, | ||
"browserify": { | ||
@@ -81,0 +72,0 @@ "transform": [ |
@@ -31,5 +31,5 @@ react-inlinesvg | ||
The SVG [`<use>`][svg-use] element can be used to achieve something similar to | ||
this component. See [this article][use-article] for more information and [this | ||
table][use-support] for browser support and caveats. | ||
The SVG [`<use>`][svg-use-external-source] element can be used to achieve | ||
something similar to this component. See [this article][use-article] for more | ||
information and [this table][use-support] for browser support and caveats. | ||
@@ -148,4 +148,5 @@ | ||
[CORS](https://developer.mozilla.org/en-US/docs/HTTP/Access_control_CORS) | ||
[svg-use-external-source](http://css-tricks.com/svg-use-external-source) | ||
[use-support](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/use#Browser_compatibility) | ||
[CORS]: https://developer.mozilla.org/en-US/docs/HTTP/Access_control_CORS | ||
[svg-use-external-source]: http://css-tricks.com/svg-use-external-source | ||
[use-article]: http://taye.me/blog/svg/a-guide-to-svg-use-elements/ | ||
[use-support]: https://developer.mozilla.org/en-US/docs/Web/SVG/Element/use#Browser_compatibility |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
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
49511
308
151
32
17
Updatedonce@^1.4