gatsby-plugin-image 2.12.0 → 2.14.0-next.0
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.
- package/CHANGELOG.md +16 -0
- package/gatsby-ssr.js +45 -0
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
### [2.12.1](https://github.com/gatsbyjs/gatsby/commits/gatsby-plugin-image@2.12.1/packages/gatsby-plugin-image) (2022-04-13)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package gatsby-plugin-image
|
|
9
|
+
|
|
10
|
+
## [2.12.0](https://github.com/gatsbyjs/gatsby/commits/gatsby-plugin-image@2.12.0/packages/gatsby-plugin-image) (2022-04-12)
|
|
11
|
+
|
|
12
|
+
[🧾 Release notes](https://www.gatsbyjs.com/docs/reference/release-notes/v4.12)
|
|
13
|
+
|
|
14
|
+
#### Bug Fixes
|
|
15
|
+
|
|
16
|
+
- update dependency prop-types to ^15.8.1 for gatsby-plugin-image [#35292](https://github.com/gatsbyjs/gatsby/issues/35292) ([c662a39](https://github.com/gatsbyjs/gatsby/commit/c662a3931dc38bd819e75539e52b1346fbb95b70))
|
|
17
|
+
|
|
18
|
+
#### Chores
|
|
19
|
+
|
|
20
|
+
- update dependency semver to ^7.3.5 [#35279](https://github.com/gatsbyjs/gatsby/issues/35279) ([1d5d4a6](https://github.com/gatsbyjs/gatsby/commit/1d5d4a6ff6e376476b2a7db6dd2f5f7ce61f4483))
|
|
21
|
+
|
|
6
22
|
### [2.11.1](https://github.com/gatsbyjs/gatsby/commits/gatsby-plugin-image@2.11.1/packages/gatsby-plugin-image) (2022-03-31)
|
|
7
23
|
|
|
8
24
|
**Note:** Version bump only for package gatsby-plugin-image
|
package/gatsby-ssr.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
var React = require('react');
|
|
2
|
+
var commonTags = require('common-tags');
|
|
3
|
+
|
|
4
|
+
function _interopNamespace(e) {
|
|
5
|
+
if (e && e.__esModule) return e;
|
|
6
|
+
var n = Object.create(null);
|
|
7
|
+
if (e) {
|
|
8
|
+
Object.keys(e).forEach(function (k) {
|
|
9
|
+
if (k !== 'default') {
|
|
10
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
11
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function () { return e[k]; }
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
n["default"] = e;
|
|
19
|
+
return n;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
23
|
+
|
|
24
|
+
var generateHtml = function generateHtml(str) {
|
|
25
|
+
return {
|
|
26
|
+
__html: commonTags.oneLine(str)
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
function onRenderBody(_ref) {
|
|
31
|
+
var setHeadComponents = _ref.setHeadComponents;
|
|
32
|
+
setHeadComponents([React__namespace.createElement("style", {
|
|
33
|
+
key: "gatsby-image-style",
|
|
34
|
+
dangerouslySetInnerHTML: generateHtml(".gatsby-image-wrapper{position:relative;overflow:hidden}.gatsby-image-wrapper picture.object-fit-polyfill{position:static!important}.gatsby-image-wrapper img{bottom:0;height:100%;left:0;margin:0;max-width:none;padding:0;position:absolute;right:0;top:0;width:100%;object-fit:cover}.gatsby-image-wrapper [data-main-image]{opacity:0;transform:translateZ(0);transition:opacity .25s linear;will-change:opacity}.gatsby-image-wrapper-constrained{display:inline-block;vertical-align:top}")
|
|
35
|
+
}), React__namespace.createElement("noscript", {
|
|
36
|
+
key: "gatsby-image-style-noscript",
|
|
37
|
+
dangerouslySetInnerHTML: generateHtml("<style>" + ".gatsby-image-wrapper noscript [data-main-image]{opacity:1!important}.gatsby-image-wrapper [data-placeholder-image]{opacity:0!important}" + "</style>")
|
|
38
|
+
}), React__namespace.createElement("script", {
|
|
39
|
+
key: "gatsby-image-style-script",
|
|
40
|
+
type: "module",
|
|
41
|
+
dangerouslySetInnerHTML: generateHtml("const e=\"undefined\"!=typeof HTMLImageElement&&\"loading\"in HTMLImageElement.prototype;e&&document.body.addEventListener(\"load\",(function(e){if(void 0===e.target.dataset.mainImage)return;if(void 0===e.target.dataset.gatsbyImageSsr)return;const t=e.target;let a=null,n=t;for(;null===a&&n;)void 0!==n.parentNode.dataset.gatsbyImageWrapper&&(a=n.parentNode),n=n.parentNode;const o=a.querySelector(\"[data-placeholder-image]\"),r=new Image;r.src=t.currentSrc,r.decode().catch((()=>{})).then((()=>{t.style.opacity=1,o&&(o.style.opacity=0,o.style.transition=\"opacity 500ms linear\")}))}),!0);")
|
|
42
|
+
})]);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
exports.onRenderBody = onRenderBody;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gatsby-plugin-image",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.14.0-next.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "npm-run-all -s clean -p build:*",
|
|
6
6
|
"build:gatsby-node": "tsc --jsx react --downlevelIteration true --skipLibCheck true --esModuleInterop true --outDir dist/ src/gatsby-node.ts src/babel-plugin-parse-static-images.ts src/resolver-utils.ts src/types.d.ts -d --declarationDir dist/src",
|
|
@@ -78,12 +78,12 @@
|
|
|
78
78
|
"@babel/runtime": "^7.15.4",
|
|
79
79
|
"@babel/traverse": "^7.15.4",
|
|
80
80
|
"babel-jsx-utils": "^1.1.0",
|
|
81
|
-
"babel-plugin-remove-graphql-queries": "^4.
|
|
81
|
+
"babel-plugin-remove-graphql-queries": "^4.14.0-next.0",
|
|
82
82
|
"camelcase": "^5.3.1",
|
|
83
83
|
"chokidar": "^3.5.2",
|
|
84
84
|
"common-tags": "^1.8.2",
|
|
85
85
|
"fs-extra": "^10.0.0",
|
|
86
|
-
"gatsby-core-utils": "^3.
|
|
86
|
+
"gatsby-core-utils": "^3.14.0-next.0",
|
|
87
87
|
"objectFitPolyfill": "^2.3.5",
|
|
88
88
|
"prop-types": "^15.8.1"
|
|
89
89
|
},
|
|
@@ -94,5 +94,5 @@
|
|
|
94
94
|
},
|
|
95
95
|
"author": "Matt Kane <matt@gatsbyjs.com>",
|
|
96
96
|
"license": "MIT",
|
|
97
|
-
"gitHead": "
|
|
97
|
+
"gitHead": "32614f53057169772d4e8469d2985d9a54ef5aed"
|
|
98
98
|
}
|