gatsby-plugin-image 2.9.0 → 2.10.0-next.2
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/dist/babel-helpers.js +66 -66
- package/dist/babel-plugin-parse-static-images.js +80 -80
- package/dist/components/gatsby-image.browser.js +247 -247
- package/dist/components/gatsby-image.server.js +112 -112
- package/dist/components/hooks.js +399 -399
- package/dist/components/intersection-observer.js +55 -55
- package/dist/components/layout-wrapper.js +94 -94
- package/dist/components/lazy-hydrate.js +75 -75
- package/dist/components/main-image.js +43 -43
- package/dist/components/picture.js +96 -96
- package/dist/components/placeholder.js +74 -74
- package/dist/components/static-image.server.js +111 -111
- package/dist/gatsby-node.js +54 -54
- package/dist/image-utils.js +449 -449
- package/dist/index.js +27 -27
- package/dist/node-apis/image-processing.js +278 -278
- package/dist/node-apis/node-utils.js +11 -11
- package/dist/node-apis/parser.js +98 -98
- package/dist/node-apis/preprocess-source.js +118 -118
- package/dist/node-apis/watcher.js +129 -129
- package/dist/resolver-utils.js +119 -119
- package/dist/src/babel-helpers.d.ts +6 -6
- package/dist/src/babel-plugin-parse-static-images.d.ts +10 -10
- package/dist/src/gatsby-node.d.ts +5 -5
- package/dist/src/node-apis/image-processing.d.ts +30 -30
- package/dist/src/node-apis/node-utils.d.ts +1 -1
- package/dist/src/node-apis/parser.d.ts +11 -11
- package/dist/src/node-apis/preprocess-source.d.ts +2 -2
- package/dist/src/node-apis/watcher.d.ts +12 -12
- package/dist/src/resolver-utils.d.ts +21 -21
- package/package.json +4 -4
|
@@ -1,96 +1,96 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
-
if (k2 === undefined) k2 = k;
|
|
15
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
16
|
-
}) : (function(o, m, k, k2) {
|
|
17
|
-
if (k2 === undefined) k2 = k;
|
|
18
|
-
o[k2] = m[k];
|
|
19
|
-
}));
|
|
20
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
21
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
22
|
-
}) : function(o, v) {
|
|
23
|
-
o["default"] = v;
|
|
24
|
-
});
|
|
25
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
26
|
-
if (mod && mod.__esModule) return mod;
|
|
27
|
-
var result = {};
|
|
28
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
29
|
-
__setModuleDefault(result, mod);
|
|
30
|
-
return result;
|
|
31
|
-
};
|
|
32
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
33
|
-
var t = {};
|
|
34
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
35
|
-
t[p] = s[p];
|
|
36
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
37
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
38
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
39
|
-
t[p[i]] = s[p[i]];
|
|
40
|
-
}
|
|
41
|
-
return t;
|
|
42
|
-
};
|
|
43
|
-
exports.__esModule = true;
|
|
44
|
-
exports.Picture = void 0;
|
|
45
|
-
/* eslint-disable filenames/match-regex */
|
|
46
|
-
var react_1 = __importStar(require("react"));
|
|
47
|
-
var PropTypes = __importStar(require("prop-types"));
|
|
48
|
-
var Image = function Image(_a) {
|
|
49
|
-
var src = _a.src, srcSet = _a.srcSet, loading = _a.loading, _b = _a.alt, alt = _b === void 0 ? "" : _b, shouldLoad = _a.shouldLoad, innerRef = _a.innerRef, props = __rest(_a, ["src", "srcSet", "loading", "alt", "shouldLoad", "innerRef"]);
|
|
50
|
-
return (react_1["default"].createElement("img", __assign({}, props, { decoding: "async", loading: loading, src: shouldLoad ? src : undefined, "data-src": !shouldLoad ? src : undefined, srcSet: shouldLoad ? srcSet : undefined, "data-srcset": !shouldLoad ? srcSet : undefined, alt: alt, ref: innerRef })));
|
|
51
|
-
};
|
|
52
|
-
exports.Picture = (0, react_1.forwardRef)(function Picture(_a, ref) {
|
|
53
|
-
var fallback = _a.fallback, _b = _a.sources, sources = _b === void 0 ? [] : _b, _c = _a.shouldLoad, shouldLoad = _c === void 0 ? true : _c, props = __rest(_a, ["fallback", "sources", "shouldLoad"]);
|
|
54
|
-
var sizes = props.sizes || (fallback === null || fallback === void 0 ? void 0 : fallback.sizes);
|
|
55
|
-
var fallbackImage = (react_1["default"].createElement(Image, __assign({}, props, fallback, { sizes: sizes, shouldLoad: shouldLoad, innerRef: ref })));
|
|
56
|
-
if (!sources.length) {
|
|
57
|
-
return fallbackImage;
|
|
58
|
-
}
|
|
59
|
-
return (react_1["default"].createElement("picture", null,
|
|
60
|
-
sources.map(function (_a) {
|
|
61
|
-
var media = _a.media, srcSet = _a.srcSet, type = _a.type;
|
|
62
|
-
return (react_1["default"].createElement("source", { key: "".concat(media, "-").concat(type, "-").concat(srcSet), type: type, media: media, srcSet: shouldLoad ? srcSet : undefined, "data-srcset": !shouldLoad ? srcSet : undefined, sizes: sizes }));
|
|
63
|
-
}),
|
|
64
|
-
fallbackImage));
|
|
65
|
-
});
|
|
66
|
-
Image.propTypes = {
|
|
67
|
-
src: PropTypes.string.isRequired,
|
|
68
|
-
alt: PropTypes.string.isRequired,
|
|
69
|
-
sizes: PropTypes.string,
|
|
70
|
-
srcSet: PropTypes.string,
|
|
71
|
-
shouldLoad: PropTypes.bool
|
|
72
|
-
};
|
|
73
|
-
exports.Picture.displayName = "Picture";
|
|
74
|
-
exports.Picture.propTypes = {
|
|
75
|
-
alt: PropTypes.string.isRequired,
|
|
76
|
-
shouldLoad: PropTypes.bool,
|
|
77
|
-
fallback: PropTypes.exact({
|
|
78
|
-
src: PropTypes.string.isRequired,
|
|
79
|
-
srcSet: PropTypes.string,
|
|
80
|
-
sizes: PropTypes.string
|
|
81
|
-
}),
|
|
82
|
-
sources: PropTypes.arrayOf(PropTypes.oneOfType([
|
|
83
|
-
PropTypes.exact({
|
|
84
|
-
media: PropTypes.string.isRequired,
|
|
85
|
-
type: PropTypes.string,
|
|
86
|
-
sizes: PropTypes.string,
|
|
87
|
-
srcSet: PropTypes.string.isRequired
|
|
88
|
-
}),
|
|
89
|
-
PropTypes.exact({
|
|
90
|
-
media: PropTypes.string,
|
|
91
|
-
type: PropTypes.string.isRequired,
|
|
92
|
-
sizes: PropTypes.string,
|
|
93
|
-
srcSet: PropTypes.string.isRequired
|
|
94
|
-
}),
|
|
95
|
-
]))
|
|
96
|
-
};
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
16
|
+
}) : (function(o, m, k, k2) {
|
|
17
|
+
if (k2 === undefined) k2 = k;
|
|
18
|
+
o[k2] = m[k];
|
|
19
|
+
}));
|
|
20
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
21
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
22
|
+
}) : function(o, v) {
|
|
23
|
+
o["default"] = v;
|
|
24
|
+
});
|
|
25
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
26
|
+
if (mod && mod.__esModule) return mod;
|
|
27
|
+
var result = {};
|
|
28
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
29
|
+
__setModuleDefault(result, mod);
|
|
30
|
+
return result;
|
|
31
|
+
};
|
|
32
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
33
|
+
var t = {};
|
|
34
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
35
|
+
t[p] = s[p];
|
|
36
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
37
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
38
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
39
|
+
t[p[i]] = s[p[i]];
|
|
40
|
+
}
|
|
41
|
+
return t;
|
|
42
|
+
};
|
|
43
|
+
exports.__esModule = true;
|
|
44
|
+
exports.Picture = void 0;
|
|
45
|
+
/* eslint-disable filenames/match-regex */
|
|
46
|
+
var react_1 = __importStar(require("react"));
|
|
47
|
+
var PropTypes = __importStar(require("prop-types"));
|
|
48
|
+
var Image = function Image(_a) {
|
|
49
|
+
var src = _a.src, srcSet = _a.srcSet, loading = _a.loading, _b = _a.alt, alt = _b === void 0 ? "" : _b, shouldLoad = _a.shouldLoad, innerRef = _a.innerRef, props = __rest(_a, ["src", "srcSet", "loading", "alt", "shouldLoad", "innerRef"]);
|
|
50
|
+
return (react_1["default"].createElement("img", __assign({}, props, { decoding: "async", loading: loading, src: shouldLoad ? src : undefined, "data-src": !shouldLoad ? src : undefined, srcSet: shouldLoad ? srcSet : undefined, "data-srcset": !shouldLoad ? srcSet : undefined, alt: alt, ref: innerRef })));
|
|
51
|
+
};
|
|
52
|
+
exports.Picture = (0, react_1.forwardRef)(function Picture(_a, ref) {
|
|
53
|
+
var fallback = _a.fallback, _b = _a.sources, sources = _b === void 0 ? [] : _b, _c = _a.shouldLoad, shouldLoad = _c === void 0 ? true : _c, props = __rest(_a, ["fallback", "sources", "shouldLoad"]);
|
|
54
|
+
var sizes = props.sizes || (fallback === null || fallback === void 0 ? void 0 : fallback.sizes);
|
|
55
|
+
var fallbackImage = (react_1["default"].createElement(Image, __assign({}, props, fallback, { sizes: sizes, shouldLoad: shouldLoad, innerRef: ref })));
|
|
56
|
+
if (!sources.length) {
|
|
57
|
+
return fallbackImage;
|
|
58
|
+
}
|
|
59
|
+
return (react_1["default"].createElement("picture", null,
|
|
60
|
+
sources.map(function (_a) {
|
|
61
|
+
var media = _a.media, srcSet = _a.srcSet, type = _a.type;
|
|
62
|
+
return (react_1["default"].createElement("source", { key: "".concat(media, "-").concat(type, "-").concat(srcSet), type: type, media: media, srcSet: shouldLoad ? srcSet : undefined, "data-srcset": !shouldLoad ? srcSet : undefined, sizes: sizes }));
|
|
63
|
+
}),
|
|
64
|
+
fallbackImage));
|
|
65
|
+
});
|
|
66
|
+
Image.propTypes = {
|
|
67
|
+
src: PropTypes.string.isRequired,
|
|
68
|
+
alt: PropTypes.string.isRequired,
|
|
69
|
+
sizes: PropTypes.string,
|
|
70
|
+
srcSet: PropTypes.string,
|
|
71
|
+
shouldLoad: PropTypes.bool
|
|
72
|
+
};
|
|
73
|
+
exports.Picture.displayName = "Picture";
|
|
74
|
+
exports.Picture.propTypes = {
|
|
75
|
+
alt: PropTypes.string.isRequired,
|
|
76
|
+
shouldLoad: PropTypes.bool,
|
|
77
|
+
fallback: PropTypes.exact({
|
|
78
|
+
src: PropTypes.string.isRequired,
|
|
79
|
+
srcSet: PropTypes.string,
|
|
80
|
+
sizes: PropTypes.string
|
|
81
|
+
}),
|
|
82
|
+
sources: PropTypes.arrayOf(PropTypes.oneOfType([
|
|
83
|
+
PropTypes.exact({
|
|
84
|
+
media: PropTypes.string.isRequired,
|
|
85
|
+
type: PropTypes.string,
|
|
86
|
+
sizes: PropTypes.string,
|
|
87
|
+
srcSet: PropTypes.string.isRequired
|
|
88
|
+
}),
|
|
89
|
+
PropTypes.exact({
|
|
90
|
+
media: PropTypes.string,
|
|
91
|
+
type: PropTypes.string.isRequired,
|
|
92
|
+
sizes: PropTypes.string,
|
|
93
|
+
srcSet: PropTypes.string.isRequired
|
|
94
|
+
}),
|
|
95
|
+
]))
|
|
96
|
+
};
|
|
@@ -1,74 +1,74 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
-
if (k2 === undefined) k2 = k;
|
|
15
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
16
|
-
}) : (function(o, m, k, k2) {
|
|
17
|
-
if (k2 === undefined) k2 = k;
|
|
18
|
-
o[k2] = m[k];
|
|
19
|
-
}));
|
|
20
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
21
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
22
|
-
}) : function(o, v) {
|
|
23
|
-
o["default"] = v;
|
|
24
|
-
});
|
|
25
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
26
|
-
if (mod && mod.__esModule) return mod;
|
|
27
|
-
var result = {};
|
|
28
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
29
|
-
__setModuleDefault(result, mod);
|
|
30
|
-
return result;
|
|
31
|
-
};
|
|
32
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
33
|
-
var t = {};
|
|
34
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
35
|
-
t[p] = s[p];
|
|
36
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
37
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
38
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
39
|
-
t[p[i]] = s[p[i]];
|
|
40
|
-
}
|
|
41
|
-
return t;
|
|
42
|
-
};
|
|
43
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
44
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
45
|
-
};
|
|
46
|
-
var _a;
|
|
47
|
-
exports.__esModule = true;
|
|
48
|
-
exports.Placeholder = void 0;
|
|
49
|
-
var react_1 = __importDefault(require("react"));
|
|
50
|
-
var PropTypes = __importStar(require("prop-types"));
|
|
51
|
-
var picture_1 = require("./picture");
|
|
52
|
-
var Placeholder = function Placeholder(_a) {
|
|
53
|
-
var fallback = _a.fallback, props = __rest(_a, ["fallback"]);
|
|
54
|
-
if (fallback) {
|
|
55
|
-
return (react_1["default"].createElement(picture_1.Picture, __assign({}, props, { fallback: {
|
|
56
|
-
src: fallback
|
|
57
|
-
}, "aria-hidden": true, alt: "" })));
|
|
58
|
-
}
|
|
59
|
-
else {
|
|
60
|
-
return react_1["default"].createElement("div", __assign({}, props));
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
exports.Placeholder = Placeholder;
|
|
64
|
-
exports.Placeholder.displayName = "Placeholder";
|
|
65
|
-
exports.Placeholder.propTypes = {
|
|
66
|
-
fallback: PropTypes.string,
|
|
67
|
-
sources: (_a = picture_1.Picture.propTypes) === null || _a === void 0 ? void 0 : _a.sources,
|
|
68
|
-
alt: function (props, propName, componentName) {
|
|
69
|
-
if (!props[propName]) {
|
|
70
|
-
return null;
|
|
71
|
-
}
|
|
72
|
-
return new Error("Invalid prop `".concat(propName, "` supplied to `").concat(componentName, "`. Validation failed."));
|
|
73
|
-
}
|
|
74
|
-
};
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
16
|
+
}) : (function(o, m, k, k2) {
|
|
17
|
+
if (k2 === undefined) k2 = k;
|
|
18
|
+
o[k2] = m[k];
|
|
19
|
+
}));
|
|
20
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
21
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
22
|
+
}) : function(o, v) {
|
|
23
|
+
o["default"] = v;
|
|
24
|
+
});
|
|
25
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
26
|
+
if (mod && mod.__esModule) return mod;
|
|
27
|
+
var result = {};
|
|
28
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
29
|
+
__setModuleDefault(result, mod);
|
|
30
|
+
return result;
|
|
31
|
+
};
|
|
32
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
33
|
+
var t = {};
|
|
34
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
35
|
+
t[p] = s[p];
|
|
36
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
37
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
38
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
39
|
+
t[p[i]] = s[p[i]];
|
|
40
|
+
}
|
|
41
|
+
return t;
|
|
42
|
+
};
|
|
43
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
44
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
45
|
+
};
|
|
46
|
+
var _a;
|
|
47
|
+
exports.__esModule = true;
|
|
48
|
+
exports.Placeholder = void 0;
|
|
49
|
+
var react_1 = __importDefault(require("react"));
|
|
50
|
+
var PropTypes = __importStar(require("prop-types"));
|
|
51
|
+
var picture_1 = require("./picture");
|
|
52
|
+
var Placeholder = function Placeholder(_a) {
|
|
53
|
+
var fallback = _a.fallback, props = __rest(_a, ["fallback"]);
|
|
54
|
+
if (fallback) {
|
|
55
|
+
return (react_1["default"].createElement(picture_1.Picture, __assign({}, props, { fallback: {
|
|
56
|
+
src: fallback
|
|
57
|
+
}, "aria-hidden": true, alt: "" })));
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
return react_1["default"].createElement("div", __assign({}, props));
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
exports.Placeholder = Placeholder;
|
|
64
|
+
exports.Placeholder.displayName = "Placeholder";
|
|
65
|
+
exports.Placeholder.propTypes = {
|
|
66
|
+
fallback: PropTypes.string,
|
|
67
|
+
sources: (_a = picture_1.Picture.propTypes) === null || _a === void 0 ? void 0 : _a.sources,
|
|
68
|
+
alt: function (props, propName, componentName) {
|
|
69
|
+
if (!props[propName]) {
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
return new Error("Invalid prop `".concat(propName, "` supplied to `").concat(componentName, "`. Validation failed."));
|
|
73
|
+
}
|
|
74
|
+
};
|
|
@@ -1,111 +1,111 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
-
var t = {};
|
|
15
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
-
t[p] = s[p];
|
|
17
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
-
t[p[i]] = s[p[i]];
|
|
21
|
-
}
|
|
22
|
-
return t;
|
|
23
|
-
};
|
|
24
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
25
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
26
|
-
if (!m) return o;
|
|
27
|
-
var i = m.call(o), r, ar = [], e;
|
|
28
|
-
try {
|
|
29
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
30
|
-
}
|
|
31
|
-
catch (error) { e = { error: error }; }
|
|
32
|
-
finally {
|
|
33
|
-
try {
|
|
34
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
35
|
-
}
|
|
36
|
-
finally { if (e) throw e.error; }
|
|
37
|
-
}
|
|
38
|
-
return ar;
|
|
39
|
-
};
|
|
40
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
41
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
42
|
-
if (ar || !(i in from)) {
|
|
43
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
44
|
-
ar[i] = from[i];
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
48
|
-
};
|
|
49
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
50
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
51
|
-
};
|
|
52
|
-
exports.__esModule = true;
|
|
53
|
-
exports.StaticImage = exports.propTypes = exports._getStaticImage = void 0;
|
|
54
|
-
var react_1 = __importDefault(require("react"));
|
|
55
|
-
var gatsby_image_server_1 = require("./gatsby-image.server");
|
|
56
|
-
var prop_types_1 = __importDefault(require("prop-types"));
|
|
57
|
-
function _getStaticImage(GatsbyImage) {
|
|
58
|
-
return function StaticImage(_a) {
|
|
59
|
-
var src = _a.src, imageData = _a.__imageData, __error = _a.__error,
|
|
60
|
-
// We extract these because they're not meant to be passed-down to GatsbyImage
|
|
61
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
62
|
-
width = _a.width, height = _a.height, aspectRatio = _a.aspectRatio, tracedSVGOptions = _a.tracedSVGOptions, placeholder = _a.placeholder, formats = _a.formats, quality = _a.quality, transformOptions = _a.transformOptions, jpgOptions = _a.jpgOptions, pngOptions = _a.pngOptions, webpOptions = _a.webpOptions, avifOptions = _a.avifOptions, blurredOptions = _a.blurredOptions,
|
|
63
|
-
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
64
|
-
props = __rest(_a, ["src", "__imageData", "__error", "width", "height", "aspectRatio", "tracedSVGOptions", "placeholder", "formats", "quality", "transformOptions", "jpgOptions", "pngOptions", "webpOptions", "avifOptions", "blurredOptions"]);
|
|
65
|
-
if (__error) {
|
|
66
|
-
console.warn(__error);
|
|
67
|
-
}
|
|
68
|
-
if (imageData) {
|
|
69
|
-
return react_1["default"].createElement(GatsbyImage, __assign({ image: imageData }, props));
|
|
70
|
-
}
|
|
71
|
-
console.warn("Image not loaded", src);
|
|
72
|
-
if (!__error && process.env.NODE_ENV === "development") {
|
|
73
|
-
console.warn("Please ensure that \"gatsby-plugin-image\" is included in the plugins array in gatsby-config.js, and that your version of gatsby is at least 2.24.78");
|
|
74
|
-
}
|
|
75
|
-
return null;
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
exports._getStaticImage = _getStaticImage;
|
|
79
|
-
var StaticImage = _getStaticImage(gatsby_image_server_1.GatsbyImage);
|
|
80
|
-
exports.StaticImage = StaticImage;
|
|
81
|
-
var checkDimensionProps = function (props, propName) {
|
|
82
|
-
var rest = [];
|
|
83
|
-
for (var _i = 2; _i < arguments.length; _i++) {
|
|
84
|
-
rest[_i - 2] = arguments[_i];
|
|
85
|
-
}
|
|
86
|
-
if (props.layout === "fullWidth" &&
|
|
87
|
-
(propName === "width" || propName === "height") &&
|
|
88
|
-
props[propName]) {
|
|
89
|
-
return new Error("\"".concat(propName, "\" ").concat(props[propName], " may not be passed when layout is fullWidth."));
|
|
90
|
-
}
|
|
91
|
-
return prop_types_1["default"].number.apply(prop_types_1["default"], __spreadArray([props, propName], __read(rest), false));
|
|
92
|
-
};
|
|
93
|
-
var validLayouts = new Set(["fixed", "fullWidth", "constrained"]);
|
|
94
|
-
exports.propTypes = {
|
|
95
|
-
src: prop_types_1["default"].string.isRequired,
|
|
96
|
-
alt: gatsby_image_server_1.altValidator,
|
|
97
|
-
width: checkDimensionProps,
|
|
98
|
-
height: checkDimensionProps,
|
|
99
|
-
sizes: prop_types_1["default"].string,
|
|
100
|
-
layout: function (props) {
|
|
101
|
-
if (props.layout === undefined) {
|
|
102
|
-
return undefined;
|
|
103
|
-
}
|
|
104
|
-
if (validLayouts.has(props.layout)) {
|
|
105
|
-
return undefined;
|
|
106
|
-
}
|
|
107
|
-
return new Error("Invalid value ".concat(props.layout, "\" provided for prop \"layout\". Defaulting to \"constrained\". Valid values are \"fixed\", \"fullWidth\" or \"constrained\"."));
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
|
-
StaticImage.displayName = "StaticImage";
|
|
111
|
-
StaticImage.propTypes = exports.propTypes;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
25
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
26
|
+
if (!m) return o;
|
|
27
|
+
var i = m.call(o), r, ar = [], e;
|
|
28
|
+
try {
|
|
29
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
30
|
+
}
|
|
31
|
+
catch (error) { e = { error: error }; }
|
|
32
|
+
finally {
|
|
33
|
+
try {
|
|
34
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
35
|
+
}
|
|
36
|
+
finally { if (e) throw e.error; }
|
|
37
|
+
}
|
|
38
|
+
return ar;
|
|
39
|
+
};
|
|
40
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
41
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
42
|
+
if (ar || !(i in from)) {
|
|
43
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
44
|
+
ar[i] = from[i];
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
48
|
+
};
|
|
49
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
50
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
51
|
+
};
|
|
52
|
+
exports.__esModule = true;
|
|
53
|
+
exports.StaticImage = exports.propTypes = exports._getStaticImage = void 0;
|
|
54
|
+
var react_1 = __importDefault(require("react"));
|
|
55
|
+
var gatsby_image_server_1 = require("./gatsby-image.server");
|
|
56
|
+
var prop_types_1 = __importDefault(require("prop-types"));
|
|
57
|
+
function _getStaticImage(GatsbyImage) {
|
|
58
|
+
return function StaticImage(_a) {
|
|
59
|
+
var src = _a.src, imageData = _a.__imageData, __error = _a.__error,
|
|
60
|
+
// We extract these because they're not meant to be passed-down to GatsbyImage
|
|
61
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
62
|
+
width = _a.width, height = _a.height, aspectRatio = _a.aspectRatio, tracedSVGOptions = _a.tracedSVGOptions, placeholder = _a.placeholder, formats = _a.formats, quality = _a.quality, transformOptions = _a.transformOptions, jpgOptions = _a.jpgOptions, pngOptions = _a.pngOptions, webpOptions = _a.webpOptions, avifOptions = _a.avifOptions, blurredOptions = _a.blurredOptions,
|
|
63
|
+
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
64
|
+
props = __rest(_a, ["src", "__imageData", "__error", "width", "height", "aspectRatio", "tracedSVGOptions", "placeholder", "formats", "quality", "transformOptions", "jpgOptions", "pngOptions", "webpOptions", "avifOptions", "blurredOptions"]);
|
|
65
|
+
if (__error) {
|
|
66
|
+
console.warn(__error);
|
|
67
|
+
}
|
|
68
|
+
if (imageData) {
|
|
69
|
+
return react_1["default"].createElement(GatsbyImage, __assign({ image: imageData }, props));
|
|
70
|
+
}
|
|
71
|
+
console.warn("Image not loaded", src);
|
|
72
|
+
if (!__error && process.env.NODE_ENV === "development") {
|
|
73
|
+
console.warn("Please ensure that \"gatsby-plugin-image\" is included in the plugins array in gatsby-config.js, and that your version of gatsby is at least 2.24.78");
|
|
74
|
+
}
|
|
75
|
+
return null;
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
exports._getStaticImage = _getStaticImage;
|
|
79
|
+
var StaticImage = _getStaticImage(gatsby_image_server_1.GatsbyImage);
|
|
80
|
+
exports.StaticImage = StaticImage;
|
|
81
|
+
var checkDimensionProps = function (props, propName) {
|
|
82
|
+
var rest = [];
|
|
83
|
+
for (var _i = 2; _i < arguments.length; _i++) {
|
|
84
|
+
rest[_i - 2] = arguments[_i];
|
|
85
|
+
}
|
|
86
|
+
if (props.layout === "fullWidth" &&
|
|
87
|
+
(propName === "width" || propName === "height") &&
|
|
88
|
+
props[propName]) {
|
|
89
|
+
return new Error("\"".concat(propName, "\" ").concat(props[propName], " may not be passed when layout is fullWidth."));
|
|
90
|
+
}
|
|
91
|
+
return prop_types_1["default"].number.apply(prop_types_1["default"], __spreadArray([props, propName], __read(rest), false));
|
|
92
|
+
};
|
|
93
|
+
var validLayouts = new Set(["fixed", "fullWidth", "constrained"]);
|
|
94
|
+
exports.propTypes = {
|
|
95
|
+
src: prop_types_1["default"].string.isRequired,
|
|
96
|
+
alt: gatsby_image_server_1.altValidator,
|
|
97
|
+
width: checkDimensionProps,
|
|
98
|
+
height: checkDimensionProps,
|
|
99
|
+
sizes: prop_types_1["default"].string,
|
|
100
|
+
layout: function (props) {
|
|
101
|
+
if (props.layout === undefined) {
|
|
102
|
+
return undefined;
|
|
103
|
+
}
|
|
104
|
+
if (validLayouts.has(props.layout)) {
|
|
105
|
+
return undefined;
|
|
106
|
+
}
|
|
107
|
+
return new Error("Invalid value ".concat(props.layout, "\" provided for prop \"layout\". Defaulting to \"constrained\". Valid values are \"fixed\", \"fullWidth\" or \"constrained\"."));
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
StaticImage.displayName = "StaticImage";
|
|
111
|
+
StaticImage.propTypes = exports.propTypes;
|