gatsby-plugin-image 2.2.0-next.2 → 2.2.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 +8 -0
- 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,129 +1,129 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
-
};
|
|
41
|
-
exports.__esModule = true;
|
|
42
|
-
exports.watchImage = void 0;
|
|
43
|
-
var chokidar_1 = __importDefault(require("chokidar"));
|
|
44
|
-
var image_processing_1 = require("./image-processing");
|
|
45
|
-
var watcher;
|
|
46
|
-
/**
|
|
47
|
-
* Watch a static source image for changes during develop
|
|
48
|
-
*/
|
|
49
|
-
function watchImage(_a) {
|
|
50
|
-
var _this = this;
|
|
51
|
-
var fullPath = _a.fullPath, pathPrefix = _a.pathPrefix, createNodeId = _a.createNodeId, createNode = _a.createNode, cache = _a.cache, reporter = _a.reporter;
|
|
52
|
-
// We use a shared watcher, but only create it if needed
|
|
53
|
-
if (!watcher) {
|
|
54
|
-
watcher = chokidar_1["default"].watch(fullPath);
|
|
55
|
-
watcher.on("change", function (path) { return __awaiter(_this, void 0, void 0, function () {
|
|
56
|
-
var node;
|
|
57
|
-
return __generator(this, function (_a) {
|
|
58
|
-
switch (_a.label) {
|
|
59
|
-
case 0:
|
|
60
|
-
reporter.verbose("Image changed: " + path);
|
|
61
|
-
return [4 /*yield*/, (0, image_processing_1.createImageNode)({
|
|
62
|
-
fullPath: path,
|
|
63
|
-
createNodeId: createNodeId,
|
|
64
|
-
createNode: createNode,
|
|
65
|
-
reporter: reporter
|
|
66
|
-
})];
|
|
67
|
-
case 1:
|
|
68
|
-
node = _a.sent();
|
|
69
|
-
if (!node) {
|
|
70
|
-
reporter.warn("Could not process image " + path);
|
|
71
|
-
return [2 /*return*/];
|
|
72
|
-
}
|
|
73
|
-
return [4 /*yield*/, updateImages({ node: node, cache: cache, pathPrefix: pathPrefix, reporter: reporter })];
|
|
74
|
-
case 2:
|
|
75
|
-
_a.sent();
|
|
76
|
-
return [2 /*return*/];
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
}); });
|
|
80
|
-
}
|
|
81
|
-
else {
|
|
82
|
-
// If we already have a watcher, just add this image to it
|
|
83
|
-
watcher.add(fullPath);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
exports.watchImage = watchImage;
|
|
87
|
-
/**
|
|
88
|
-
* Update any static image instances that use a source image
|
|
89
|
-
*/
|
|
90
|
-
function updateImages(_a) {
|
|
91
|
-
var cache = _a.cache, node = _a.node, pathPrefix = _a.pathPrefix, reporter = _a.reporter;
|
|
92
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
93
|
-
var imageRefs;
|
|
94
|
-
var _this = this;
|
|
95
|
-
return __generator(this, function (_b) {
|
|
96
|
-
switch (_b.label) {
|
|
97
|
-
case 0: return [4 /*yield*/, cache.get("ref-" + node.id)];
|
|
98
|
-
case 1:
|
|
99
|
-
imageRefs = _b.sent();
|
|
100
|
-
if (!imageRefs) {
|
|
101
|
-
return [2 /*return*/];
|
|
102
|
-
}
|
|
103
|
-
return [4 /*yield*/, Promise.all(Object.values(imageRefs).map(function (_a) {
|
|
104
|
-
var contentDigest = _a.contentDigest, args = _a.args, cacheFilename = _a.cacheFilename;
|
|
105
|
-
return __awaiter(_this, void 0, void 0, function () {
|
|
106
|
-
return __generator(this, function (_b) {
|
|
107
|
-
switch (_b.label) {
|
|
108
|
-
case 0:
|
|
109
|
-
if (contentDigest && contentDigest === node.internal.contentDigest) {
|
|
110
|
-
// Skipping, because the file is unchanged
|
|
111
|
-
return [2 /*return*/];
|
|
112
|
-
}
|
|
113
|
-
// Update the image
|
|
114
|
-
return [4 /*yield*/, (0, image_processing_1.writeImage)(node, args, pathPrefix, reporter, cache, cacheFilename)];
|
|
115
|
-
case 1:
|
|
116
|
-
// Update the image
|
|
117
|
-
_b.sent();
|
|
118
|
-
return [2 /*return*/];
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
|
-
});
|
|
122
|
-
}))];
|
|
123
|
-
case 2:
|
|
124
|
-
_b.sent();
|
|
125
|
-
return [2 /*return*/];
|
|
126
|
-
}
|
|
127
|
-
});
|
|
128
|
-
});
|
|
129
|
-
}
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
+
};
|
|
41
|
+
exports.__esModule = true;
|
|
42
|
+
exports.watchImage = void 0;
|
|
43
|
+
var chokidar_1 = __importDefault(require("chokidar"));
|
|
44
|
+
var image_processing_1 = require("./image-processing");
|
|
45
|
+
var watcher;
|
|
46
|
+
/**
|
|
47
|
+
* Watch a static source image for changes during develop
|
|
48
|
+
*/
|
|
49
|
+
function watchImage(_a) {
|
|
50
|
+
var _this = this;
|
|
51
|
+
var fullPath = _a.fullPath, pathPrefix = _a.pathPrefix, createNodeId = _a.createNodeId, createNode = _a.createNode, cache = _a.cache, reporter = _a.reporter;
|
|
52
|
+
// We use a shared watcher, but only create it if needed
|
|
53
|
+
if (!watcher) {
|
|
54
|
+
watcher = chokidar_1["default"].watch(fullPath);
|
|
55
|
+
watcher.on("change", function (path) { return __awaiter(_this, void 0, void 0, function () {
|
|
56
|
+
var node;
|
|
57
|
+
return __generator(this, function (_a) {
|
|
58
|
+
switch (_a.label) {
|
|
59
|
+
case 0:
|
|
60
|
+
reporter.verbose("Image changed: " + path);
|
|
61
|
+
return [4 /*yield*/, (0, image_processing_1.createImageNode)({
|
|
62
|
+
fullPath: path,
|
|
63
|
+
createNodeId: createNodeId,
|
|
64
|
+
createNode: createNode,
|
|
65
|
+
reporter: reporter
|
|
66
|
+
})];
|
|
67
|
+
case 1:
|
|
68
|
+
node = _a.sent();
|
|
69
|
+
if (!node) {
|
|
70
|
+
reporter.warn("Could not process image " + path);
|
|
71
|
+
return [2 /*return*/];
|
|
72
|
+
}
|
|
73
|
+
return [4 /*yield*/, updateImages({ node: node, cache: cache, pathPrefix: pathPrefix, reporter: reporter })];
|
|
74
|
+
case 2:
|
|
75
|
+
_a.sent();
|
|
76
|
+
return [2 /*return*/];
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
}); });
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
// If we already have a watcher, just add this image to it
|
|
83
|
+
watcher.add(fullPath);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
exports.watchImage = watchImage;
|
|
87
|
+
/**
|
|
88
|
+
* Update any static image instances that use a source image
|
|
89
|
+
*/
|
|
90
|
+
function updateImages(_a) {
|
|
91
|
+
var cache = _a.cache, node = _a.node, pathPrefix = _a.pathPrefix, reporter = _a.reporter;
|
|
92
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
93
|
+
var imageRefs;
|
|
94
|
+
var _this = this;
|
|
95
|
+
return __generator(this, function (_b) {
|
|
96
|
+
switch (_b.label) {
|
|
97
|
+
case 0: return [4 /*yield*/, cache.get("ref-" + node.id)];
|
|
98
|
+
case 1:
|
|
99
|
+
imageRefs = _b.sent();
|
|
100
|
+
if (!imageRefs) {
|
|
101
|
+
return [2 /*return*/];
|
|
102
|
+
}
|
|
103
|
+
return [4 /*yield*/, Promise.all(Object.values(imageRefs).map(function (_a) {
|
|
104
|
+
var contentDigest = _a.contentDigest, args = _a.args, cacheFilename = _a.cacheFilename;
|
|
105
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
106
|
+
return __generator(this, function (_b) {
|
|
107
|
+
switch (_b.label) {
|
|
108
|
+
case 0:
|
|
109
|
+
if (contentDigest && contentDigest === node.internal.contentDigest) {
|
|
110
|
+
// Skipping, because the file is unchanged
|
|
111
|
+
return [2 /*return*/];
|
|
112
|
+
}
|
|
113
|
+
// Update the image
|
|
114
|
+
return [4 /*yield*/, (0, image_processing_1.writeImage)(node, args, pathPrefix, reporter, cache, cacheFilename)];
|
|
115
|
+
case 1:
|
|
116
|
+
// Update the image
|
|
117
|
+
_b.sent();
|
|
118
|
+
return [2 /*return*/];
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
}))];
|
|
123
|
+
case 2:
|
|
124
|
+
_b.sent();
|
|
125
|
+
return [2 /*return*/];
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
}
|
package/dist/resolver-utils.js
CHANGED
|
@@ -1,119 +1,119 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
-
return cooked;
|
|
5
|
-
};
|
|
6
|
-
var __assign = (this && this.__assign) || function () {
|
|
7
|
-
__assign = Object.assign || function(t) {
|
|
8
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
9
|
-
s = arguments[i];
|
|
10
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
11
|
-
t[p] = s[p];
|
|
12
|
-
}
|
|
13
|
-
return t;
|
|
14
|
-
};
|
|
15
|
-
return __assign.apply(this, arguments);
|
|
16
|
-
};
|
|
17
|
-
exports.__esModule = true;
|
|
18
|
-
exports.getGatsbyImageFieldConfig = exports.getGatsbyImageResolver = exports.ImagePlaceholderType = exports.ImageLayoutType = exports.ImageFormatType = void 0;
|
|
19
|
-
var common_tags_1 = require("common-tags");
|
|
20
|
-
exports.ImageFormatType = {
|
|
21
|
-
name: "GatsbyImageFormat",
|
|
22
|
-
values: {
|
|
23
|
-
NO_CHANGE: { value: "" },
|
|
24
|
-
AUTO: { value: "auto" },
|
|
25
|
-
JPG: { value: "jpg" },
|
|
26
|
-
PNG: { value: "png" },
|
|
27
|
-
WEBP: { value: "webp" },
|
|
28
|
-
AVIF: { value: "avif" }
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
exports.ImageLayoutType = {
|
|
32
|
-
name: "GatsbyImageLayout",
|
|
33
|
-
values: {
|
|
34
|
-
FIXED: { value: "fixed" },
|
|
35
|
-
FULL_WIDTH: { value: "fullWidth" },
|
|
36
|
-
CONSTRAINED: { value: "constrained" }
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
exports.ImagePlaceholderType = {
|
|
40
|
-
name: "GatsbyImagePlaceholder",
|
|
41
|
-
values: {
|
|
42
|
-
DOMINANT_COLOR: { value: "dominantColor" },
|
|
43
|
-
TRACED_SVG: { value: "tracedSVG" },
|
|
44
|
-
BLURRED: { value: "blurred" },
|
|
45
|
-
NONE: { value: "none" }
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
function getGatsbyImageResolver(resolve, extraArgs) {
|
|
49
|
-
return {
|
|
50
|
-
type: "JSON!",
|
|
51
|
-
args: __assign({ layout: {
|
|
52
|
-
type: exports.ImageLayoutType.name,
|
|
53
|
-
description: (0, common_tags_1.stripIndent)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n The layout for the image.\n FIXED: A static image sized, that does not resize according to the screen width\n FULL_WIDTH: The image resizes to fit its container. Pass a \"sizes\" option if it isn't going to be the full width of the screen.\n CONSTRAINED: Resizes to fit its container, up to a maximum width, at which point it will remain fixed in size.\n "], ["\n The layout for the image.\n FIXED: A static image sized, that does not resize according to the screen width\n FULL_WIDTH: The image resizes to fit its container. Pass a \"sizes\" option if it isn't going to be the full width of the screen.\n CONSTRAINED: Resizes to fit its container, up to a maximum width, at which point it will remain fixed in size.\n "])))
|
|
54
|
-
}, width: {
|
|
55
|
-
type: "Int",
|
|
56
|
-
description: (0, common_tags_1.stripIndent)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n The display width of the generated image for layout = FIXED, and the display width of the largest image for layout = CONSTRAINED.\n The actual largest image resolution will be this value multiplied by the largest value in outputPixelDensities\n Ignored if layout = FULL_WIDTH.\n "], ["\n The display width of the generated image for layout = FIXED, and the display width of the largest image for layout = CONSTRAINED.\n The actual largest image resolution will be this value multiplied by the largest value in outputPixelDensities\n Ignored if layout = FULL_WIDTH.\n "])))
|
|
57
|
-
}, height: {
|
|
58
|
-
type: "Int",
|
|
59
|
-
description: (0, common_tags_1.stripIndent)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n If set, the height of the generated image. If omitted, it is calculated from the supplied width, matching the aspect ratio of the source image."], ["\n If set, the height of the generated image. If omitted, it is calculated from the supplied width, matching the aspect ratio of the source image."])))
|
|
60
|
-
}, aspectRatio: {
|
|
61
|
-
type: "Float",
|
|
62
|
-
description: (0, common_tags_1.stripIndent)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n If set along with width or height, this will set the value of the other dimension to match the provided aspect ratio, cropping the image if needed.\n If neither width or height is provided, height will be set based on the intrinsic width of the source image.\n "], ["\n If set along with width or height, this will set the value of the other dimension to match the provided aspect ratio, cropping the image if needed.\n If neither width or height is provided, height will be set based on the intrinsic width of the source image.\n "])))
|
|
63
|
-
}, sizes: {
|
|
64
|
-
type: "String",
|
|
65
|
-
description: (0, common_tags_1.stripIndent)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n The \"sizes\" property, passed to the img tag. This describes the display size of the image.\n This does not affect the generated images, but is used by the browser to decide which images to download. You can leave this blank for fixed images, or if the responsive image\n container will be the full width of the screen. In these cases we will generate an appropriate value.\n "], ["\n The \"sizes\" property, passed to the img tag. This describes the display size of the image.\n This does not affect the generated images, but is used by the browser to decide which images to download. You can leave this blank for fixed images, or if the responsive image\n container will be the full width of the screen. In these cases we will generate an appropriate value.\n "])))
|
|
66
|
-
}, outputPixelDensities: {
|
|
67
|
-
type: "[Float]",
|
|
68
|
-
description: (0, common_tags_1.stripIndent)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n A list of image pixel densities to generate for FIXED and CONSTRAINED images. You should rarely need to change this. It will never generate images larger than the source, and will always include a 1x image.\n Default is [ 1, 2 ] for fixed images, meaning 1x, 2x, 3x, and [0.25, 0.5, 1, 2] for fluid. In this case, an image with a fluid layout and width = 400 would generate images at 100, 200, 400 and 800px wide.\n Ignored for FULL_WIDTH, which uses breakpoints instead.\n "], ["\n A list of image pixel densities to generate for FIXED and CONSTRAINED images. You should rarely need to change this. It will never generate images larger than the source, and will always include a 1x image.\n Default is [ 1, 2 ] for fixed images, meaning 1x, 2x, 3x, and [0.25, 0.5, 1, 2] for fluid. In this case, an image with a fluid layout and width = 400 would generate images at 100, 200, 400 and 800px wide.\n Ignored for FULL_WIDTH, which uses breakpoints instead.\n "])))
|
|
69
|
-
}, breakpoints: {
|
|
70
|
-
type: "[Int]",
|
|
71
|
-
description: (0, common_tags_1.stripIndent)(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n Specifies the image widths to generate. You should rarely need to change this. For FIXED and CONSTRAINED images it is better to allow these to be determined automatically,\n based on the image size. For FULL_WIDTH images this can be used to override the default, which is determined by the plugin.\n It will never generate any images larger than the source.\n "], ["\n Specifies the image widths to generate. You should rarely need to change this. For FIXED and CONSTRAINED images it is better to allow these to be determined automatically,\n based on the image size. For FULL_WIDTH images this can be used to override the default, which is determined by the plugin.\n It will never generate any images larger than the source.\n "])))
|
|
72
|
-
}, backgroundColor: {
|
|
73
|
-
type: "String",
|
|
74
|
-
description: "Background color applied to the wrapper, or when \"letterboxing\" an image to another aspect ratio."
|
|
75
|
-
} }, extraArgs),
|
|
76
|
-
resolve: resolve
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
exports.getGatsbyImageResolver = getGatsbyImageResolver;
|
|
80
|
-
function getGatsbyImageFieldConfig(resolve, extraArgs) {
|
|
81
|
-
return {
|
|
82
|
-
type: "JSON!",
|
|
83
|
-
args: __assign({ layout: {
|
|
84
|
-
type: exports.ImageLayoutType.name,
|
|
85
|
-
description: (0, common_tags_1.stripIndent)(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n The layout for the image.\n FIXED: A static image sized, that does not resize according to the screen width\n FULL_WIDTH: The image resizes to fit its container. Pass a \"sizes\" option if it isn't going to be the full width of the screen.\n CONSTRAINED: Resizes to fit its container, up to a maximum width, at which point it will remain fixed in size.\n "], ["\n The layout for the image.\n FIXED: A static image sized, that does not resize according to the screen width\n FULL_WIDTH: The image resizes to fit its container. Pass a \"sizes\" option if it isn't going to be the full width of the screen.\n CONSTRAINED: Resizes to fit its container, up to a maximum width, at which point it will remain fixed in size.\n "])))
|
|
86
|
-
}, width: {
|
|
87
|
-
type: "Int",
|
|
88
|
-
description: (0, common_tags_1.stripIndent)(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n The display width of the generated image for layout = FIXED, and the display width of the largest image for layout = CONSTRAINED.\n The actual largest image resolution will be this value multiplied by the largest value in outputPixelDensities\n Ignored if layout = FLUID.\n "], ["\n The display width of the generated image for layout = FIXED, and the display width of the largest image for layout = CONSTRAINED.\n The actual largest image resolution will be this value multiplied by the largest value in outputPixelDensities\n Ignored if layout = FLUID.\n "])))
|
|
89
|
-
}, height: {
|
|
90
|
-
type: "Int",
|
|
91
|
-
description: (0, common_tags_1.stripIndent)(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n If set, the height of the generated image. If omitted, it is calculated from the supplied width, matching the aspect ratio of the source image."], ["\n If set, the height of the generated image. If omitted, it is calculated from the supplied width, matching the aspect ratio of the source image."])))
|
|
92
|
-
}, aspectRatio: {
|
|
93
|
-
type: "Float",
|
|
94
|
-
description: (0, common_tags_1.stripIndent)(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n If set along with width or height, this will set the value of the other dimension to match the provided aspect ratio, cropping the image if needed.\n If neither width or height is provided, height will be set based on the intrinsic width of the source image.\n "], ["\n If set along with width or height, this will set the value of the other dimension to match the provided aspect ratio, cropping the image if needed.\n If neither width or height is provided, height will be set based on the intrinsic width of the source image.\n "])))
|
|
95
|
-
}, placeholder: {
|
|
96
|
-
type: exports.ImagePlaceholderType.name,
|
|
97
|
-
description: (0, common_tags_1.stripIndent)(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n Format of generated placeholder image, displayed while the main image loads.\n BLURRED: a blurred, low resolution image, encoded as a base64 data URI (default)\n DOMINANT_COLOR: a solid color, calculated from the dominant color of the image.\n TRACED_SVG: a low-resolution traced SVG of the image.\n NONE: no placeholder. Set the argument \"backgroundColor\" to use a fixed background color."], ["\n Format of generated placeholder image, displayed while the main image loads.\n BLURRED: a blurred, low resolution image, encoded as a base64 data URI (default)\n DOMINANT_COLOR: a solid color, calculated from the dominant color of the image.\n TRACED_SVG: a low-resolution traced SVG of the image.\n NONE: no placeholder. Set the argument \"backgroundColor\" to use a fixed background color."])))
|
|
98
|
-
}, formats: {
|
|
99
|
-
type: "[" + exports.ImageFormatType.name + "]",
|
|
100
|
-
description: (0, common_tags_1.stripIndent)(templateObject_13 || (templateObject_13 = __makeTemplateObject(["\n The image formats to generate. Valid values are AUTO (meaning the same format as the source image), JPG, PNG, WEBP and AVIF.\n The default value is [AUTO, WEBP], and you should rarely need to change this. Take care if you specify JPG or PNG when you do\n not know the formats of the source images, as this could lead to unwanted results such as converting JPEGs to PNGs. Specifying\n both PNG and JPG is not supported and will be ignored.\n "], ["\n The image formats to generate. Valid values are AUTO (meaning the same format as the source image), JPG, PNG, WEBP and AVIF.\n The default value is [AUTO, WEBP], and you should rarely need to change this. Take care if you specify JPG or PNG when you do\n not know the formats of the source images, as this could lead to unwanted results such as converting JPEGs to PNGs. Specifying\n both PNG and JPG is not supported and will be ignored.\n "]))),
|
|
101
|
-
defaultValue: ["", "webp"]
|
|
102
|
-
}, outputPixelDensities: {
|
|
103
|
-
type: "[Float]",
|
|
104
|
-
description: (0, common_tags_1.stripIndent)(templateObject_14 || (templateObject_14 = __makeTemplateObject(["\n A list of image pixel densities to generate for FIXED and CONSTRAINED images. You should rarely need to change this. It will never generate images larger than the source, and will always include a 1x image.\n Default is [ 1, 2 ] for fixed images, meaning 1x, 2x, 3x, and [0.25, 0.5, 1, 2] for fluid. In this case, an image with a fluid layout and width = 400 would generate images at 100, 200, 400 and 800px wide.\n "], ["\n A list of image pixel densities to generate for FIXED and CONSTRAINED images. You should rarely need to change this. It will never generate images larger than the source, and will always include a 1x image.\n Default is [ 1, 2 ] for fixed images, meaning 1x, 2x, 3x, and [0.25, 0.5, 1, 2] for fluid. In this case, an image with a fluid layout and width = 400 would generate images at 100, 200, 400 and 800px wide.\n "])))
|
|
105
|
-
}, breakpoints: {
|
|
106
|
-
type: "[Int]",
|
|
107
|
-
description: (0, common_tags_1.stripIndent)(templateObject_15 || (templateObject_15 = __makeTemplateObject(["\n Specifies the image widths to generate. You should rarely need to change this. For FIXED and CONSTRAINED images it is better to allow these to be determined automatically,\n based on the image size. For FULL_WIDTH images this can be used to override the default, which is [750, 1080, 1366, 1920].\n It will never generate any images larger than the source.\n "], ["\n Specifies the image widths to generate. You should rarely need to change this. For FIXED and CONSTRAINED images it is better to allow these to be determined automatically,\n based on the image size. For FULL_WIDTH images this can be used to override the default, which is [750, 1080, 1366, 1920].\n It will never generate any images larger than the source.\n "])))
|
|
108
|
-
}, sizes: {
|
|
109
|
-
type: "String",
|
|
110
|
-
description: (0, common_tags_1.stripIndent)(templateObject_16 || (templateObject_16 = __makeTemplateObject(["\n The \"sizes\" property, passed to the img tag. This describes the display size of the image.\n This does not affect the generated images, but is used by the browser to decide which images to download. You can leave this blank for fixed images, or if the responsive image\n container will be the full width of the screen. In these cases we will generate an appropriate value.\n "], ["\n The \"sizes\" property, passed to the img tag. This describes the display size of the image.\n This does not affect the generated images, but is used by the browser to decide which images to download. You can leave this blank for fixed images, or if the responsive image\n container will be the full width of the screen. In these cases we will generate an appropriate value.\n "])))
|
|
111
|
-
}, backgroundColor: {
|
|
112
|
-
type: "String",
|
|
113
|
-
description: "Background color applied to the wrapper, or when \"letterboxing\" an image to another aspect ratio."
|
|
114
|
-
} }, extraArgs),
|
|
115
|
-
resolve: resolve
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
exports.getGatsbyImageFieldConfig = getGatsbyImageFieldConfig;
|
|
119
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
+
return cooked;
|
|
5
|
+
};
|
|
6
|
+
var __assign = (this && this.__assign) || function () {
|
|
7
|
+
__assign = Object.assign || function(t) {
|
|
8
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
9
|
+
s = arguments[i];
|
|
10
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
11
|
+
t[p] = s[p];
|
|
12
|
+
}
|
|
13
|
+
return t;
|
|
14
|
+
};
|
|
15
|
+
return __assign.apply(this, arguments);
|
|
16
|
+
};
|
|
17
|
+
exports.__esModule = true;
|
|
18
|
+
exports.getGatsbyImageFieldConfig = exports.getGatsbyImageResolver = exports.ImagePlaceholderType = exports.ImageLayoutType = exports.ImageFormatType = void 0;
|
|
19
|
+
var common_tags_1 = require("common-tags");
|
|
20
|
+
exports.ImageFormatType = {
|
|
21
|
+
name: "GatsbyImageFormat",
|
|
22
|
+
values: {
|
|
23
|
+
NO_CHANGE: { value: "" },
|
|
24
|
+
AUTO: { value: "auto" },
|
|
25
|
+
JPG: { value: "jpg" },
|
|
26
|
+
PNG: { value: "png" },
|
|
27
|
+
WEBP: { value: "webp" },
|
|
28
|
+
AVIF: { value: "avif" }
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
exports.ImageLayoutType = {
|
|
32
|
+
name: "GatsbyImageLayout",
|
|
33
|
+
values: {
|
|
34
|
+
FIXED: { value: "fixed" },
|
|
35
|
+
FULL_WIDTH: { value: "fullWidth" },
|
|
36
|
+
CONSTRAINED: { value: "constrained" }
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
exports.ImagePlaceholderType = {
|
|
40
|
+
name: "GatsbyImagePlaceholder",
|
|
41
|
+
values: {
|
|
42
|
+
DOMINANT_COLOR: { value: "dominantColor" },
|
|
43
|
+
TRACED_SVG: { value: "tracedSVG" },
|
|
44
|
+
BLURRED: { value: "blurred" },
|
|
45
|
+
NONE: { value: "none" }
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
function getGatsbyImageResolver(resolve, extraArgs) {
|
|
49
|
+
return {
|
|
50
|
+
type: "JSON!",
|
|
51
|
+
args: __assign({ layout: {
|
|
52
|
+
type: exports.ImageLayoutType.name,
|
|
53
|
+
description: (0, common_tags_1.stripIndent)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n The layout for the image.\n FIXED: A static image sized, that does not resize according to the screen width\n FULL_WIDTH: The image resizes to fit its container. Pass a \"sizes\" option if it isn't going to be the full width of the screen.\n CONSTRAINED: Resizes to fit its container, up to a maximum width, at which point it will remain fixed in size.\n "], ["\n The layout for the image.\n FIXED: A static image sized, that does not resize according to the screen width\n FULL_WIDTH: The image resizes to fit its container. Pass a \"sizes\" option if it isn't going to be the full width of the screen.\n CONSTRAINED: Resizes to fit its container, up to a maximum width, at which point it will remain fixed in size.\n "])))
|
|
54
|
+
}, width: {
|
|
55
|
+
type: "Int",
|
|
56
|
+
description: (0, common_tags_1.stripIndent)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n The display width of the generated image for layout = FIXED, and the display width of the largest image for layout = CONSTRAINED.\n The actual largest image resolution will be this value multiplied by the largest value in outputPixelDensities\n Ignored if layout = FULL_WIDTH.\n "], ["\n The display width of the generated image for layout = FIXED, and the display width of the largest image for layout = CONSTRAINED.\n The actual largest image resolution will be this value multiplied by the largest value in outputPixelDensities\n Ignored if layout = FULL_WIDTH.\n "])))
|
|
57
|
+
}, height: {
|
|
58
|
+
type: "Int",
|
|
59
|
+
description: (0, common_tags_1.stripIndent)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n If set, the height of the generated image. If omitted, it is calculated from the supplied width, matching the aspect ratio of the source image."], ["\n If set, the height of the generated image. If omitted, it is calculated from the supplied width, matching the aspect ratio of the source image."])))
|
|
60
|
+
}, aspectRatio: {
|
|
61
|
+
type: "Float",
|
|
62
|
+
description: (0, common_tags_1.stripIndent)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n If set along with width or height, this will set the value of the other dimension to match the provided aspect ratio, cropping the image if needed.\n If neither width or height is provided, height will be set based on the intrinsic width of the source image.\n "], ["\n If set along with width or height, this will set the value of the other dimension to match the provided aspect ratio, cropping the image if needed.\n If neither width or height is provided, height will be set based on the intrinsic width of the source image.\n "])))
|
|
63
|
+
}, sizes: {
|
|
64
|
+
type: "String",
|
|
65
|
+
description: (0, common_tags_1.stripIndent)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n The \"sizes\" property, passed to the img tag. This describes the display size of the image.\n This does not affect the generated images, but is used by the browser to decide which images to download. You can leave this blank for fixed images, or if the responsive image\n container will be the full width of the screen. In these cases we will generate an appropriate value.\n "], ["\n The \"sizes\" property, passed to the img tag. This describes the display size of the image.\n This does not affect the generated images, but is used by the browser to decide which images to download. You can leave this blank for fixed images, or if the responsive image\n container will be the full width of the screen. In these cases we will generate an appropriate value.\n "])))
|
|
66
|
+
}, outputPixelDensities: {
|
|
67
|
+
type: "[Float]",
|
|
68
|
+
description: (0, common_tags_1.stripIndent)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n A list of image pixel densities to generate for FIXED and CONSTRAINED images. You should rarely need to change this. It will never generate images larger than the source, and will always include a 1x image.\n Default is [ 1, 2 ] for fixed images, meaning 1x, 2x, 3x, and [0.25, 0.5, 1, 2] for fluid. In this case, an image with a fluid layout and width = 400 would generate images at 100, 200, 400 and 800px wide.\n Ignored for FULL_WIDTH, which uses breakpoints instead.\n "], ["\n A list of image pixel densities to generate for FIXED and CONSTRAINED images. You should rarely need to change this. It will never generate images larger than the source, and will always include a 1x image.\n Default is [ 1, 2 ] for fixed images, meaning 1x, 2x, 3x, and [0.25, 0.5, 1, 2] for fluid. In this case, an image with a fluid layout and width = 400 would generate images at 100, 200, 400 and 800px wide.\n Ignored for FULL_WIDTH, which uses breakpoints instead.\n "])))
|
|
69
|
+
}, breakpoints: {
|
|
70
|
+
type: "[Int]",
|
|
71
|
+
description: (0, common_tags_1.stripIndent)(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n Specifies the image widths to generate. You should rarely need to change this. For FIXED and CONSTRAINED images it is better to allow these to be determined automatically,\n based on the image size. For FULL_WIDTH images this can be used to override the default, which is determined by the plugin.\n It will never generate any images larger than the source.\n "], ["\n Specifies the image widths to generate. You should rarely need to change this. For FIXED and CONSTRAINED images it is better to allow these to be determined automatically,\n based on the image size. For FULL_WIDTH images this can be used to override the default, which is determined by the plugin.\n It will never generate any images larger than the source.\n "])))
|
|
72
|
+
}, backgroundColor: {
|
|
73
|
+
type: "String",
|
|
74
|
+
description: "Background color applied to the wrapper, or when \"letterboxing\" an image to another aspect ratio."
|
|
75
|
+
} }, extraArgs),
|
|
76
|
+
resolve: resolve
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
exports.getGatsbyImageResolver = getGatsbyImageResolver;
|
|
80
|
+
function getGatsbyImageFieldConfig(resolve, extraArgs) {
|
|
81
|
+
return {
|
|
82
|
+
type: "JSON!",
|
|
83
|
+
args: __assign({ layout: {
|
|
84
|
+
type: exports.ImageLayoutType.name,
|
|
85
|
+
description: (0, common_tags_1.stripIndent)(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n The layout for the image.\n FIXED: A static image sized, that does not resize according to the screen width\n FULL_WIDTH: The image resizes to fit its container. Pass a \"sizes\" option if it isn't going to be the full width of the screen.\n CONSTRAINED: Resizes to fit its container, up to a maximum width, at which point it will remain fixed in size.\n "], ["\n The layout for the image.\n FIXED: A static image sized, that does not resize according to the screen width\n FULL_WIDTH: The image resizes to fit its container. Pass a \"sizes\" option if it isn't going to be the full width of the screen.\n CONSTRAINED: Resizes to fit its container, up to a maximum width, at which point it will remain fixed in size.\n "])))
|
|
86
|
+
}, width: {
|
|
87
|
+
type: "Int",
|
|
88
|
+
description: (0, common_tags_1.stripIndent)(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n The display width of the generated image for layout = FIXED, and the display width of the largest image for layout = CONSTRAINED.\n The actual largest image resolution will be this value multiplied by the largest value in outputPixelDensities\n Ignored if layout = FLUID.\n "], ["\n The display width of the generated image for layout = FIXED, and the display width of the largest image for layout = CONSTRAINED.\n The actual largest image resolution will be this value multiplied by the largest value in outputPixelDensities\n Ignored if layout = FLUID.\n "])))
|
|
89
|
+
}, height: {
|
|
90
|
+
type: "Int",
|
|
91
|
+
description: (0, common_tags_1.stripIndent)(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n If set, the height of the generated image. If omitted, it is calculated from the supplied width, matching the aspect ratio of the source image."], ["\n If set, the height of the generated image. If omitted, it is calculated from the supplied width, matching the aspect ratio of the source image."])))
|
|
92
|
+
}, aspectRatio: {
|
|
93
|
+
type: "Float",
|
|
94
|
+
description: (0, common_tags_1.stripIndent)(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n If set along with width or height, this will set the value of the other dimension to match the provided aspect ratio, cropping the image if needed.\n If neither width or height is provided, height will be set based on the intrinsic width of the source image.\n "], ["\n If set along with width or height, this will set the value of the other dimension to match the provided aspect ratio, cropping the image if needed.\n If neither width or height is provided, height will be set based on the intrinsic width of the source image.\n "])))
|
|
95
|
+
}, placeholder: {
|
|
96
|
+
type: exports.ImagePlaceholderType.name,
|
|
97
|
+
description: (0, common_tags_1.stripIndent)(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n Format of generated placeholder image, displayed while the main image loads.\n BLURRED: a blurred, low resolution image, encoded as a base64 data URI (default)\n DOMINANT_COLOR: a solid color, calculated from the dominant color of the image.\n TRACED_SVG: a low-resolution traced SVG of the image.\n NONE: no placeholder. Set the argument \"backgroundColor\" to use a fixed background color."], ["\n Format of generated placeholder image, displayed while the main image loads.\n BLURRED: a blurred, low resolution image, encoded as a base64 data URI (default)\n DOMINANT_COLOR: a solid color, calculated from the dominant color of the image.\n TRACED_SVG: a low-resolution traced SVG of the image.\n NONE: no placeholder. Set the argument \"backgroundColor\" to use a fixed background color."])))
|
|
98
|
+
}, formats: {
|
|
99
|
+
type: "[" + exports.ImageFormatType.name + "]",
|
|
100
|
+
description: (0, common_tags_1.stripIndent)(templateObject_13 || (templateObject_13 = __makeTemplateObject(["\n The image formats to generate. Valid values are AUTO (meaning the same format as the source image), JPG, PNG, WEBP and AVIF.\n The default value is [AUTO, WEBP], and you should rarely need to change this. Take care if you specify JPG or PNG when you do\n not know the formats of the source images, as this could lead to unwanted results such as converting JPEGs to PNGs. Specifying\n both PNG and JPG is not supported and will be ignored.\n "], ["\n The image formats to generate. Valid values are AUTO (meaning the same format as the source image), JPG, PNG, WEBP and AVIF.\n The default value is [AUTO, WEBP], and you should rarely need to change this. Take care if you specify JPG or PNG when you do\n not know the formats of the source images, as this could lead to unwanted results such as converting JPEGs to PNGs. Specifying\n both PNG and JPG is not supported and will be ignored.\n "]))),
|
|
101
|
+
defaultValue: ["", "webp"]
|
|
102
|
+
}, outputPixelDensities: {
|
|
103
|
+
type: "[Float]",
|
|
104
|
+
description: (0, common_tags_1.stripIndent)(templateObject_14 || (templateObject_14 = __makeTemplateObject(["\n A list of image pixel densities to generate for FIXED and CONSTRAINED images. You should rarely need to change this. It will never generate images larger than the source, and will always include a 1x image.\n Default is [ 1, 2 ] for fixed images, meaning 1x, 2x, 3x, and [0.25, 0.5, 1, 2] for fluid. In this case, an image with a fluid layout and width = 400 would generate images at 100, 200, 400 and 800px wide.\n "], ["\n A list of image pixel densities to generate for FIXED and CONSTRAINED images. You should rarely need to change this. It will never generate images larger than the source, and will always include a 1x image.\n Default is [ 1, 2 ] for fixed images, meaning 1x, 2x, 3x, and [0.25, 0.5, 1, 2] for fluid. In this case, an image with a fluid layout and width = 400 would generate images at 100, 200, 400 and 800px wide.\n "])))
|
|
105
|
+
}, breakpoints: {
|
|
106
|
+
type: "[Int]",
|
|
107
|
+
description: (0, common_tags_1.stripIndent)(templateObject_15 || (templateObject_15 = __makeTemplateObject(["\n Specifies the image widths to generate. You should rarely need to change this. For FIXED and CONSTRAINED images it is better to allow these to be determined automatically,\n based on the image size. For FULL_WIDTH images this can be used to override the default, which is [750, 1080, 1366, 1920].\n It will never generate any images larger than the source.\n "], ["\n Specifies the image widths to generate. You should rarely need to change this. For FIXED and CONSTRAINED images it is better to allow these to be determined automatically,\n based on the image size. For FULL_WIDTH images this can be used to override the default, which is [750, 1080, 1366, 1920].\n It will never generate any images larger than the source.\n "])))
|
|
108
|
+
}, sizes: {
|
|
109
|
+
type: "String",
|
|
110
|
+
description: (0, common_tags_1.stripIndent)(templateObject_16 || (templateObject_16 = __makeTemplateObject(["\n The \"sizes\" property, passed to the img tag. This describes the display size of the image.\n This does not affect the generated images, but is used by the browser to decide which images to download. You can leave this blank for fixed images, or if the responsive image\n container will be the full width of the screen. In these cases we will generate an appropriate value.\n "], ["\n The \"sizes\" property, passed to the img tag. This describes the display size of the image.\n This does not affect the generated images, but is used by the browser to decide which images to download. You can leave this blank for fixed images, or if the responsive image\n container will be the full width of the screen. In these cases we will generate an appropriate value.\n "])))
|
|
111
|
+
}, backgroundColor: {
|
|
112
|
+
type: "String",
|
|
113
|
+
description: "Background color applied to the wrapper, or when \"letterboxing\" an image to another aspect ratio."
|
|
114
|
+
} }, extraArgs),
|
|
115
|
+
resolve: resolve
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
exports.getGatsbyImageFieldConfig = getGatsbyImageFieldConfig;
|
|
119
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { JSXOpeningElement } from "@babel/types";
|
|
2
|
-
import { NodePath } from "@babel/core";
|
|
3
|
-
export declare const SHARP_ATTRIBUTES: Set<string>;
|
|
4
|
-
export declare function normalizeProps(props: Record<string, unknown>): Record<string, unknown>;
|
|
5
|
-
export declare function evaluateImageAttributes(nodePath: NodePath<JSXOpeningElement>, onError?: (prop: string, nodePath: NodePath<any>) => void): Record<string, unknown>;
|
|
6
|
-
export declare function hashOptions(options: unknown): string;
|
|
1
|
+
import { JSXOpeningElement } from "@babel/types";
|
|
2
|
+
import { NodePath } from "@babel/core";
|
|
3
|
+
export declare const SHARP_ATTRIBUTES: Set<string>;
|
|
4
|
+
export declare function normalizeProps(props: Record<string, unknown>): Record<string, unknown>;
|
|
5
|
+
export declare function evaluateImageAttributes(nodePath: NodePath<JSXOpeningElement>, onError?: (prop: string, nodePath: NodePath<any>) => void): Record<string, unknown>;
|
|
6
|
+
export declare function hashOptions(options: unknown): string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/// <reference types="babel__template" />
|
|
2
|
-
import type { PluginObj, template as BabelTemplate, types as BabelTypes } from "@babel/core";
|
|
3
|
-
/**
|
|
4
|
-
* This is a plugin that finds StaticImage components and injects the image props into the component.
|
|
5
|
-
* These props contain the image URLs etc, and were created earlier in the build process
|
|
6
|
-
*/
|
|
7
|
-
export default function attrs({ types: t, template, }: {
|
|
8
|
-
types: typeof BabelTypes;
|
|
9
|
-
template: typeof BabelTemplate;
|
|
10
|
-
}): PluginObj;
|
|
1
|
+
/// <reference types="babel__template" />
|
|
2
|
+
import type { PluginObj, template as BabelTemplate, types as BabelTypes } from "@babel/core";
|
|
3
|
+
/**
|
|
4
|
+
* This is a plugin that finds StaticImage components and injects the image props into the component.
|
|
5
|
+
* These props contain the image URLs etc, and were created earlier in the build process
|
|
6
|
+
*/
|
|
7
|
+
export default function attrs({ types: t, template, }: {
|
|
8
|
+
types: typeof BabelTypes;
|
|
9
|
+
template: typeof BabelTemplate;
|
|
10
|
+
}): PluginObj;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { GatsbyNode } from "gatsby";
|
|
2
|
-
export * from "./node-apis/preprocess-source";
|
|
3
|
-
export declare const createSchemaCustomization: GatsbyNode["createSchemaCustomization"];
|
|
4
|
-
export declare const onCreateBabelConfig: GatsbyNode["onCreateBabelConfig"];
|
|
5
|
-
export declare const onCreateWebpackConfig: GatsbyNode["onCreateWebpackConfig"];
|
|
1
|
+
import { GatsbyNode } from "gatsby";
|
|
2
|
+
export * from "./node-apis/preprocess-source";
|
|
3
|
+
export declare const createSchemaCustomization: GatsbyNode["createSchemaCustomization"];
|
|
4
|
+
export declare const onCreateBabelConfig: GatsbyNode["onCreateBabelConfig"];
|
|
5
|
+
export declare const onCreateWebpackConfig: GatsbyNode["onCreateWebpackConfig"];
|