gatsby-image
Advanced tools
Comparing version 2.4.8 to 2.4.9
@@ -6,2 +6,6 @@ # Change Log | ||
## [2.4.9](https://github.com/gatsbyjs/gatsby/compare/gatsby-image@2.4.8...gatsby-image@2.4.9) (2020-06-24) | ||
**Note:** Version bump only for package gatsby-image | ||
## [2.4.8](https://github.com/gatsbyjs/gatsby/compare/gatsby-image@2.4.7...gatsby-image@2.4.8) (2020-06-22) | ||
@@ -8,0 +12,0 @@ |
334
index.js
@@ -187,15 +187,14 @@ "use strict"; | ||
sizes = _ref3.sizes; | ||
return (/*#__PURE__*/_react.default.createElement(_react.default.Fragment, { | ||
key: src | ||
}, srcSetWebp && /*#__PURE__*/_react.default.createElement("source", { | ||
type: "image/webp", | ||
media: media, | ||
srcSet: srcSetWebp, | ||
sizes: sizes | ||
}), /*#__PURE__*/_react.default.createElement("source", { | ||
media: media, | ||
srcSet: srcSet, | ||
sizes: sizes | ||
})) | ||
); | ||
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, { | ||
key: src | ||
}, srcSetWebp && /*#__PURE__*/_react.default.createElement("source", { | ||
type: "image/webp", | ||
media: media, | ||
srcSet: srcSetWebp, | ||
sizes: sizes | ||
}), /*#__PURE__*/_react.default.createElement("source", { | ||
media: media, | ||
srcSet: srcSet, | ||
sizes: sizes | ||
})); | ||
}); | ||
@@ -225,8 +224,7 @@ } // Return an array ordered by elements having a media prop, does not use | ||
tracedSVG = _ref4.tracedSVG; | ||
return (/*#__PURE__*/_react.default.createElement("source", { | ||
key: src, | ||
media: media, | ||
srcSet: tracedSVG | ||
}) | ||
); | ||
return /*#__PURE__*/_react.default.createElement("source", { | ||
key: src, | ||
media: media, | ||
srcSet: tracedSVG | ||
}); | ||
}); | ||
@@ -240,8 +238,7 @@ } | ||
base64 = _ref5.base64; | ||
return (/*#__PURE__*/_react.default.createElement("source", { | ||
key: src, | ||
media: media, | ||
srcSet: base64 | ||
}) | ||
); | ||
return /*#__PURE__*/_react.default.createElement("source", { | ||
key: src, | ||
media: media, | ||
srcSet: base64 | ||
}); | ||
}); | ||
@@ -332,24 +329,23 @@ } | ||
otherProps = (0, _objectWithoutPropertiesLoose2.default)(props, ["sizes", "srcSet", "src", "style", "onLoad", "onError", "loading", "draggable", "ariaHidden"]); | ||
return (/*#__PURE__*/_react.default.createElement("img", (0, _extends2.default)({ | ||
"aria-hidden": ariaHidden, | ||
sizes: sizes, | ||
srcSet: srcSet, | ||
src: src | ||
}, otherProps, { | ||
onLoad: onLoad, | ||
onError: onError, | ||
ref: ref, | ||
loading: loading, | ||
draggable: draggable, | ||
style: (0, _extends2.default)({ | ||
position: "absolute", | ||
top: 0, | ||
left: 0, | ||
width: "100%", | ||
height: "100%", | ||
objectFit: "cover", | ||
objectPosition: "center" | ||
}, style) | ||
})) | ||
); | ||
return /*#__PURE__*/_react.default.createElement("img", (0, _extends2.default)({ | ||
"aria-hidden": ariaHidden, | ||
sizes: sizes, | ||
srcSet: srcSet, | ||
src: src | ||
}, otherProps, { | ||
onLoad: onLoad, | ||
onError: onError, | ||
ref: ref, | ||
loading: loading, | ||
draggable: draggable, | ||
style: (0, _extends2.default)({ | ||
position: "absolute", | ||
top: 0, | ||
left: 0, | ||
width: "100%", | ||
height: "100%", | ||
objectFit: "cover", | ||
objectPosition: "center" | ||
}, style) | ||
})); | ||
}); | ||
@@ -504,70 +500,69 @@ | ||
var image = getCurrentSrcData(fluid); | ||
return (/*#__PURE__*/_react.default.createElement(Tag, { | ||
className: (className ? className : "") + " gatsby-image-wrapper", | ||
style: (0, _extends2.default)({ | ||
position: "relative", | ||
overflow: "hidden", | ||
maxWidth: image.maxWidth ? image.maxWidth + "px" : null, | ||
maxHeight: image.maxHeight ? image.maxHeight + "px" : null | ||
}, style), | ||
ref: this.handleRef, | ||
key: "fluid-" + JSON.stringify(image.srcSet) | ||
}, /*#__PURE__*/_react.default.createElement(Tag, { | ||
"aria-hidden": true, | ||
style: { | ||
width: "100%", | ||
paddingBottom: 100 / image.aspectRatio + "%" | ||
} | ||
}), bgColor && /*#__PURE__*/_react.default.createElement(Tag, { | ||
"aria-hidden": true, | ||
title: title, | ||
style: (0, _extends2.default)({ | ||
backgroundColor: bgColor, | ||
position: "absolute", | ||
top: 0, | ||
bottom: 0, | ||
opacity: !this.state.imgLoaded ? 1 : 0, | ||
right: 0, | ||
left: 0 | ||
}, shouldFadeIn && delayHideStyle) | ||
}), image.base64 && /*#__PURE__*/_react.default.createElement(Placeholder, { | ||
ariaHidden: true, | ||
ref: this.placeholderRef, | ||
src: image.base64, | ||
spreadProps: placeholderImageProps, | ||
imageVariants: imageVariants, | ||
generateSources: generateBase64Sources | ||
}), image.tracedSVG && /*#__PURE__*/_react.default.createElement(Placeholder, { | ||
ariaHidden: true, | ||
ref: this.placeholderRef, | ||
src: image.tracedSVG, | ||
spreadProps: placeholderImageProps, | ||
imageVariants: imageVariants, | ||
generateSources: generateTracedSVGSources | ||
}), this.state.isVisible && /*#__PURE__*/_react.default.createElement("picture", null, generateImageSources(imageVariants), /*#__PURE__*/_react.default.createElement(Img, { | ||
alt: alt, | ||
title: title, | ||
sizes: image.sizes, | ||
src: image.src, | ||
crossOrigin: this.props.crossOrigin, | ||
srcSet: image.srcSet, | ||
style: imageStyle, | ||
ref: this.imageRef, | ||
onLoad: this.handleImageLoaded, | ||
onError: this.props.onError, | ||
itemProp: itemProp, | ||
loading: loading, | ||
draggable: draggable | ||
})), this.addNoScript && /*#__PURE__*/_react.default.createElement("noscript", { | ||
dangerouslySetInnerHTML: { | ||
__html: noscriptImg((0, _extends2.default)({ | ||
alt: alt, | ||
title: title, | ||
loading: loading | ||
}, image, { | ||
imageVariants: imageVariants | ||
})) | ||
} | ||
})) | ||
); | ||
return /*#__PURE__*/_react.default.createElement(Tag, { | ||
className: (className ? className : "") + " gatsby-image-wrapper", | ||
style: (0, _extends2.default)({ | ||
position: "relative", | ||
overflow: "hidden", | ||
maxWidth: image.maxWidth ? image.maxWidth + "px" : null, | ||
maxHeight: image.maxHeight ? image.maxHeight + "px" : null | ||
}, style), | ||
ref: this.handleRef, | ||
key: "fluid-" + JSON.stringify(image.srcSet) | ||
}, /*#__PURE__*/_react.default.createElement(Tag, { | ||
"aria-hidden": true, | ||
style: { | ||
width: "100%", | ||
paddingBottom: 100 / image.aspectRatio + "%" | ||
} | ||
}), bgColor && /*#__PURE__*/_react.default.createElement(Tag, { | ||
"aria-hidden": true, | ||
title: title, | ||
style: (0, _extends2.default)({ | ||
backgroundColor: bgColor, | ||
position: "absolute", | ||
top: 0, | ||
bottom: 0, | ||
opacity: !this.state.imgLoaded ? 1 : 0, | ||
right: 0, | ||
left: 0 | ||
}, shouldFadeIn && delayHideStyle) | ||
}), image.base64 && /*#__PURE__*/_react.default.createElement(Placeholder, { | ||
ariaHidden: true, | ||
ref: this.placeholderRef, | ||
src: image.base64, | ||
spreadProps: placeholderImageProps, | ||
imageVariants: imageVariants, | ||
generateSources: generateBase64Sources | ||
}), image.tracedSVG && /*#__PURE__*/_react.default.createElement(Placeholder, { | ||
ariaHidden: true, | ||
ref: this.placeholderRef, | ||
src: image.tracedSVG, | ||
spreadProps: placeholderImageProps, | ||
imageVariants: imageVariants, | ||
generateSources: generateTracedSVGSources | ||
}), this.state.isVisible && /*#__PURE__*/_react.default.createElement("picture", null, generateImageSources(imageVariants), /*#__PURE__*/_react.default.createElement(Img, { | ||
alt: alt, | ||
title: title, | ||
sizes: image.sizes, | ||
src: image.src, | ||
crossOrigin: this.props.crossOrigin, | ||
srcSet: image.srcSet, | ||
style: imageStyle, | ||
ref: this.imageRef, | ||
onLoad: this.handleImageLoaded, | ||
onError: this.props.onError, | ||
itemProp: itemProp, | ||
loading: loading, | ||
draggable: draggable | ||
})), this.addNoScript && /*#__PURE__*/_react.default.createElement("noscript", { | ||
dangerouslySetInnerHTML: { | ||
__html: noscriptImg((0, _extends2.default)({ | ||
alt: alt, | ||
title: title, | ||
loading: loading | ||
}, image, { | ||
imageVariants: imageVariants | ||
})) | ||
} | ||
})); | ||
} | ||
@@ -592,58 +587,57 @@ | ||
return (/*#__PURE__*/_react.default.createElement(Tag, { | ||
className: (className ? className : "") + " gatsby-image-wrapper", | ||
style: divStyle, | ||
ref: this.handleRef, | ||
key: "fixed-" + JSON.stringify(_image.srcSet) | ||
}, bgColor && /*#__PURE__*/_react.default.createElement(Tag, { | ||
"aria-hidden": true, | ||
title: title, | ||
style: (0, _extends2.default)({ | ||
backgroundColor: bgColor, | ||
width: _image.width, | ||
opacity: !this.state.imgLoaded ? 1 : 0, | ||
height: _image.height | ||
}, shouldFadeIn && delayHideStyle) | ||
}), _image.base64 && /*#__PURE__*/_react.default.createElement(Placeholder, { | ||
ariaHidden: true, | ||
ref: this.placeholderRef, | ||
src: _image.base64, | ||
spreadProps: placeholderImageProps, | ||
imageVariants: _imageVariants, | ||
generateSources: generateBase64Sources | ||
}), _image.tracedSVG && /*#__PURE__*/_react.default.createElement(Placeholder, { | ||
ariaHidden: true, | ||
ref: this.placeholderRef, | ||
src: _image.tracedSVG, | ||
spreadProps: placeholderImageProps, | ||
imageVariants: _imageVariants, | ||
generateSources: generateTracedSVGSources | ||
}), this.state.isVisible && /*#__PURE__*/_react.default.createElement("picture", null, generateImageSources(_imageVariants), /*#__PURE__*/_react.default.createElement(Img, { | ||
alt: alt, | ||
title: title, | ||
return /*#__PURE__*/_react.default.createElement(Tag, { | ||
className: (className ? className : "") + " gatsby-image-wrapper", | ||
style: divStyle, | ||
ref: this.handleRef, | ||
key: "fixed-" + JSON.stringify(_image.srcSet) | ||
}, bgColor && /*#__PURE__*/_react.default.createElement(Tag, { | ||
"aria-hidden": true, | ||
title: title, | ||
style: (0, _extends2.default)({ | ||
backgroundColor: bgColor, | ||
width: _image.width, | ||
height: _image.height, | ||
sizes: _image.sizes, | ||
src: _image.src, | ||
crossOrigin: this.props.crossOrigin, | ||
srcSet: _image.srcSet, | ||
style: imageStyle, | ||
ref: this.imageRef, | ||
onLoad: this.handleImageLoaded, | ||
onError: this.props.onError, | ||
itemProp: itemProp, | ||
loading: loading, | ||
draggable: draggable | ||
})), this.addNoScript && /*#__PURE__*/_react.default.createElement("noscript", { | ||
dangerouslySetInnerHTML: { | ||
__html: noscriptImg((0, _extends2.default)({ | ||
alt: alt, | ||
title: title, | ||
loading: loading | ||
}, _image, { | ||
imageVariants: _imageVariants | ||
})) | ||
} | ||
})) | ||
); | ||
opacity: !this.state.imgLoaded ? 1 : 0, | ||
height: _image.height | ||
}, shouldFadeIn && delayHideStyle) | ||
}), _image.base64 && /*#__PURE__*/_react.default.createElement(Placeholder, { | ||
ariaHidden: true, | ||
ref: this.placeholderRef, | ||
src: _image.base64, | ||
spreadProps: placeholderImageProps, | ||
imageVariants: _imageVariants, | ||
generateSources: generateBase64Sources | ||
}), _image.tracedSVG && /*#__PURE__*/_react.default.createElement(Placeholder, { | ||
ariaHidden: true, | ||
ref: this.placeholderRef, | ||
src: _image.tracedSVG, | ||
spreadProps: placeholderImageProps, | ||
imageVariants: _imageVariants, | ||
generateSources: generateTracedSVGSources | ||
}), this.state.isVisible && /*#__PURE__*/_react.default.createElement("picture", null, generateImageSources(_imageVariants), /*#__PURE__*/_react.default.createElement(Img, { | ||
alt: alt, | ||
title: title, | ||
width: _image.width, | ||
height: _image.height, | ||
sizes: _image.sizes, | ||
src: _image.src, | ||
crossOrigin: this.props.crossOrigin, | ||
srcSet: _image.srcSet, | ||
style: imageStyle, | ||
ref: this.imageRef, | ||
onLoad: this.handleImageLoaded, | ||
onError: this.props.onError, | ||
itemProp: itemProp, | ||
loading: loading, | ||
draggable: draggable | ||
})), this.addNoScript && /*#__PURE__*/_react.default.createElement("noscript", { | ||
dangerouslySetInnerHTML: { | ||
__html: noscriptImg((0, _extends2.default)({ | ||
alt: alt, | ||
title: title, | ||
loading: loading | ||
}, _image, { | ||
imageVariants: _imageVariants | ||
})) | ||
} | ||
})); | ||
} | ||
@@ -650,0 +644,0 @@ |
{ | ||
"name": "gatsby-image", | ||
"description": "Lazy-loading React image component with optional support for the blur-up effect.", | ||
"version": "2.4.8", | ||
"version": "2.4.9", | ||
"author": "Kyle Mathews <mathews.kyle@gmail.com>", | ||
@@ -10,3 +10,3 @@ "bugs": { | ||
"dependencies": { | ||
"@babel/runtime": "^7.10.2", | ||
"@babel/runtime": "^7.10.3", | ||
"object-fit-images": "^3.2.4", | ||
@@ -16,6 +16,6 @@ "prop-types": "^15.7.2" | ||
"devDependencies": { | ||
"@babel/cli": "^7.10.1", | ||
"@babel/core": "^7.10.2", | ||
"@babel/cli": "^7.10.3", | ||
"@babel/core": "^7.10.3", | ||
"@testing-library/react": "^9.5.0", | ||
"babel-preset-gatsby-package": "^0.4.5", | ||
"babel-preset-gatsby-package": "^0.4.6", | ||
"cross-env": "^5.2.1" | ||
@@ -44,3 +44,3 @@ }, | ||
}, | ||
"gitHead": "934e51691b29d55bbad8094175b6d9d71337bd61" | ||
"gitHead": "0005a1f2c905e4037aa9815605360688767b5e2e" | ||
} |
@@ -69,10 +69,9 @@ "use strict"; | ||
}; | ||
return (/*#__PURE__*/_react.default.createElement(_index.default, (0, _extends2.default)({ | ||
ref: this.imageRef, | ||
placeholderRef: this.placeholderRef | ||
}, props, { | ||
imgStyle: (0, _extends2.default)({}, props.imgStyle, polyfillStyle), | ||
placeholderStyle: (0, _extends2.default)({}, props.placeholderStyle, polyfillStyle) | ||
})) | ||
); | ||
return /*#__PURE__*/_react.default.createElement(_index.default, (0, _extends2.default)({ | ||
ref: this.imageRef, | ||
placeholderRef: this.placeholderRef | ||
}, props, { | ||
imgStyle: (0, _extends2.default)({}, props.imgStyle, polyfillStyle), | ||
placeholderStyle: (0, _extends2.default)({}, props.placeholderStyle, polyfillStyle) | ||
})); | ||
}; | ||
@@ -97,8 +96,7 @@ | ||
var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) { | ||
return (/*#__PURE__*/_react.default.createElement(ImageWithIEPolyfill, (0, _extends2.default)({}, props, { | ||
innerRef: ref | ||
})) | ||
); | ||
return /*#__PURE__*/_react.default.createElement(ImageWithIEPolyfill, (0, _extends2.default)({}, props, { | ||
innerRef: ref | ||
})); | ||
}); | ||
exports.default = _default; |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
80588
753
1
Updated@babel/runtime@^7.10.3