gatsby-plugin-image 2.2.0-next.2 → 2.3.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.
Files changed (32) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/babel-helpers.js +66 -66
  3. package/dist/babel-plugin-parse-static-images.js +80 -80
  4. package/dist/components/gatsby-image.browser.js +247 -247
  5. package/dist/components/gatsby-image.server.js +112 -112
  6. package/dist/components/hooks.js +399 -399
  7. package/dist/components/intersection-observer.js +55 -55
  8. package/dist/components/layout-wrapper.js +94 -94
  9. package/dist/components/lazy-hydrate.js +75 -75
  10. package/dist/components/main-image.js +43 -43
  11. package/dist/components/picture.js +96 -96
  12. package/dist/components/placeholder.js +74 -74
  13. package/dist/components/static-image.server.js +111 -111
  14. package/dist/gatsby-node.js +54 -54
  15. package/dist/image-utils.js +449 -449
  16. package/dist/index.js +27 -27
  17. package/dist/node-apis/image-processing.js +278 -278
  18. package/dist/node-apis/node-utils.js +11 -11
  19. package/dist/node-apis/parser.js +98 -98
  20. package/dist/node-apis/preprocess-source.js +118 -118
  21. package/dist/node-apis/watcher.js +129 -129
  22. package/dist/resolver-utils.js +119 -119
  23. package/dist/src/babel-helpers.d.ts +6 -6
  24. package/dist/src/babel-plugin-parse-static-images.d.ts +10 -10
  25. package/dist/src/gatsby-node.d.ts +5 -5
  26. package/dist/src/node-apis/image-processing.d.ts +30 -30
  27. package/dist/src/node-apis/node-utils.d.ts +1 -1
  28. package/dist/src/node-apis/parser.d.ts +11 -11
  29. package/dist/src/node-apis/preprocess-source.d.ts +2 -2
  30. package/dist/src/node-apis/watcher.d.ts +12 -12
  31. package/dist/src/resolver-utils.d.ts +21 -21
  32. package/package.json +4 -4
@@ -1,54 +1,54 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
- };
12
- exports.__esModule = true;
13
- exports.onCreateWebpackConfig = exports.onCreateBabelConfig = exports.createSchemaCustomization = void 0;
14
- var node_utils_1 = require("./node-apis/node-utils");
15
- var resolver_utils_1 = require("./resolver-utils");
16
- __exportStar(require("./node-apis/preprocess-source"), exports);
17
- var createSchemaCustomization = function (_a) {
18
- var actions = _a.actions, schema = _a.schema;
19
- actions.createTypes([
20
- schema.buildEnumType(resolver_utils_1.ImageFormatType),
21
- schema.buildEnumType(resolver_utils_1.ImageLayoutType),
22
- schema.buildEnumType(resolver_utils_1.ImagePlaceholderType),
23
- ]);
24
- };
25
- exports.createSchemaCustomization = createSchemaCustomization;
26
- var onCreateBabelConfig = function (_a) {
27
- var actions = _a.actions, store = _a.store;
28
- var root = store.getState().program.directory;
29
- var cacheDir = (0, node_utils_1.getCacheDir)(root);
30
- actions.setBabelPlugin({
31
- name: require.resolve("./babel-plugin-parse-static-images"),
32
- options: {
33
- cacheDir: cacheDir
34
- }
35
- });
36
- };
37
- exports.onCreateBabelConfig = onCreateBabelConfig;
38
- var onCreateWebpackConfig = function (_a) {
39
- var stage = _a.stage, plugins = _a.plugins, actions = _a.actions;
40
- if (stage !== "develop" &&
41
- stage !== "build-javascript" &&
42
- stage !== "build-html") {
43
- return;
44
- }
45
- actions.setWebpackConfig({
46
- plugins: [
47
- plugins.define({
48
- // eslint-disable-next-line @typescript-eslint/naming-convention
49
- GATSBY___IMAGE: true
50
- }),
51
- ]
52
- });
53
- };
54
- exports.onCreateWebpackConfig = onCreateWebpackConfig;
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ exports.__esModule = true;
13
+ exports.onCreateWebpackConfig = exports.onCreateBabelConfig = exports.createSchemaCustomization = void 0;
14
+ var node_utils_1 = require("./node-apis/node-utils");
15
+ var resolver_utils_1 = require("./resolver-utils");
16
+ __exportStar(require("./node-apis/preprocess-source"), exports);
17
+ var createSchemaCustomization = function (_a) {
18
+ var actions = _a.actions, schema = _a.schema;
19
+ actions.createTypes([
20
+ schema.buildEnumType(resolver_utils_1.ImageFormatType),
21
+ schema.buildEnumType(resolver_utils_1.ImageLayoutType),
22
+ schema.buildEnumType(resolver_utils_1.ImagePlaceholderType),
23
+ ]);
24
+ };
25
+ exports.createSchemaCustomization = createSchemaCustomization;
26
+ var onCreateBabelConfig = function (_a) {
27
+ var actions = _a.actions, store = _a.store;
28
+ var root = store.getState().program.directory;
29
+ var cacheDir = (0, node_utils_1.getCacheDir)(root);
30
+ actions.setBabelPlugin({
31
+ name: require.resolve("./babel-plugin-parse-static-images"),
32
+ options: {
33
+ cacheDir: cacheDir
34
+ }
35
+ });
36
+ };
37
+ exports.onCreateBabelConfig = onCreateBabelConfig;
38
+ var onCreateWebpackConfig = function (_a) {
39
+ var stage = _a.stage, plugins = _a.plugins, actions = _a.actions;
40
+ if (stage !== "develop" &&
41
+ stage !== "build-javascript" &&
42
+ stage !== "build-html") {
43
+ return;
44
+ }
45
+ actions.setWebpackConfig({
46
+ plugins: [
47
+ plugins.define({
48
+ // eslint-disable-next-line @typescript-eslint/naming-convention
49
+ GATSBY___IMAGE: true
50
+ }),
51
+ ]
52
+ });
53
+ };
54
+ exports.onCreateWebpackConfig = onCreateWebpackConfig;