@kids-reporter/draft-renderer 1.0.6 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -29,6 +29,7 @@ const FigureCaption = _styledComponents.default.figcaption`
29
29
  `;
30
30
  const Img = _styledComponents.default.img`
31
31
  width: 100%;
32
+ object-fit: contain;
32
33
  `;
33
34
  function ImageBlock({
34
35
  className = '',
@@ -39,6 +40,7 @@ function ImageBlock({
39
40
  imageFile,
40
41
  resized
41
42
  } = data || {};
43
+ const aspectRatio = imageFile !== null && imageFile !== void 0 && imageFile.width && imageFile !== null && imageFile !== void 0 && imageFile.height ? `${imageFile.width}/${imageFile.height}` : '16/9';
42
44
  const imgSrcSetArr = [];
43
45
  if (resized !== null && resized !== void 0 && resized.medium) {
44
46
  imgSrcSetArr.push(`${resized.medium} 500w`);
@@ -52,7 +54,10 @@ function ImageBlock({
52
54
  alt: desc,
53
55
  src: imageFile === null || imageFile === void 0 ? void 0 : imageFile.url,
54
56
  srcSet: imgSrcSetArr.join(','),
55
- sizes: "(min-width: 1200px) 1000px, 100vw"
57
+ sizes: "(min-width: 1200px) 1000px, 100vw",
58
+ style: {
59
+ aspectRatio: aspectRatio
60
+ }
56
61
  }), desc && /*#__PURE__*/_react.default.createElement(FigureCaption, null, desc));
57
62
  return imgBlock;
58
63
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kids-reporter/draft-renderer",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {