boundless-image
Advanced tools
Comparing version 1.0.0-beta.6 to 1.0.0-beta.7
@@ -1,2 +0,2 @@ | ||
module.exports=function(e){function t(s){if(r[s])return r[s].exports;var o=r[s]={i:s,l:!1,exports:{}};return e[s].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};return t.m=e,t.c=r,t.i=function(e){return e},t.d=function(e,r,s){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:s})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=3)}([function(e,t,r){"use strict";function s(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Object.keys(e).reduce(function(r,s){return t.indexOf(s)===-1&&(r[s]=e[s]),r},{})}t.a=s},function(e,t){e.exports=require("classnames")},function(e,t){e.exports=require("react")},function(e,t,r){"use strict";function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function n(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=r(2),i=r.n(a),u=r(1),p=r.n(u),l=r(0),c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},f=function(){function e(e,t){for(var r=0;r<t.length;r++){var s=t[r];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}return function(t,r,s){return r&&e(t.prototype,r),s&&e(t,s),t}}(),d=function(){},m=function(e){function t(){var e,r,n,a;s(this,t);for(var i=arguments.length,u=Array(i),p=0;p<i;p++)u[p]=arguments[p];return r=n=o(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),n.state={status:t.status.LOADING},a=r,o(n,a)}return n(t,e),f(t,[{key:"componentWillReceiveProps",value:function(e){e.src!==this.props.src&&(this.resetPreloader(),this.setState({status:t.status.LOADING}))}},{key:"componentDidMount",value:function(){this.preload()}},{key:"componentDidUpdate",value:function(){this.preload()}},{key:"componentWillUnmount",value:function(){this.resetPreloader()}},{key:"resetPreloader",value:function(){this.loader.onload=null,this.loader.onerror=null,this.loader=null}},{key:"preload",value:function(){var e=this;this.loader||(this.loader=document.createElement("img"),this.loader.onload=function(){return e.setState({status:t.status.LOADED})},this.loader.onerror=function(){return e.setState({status:t.status.ERROR})},this.loader.src=this.props.src)}},{key:"renderImage",value:function(){return this.props.displayAsBackgroundImage?i.a.createElement("div",c({},this.props.imageProps,{ref:"image",className:p()("b-image",this.props.imageProps.className),title:this.props.alt,style:c({},this.props.imageProps.style,{backgroundImage:"url("+this.props.src+")"})})):i.a.createElement("img",c({},this.props.imageProps,{ref:"image",className:p()("b-image",this.props.imageProps.className),src:this.props.src,alt:this.props.alt,onLoad:d,onError:d}))}},{key:"renderStatus",value:function(){return i.a.createElement("div",c({},this.props.statusProps,{ref:"status",className:p()("b-image-status",this.props.statusProps.className,{"b-image-loading":this.state.status===t.status.LOADING,"b-image-loaded":this.state.status===t.status.LOADED,"b-image-error":this.state.status===t.status.ERROR}),role:"presentation"}))}},{key:"render",value:function(){return i.a.createElement("div",c({},r.i(l.a)(this.props,t.internalKeys),{ref:"wrapper",className:p()("b-image-wrapper",this.props.className)}),this.renderImage(),this.renderStatus())}}]),t}(i.a.PureComponent);m.status={LOADING:"LOADING",LOADED:"LOADED",ERROR:"ERROR"},m.propTypes={alt:a.PropTypes.string,displayAsBackgroundImage:a.PropTypes.bool,imageProps:a.PropTypes.object,src:a.PropTypes.string.isRequired,statusProps:a.PropTypes.object},m.defaultProps={alt:null,displayAsBackgroundImage:!1,imageProps:{},src:"about:blank",statusProps:{}},m.internalKeys=Object.keys(m.defaultProps),t.default=m}]); | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vaW5kZXguanMiLCJ3ZWJwYWNrOi8vL3dlYnBhY2svYm9vdHN0cmFwIGE2OGE1YjJjMzZjOTFlNDA1OTAwIiwid2VicGFjazovLy8uL3BhY2thZ2VzL2JvdW5kbGVzcy11dGlscy1vbWl0LWtleXMvaW5kZXguanMiLCJ3ZWJwYWNrOi8vL2V4dGVybmFsIHtcImNvbW1vbmpzMlwiOlwiY2xhc3NuYW1lc1wifSIsIndlYnBhY2s6Ly8vZXh0ZXJuYWwge1wiY29tbW9uanMyXCI6XCJyZWFjdFwifSIsIndlYnBhY2s6Ly8vLi9wYWNrYWdlcy9ib3VuZGxlc3MtaW1hZ2UvaW5kZXguanMiXSwibmFtZXMiOlsibW9kdWxlIiwiZXhwb3J0cyIsIm1vZHVsZXMiLCJfX3dlYnBhY2tfcmVxdWlyZV9fIiwibW9kdWxlSWQiLCJpbnN0YWxsZWRNb2R1bGVzIiwiaSIsImwiLCJjYWxsIiwibSIsImMiLCJ2YWx1ZSIsImQiLCJuYW1lIiwiZ2V0dGVyIiwibyIsIk9iamVjdCIsImRlZmluZVByb3BlcnR5IiwiY29uZmlndXJhYmxlIiwiZW51bWVyYWJsZSIsImdldCIsIm4iLCJfX2VzTW9kdWxlIiwib2JqZWN0IiwicHJvcGVydHkiLCJwcm90b3R5cGUiLCJoYXNPd25Qcm9wZXJ0eSIsInAiLCJzIiwiX193ZWJwYWNrX2V4cG9ydHNfXyIsIm9taXRLZXlzRnJvbVNvdXJjZU9iamVjdCIsInNvdXJjZSIsIm9taXR0ZWRLZXlzIiwiYXJndW1lbnRzIiwibGVuZ3RoIiwidW5kZWZpbmVkIiwia2V5cyIs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VzOiBJbWFnZS5zdGF0dXMuTE9BREVEfSk7XG4gICAgICAgIHRoaXMubG9hZGVyLm9uZXJyb3IgPSAoKSA9PiB0aGlzLnNldFN0YXRlKHtzdGF0dXM6IEltYWdlLnN0YXR1cy5FUlJPUn0pO1xuXG4gICAgICAgIHRoaXMubG9hZGVyLnNyYyA9IHRoaXMucHJvcHMuc3JjO1xuICAgIH1cblxuICAgIHJlbmRlckltYWdlKCkge1xuICAgICAgICBpZiAodGhpcy5wcm9wcy5kaXNwbGF5QXNCYWNrZ3JvdW5kSW1hZ2UpIHtcbiAgICAgICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICAgICAgPGRpdlxuICAgICAgICAgICAgICAgICAgICB7Li4udGhpcy5wcm9wcy5pbWFnZVByb3BzfVxuICAgICAgICAgICAgICAgICAgICByZWY9J2ltYWdlJ1xuICAgICAgICAgICAgICAgICAgICBjbGFzc05hbWU9e2N4KCdiLWltYWdlJywgdGhpcy5wcm9wcy5pbWFnZVByb3BzLmNsYXNzTmFtZSl9XG4gICAgICAgICAgICAgICAgICAgIHRpdGxlPXt0aGlzLnByb3BzLmFsdH1cbiAgICAgICAgICAgICAgICAgICAgc3R5bGU9e3tcbiAgICAgICAgICAgICAgICAgICAgICAgIC4uLnRoaXMucHJvcHMuaW1hZ2VQcm9wcy5zdHlsZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmRJbWFnZTogYHVybCgke3RoaXMucHJvcHMuc3JjfSlgLFxuICAgICAgICAgICAgICAgICAgICB9fSAvPlxuICAgICAgICAgICAgKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICA8aW1nXG4gICAgICAgICAgICAgICAgey4uLnRoaXMucHJvcHMuaW1hZ2VQcm9wc31cbiAgICAgICAgICAgICAgICByZWY9J2ltYWdlJ1xuICAgICAgICAgICAgICAgIGNsYXNzTmFtZT17Y3goJ2ItaW1hZ2UnLCB0aGlzLnByb3BzLmltYWdlUHJvcHMuY2xhc3NOYW1lKX1cbiAgICAgICAgICAgICAgICBzcmM9e3RoaXMucHJvcHMuc3JjfVxuICAgICAgICAgICAgICAgIGFsdD17dGhpcy5wcm9wcy5hbHR9XG4gICAgICAgICAgICAgICAgb25Mb2FkPXtub29wfVxuICAgICAgICAgICAgICAgIG9uRXJyb3I9e25vb3B9IC8+XG4gICAgICAgICk7XG4gICAgfVxuXG4gICAgcmVuZGVyU3RhdHVzKCkge1xuICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgPGRpdiB7Li4udGhpcy5wcm9wcy5zdGF0dXNQcm9wc31cbiAgICAgICAgICAgICAgICAgcmVmPSdzdGF0dXMnXG4gICAgICAgICAgICAgICAgIGNsYXNzTmFtZT17Y3goJ2ItaW1hZ2Utc3RhdHVzJywgdGhpcy5wcm9wcy5zdGF0dXNQcm9wcy5jbGFzc05hbWUsIHtcbiAgICAgICAgICAgICAgICAgICAgJ2ItaW1hZ2UtbG9hZGluZyc6IHRoaXMuc3RhdGUuc3RhdHVzID09PSBJbWFnZS5zdGF0dXMuTE9BRElORyxcbiAgICAgICAgICAgICAgICAgICAgJ2ItaW1hZ2UtbG9hZGVkJzogdGhpcy5zdGF0ZS5zdGF0dXMgPT09IEltYWdlLnN0YXR1cy5MT0FERUQsXG4gICAgICAgICAgICAgICAgICAgICdiLWltYWdlLWVycm9yJzogdGhpcy5zdGF0ZS5zdGF0dXMgPT09IEltYWdlLnN0YXR1cy5FUlJPUixcbiAgICAgICAgICAgICAgICAgfSl9XG4gICAgICAgICAgICAgICAgIHJvbGU9J3ByZXNlbnRhdGlvbicgLz5cbiAgICAgICAgKTtcbiAgICB9XG5cbiAgICByZW5kZXIoKSB7XG4gICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICA8ZGl2XG4gICAgICAgICAgICAgICAgey4uLm9taXQodGhpcy5wcm9wcywgSW1hZ2UuaW50ZXJuYWxLZXlzKX1cbiAgICAgICAgICAgICAgICByZWY9J3dyYXBwZXInXG4gICAgICAgICAgICAgICAgY2xhc3NOYW1lPXtjeCgnYi1pbWFnZS13cmFwcGVyJywgdGhpcy5wcm9wcy5jbGFzc05hbWUpfT5cbiAgICAgICAgICAgICAgICB7dGhpcy5yZW5kZXJJbWFnZSgpfVxuICAgICAgICAgICAgICAgIHt0aGlzLnJlbmRlclN0YXR1cygpfVxuICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICk7XG4gICAgfVxufVxuXG5cblxuLy8gV0VCUEFDSyBGT09URVIgLy9cbi8vIC4vcGFja2FnZXMvYm91bmRsZXNzLWltYWdlL2luZGV4LmpzIl0sInNvdXJjZVJvb3QiOiIifQ== | ||
module.exports=function(t){function e(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var r={};return e.m=t,e.c=r,e.i=function(t){return t},e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=4)}([function(t,e){t.exports=require("boundless-utils-omit-keys")},function(t,e){t.exports=require("boundless-utils-uuid")},function(t,e){t.exports=require("classnames")},function(t,e){t.exports=require("react")},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=r(3),u=r.n(a),i=r(2),l=r.n(i),c=r(0),p=r.n(c),f=r(1),d=r.n(f),y=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},h=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),b=function(t){function e(){var t,r,s,a;n(this,e);for(var u=arguments.length,i=Array(u),l=0;l<u;l++)i[l]=arguments[l];return r=s=o(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(i))),s.state={status:e.status.LOADING},a=r,o(s,a)}return s(e,t),h(e,[{key:"componentWillReceiveProps",value:function(t){t.src!==this.props.src&&(this.resetPreloader(),this.setState({status:e.status.LOADING}))}},{key:"componentDidMount",value:function(){this.preload()}},{key:"componentDidUpdate",value:function(){this.preload()}},{key:"componentWillUnmount",value:function(){this.resetPreloader()}},{key:"resetPreloader",value:function(){this.loader.onload=null,this.loader.onerror=null,this.loader=null}},{key:"preload",value:function(){var t=this;this.loader||(this.loader=document.createElement("img"),this.loader.onload=function(){return t.setState({status:e.status.LOADED})},this.loader.onerror=function(){return t.setState({status:e.status.ERROR})},this.loader.src=this.props.src)}},{key:"render",value:function(){return u.a.createElement(this.props.component,y({},p()(this.props,e.internalKeys),{className:l()("b-image",this.props.className,{"b-image-loading":this.state.status===e.status.LOADING,"b-image-loaded":this.state.status===e.status.LOADED,"b-image-error":this.state.status===e.status.ERROR}),title:this.props.alt,role:"img",style:y({},this.props.style,{backgroundImage:"url("+this.props.src+")"})})," ")}}]),e}(u.a.PureComponent);b.status={LOADING:d()(),LOADED:d()(),ERROR:d()()},b.propTypes={"*":a.PropTypes.any,alt:a.PropTypes.string,component:a.PropTypes.string,src:a.PropTypes.string.isRequired},b.defaultProps={alt:"",component:"div",src:"about:blank"},b.internalKeys=Object.keys(b.defaultProps),e.default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lLnN0YXR1cy5FUlJPUixcbiAgICAgICAgICAgICAgICB9KX1cbiAgICAgICAgICAgICAgICB0aXRsZT17dGhpcy5wcm9wcy5hbHR9XG4gICAgICAgICAgICAgICAgcm9sZT0naW1nJ1xuICAgICAgICAgICAgICAgIHN0eWxlPXt7XG4gICAgICAgICAgICAgICAgICAgIC4uLnRoaXMucHJvcHMuc3R5bGUsXG4gICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmRJbWFnZTogYHVybCgke3RoaXMucHJvcHMuc3JjfSlgLFxuICAgICAgICAgICAgICAgIH19PlxuICAgICAgICAgICAgICAgICZuYnNwO1xuICAgICAgICAgICAgPC90aGlzLnByb3BzLmNvbXBvbmVudD5cbiAgICAgICAgKTtcbiAgICB9XG59XG5cblxuXG4vLyBXRUJQQUNLIEZPT1RFUiAvL1xuLy8gLi9wYWNrYWdlcy9ib3VuZGxlc3MtaW1hZ2UvaW5kZXguanMiXSwic291cmNlUm9vdCI6IiJ9 |
@@ -18,11 +18,12 @@ import React from 'react'; | ||
return ( | ||
<div className='spread center'> | ||
<div className='demo-image spread center'> | ||
<figure> | ||
<h5>Normal</h5> | ||
<Image ref='normal' | ||
src={`https://c2.staticflickr.com/6/5128/5288605976_9b06c0de8f_b.jpg?${this.state.normal}`} | ||
alt='A snowy drive.' | ||
displayAsBackgroundImage={true} /> | ||
<Button onPressed={this.remountImage.bind(this, 'normal')} | ||
style={{marginTop: '1rem'}}> | ||
<Image | ||
ref='normal' | ||
src={`https://c2.staticflickr.com/6/5128/5288605976_9b06c0de8f_b.jpg?${this.state.normal}`} | ||
alt='A snowy drive.' /> | ||
<Button | ||
onPressed={this.remountImage.bind(this, 'normal')} | ||
style={{marginTop: '1rem'}}> | ||
Remount Image | ||
@@ -34,6 +35,6 @@ </Button> | ||
<h5>Delayed</h5> | ||
<Image ref='delayed' | ||
src={`http://deelay.me/5000/http://igcdn-photos-g-a.akamaihd.net/hphotos-ak-xfa1/t51.2885-15/11244434_646274218842534_532892887_n.jpg?${this.state.delayed}`} | ||
alt='A beachscape.' | ||
displayAsBackgroundImage={true} /> | ||
<Image | ||
ref='delayed' | ||
src={`http://deelay.me/5000/http://igcdn-photos-g-a.akamaihd.net/hphotos-ak-xfa1/t51.2885-15/11244434_646274218842534_532892887_n.jpg?${this.state.delayed}`} | ||
alt='A beachscape.' /> | ||
<Button onPressed={this.remountImage.bind(this, 'delayed')} | ||
@@ -47,8 +48,9 @@ style={{marginTop: '1rem'}}> | ||
<h5>Errored Out</h5> | ||
<Image ref='error' | ||
src={`http://www.flickr.com/1o2k3ok1231?${this.state.error}`} | ||
alt='A dead image.' | ||
displayAsBackgroundImage={true} /> | ||
<Button onPressed={this.remountImage.bind(this, 'error')} | ||
style={{marginTop: '1rem'}}> | ||
<Image | ||
ref='error' | ||
src={`http://www.flickr.com/1o2k3ok1231?${this.state.error}`} | ||
alt='A dead image.' /> | ||
<Button | ||
onPressed={this.remountImage.bind(this, 'error')} | ||
style={{marginTop: '1rem'}}> | ||
Remount Image | ||
@@ -55,0 +57,0 @@ </Button> |
105
index.js
@@ -5,7 +5,5 @@ import React, {PropTypes} from 'react'; | ||
import omit from 'boundless-utils-omit-keys'; | ||
import uuid from 'boundless-utils-uuid'; | ||
const noop = () => {}; | ||
/** | ||
# Image | ||
__An image block with placeholder support for loading and fallback scenarios.__ | ||
@@ -15,5 +13,5 @@ */ | ||
static status = { | ||
LOADING: 'LOADING', | ||
LOADED: 'LOADED', | ||
ERROR: 'ERROR', | ||
LOADING: uuid(), | ||
LOADED: uuid(), | ||
ERROR: uuid(), | ||
} | ||
@@ -23,15 +21,15 @@ | ||
/** | ||
* a written description of the image for search engines, hovertext and those using accessibility technologies; applied to the `.b-image` as the HTML attributes `alt` or `title`, depending on the type of rendered node | ||
* any [React-supported attribute](https://facebook.github.io/react/docs/tags-and-attributes.html#html-attributes) | ||
*/ | ||
alt: PropTypes.string, | ||
'*': PropTypes.any, | ||
/** | ||
* emits the image as a `<div>` with `background-image` css property set instead of `<img>` | ||
* a written description of the image for search engines, hovertext and those using accessibility technologies | ||
*/ | ||
displayAsBackgroundImage: PropTypes.bool, | ||
alt: PropTypes.string, | ||
/** | ||
* any [React-supported attribute](https://facebook.github.io/react/docs/tags-and-attributes.html#html-attributes); applied to the `.b-image` node | ||
* overrides the component HTML tag | ||
*/ | ||
imageProps: PropTypes.object, | ||
component: PropTypes.string, | ||
@@ -42,15 +40,8 @@ /** | ||
src: PropTypes.string.isRequired, | ||
/** | ||
* any [React-supported attribute](https://facebook.github.io/react/docs/tags-and-attributes.html#html-attributes); applied to the `.b-image-status` node | ||
*/ | ||
statusProps: PropTypes.object, | ||
} | ||
static defaultProps = { | ||
alt: null, | ||
displayAsBackgroundImage: false, | ||
imageProps: {}, | ||
alt: '', | ||
component: 'div', | ||
src: 'about:blank', | ||
statusProps: {}, | ||
} | ||
@@ -71,14 +62,6 @@ | ||
componentDidMount() { | ||
this.preload(); | ||
} | ||
componentDidMount() { this.preload(); } | ||
componentDidUpdate() { this.preload(); } | ||
componentWillUnmount() { this.resetPreloader(); } | ||
componentDidUpdate() { | ||
this.preload(); | ||
} | ||
componentWillUnmount() { | ||
this.resetPreloader(); | ||
} | ||
resetPreloader() { | ||
@@ -101,53 +84,21 @@ this.loader.onload = null; | ||
renderImage() { | ||
if (this.props.displayAsBackgroundImage) { | ||
return ( | ||
<div | ||
{...this.props.imageProps} | ||
ref='image' | ||
className={cx('b-image', this.props.imageProps.className)} | ||
title={this.props.alt} | ||
style={{ | ||
...this.props.imageProps.style, | ||
backgroundImage: `url(${this.props.src})`, | ||
}} /> | ||
); | ||
} | ||
render() { | ||
return ( | ||
<img | ||
{...this.props.imageProps} | ||
ref='image' | ||
className={cx('b-image', this.props.imageProps.className)} | ||
src={this.props.src} | ||
alt={this.props.alt} | ||
onLoad={noop} | ||
onError={noop} /> | ||
); | ||
} | ||
renderStatus() { | ||
return ( | ||
<div {...this.props.statusProps} | ||
ref='status' | ||
className={cx('b-image-status', this.props.statusProps.className, { | ||
<this.props.component | ||
{...omit(this.props, Image.internalKeys)} | ||
className={cx('b-image', this.props.className, { | ||
'b-image-loading': this.state.status === Image.status.LOADING, | ||
'b-image-loaded': this.state.status === Image.status.LOADED, | ||
'b-image-error': this.state.status === Image.status.ERROR, | ||
})} | ||
role='presentation' /> | ||
})} | ||
title={this.props.alt} | ||
role='img' | ||
style={{ | ||
...this.props.style, | ||
backgroundImage: `url(${this.props.src})`, | ||
}}> | ||
| ||
</this.props.component> | ||
); | ||
} | ||
render() { | ||
return ( | ||
<div | ||
{...omit(this.props, Image.internalKeys)} | ||
ref='wrapper' | ||
className={cx('b-image-wrapper', this.props.className)}> | ||
{this.renderImage()} | ||
{this.renderStatus()} | ||
</div> | ||
); | ||
} | ||
} |
@@ -7,3 +7,3 @@ /* eslint no-unused-expressions:0 */ | ||
import Image from './index'; | ||
import conformanceChecker from '../boundless-utils-conformance/index'; | ||
import {$, conformanceChecker} from '../boundless-utils-test-helpers/index'; | ||
@@ -20,107 +20,15 @@ describe('Image component', () => { | ||
describe('accepts', () => { | ||
it('arbitrary React-supported HTML attributes via props.imageProps', () => { | ||
const element = render(<Image {...baseProps} imageProps={{'data-id': 'xr1'}} />); | ||
const node = element.refs.image; | ||
expect(node.getAttribute('data-id')).toBe('xr1'); | ||
}); | ||
it('classes via props.imageProps.className', () => { | ||
const element = render( | ||
<Image {...baseProps} | ||
imageProps={{ | ||
className: 'foo', | ||
}} /> | ||
); | ||
expect(element.refs.image.classList.contains('foo')).toBe(true); | ||
}); | ||
it('classes via props.imageProps.className when props.displayAsBackgroundImage is true', () => { | ||
const element = render( | ||
<Image {...baseProps} | ||
displayAsBackgroundImage={true} | ||
imageProps={{ | ||
className: 'foo', | ||
}} /> | ||
); | ||
expect(element.refs.image.classList.contains('foo')).toBe(true); | ||
}); | ||
it('inline styles via props.imageProps.style when props.displayAsBackgroundImage is true', () => { | ||
const element = render( | ||
<Image {...baseProps} | ||
displayAsBackgroundImage={true} | ||
imageProps={{ | ||
style: { | ||
textDecoration: 'underline', | ||
}, | ||
}} /> | ||
); | ||
expect(element.refs.image.style.textDecoration).toBe('underline'); | ||
}); | ||
it('arbitrary React-supported HTML attributes via props.statusProps', () => { | ||
const element = render(<Image {...baseProps} statusProps={{'data-id': 'xr1'}} />); | ||
expect(element.refs.status.getAttribute('data-id')).toBe('xr1'); | ||
}); | ||
it('classes via props.statusProps.className', () => { | ||
const element = render( | ||
<Image {...baseProps} | ||
statusProps={{ | ||
className: 'foo', | ||
}} /> | ||
); | ||
expect(element.refs.status.classList.contains('foo')).toBe(true); | ||
}); | ||
it('an additional class as a string without replacing the core hook', () => { | ||
const element = render(<Image {...baseProps} className='hero-image' />); | ||
['b-image-wrapper', 'hero-image'].forEach((cname) => expect(element.refs.wrapper.classList.contains(cname)).toBe(true)); | ||
}); | ||
it('accepts component customization', () => { | ||
render(<Image {...baseProps} component='figure' />); | ||
expect($('figure.b-image')).not.toBeNull(); | ||
}); | ||
describe('CSS hook', () => { | ||
it('renders .b-image-wrapper', () => { | ||
const element = render(<Image {...baseProps} />); | ||
expect(element.refs.wrapper.classList.contains('b-image-wrapper')).toBe(true); | ||
}); | ||
it('renders .b-image', () => { | ||
const element = render(<Image {...baseProps} />); | ||
expect(element.refs.image.classList.contains('b-image')).toBe(true); | ||
}); | ||
it('renders .b-image-status', () => { | ||
const element = render(<Image {...baseProps} />); | ||
expect(element.refs.status.classList.contains('b-image-status')).toBe(true); | ||
}); | ||
it('renders a single space as its child (needed for Safari)', () => { | ||
render(<Image {...baseProps} alt='foo' />); | ||
expect($('.b-image').textContent).toBe('\u00A0'); | ||
}); | ||
describe('description', () => { | ||
it('renders the HTML `alt` attribute if `props.displayAsBackgroundImage` is falsy', () => { | ||
const element = render(<Image {...baseProps} alt='foo' />); | ||
const node = element.refs.image; | ||
expect(node.getAttribute('alt')).toBe('foo'); | ||
expect(node.hasAttribute('title')).toBe(false); | ||
}); | ||
it('renders the HTML `title` attribute if `props.displayAsBackgroundImage` is `true`', () => { | ||
const element = render(<Image {...baseProps} alt='foo' displayAsBackgroundImage={true} />); | ||
const node = element.refs.image; | ||
expect(node.getAttribute('title')).toBe('foo'); | ||
expect(node.hasAttribute('alt')).toBe(false); | ||
}); | ||
it('renders the HTML `title` attribute', () => { | ||
render(<Image {...baseProps} alt='foo' />); | ||
expect($('.b-image[title="foo"]')).not.toBeNull(); | ||
}); | ||
@@ -151,3 +59,3 @@ | ||
element.setState({ status: Image.status.ERROR }, () => { | ||
expect(element.refs.status.classList.contains('b-image-error')).toBe(true); | ||
expect($('.b-image.b-image-error')).not.toBeNull(); | ||
done(); | ||
@@ -159,3 +67,3 @@ }); | ||
element.setState({ status: Image.status.LOADING }, () => { | ||
expect(element.refs.status.classList.contains('b-image-loading')).toBe(true); | ||
expect($('.b-image.b-image-loading')).not.toBeNull(); | ||
done(); | ||
@@ -167,3 +75,3 @@ }); | ||
element.setState({ status: Image.status.LOADED }, () => { | ||
expect(element.refs.status.classList.contains('b-image-loaded')).toBe(true); | ||
expect($('.b-image.b-image-loaded')).not.toBeNull(); | ||
done(); | ||
@@ -170,0 +78,0 @@ }); |
{ | ||
"name": "boundless-image", | ||
"version": "1.0.0-beta.6", | ||
"version": "1.0.0-beta.7", | ||
"description": "An image block with placeholder support for loading and fallback scenarios.", | ||
@@ -27,3 +27,4 @@ "main": "build/index.js", | ||
"dependencies": { | ||
"boundless-utils-omit-keys": "^1.0.0-beta.6", | ||
"boundless-utils-omit-keys": "^1.0.0-beta.7", | ||
"boundless-utils-uuid": "^1.0.0-beta.7", | ||
"classnames": "^2.1.5" | ||
@@ -30,0 +31,0 @@ }, |
150
README.md
@@ -0,70 +1,122 @@ | ||
<!--- | ||
THIS IS AN AUTOGENERATED FILE. EDIT INDEX.JS INSTEAD. | ||
--> | ||
# Image | ||
# Image | ||
__An image block with placeholder support for loading and fallback scenarios.__ | ||
## Example Usage | ||
```jsx | ||
import React from 'react'; | ||
import Button from '../../boundless-button/index'; | ||
import Image from '../index'; | ||
export default class ImageDemo extends React.PureComponent { | ||
state = { | ||
normal: Date.now(), | ||
delayed: Date.now(), | ||
error: Date.now(), | ||
} | ||
remountImage(refName) { | ||
this.setState({[refName]: Date.now()}); | ||
} | ||
render() { | ||
return ( | ||
<div className='demo-image spread center'> | ||
<figure> | ||
<h5>Normal</h5> | ||
<Image | ||
ref='normal' | ||
src={`https://c2.staticflickr.com/6/5128/5288605976_9b06c0de8f_b.jpg?${this.state.normal}`} | ||
alt='A snowy drive.' /> | ||
<Button | ||
onPressed={this.remountImage.bind(this, 'normal')} | ||
style={{marginTop: '1rem'}}> | ||
Remount Image | ||
</Button> | ||
</figure> | ||
<figure> | ||
<h5>Delayed</h5> | ||
<Image | ||
ref='delayed' | ||
src={`http://deelay.me/5000/http://igcdn-photos-g-a.akamaihd.net/hphotos-ak-xfa1/t51.2885-15/11244434_646274218842534_532892887_n.jpg?${this.state.delayed}`} | ||
alt='A beachscape.' /> | ||
<Button onPressed={this.remountImage.bind(this, 'delayed')} | ||
style={{marginTop: '1rem'}}> | ||
Remount Image | ||
</Button> | ||
</figure> | ||
<figure> | ||
<h5>Errored Out</h5> | ||
<Image | ||
ref='error' | ||
src={`http://www.flickr.com/1o2k3ok1231?${this.state.error}`} | ||
alt='A dead image.' /> | ||
<Button | ||
onPressed={this.remountImage.bind(this, 'error')} | ||
style={{marginTop: '1rem'}}> | ||
Remount Image | ||
</Button> | ||
</figure> | ||
</div> | ||
); | ||
} | ||
} | ||
``` | ||
## Props | ||
_Note: only top-level props are in the README, for the full list check out the [website](http://boundless.js.org/Image#props)._ | ||
> Note: only top-level props are in the README, for the full list check out the [website](http://boundless.js.org/Image#props). | ||
### Required Props | ||
<table> | ||
<tr> | ||
<th>Name</th> | ||
<th>Type</th> | ||
<th>Default Value</th> | ||
<th>Description</th> | ||
</tr> | ||
- __`src`__ ・ a valid path to the desired image | ||
<tr> | ||
<td>src</td> | ||
<td><pre><code>string</code></pre></td> | ||
<td><pre><code class="language-js">'about:blank'</code></pre></td> | ||
<td>a valid path to the desired image</td> | ||
</tr> | ||
Expects | Default Value | ||
- | - | ||
`string` | `'about:blank'` | ||
</table> | ||
### Optional Props | ||
<table> | ||
<tr> | ||
<th>Name</th> | ||
<th>Type</th> | ||
<th>Default Value</th> | ||
<th>Description</th> | ||
</tr> | ||
- __`*`__ ・ any [React-supported attribute](https://facebook.github.io/react/docs/tags-and-attributes.html#html-attributes) | ||
<tr> | ||
<td>alt</td> | ||
<td><pre><code>string</code></pre></td> | ||
<td><pre><code class="language-js">null</code></pre></td> | ||
<td>a written description of the image for search engines, hovertext and those using accessibility technologies; applied to the `.b-image` as the HTML attributes `alt` or `title`, depending on the type of rendered node</td> | ||
</tr> | ||
Expects | Default Value | ||
- | - | ||
`any` | `n/a` | ||
<tr> | ||
<td>displayAsBackgroundImage</td> | ||
<td><pre><code>bool</code></pre></td> | ||
<td><pre><code class="language-js">false</code></pre></td> | ||
<td>emits the image as a `<div>` with `background-image` css property set instead of `<img>`</td> | ||
</tr> | ||
- __`alt`__ ・ a written description of the image for search engines, hovertext and those using accessibility technologies | ||
<tr> | ||
<td>imageProps</td> | ||
<td><pre><code>object</code></pre></td> | ||
<td><pre><code class="language-js">{}</code></pre></td> | ||
<td>any [React-supported attribute](https://facebook.github.io/react/docs/tags-and-attributes.html#html-attributes); applied to the `.b-image` node</td> | ||
</tr> | ||
Expects | Default Value | ||
- | - | ||
`string` | `''` | ||
<tr> | ||
<td>statusProps</td> | ||
<td><pre><code>object</code></pre></td> | ||
<td><pre><code class="language-js">{}</code></pre></td> | ||
<td>any [React-supported attribute](https://facebook.github.io/react/docs/tags-and-attributes.html#html-attributes); applied to the `.b-image-status` node</td> | ||
</tr> | ||
- __`component`__ ・ overrides the component HTML tag | ||
</table> | ||
Expects | Default Value | ||
- | - | ||
`string` | `'div'` | ||
## Reference Styles | ||
### Stylus | ||
```stylus | ||
// Bring in Boundless's base Stylus variables | ||
@require "node_modules/boundless-image/variables" | ||
// Redefine any variables as desired, e.g. | ||
color-accent = royalblue | ||
// Bring in the component styles; they will be autoconfigured based on the above | ||
@require "node_modules/boundless-image/style" | ||
``` | ||
### CSS | ||
If desired, a precompiled plain CSS stylesheet is available for customization at `/build/style.css`, based on Boundless's [default variables](https://github.com/enigma-io/boundless/blob/master/variables.styl). | ||
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
74637
11
123
5
271
1
+ Addedboundless-utils-uuid@1.1.0(transitive)