gatsby-plugin-image 2.5.0-next.2 → 2.5.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 +5 -5
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { GatsbyCache, Reporter, ParentSpanPluginArgs, Actions, Store } from "gatsby";
|
|
2
|
-
import type { FileSystemNode } from "gatsby-source-filesystem";
|
|
3
|
-
import { IStaticImageProps } from "../components/static-image.server";
|
|
4
|
-
import { ISharpGatsbyImageArgs } from "../image-utils";
|
|
5
|
-
export interface IImageMetadata {
|
|
6
|
-
isFixed: boolean;
|
|
7
|
-
contentDigest?: string;
|
|
8
|
-
args: Record<string, unknown>;
|
|
9
|
-
cacheFilename: string;
|
|
10
|
-
}
|
|
11
|
-
export declare function createImageNode({ fullPath, createNodeId, createNode, reporter, }: {
|
|
12
|
-
fullPath: string;
|
|
13
|
-
createNodeId: ParentSpanPluginArgs["createNodeId"];
|
|
14
|
-
createNode: Actions["createNode"];
|
|
15
|
-
reporter: Reporter;
|
|
16
|
-
}): Promise<FileSystemNode | undefined>;
|
|
17
|
-
export declare const isRemoteURL: (url: string) => boolean;
|
|
18
|
-
export declare function writeImages({ images, pathPrefix, cacheDir, reporter, cache, sourceDir, createNodeId, createNode, store, filename, }: {
|
|
19
|
-
images: Map<string, IStaticImageProps>;
|
|
20
|
-
pathPrefix: string;
|
|
21
|
-
cacheDir: string;
|
|
22
|
-
reporter: Reporter;
|
|
23
|
-
cache: GatsbyCache;
|
|
24
|
-
sourceDir: string;
|
|
25
|
-
createNodeId: ParentSpanPluginArgs["createNodeId"];
|
|
26
|
-
createNode: Actions["createNode"];
|
|
27
|
-
store: Store;
|
|
28
|
-
filename: string;
|
|
29
|
-
}): Promise<void>;
|
|
30
|
-
export declare function writeImage(file: FileSystemNode, args: ISharpGatsbyImageArgs, pathPrefix: string, reporter: Reporter, cache: GatsbyCache, filename: string): Promise<void>;
|
|
1
|
+
import { GatsbyCache, Reporter, ParentSpanPluginArgs, Actions, Store } from "gatsby";
|
|
2
|
+
import type { FileSystemNode } from "gatsby-source-filesystem";
|
|
3
|
+
import { IStaticImageProps } from "../components/static-image.server";
|
|
4
|
+
import { ISharpGatsbyImageArgs } from "../image-utils";
|
|
5
|
+
export interface IImageMetadata {
|
|
6
|
+
isFixed: boolean;
|
|
7
|
+
contentDigest?: string;
|
|
8
|
+
args: Record<string, unknown>;
|
|
9
|
+
cacheFilename: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function createImageNode({ fullPath, createNodeId, createNode, reporter, }: {
|
|
12
|
+
fullPath: string;
|
|
13
|
+
createNodeId: ParentSpanPluginArgs["createNodeId"];
|
|
14
|
+
createNode: Actions["createNode"];
|
|
15
|
+
reporter: Reporter;
|
|
16
|
+
}): Promise<FileSystemNode | undefined>;
|
|
17
|
+
export declare const isRemoteURL: (url: string) => boolean;
|
|
18
|
+
export declare function writeImages({ images, pathPrefix, cacheDir, reporter, cache, sourceDir, createNodeId, createNode, store, filename, }: {
|
|
19
|
+
images: Map<string, IStaticImageProps>;
|
|
20
|
+
pathPrefix: string;
|
|
21
|
+
cacheDir: string;
|
|
22
|
+
reporter: Reporter;
|
|
23
|
+
cache: GatsbyCache;
|
|
24
|
+
sourceDir: string;
|
|
25
|
+
createNodeId: ParentSpanPluginArgs["createNodeId"];
|
|
26
|
+
createNode: Actions["createNode"];
|
|
27
|
+
store: Store;
|
|
28
|
+
filename: string;
|
|
29
|
+
}): Promise<void>;
|
|
30
|
+
export declare function writeImage(file: FileSystemNode, args: ISharpGatsbyImageArgs, pathPrefix: string, reporter: Reporter, cache: GatsbyCache, filename: string): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const getCacheDir: (root: string) => string;
|
|
1
|
+
export declare const getCacheDir: (root: string) => string;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { NodePath } from "@babel/core";
|
|
2
|
-
import { ParserOptions } from "@babel/parser";
|
|
3
|
-
import babel from "@babel/core";
|
|
4
|
-
import { IStaticImageProps } from "../components/static-image.server";
|
|
5
|
-
export declare function getBabelParserOptions(filePath: string): ParserOptions;
|
|
6
|
-
export declare function babelParseToAst(contents: string, filePath: string): babel.types.File;
|
|
7
|
-
/**
|
|
8
|
-
* Traverses the parsed source, looking for StaticImage components.
|
|
9
|
-
* Extracts and returns the props from any that are found
|
|
10
|
-
*/
|
|
11
|
-
export declare const extractStaticImageProps: (ast: babel.types.File, onError?: (prop: string, nodePath: NodePath) => void) => Map<string, IStaticImageProps>;
|
|
1
|
+
import { NodePath } from "@babel/core";
|
|
2
|
+
import { ParserOptions } from "@babel/parser";
|
|
3
|
+
import babel from "@babel/core";
|
|
4
|
+
import { IStaticImageProps } from "../components/static-image.server";
|
|
5
|
+
export declare function getBabelParserOptions(filePath: string): ParserOptions;
|
|
6
|
+
export declare function babelParseToAst(contents: string, filePath: string): babel.types.File;
|
|
7
|
+
/**
|
|
8
|
+
* Traverses the parsed source, looking for StaticImage components.
|
|
9
|
+
* Extracts and returns the props from any that are found
|
|
10
|
+
*/
|
|
11
|
+
export declare const extractStaticImageProps: (ast: babel.types.File, onError?: (prop: string, nodePath: NodePath) => void) => Map<string, IStaticImageProps>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { PreprocessSourceArgs } from "gatsby";
|
|
2
|
-
export declare function preprocessSource({ filename, contents, pathPrefix, cache, reporter, store, createNodeId, actions: { createNode }, }: PreprocessSourceArgs): Promise<void>;
|
|
1
|
+
import { PreprocessSourceArgs } from "gatsby";
|
|
2
|
+
export declare function preprocessSource({ filename, contents, pathPrefix, cache, reporter, store, createNodeId, actions: { createNode }, }: PreprocessSourceArgs): Promise<void>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Actions, ParentSpanPluginArgs, GatsbyCache, Reporter } from "gatsby";
|
|
2
|
-
/**
|
|
3
|
-
* Watch a static source image for changes during develop
|
|
4
|
-
*/
|
|
5
|
-
export declare function watchImage({ fullPath, pathPrefix, createNodeId, createNode, cache, reporter, }: {
|
|
6
|
-
fullPath: string;
|
|
7
|
-
pathPrefix: string;
|
|
8
|
-
createNodeId: ParentSpanPluginArgs["createNodeId"];
|
|
9
|
-
createNode: Actions["createNode"];
|
|
10
|
-
cache: GatsbyCache;
|
|
11
|
-
reporter: Reporter;
|
|
12
|
-
}): void;
|
|
1
|
+
import { Actions, ParentSpanPluginArgs, GatsbyCache, Reporter } from "gatsby";
|
|
2
|
+
/**
|
|
3
|
+
* Watch a static source image for changes during develop
|
|
4
|
+
*/
|
|
5
|
+
export declare function watchImage({ fullPath, pathPrefix, createNodeId, createNode, cache, reporter, }: {
|
|
6
|
+
fullPath: string;
|
|
7
|
+
pathPrefix: string;
|
|
8
|
+
createNodeId: ParentSpanPluginArgs["createNodeId"];
|
|
9
|
+
createNode: Actions["createNode"];
|
|
10
|
+
cache: GatsbyCache;
|
|
11
|
+
reporter: Reporter;
|
|
12
|
+
}): void;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { GraphQLFieldResolver } from "gatsby/graphql";
|
|
2
|
-
import { EnumTypeComposerAsObjectDefinition, ObjectTypeComposerFieldConfigAsObjectDefinition, ObjectTypeComposerArgumentConfigMapDefinition } from "graphql-compose";
|
|
3
|
-
import { ISharpGatsbyImageArgs, IImageSizeArgs } from "./image-utils";
|
|
4
|
-
export declare const ImageFormatType: EnumTypeComposerAsObjectDefinition;
|
|
5
|
-
export declare const ImageLayoutType: EnumTypeComposerAsObjectDefinition;
|
|
6
|
-
export declare const ImagePlaceholderType: EnumTypeComposerAsObjectDefinition;
|
|
7
|
-
export interface IGatsbyGraphQLFieldConfig<TSource, TContext, TArgs> {
|
|
8
|
-
description?: string;
|
|
9
|
-
type: string;
|
|
10
|
-
args?: Record<string, IGatsbyGraphQLResolverArgumentConfig>;
|
|
11
|
-
resolve: GraphQLFieldResolver<TSource, TContext, TArgs>;
|
|
12
|
-
}
|
|
13
|
-
export interface IGatsbyGraphQLResolverArgumentConfig<TValue = any> {
|
|
14
|
-
description?: string;
|
|
15
|
-
type: string | Array<string>;
|
|
16
|
-
defaultValue?: TValue;
|
|
17
|
-
}
|
|
18
|
-
export declare type IGatsbyImageResolverArgs = Pick<ISharpGatsbyImageArgs & IImageSizeArgs, "aspectRatio" | "backgroundColor" | "breakpoints" | "height" | "layout" | "outputPixelDensities" | "sizes" | "width">;
|
|
19
|
-
export declare function getGatsbyImageResolver<TSource, TContext, TArgs>(resolve: GraphQLFieldResolver<TSource, TContext, IGatsbyImageResolverArgs & TArgs>, extraArgs?: ObjectTypeComposerArgumentConfigMapDefinition<TArgs>): ObjectTypeComposerFieldConfigAsObjectDefinition<TSource, TContext, IGatsbyImageResolverArgs & TArgs>;
|
|
20
|
-
export declare type IGatsbyImageFieldArgs = Pick<ISharpGatsbyImageArgs & IImageSizeArgs, "aspectRatio" | "backgroundColor" | "breakpoints" | "formats" | "height" | "layout" | "outputPixelDensities" | "placeholder" | "sizes" | "width">;
|
|
21
|
-
export declare function getGatsbyImageFieldConfig<TSource, TContext, TArgs>(resolve: GraphQLFieldResolver<TSource, TContext, IGatsbyImageFieldArgs & TArgs>, extraArgs?: ObjectTypeComposerArgumentConfigMapDefinition<TArgs>): ObjectTypeComposerFieldConfigAsObjectDefinition<TSource, TContext, IGatsbyImageFieldArgs & TArgs>;
|
|
1
|
+
import { GraphQLFieldResolver } from "gatsby/graphql";
|
|
2
|
+
import { EnumTypeComposerAsObjectDefinition, ObjectTypeComposerFieldConfigAsObjectDefinition, ObjectTypeComposerArgumentConfigMapDefinition } from "graphql-compose";
|
|
3
|
+
import { ISharpGatsbyImageArgs, IImageSizeArgs } from "./image-utils";
|
|
4
|
+
export declare const ImageFormatType: EnumTypeComposerAsObjectDefinition;
|
|
5
|
+
export declare const ImageLayoutType: EnumTypeComposerAsObjectDefinition;
|
|
6
|
+
export declare const ImagePlaceholderType: EnumTypeComposerAsObjectDefinition;
|
|
7
|
+
export interface IGatsbyGraphQLFieldConfig<TSource, TContext, TArgs> {
|
|
8
|
+
description?: string;
|
|
9
|
+
type: string;
|
|
10
|
+
args?: Record<string, IGatsbyGraphQLResolverArgumentConfig>;
|
|
11
|
+
resolve: GraphQLFieldResolver<TSource, TContext, TArgs>;
|
|
12
|
+
}
|
|
13
|
+
export interface IGatsbyGraphQLResolverArgumentConfig<TValue = any> {
|
|
14
|
+
description?: string;
|
|
15
|
+
type: string | Array<string>;
|
|
16
|
+
defaultValue?: TValue;
|
|
17
|
+
}
|
|
18
|
+
export declare type IGatsbyImageResolverArgs = Pick<ISharpGatsbyImageArgs & IImageSizeArgs, "aspectRatio" | "backgroundColor" | "breakpoints" | "height" | "layout" | "outputPixelDensities" | "sizes" | "width">;
|
|
19
|
+
export declare function getGatsbyImageResolver<TSource, TContext, TArgs>(resolve: GraphQLFieldResolver<TSource, TContext, IGatsbyImageResolverArgs & TArgs>, extraArgs?: ObjectTypeComposerArgumentConfigMapDefinition<TArgs>): ObjectTypeComposerFieldConfigAsObjectDefinition<TSource, TContext, IGatsbyImageResolverArgs & TArgs>;
|
|
20
|
+
export declare type IGatsbyImageFieldArgs = Pick<ISharpGatsbyImageArgs & IImageSizeArgs, "aspectRatio" | "backgroundColor" | "breakpoints" | "formats" | "height" | "layout" | "outputPixelDensities" | "placeholder" | "sizes" | "width">;
|
|
21
|
+
export declare function getGatsbyImageFieldConfig<TSource, TContext, TArgs>(resolve: GraphQLFieldResolver<TSource, TContext, IGatsbyImageFieldArgs & TArgs>, extraArgs?: ObjectTypeComposerArgumentConfigMapDefinition<TArgs>): ObjectTypeComposerFieldConfigAsObjectDefinition<TSource, TContext, IGatsbyImageFieldArgs & TArgs>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gatsby-plugin-image",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.2",
|
|
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",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"npm-run-all": "^4.1.5",
|
|
62
62
|
"postcss": "^8.2.9",
|
|
63
63
|
"terser": "^5.3.8",
|
|
64
|
-
"typescript": "^4.5.
|
|
64
|
+
"typescript": "^4.5.4"
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
67
67
|
"@babel/core": "^7.12.3",
|
|
@@ -77,12 +77,12 @@
|
|
|
77
77
|
"@babel/runtime": "^7.15.4",
|
|
78
78
|
"@babel/traverse": "^7.15.4",
|
|
79
79
|
"babel-jsx-utils": "^1.1.0",
|
|
80
|
-
"babel-plugin-remove-graphql-queries": "^4.5.
|
|
80
|
+
"babel-plugin-remove-graphql-queries": "^4.5.2",
|
|
81
81
|
"camelcase": "^5.3.1",
|
|
82
82
|
"chokidar": "^3.5.2",
|
|
83
83
|
"common-tags": "^1.8.2",
|
|
84
84
|
"fs-extra": "^10.0.0",
|
|
85
|
-
"gatsby-core-utils": "^3.5.
|
|
85
|
+
"gatsby-core-utils": "^3.5.2",
|
|
86
86
|
"objectFitPolyfill": "^2.3.5",
|
|
87
87
|
"prop-types": "^15.7.2"
|
|
88
88
|
},
|
|
@@ -93,5 +93,5 @@
|
|
|
93
93
|
},
|
|
94
94
|
"author": "Matt Kane <matt@gatsbyjs.com>",
|
|
95
95
|
"license": "MIT",
|
|
96
|
-
"gitHead": "
|
|
96
|
+
"gitHead": "c493ee721c16b5101134bcd98fdf4f6f0e40cede"
|
|
97
97
|
}
|