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

gatsby-image

Package Overview
Dependencies
Maintainers
22
Versions
310
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gatsby-image - npm Package Compare versions

Comparing version 2.4.7 to 2.4.8

6

CHANGELOG.md

@@ -6,2 +6,8 @@ # Change Log

## [2.4.8](https://github.com/gatsbyjs/gatsby/compare/gatsby-image@2.4.7...gatsby-image@2.4.8) (2020-06-22)
### Bug Fixes
- **docs:** change bash to shell in code language blocks ([#22899](https://github.com/gatsbyjs/gatsby/issues/22899)) ([6b6b2f2](https://github.com/gatsbyjs/gatsby/commit/6b6b2f2))
## [2.4.7](https://github.com/gatsbyjs/gatsby/compare/gatsby-image@2.4.6...gatsby-image@2.4.7) (2020-06-09)

@@ -8,0 +14,0 @@

334

index.js

@@ -187,14 +187,15 @@ "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
}))
);
});

@@ -224,7 +225,8 @@ } // 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
})
);
});

@@ -238,7 +240,8 @@ }

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
})
);
});

@@ -329,23 +332,24 @@ }

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)
}))
);
});

@@ -500,69 +504,70 @@

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
}))
}
}))
);
}

@@ -587,57 +592,58 @@

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,
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,
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,
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
}))
}
}));
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
}))
}
}))
);
}

@@ -644,0 +650,0 @@

{
"name": "gatsby-image",
"description": "Lazy-loading React image component with optional support for the blur-up effect.",
"version": "2.4.7",
"version": "2.4.8",
"author": "Kyle Mathews <mathews.kyle@gmail.com>",

@@ -18,3 +18,3 @@ "bugs": {

"@testing-library/react": "^9.5.0",
"babel-preset-gatsby-package": "^0.4.4",
"babel-preset-gatsby-package": "^0.4.5",
"cross-env": "^5.2.1"

@@ -43,3 +43,3 @@ },

},
"gitHead": "221481bef7733c9957fb9ba83178f08280243b81"
"gitHead": "934e51691b29d55bbad8094175b6d9d71337bd61"
}

@@ -87,3 +87,3 @@ # gatsby-image

```bash
```shell
npm install --save gatsby-transformer-sharp gatsby-plugin-sharp

@@ -90,0 +90,0 @@ ```

@@ -69,9 +69,10 @@ "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)
}))
);
};

@@ -96,7 +97,8 @@

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;
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