@stati/core 1.27.1 → 1.28.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/dist/config/errors.d.ts +10 -0
- package/dist/config/errors.d.ts.map +1 -0
- package/dist/config/errors.js +10 -0
- package/dist/config/loader.d.ts.map +1 -1
- package/dist/config/loader.js +15 -2
- package/dist/constants.d.ts +26 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +23 -0
- package/dist/core/build.d.ts.map +1 -1
- package/dist/core/build.js +98 -26
- package/dist/core/isg/builder.d.ts +21 -6
- package/dist/core/isg/builder.d.ts.map +1 -1
- package/dist/core/isg/builder.js +59 -17
- package/dist/core/isg/deps.d.ts +23 -2
- package/dist/core/isg/deps.d.ts.map +1 -1
- package/dist/core/isg/deps.js +54 -8
- package/dist/core/isg/hash.d.ts +10 -0
- package/dist/core/isg/hash.d.ts.map +1 -1
- package/dist/core/isg/hash.js +14 -0
- package/dist/core/isg/index.d.ts +2 -1
- package/dist/core/isg/index.d.ts.map +1 -1
- package/dist/core/isg/index.js +1 -1
- package/dist/core/isg/manifest.js +8 -0
- package/dist/core/markdown.d.ts +10 -1
- package/dist/core/markdown.d.ts.map +1 -1
- package/dist/core/markdown.js +13 -3
- package/dist/core/templates.d.ts +12 -1
- package/dist/core/templates.d.ts.map +1 -1
- package/dist/core/templates.js +61 -6
- package/dist/core/utils/fs.utils.d.ts +21 -1
- package/dist/core/utils/fs.utils.d.ts.map +1 -1
- package/dist/core/utils/fs.utils.js +61 -0
- package/dist/core/utils/index.d.ts +1 -1
- package/dist/core/utils/index.d.ts.map +1 -1
- package/dist/core/utils/index.js +1 -1
- package/dist/core/utils/template-discovery.utils.d.ts +8 -6
- package/dist/core/utils/template-discovery.utils.d.ts.map +1 -1
- package/dist/core/utils/template-discovery.utils.js +43 -12
- package/dist/images/config.d.ts +52 -0
- package/dist/images/config.d.ts.map +1 -0
- package/dist/images/config.js +200 -0
- package/dist/images/index.d.ts +15 -0
- package/dist/images/index.d.ts.map +1 -0
- package/dist/images/index.js +11 -0
- package/dist/images/manifest.d.ts +36 -0
- package/dist/images/manifest.d.ts.map +1 -0
- package/dist/images/manifest.js +69 -0
- package/dist/images/markdown-rule.d.ts +26 -0
- package/dist/images/markdown-rule.d.ts.map +1 -0
- package/dist/images/markdown-rule.js +60 -0
- package/dist/images/markup.d.ts +39 -0
- package/dist/images/markup.d.ts.map +1 -0
- package/dist/images/markup.js +72 -0
- package/dist/images/og.d.ts +52 -0
- package/dist/images/og.d.ts.map +1 -0
- package/dist/images/og.js +165 -0
- package/dist/images/plan.d.ts +101 -0
- package/dist/images/plan.d.ts.map +1 -0
- package/dist/images/plan.js +128 -0
- package/dist/images/provider.d.ts +35 -0
- package/dist/images/provider.d.ts.map +1 -0
- package/dist/images/provider.js +70 -0
- package/dist/images/resolve.d.ts +45 -0
- package/dist/images/resolve.d.ts.map +1 -0
- package/dist/images/resolve.js +51 -0
- package/dist/images/runtime.d.ts +258 -0
- package/dist/images/runtime.d.ts.map +1 -0
- package/dist/images/runtime.js +659 -0
- package/dist/images/sources.d.ts +47 -0
- package/dist/images/sources.d.ts.map +1 -0
- package/dist/images/sources.js +97 -0
- package/dist/images/utils/image-probe.utils.d.ts +30 -0
- package/dist/images/utils/image-probe.utils.d.ts.map +1 -0
- package/dist/images/utils/image-probe.utils.js +307 -0
- package/dist/images/utils/index.d.ts +7 -0
- package/dist/images/utils/index.d.ts.map +1 -0
- package/dist/images/utils/index.js +5 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/metrics/noop.d.ts.map +1 -1
- package/dist/metrics/noop.js +3 -0
- package/dist/metrics/recorder.d.ts.map +1 -1
- package/dist/metrics/recorder.js +3 -0
- package/dist/metrics/types.d.ts +8 -0
- package/dist/metrics/types.d.ts.map +1 -1
- package/dist/seo/auto-inject.d.ts +3 -0
- package/dist/seo/auto-inject.d.ts.map +1 -1
- package/dist/seo/auto-inject.js +1 -0
- package/dist/seo/generator.d.ts +24 -0
- package/dist/seo/generator.d.ts.map +1 -1
- package/dist/seo/generator.js +65 -1
- package/dist/seo/index.d.ts +1 -1
- package/dist/seo/index.d.ts.map +1 -1
- package/dist/seo/index.js +1 -1
- package/dist/types/config.d.ts +5 -0
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/content.d.ts +21 -2
- package/dist/types/content.d.ts.map +1 -1
- package/dist/types/images.d.ts +185 -0
- package/dist/types/images.d.ts.map +1 -0
- package/dist/types/images.js +8 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/isg.d.ts +7 -0
- package/dist/types/isg.d.ts.map +1 -1
- package/dist/types/seo.d.ts +9 -0
- package/dist/types/seo.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Image pipeline exports
|
|
3
|
+
* Intrinsic sizes, lazy loading and co-located images in core, plus the plumbing for
|
|
4
|
+
* responsive variants and Open Graph images rendered by `@stati/images`.
|
|
5
|
+
*/
|
|
6
|
+
export { resolveImagesConfig, validateImagesConfig } from './config.js';
|
|
7
|
+
export { ImageRuntime, PageImages, validateOgBaseUrl } from './runtime.js';
|
|
8
|
+
export { installImageRule, selectEagerImage } from './markdown-rule.js';
|
|
9
|
+
export { findOgTemplatePath, clearOgTemplateCache } from './og.js';
|
|
10
|
+
export { loadImageProvider, resolveImagesPackage, missingPackageMessage } from './provider.js';
|
|
11
|
+
export { probeImage } from './utils/index.js';
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The images manifest, `.stati/images/manifest.json`: which files each image job produced,
|
|
3
|
+
* and cached hashes and probes of source images.
|
|
4
|
+
* @module images/manifest
|
|
5
|
+
*/
|
|
6
|
+
import type { SourceInfo } from './sources.js';
|
|
7
|
+
/**
|
|
8
|
+
* Persisted state of the image pipeline.
|
|
9
|
+
*/
|
|
10
|
+
export interface ImagesManifest {
|
|
11
|
+
version: number;
|
|
12
|
+
/** Cached facts about source images, keyed by absolute path */
|
|
13
|
+
sources: Record<string, SourceInfo>;
|
|
14
|
+
/** Files each job wrote, relative to the output directory, keyed by job key */
|
|
15
|
+
outputs: Record<string, {
|
|
16
|
+
files: string[];
|
|
17
|
+
}>;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Creates an empty images manifest.
|
|
21
|
+
*/
|
|
22
|
+
export declare function createEmptyImagesManifest(): ImagesManifest;
|
|
23
|
+
/**
|
|
24
|
+
* Path of the images manifest inside the cache directory.
|
|
25
|
+
*/
|
|
26
|
+
export declare function getImagesManifestPath(cacheDir: string): string;
|
|
27
|
+
/**
|
|
28
|
+
* Loads the images manifest. A missing, unreadable or outdated manifest yields an empty one,
|
|
29
|
+
* which only means images are checked again.
|
|
30
|
+
*/
|
|
31
|
+
export declare function loadImagesManifest(cacheDir: string): Promise<ImagesManifest>;
|
|
32
|
+
/**
|
|
33
|
+
* Saves the images manifest.
|
|
34
|
+
*/
|
|
35
|
+
export declare function saveImagesManifest(cacheDir: string, manifest: ImagesManifest): Promise<void>;
|
|
36
|
+
//# sourceMappingURL=manifest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../src/images/manifest.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAK/C;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,+DAA+D;IAC/D,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACpC,+EAA+E;IAC/E,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAC;CAC9C;AAED;;GAEG;AACH,wBAAgB,yBAAyB,IAAI,cAAc,CAE1D;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE9D;AAMD;;;GAGG;AACH,wBAAsB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAqClF;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CACtC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,cAAc,GACvB,OAAO,CAAC,IAAI,CAAC,CAIf"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The images manifest, `.stati/images/manifest.json`: which files each image job produced,
|
|
3
|
+
* and cached hashes and probes of source images.
|
|
4
|
+
* @module images/manifest
|
|
5
|
+
*/
|
|
6
|
+
import { join } from 'node:path';
|
|
7
|
+
import { ensureDir, readFile, writeFile } from '../core/utils/index.js';
|
|
8
|
+
import { IMAGES_CACHE_SUBDIR, MANIFEST_FILENAME } from '../constants.js';
|
|
9
|
+
/** Bumped when the manifest layout changes; older manifests are discarded. */
|
|
10
|
+
const IMAGES_MANIFEST_VERSION = 1;
|
|
11
|
+
/**
|
|
12
|
+
* Creates an empty images manifest.
|
|
13
|
+
*/
|
|
14
|
+
export function createEmptyImagesManifest() {
|
|
15
|
+
return { version: IMAGES_MANIFEST_VERSION, sources: {}, outputs: {} };
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Path of the images manifest inside the cache directory.
|
|
19
|
+
*/
|
|
20
|
+
export function getImagesManifestPath(cacheDir) {
|
|
21
|
+
return join(cacheDir, IMAGES_CACHE_SUBDIR, MANIFEST_FILENAME);
|
|
22
|
+
}
|
|
23
|
+
function isStringArray(value) {
|
|
24
|
+
return Array.isArray(value) && value.every((item) => typeof item === 'string');
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Loads the images manifest. A missing, unreadable or outdated manifest yields an empty one,
|
|
28
|
+
* which only means images are checked again.
|
|
29
|
+
*/
|
|
30
|
+
export async function loadImagesManifest(cacheDir) {
|
|
31
|
+
try {
|
|
32
|
+
const content = await readFile(getImagesManifestPath(cacheDir));
|
|
33
|
+
if (!content)
|
|
34
|
+
return createEmptyImagesManifest();
|
|
35
|
+
const parsed = JSON.parse(content);
|
|
36
|
+
if (parsed?.version !== IMAGES_MANIFEST_VERSION ||
|
|
37
|
+
typeof parsed.sources !== 'object' ||
|
|
38
|
+
typeof parsed.outputs !== 'object') {
|
|
39
|
+
return createEmptyImagesManifest();
|
|
40
|
+
}
|
|
41
|
+
const outputs = {};
|
|
42
|
+
for (const [key, record] of Object.entries(parsed.outputs ?? {})) {
|
|
43
|
+
if (record && isStringArray(record.files)) {
|
|
44
|
+
outputs[key] = { files: record.files };
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
const sources = {};
|
|
48
|
+
for (const [path, info] of Object.entries(parsed.sources ?? {})) {
|
|
49
|
+
if (info &&
|
|
50
|
+
typeof info.size === 'number' &&
|
|
51
|
+
typeof info.mtimeMs === 'number' &&
|
|
52
|
+
typeof info.hash === 'string') {
|
|
53
|
+
sources[path] = info;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return { version: IMAGES_MANIFEST_VERSION, sources, outputs };
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
return createEmptyImagesManifest();
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Saves the images manifest.
|
|
64
|
+
*/
|
|
65
|
+
export async function saveImagesManifest(cacheDir, manifest) {
|
|
66
|
+
const path = getImagesManifestPath(cacheDir);
|
|
67
|
+
await ensureDir(join(cacheDir, IMAGES_CACHE_SUBDIR));
|
|
68
|
+
await writeFile(path, JSON.stringify(manifest, null, 2), 'utf-8');
|
|
69
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The markdown-it `image` rule that adds dimensions, lazy loading and responsive variants.
|
|
3
|
+
* @module images/markdown-rule
|
|
4
|
+
*/
|
|
5
|
+
import type MarkdownIt from 'markdown-it';
|
|
6
|
+
import type Token from 'markdown-it/lib/token.mjs';
|
|
7
|
+
/** Key of the page's image state in the markdown-it `env`. */
|
|
8
|
+
export declare const IMAGES_ENV_KEY = "statiImages";
|
|
9
|
+
/**
|
|
10
|
+
* Installs the image rule. It holds no per-page state: each render passes its page's image
|
|
11
|
+
* state in `env`, and renders without it fall through to the previous rule. Installed before
|
|
12
|
+
* plugins and `markdown.configure`, so a custom image rule there replaces it.
|
|
13
|
+
*
|
|
14
|
+
* @param md - The markdown-it instance
|
|
15
|
+
*/
|
|
16
|
+
export declare function installImageRule(md: MarkdownIt): void;
|
|
17
|
+
/**
|
|
18
|
+
* Picks the image `eagerFirst` loads eagerly: the document's first image, when it sits in
|
|
19
|
+
* one of the first top-level blocks. A first image further down is not the page's largest
|
|
20
|
+
* contentful paint, so it stays lazy.
|
|
21
|
+
*
|
|
22
|
+
* @param tokens - Parsed block tokens
|
|
23
|
+
* @returns The image token, or undefined
|
|
24
|
+
*/
|
|
25
|
+
export declare function selectEagerImage(tokens: Token[]): Token | undefined;
|
|
26
|
+
//# sourceMappingURL=markdown-rule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown-rule.d.ts","sourceRoot":"","sources":["../../src/images/markdown-rule.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,UAAU,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,KAAK,MAAM,2BAA2B,CAAC;AAGnD,8DAA8D;AAC9D,eAAO,MAAM,cAAc,gBAAgB,CAAC;AAO5C;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,UAAU,GAAG,IAAI,CAwBrD;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,GAAG,SAAS,CAanE"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The markdown-it `image` rule that adds dimensions, lazy loading and responsive variants.
|
|
3
|
+
* @module images/markdown-rule
|
|
4
|
+
*/
|
|
5
|
+
/** Key of the page's image state in the markdown-it `env`. */
|
|
6
|
+
export const IMAGES_ENV_KEY = 'statiImages';
|
|
7
|
+
/** An image counts as near the top of a page when it sits in one of the first blocks. */
|
|
8
|
+
const EAGER_BLOCK_LIMIT = 3;
|
|
9
|
+
/**
|
|
10
|
+
* Installs the image rule. It holds no per-page state: each render passes its page's image
|
|
11
|
+
* state in `env`, and renders without it fall through to the previous rule. Installed before
|
|
12
|
+
* plugins and `markdown.configure`, so a custom image rule there replaces it.
|
|
13
|
+
*
|
|
14
|
+
* @param md - The markdown-it instance
|
|
15
|
+
*/
|
|
16
|
+
export function installImageRule(md) {
|
|
17
|
+
const previous = md.renderer.rules.image ??
|
|
18
|
+
((tokens, idx, options, _env, self) => self.renderToken(tokens, idx, options));
|
|
19
|
+
md.renderer.rules.image = (tokens, idx, options, env, self) => {
|
|
20
|
+
const images = env?.[IMAGES_ENV_KEY];
|
|
21
|
+
const token = tokens[idx];
|
|
22
|
+
if (!images || !token) {
|
|
23
|
+
return previous(tokens, idx, options, env, self);
|
|
24
|
+
}
|
|
25
|
+
const alt = self.renderInlineAsText(token.children ?? [], options, env);
|
|
26
|
+
const result = images.renderMarkdownImage(token, alt);
|
|
27
|
+
if ('html' in result) {
|
|
28
|
+
return result.html;
|
|
29
|
+
}
|
|
30
|
+
// Left as authored, apart from a stripped `?raw` suffix
|
|
31
|
+
if (result.src !== token.attrGet('src')) {
|
|
32
|
+
token.attrSet('src', result.src);
|
|
33
|
+
}
|
|
34
|
+
return previous(tokens, idx, options, env, self);
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Picks the image `eagerFirst` loads eagerly: the document's first image, when it sits in
|
|
39
|
+
* one of the first top-level blocks. A first image further down is not the page's largest
|
|
40
|
+
* contentful paint, so it stays lazy.
|
|
41
|
+
*
|
|
42
|
+
* @param tokens - Parsed block tokens
|
|
43
|
+
* @returns The image token, or undefined
|
|
44
|
+
*/
|
|
45
|
+
export function selectEagerImage(tokens) {
|
|
46
|
+
let blocks = 0;
|
|
47
|
+
for (const token of tokens) {
|
|
48
|
+
if (token.level === 0 && token.nesting !== -1) {
|
|
49
|
+
blocks++;
|
|
50
|
+
if (blocks > EAGER_BLOCK_LIMIT)
|
|
51
|
+
return undefined;
|
|
52
|
+
}
|
|
53
|
+
if (token.type === 'inline') {
|
|
54
|
+
const image = token.children?.find((child) => child.type === 'image');
|
|
55
|
+
if (image)
|
|
56
|
+
return image;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return undefined;
|
|
60
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HTML for processed images.
|
|
3
|
+
* @module images/markup
|
|
4
|
+
*/
|
|
5
|
+
import type { VariantPlan } from './plan.js';
|
|
6
|
+
/**
|
|
7
|
+
* Attributes for an `<img>` element.
|
|
8
|
+
*/
|
|
9
|
+
export interface ImgMarkupOptions {
|
|
10
|
+
alt: string;
|
|
11
|
+
title?: string | undefined;
|
|
12
|
+
/** Other authored attributes, such as `class` or `id`, in order */
|
|
13
|
+
attributes?: ReadonlyArray<readonly [string, string]> | undefined;
|
|
14
|
+
width?: number | string | undefined;
|
|
15
|
+
height?: number | string | undefined;
|
|
16
|
+
/** Load eagerly with high fetch priority instead of lazily */
|
|
17
|
+
eager?: boolean | undefined;
|
|
18
|
+
srcset?: string | undefined;
|
|
19
|
+
sizes?: string | undefined;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Renders an `<img>` with dimensions, loading hints and authored attributes.
|
|
23
|
+
*
|
|
24
|
+
* @param src - Image URL
|
|
25
|
+
* @param options - Attributes
|
|
26
|
+
* @returns The `<img>` element
|
|
27
|
+
*/
|
|
28
|
+
export declare function renderImg(src: string, options: ImgMarkupOptions): string;
|
|
29
|
+
/**
|
|
30
|
+
* Renders a responsive image: a `<picture>` with one `<source>` per modern format, or a
|
|
31
|
+
* plain `<img srcset>` when there are none.
|
|
32
|
+
*
|
|
33
|
+
* @param plan - The planned variants
|
|
34
|
+
* @param options - Attributes for the `<img>` fallback
|
|
35
|
+
* @param sizes - The `sizes` attribute
|
|
36
|
+
* @returns The `<picture>` or `<img>` element
|
|
37
|
+
*/
|
|
38
|
+
export declare function renderResponsiveImage(plan: VariantPlan, options: Omit<ImgMarkupOptions, 'srcset' | 'sizes'>, sizes: string): string;
|
|
39
|
+
//# sourceMappingURL=markup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markup.d.ts","sourceRoot":"","sources":["../../src/images/markup.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAgB7C;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,mEAAmE;IACnE,UAAU,CAAC,EAAE,aAAa,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,SAAS,CAAC;IAClE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IACpC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IACrC,8DAA8D;IAC9D,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC5B;AAMD;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,GAAG,MAAM,CAexE;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,WAAW,EACjB,OAAO,EAAE,IAAI,CAAC,gBAAgB,EAAE,QAAQ,GAAG,OAAO,CAAC,EACnD,KAAK,EAAE,MAAM,GACZ,MAAM,CAgBR"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HTML for processed images.
|
|
3
|
+
* @module images/markup
|
|
4
|
+
*/
|
|
5
|
+
import { escapeHtml } from '../seo/utils/index.js';
|
|
6
|
+
/** Attributes Stati sets itself; authored values for these are ignored or handled separately. */
|
|
7
|
+
const MANAGED_ATTRIBUTES = new Set([
|
|
8
|
+
'src',
|
|
9
|
+
'srcset',
|
|
10
|
+
'sizes',
|
|
11
|
+
'alt',
|
|
12
|
+
'title',
|
|
13
|
+
'width',
|
|
14
|
+
'height',
|
|
15
|
+
'loading',
|
|
16
|
+
'decoding',
|
|
17
|
+
'fetchpriority',
|
|
18
|
+
]);
|
|
19
|
+
function attribute(name, value) {
|
|
20
|
+
return ` ${name}="${escapeHtml(String(value))}"`;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Renders an `<img>` with dimensions, loading hints and authored attributes.
|
|
24
|
+
*
|
|
25
|
+
* @param src - Image URL
|
|
26
|
+
* @param options - Attributes
|
|
27
|
+
* @returns The `<img>` element
|
|
28
|
+
*/
|
|
29
|
+
export function renderImg(src, options) {
|
|
30
|
+
let html = `<img${attribute('src', src)}`;
|
|
31
|
+
if (options.srcset)
|
|
32
|
+
html += attribute('srcset', options.srcset);
|
|
33
|
+
if (options.sizes)
|
|
34
|
+
html += attribute('sizes', options.sizes);
|
|
35
|
+
html += attribute('alt', options.alt);
|
|
36
|
+
if (options.title)
|
|
37
|
+
html += attribute('title', options.title);
|
|
38
|
+
for (const [name, value] of options.attributes ?? []) {
|
|
39
|
+
if (!MANAGED_ATTRIBUTES.has(name.toLowerCase())) {
|
|
40
|
+
html += attribute(name, value);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
if (options.width !== undefined)
|
|
44
|
+
html += attribute('width', options.width);
|
|
45
|
+
if (options.height !== undefined)
|
|
46
|
+
html += attribute('height', options.height);
|
|
47
|
+
html += options.eager ? ' loading="eager" fetchpriority="high"' : ' loading="lazy"';
|
|
48
|
+
return `${html} decoding="async">`;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Renders a responsive image: a `<picture>` with one `<source>` per modern format, or a
|
|
52
|
+
* plain `<img srcset>` when there are none.
|
|
53
|
+
*
|
|
54
|
+
* @param plan - The planned variants
|
|
55
|
+
* @param options - Attributes for the `<img>` fallback
|
|
56
|
+
* @param sizes - The `sizes` attribute
|
|
57
|
+
* @returns The `<picture>` or `<img>` element
|
|
58
|
+
*/
|
|
59
|
+
export function renderResponsiveImage(plan, options, sizes) {
|
|
60
|
+
const img = renderImg(plan.fallback.src, {
|
|
61
|
+
...options,
|
|
62
|
+
srcset: plan.fallback.srcset,
|
|
63
|
+
sizes,
|
|
64
|
+
});
|
|
65
|
+
if (plan.sources.length === 0) {
|
|
66
|
+
return img;
|
|
67
|
+
}
|
|
68
|
+
const sources = plan.sources
|
|
69
|
+
.map((source) => `<source${attribute('type', source.type)}${attribute('srcset', source.srcset)}${attribute('sizes', sizes)}>`)
|
|
70
|
+
.join('');
|
|
71
|
+
return `<picture>${sources}${img}</picture>`;
|
|
72
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helpers for Open Graph image generation: template lookup, exclusions and inlining.
|
|
3
|
+
* @module images/og
|
|
4
|
+
*/
|
|
5
|
+
import type { PageModel } from '../types/index.js';
|
|
6
|
+
/**
|
|
7
|
+
* Clears the Open Graph template lookup cache.
|
|
8
|
+
*/
|
|
9
|
+
export declare function clearOgTemplateCache(): void;
|
|
10
|
+
/**
|
|
11
|
+
* Finds the Open Graph template for a page: the nearest file named `templateName` in the
|
|
12
|
+
* page's directory or one of its parents, up to the source directory.
|
|
13
|
+
*
|
|
14
|
+
* @param pageSourcePath - Absolute path of the page's Markdown file
|
|
15
|
+
* @param srcDir - Absolute source directory
|
|
16
|
+
* @param templateName - Template file name, such as `og.eta`
|
|
17
|
+
* @returns Absolute path of the template, or null when there is none
|
|
18
|
+
*/
|
|
19
|
+
export declare function findOgTemplatePath(pageSourcePath: string, srcDir: string, templateName: string): Promise<string | null>;
|
|
20
|
+
/**
|
|
21
|
+
* Whether a page gets no generated Open Graph image: it sets its own image in front matter
|
|
22
|
+
* (`seo.openGraph.image`, or `false` to have none) or matches an `exclude` pattern.
|
|
23
|
+
*/
|
|
24
|
+
export declare function isOgImageExcluded(page: PageModel, exclude: readonly string[]): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* File name stem for a page's Open Graph image, from its URL.
|
|
27
|
+
* The root page is `index`; `/blog/hello/` becomes `blog-hello`.
|
|
28
|
+
*/
|
|
29
|
+
export declare function ogImageSlug(url: string): string;
|
|
30
|
+
/**
|
|
31
|
+
* Replaces local `<img src>` values in Open Graph HTML with data URIs, because the renderer
|
|
32
|
+
* does not fetch files. Root-relative paths resolve from the static directory, relative ones
|
|
33
|
+
* from `baseDir`. Remote URLs and data URIs are left alone.
|
|
34
|
+
*
|
|
35
|
+
* @param generatedSource - Finds the source of an image Stati generates (`/_img/...`), such as
|
|
36
|
+
* a responsive variant from `stati.image()`. Cards inline the source, because generated
|
|
37
|
+
* files may not exist yet.
|
|
38
|
+
* @returns The HTML and the absolute paths of the files that were inlined
|
|
39
|
+
*/
|
|
40
|
+
export declare function inlineLocalImages(html: string, dirs: {
|
|
41
|
+
staticDir: string;
|
|
42
|
+
baseDir: string;
|
|
43
|
+
srcDir: string;
|
|
44
|
+
}, generatedSource?: (path: string) => string | undefined): Promise<{
|
|
45
|
+
html: string;
|
|
46
|
+
files: string[];
|
|
47
|
+
}>;
|
|
48
|
+
/**
|
|
49
|
+
* The template path to show in messages, relative to the project.
|
|
50
|
+
*/
|
|
51
|
+
export declare function displayTemplatePath(templatePath: string): string;
|
|
52
|
+
//# sourceMappingURL=og.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"og.d.ts","sourceRoot":"","sources":["../../src/images/og.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAKnD;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,CAE3C;AAED;;;;;;;;GAQG;AACH,wBAAsB,kBAAkB,CACtC,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAyBxB;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAOtF;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAU/C;AAsCD;;;;;;;;;GASG;AACH,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,EAC5D,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,GACrD,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CAwC5C;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAEhE"}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helpers for Open Graph image generation: template lookup, exclusions and inlining.
|
|
3
|
+
* @module images/og
|
|
4
|
+
*/
|
|
5
|
+
import { dirname, extname, join, relative, resolve } from 'node:path';
|
|
6
|
+
import { isPathWithinDirectory, pathExists, readFileBuffer } from '../core/utils/index.js';
|
|
7
|
+
import { matchesGlob } from '../core/utils/glob-patterns.utils.js';
|
|
8
|
+
/** Cache of template lookups per directory, cleared at the start of each build. */
|
|
9
|
+
const templateCache = new Map();
|
|
10
|
+
/**
|
|
11
|
+
* Clears the Open Graph template lookup cache.
|
|
12
|
+
*/
|
|
13
|
+
export function clearOgTemplateCache() {
|
|
14
|
+
templateCache.clear();
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Finds the Open Graph template for a page: the nearest file named `templateName` in the
|
|
18
|
+
* page's directory or one of its parents, up to the source directory.
|
|
19
|
+
*
|
|
20
|
+
* @param pageSourcePath - Absolute path of the page's Markdown file
|
|
21
|
+
* @param srcDir - Absolute source directory
|
|
22
|
+
* @param templateName - Template file name, such as `og.eta`
|
|
23
|
+
* @returns Absolute path of the template, or null when there is none
|
|
24
|
+
*/
|
|
25
|
+
export async function findOgTemplatePath(pageSourcePath, srcDir, templateName) {
|
|
26
|
+
const root = resolve(srcDir);
|
|
27
|
+
let dir = dirname(resolve(pageSourcePath));
|
|
28
|
+
const visited = [];
|
|
29
|
+
while (isPathWithinDirectory(root, dir)) {
|
|
30
|
+
const cacheKey = `${dir}|${templateName}`;
|
|
31
|
+
if (templateCache.has(cacheKey)) {
|
|
32
|
+
const cached = templateCache.get(cacheKey);
|
|
33
|
+
for (const key of visited)
|
|
34
|
+
templateCache.set(key, cached);
|
|
35
|
+
return cached;
|
|
36
|
+
}
|
|
37
|
+
visited.push(cacheKey);
|
|
38
|
+
const candidate = join(dir, templateName);
|
|
39
|
+
if (await pathExists(candidate)) {
|
|
40
|
+
for (const key of visited)
|
|
41
|
+
templateCache.set(key, candidate);
|
|
42
|
+
return candidate;
|
|
43
|
+
}
|
|
44
|
+
if (dir === root)
|
|
45
|
+
break;
|
|
46
|
+
dir = dirname(dir);
|
|
47
|
+
}
|
|
48
|
+
for (const key of visited)
|
|
49
|
+
templateCache.set(key, null);
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Whether a page gets no generated Open Graph image: it sets its own image in front matter
|
|
54
|
+
* (`seo.openGraph.image`, or `false` to have none) or matches an `exclude` pattern.
|
|
55
|
+
*/
|
|
56
|
+
export function isOgImageExcluded(page, exclude) {
|
|
57
|
+
const seo = page.frontMatter.seo;
|
|
58
|
+
const image = seo?.openGraph?.image;
|
|
59
|
+
if (image !== undefined && image !== null && image !== '') {
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
return exclude.some((pattern) => matchesGlob(page.url, pattern));
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* File name stem for a page's Open Graph image, from its URL.
|
|
66
|
+
* The root page is `index`; `/blog/hello/` becomes `blog-hello`.
|
|
67
|
+
*/
|
|
68
|
+
export function ogImageSlug(url) {
|
|
69
|
+
const slug = url
|
|
70
|
+
.split('/')
|
|
71
|
+
.filter(Boolean)
|
|
72
|
+
.join('-')
|
|
73
|
+
.replace(/[^a-zA-Z0-9-_]+/g, '-')
|
|
74
|
+
.replace(/-+/g, '-')
|
|
75
|
+
.replace(/^-|-$/g, '')
|
|
76
|
+
.toLowerCase();
|
|
77
|
+
return slug || 'index';
|
|
78
|
+
}
|
|
79
|
+
const MIME_BY_EXTENSION = {
|
|
80
|
+
'.png': 'image/png',
|
|
81
|
+
'.jpg': 'image/jpeg',
|
|
82
|
+
'.jpeg': 'image/jpeg',
|
|
83
|
+
'.gif': 'image/gif',
|
|
84
|
+
'.webp': 'image/webp',
|
|
85
|
+
'.avif': 'image/avif',
|
|
86
|
+
'.svg': 'image/svg+xml',
|
|
87
|
+
};
|
|
88
|
+
const NAMED_ENTITIES = {
|
|
89
|
+
amp: '&',
|
|
90
|
+
lt: '<',
|
|
91
|
+
gt: '>',
|
|
92
|
+
quot: '"',
|
|
93
|
+
apos: "'",
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* Decodes the character references in an attribute value: the ones Eta's escaping writes,
|
|
97
|
+
* and numeric ones.
|
|
98
|
+
*/
|
|
99
|
+
function decodeHtmlEntities(text) {
|
|
100
|
+
return text.replace(/&(#[xX][0-9a-fA-F]+|#\d+|amp|lt|gt|quot|apos);/g, (match, entity) => {
|
|
101
|
+
if (!entity.startsWith('#'))
|
|
102
|
+
return NAMED_ENTITIES[entity];
|
|
103
|
+
const code = entity[1] === 'x' || entity[1] === 'X'
|
|
104
|
+
? parseInt(entity.slice(2), 16)
|
|
105
|
+
: parseInt(entity.slice(1), 10);
|
|
106
|
+
return code > 0 && code <= 0x10ffff ? String.fromCodePoint(code) : match;
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Replaces local `<img src>` values in Open Graph HTML with data URIs, because the renderer
|
|
111
|
+
* does not fetch files. Root-relative paths resolve from the static directory, relative ones
|
|
112
|
+
* from `baseDir`. Remote URLs and data URIs are left alone.
|
|
113
|
+
*
|
|
114
|
+
* @param generatedSource - Finds the source of an image Stati generates (`/_img/...`), such as
|
|
115
|
+
* a responsive variant from `stati.image()`. Cards inline the source, because generated
|
|
116
|
+
* files may not exist yet.
|
|
117
|
+
* @returns The HTML and the absolute paths of the files that were inlined
|
|
118
|
+
*/
|
|
119
|
+
export async function inlineLocalImages(html, dirs, generatedSource) {
|
|
120
|
+
const files = [];
|
|
121
|
+
// `[^<>]` keeps each match inside one tag, so unclosed tags can't make the search quadratic
|
|
122
|
+
const pattern = /(<img\b[^<>]*?\bsrc\s*=\s*)("([^"]*)"|'([^']*)')/gi;
|
|
123
|
+
const replacements = [];
|
|
124
|
+
for (const match of html.matchAll(pattern)) {
|
|
125
|
+
// The value is HTML-escaped: `a&b.png` names the file `a&b.png`
|
|
126
|
+
const src = decodeHtmlEntities(match[3] ?? match[4] ?? '').trim();
|
|
127
|
+
if (!src || /^(?:[a-z][a-z\d+.-]*:|\/\/)/i.test(src))
|
|
128
|
+
continue;
|
|
129
|
+
let path;
|
|
130
|
+
try {
|
|
131
|
+
path = decodeURIComponent(src.replace(/[?#].*$/, ''));
|
|
132
|
+
}
|
|
133
|
+
catch {
|
|
134
|
+
continue;
|
|
135
|
+
}
|
|
136
|
+
let filePath = generatedSource?.(path);
|
|
137
|
+
if (!filePath) {
|
|
138
|
+
filePath = path.startsWith('/') ? join(dirs.staticDir, path) : resolve(dirs.baseDir, path);
|
|
139
|
+
const root = path.startsWith('/') ? dirs.staticDir : dirs.srcDir;
|
|
140
|
+
if (!isPathWithinDirectory(root, filePath))
|
|
141
|
+
continue;
|
|
142
|
+
}
|
|
143
|
+
const mime = MIME_BY_EXTENSION[extname(filePath).toLowerCase()];
|
|
144
|
+
if (!mime)
|
|
145
|
+
continue;
|
|
146
|
+
files.push(filePath.replace(/\\/g, '/'));
|
|
147
|
+
const bytes = await readFileBuffer(filePath);
|
|
148
|
+
if (!bytes)
|
|
149
|
+
continue;
|
|
150
|
+
const dataUri = `data:${mime};base64,${bytes.toString('base64')}`;
|
|
151
|
+
replacements.push({ match: match[0], replacement: `${match[1]}"${dataUri}"` });
|
|
152
|
+
}
|
|
153
|
+
let result = html;
|
|
154
|
+
for (const { match, replacement } of replacements) {
|
|
155
|
+
// A function, so `$&` and the like in the tag's other attributes stay literal
|
|
156
|
+
result = result.replace(match, () => replacement);
|
|
157
|
+
}
|
|
158
|
+
return { html: result, files };
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* The template path to show in messages, relative to the project.
|
|
162
|
+
*/
|
|
163
|
+
export function displayTemplatePath(templatePath) {
|
|
164
|
+
return relative(process.cwd(), templatePath).replace(/\\/g, '/') || templatePath;
|
|
165
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Decides which files to generate for an image and what to call them.
|
|
3
|
+
* Names come from inputs, not from encoded bytes, so page HTML can be written before
|
|
4
|
+
* encoding finishes.
|
|
5
|
+
* @module images/plan
|
|
6
|
+
*/
|
|
7
|
+
import type { ImageOutputFormat, ImageSourceFormat } from '../types/index.js';
|
|
8
|
+
import type { ResolvedResponsiveConfig } from './config.js';
|
|
9
|
+
/**
|
|
10
|
+
* Picks the widths to generate for an image.
|
|
11
|
+
* Configured widths up to the image's own width are kept, and the image's own width is
|
|
12
|
+
* added when it is below the largest configured width. Images are never enlarged.
|
|
13
|
+
*
|
|
14
|
+
* @param intrinsicWidth - The image's display width
|
|
15
|
+
* @param configured - Candidate widths, ascending
|
|
16
|
+
* @returns Widths to generate, ascending
|
|
17
|
+
*/
|
|
18
|
+
export declare function planWidths(intrinsicWidth: number, configured: readonly number[]): number[];
|
|
19
|
+
/**
|
|
20
|
+
* The format of the `<img>` fallback for a source format: the source's own format, except
|
|
21
|
+
* GIF, which becomes PNG.
|
|
22
|
+
*/
|
|
23
|
+
export declare function fallbackFormatFor(format: ImageSourceFormat): ImageOutputFormat;
|
|
24
|
+
/**
|
|
25
|
+
* File extension for a format.
|
|
26
|
+
*/
|
|
27
|
+
export declare function extensionFor(format: ImageSourceFormat | ImageOutputFormat): string;
|
|
28
|
+
/**
|
|
29
|
+
* MIME type for a generated format.
|
|
30
|
+
*/
|
|
31
|
+
export declare function mimeTypeFor(format: ImageOutputFormat): string;
|
|
32
|
+
/**
|
|
33
|
+
* A URL-safe base name for generated files, from the source file name.
|
|
34
|
+
*/
|
|
35
|
+
export declare function imageBaseName(filePath: string): string;
|
|
36
|
+
/** One file to generate, with its path relative to the output directory and its URL. */
|
|
37
|
+
export interface PlannedOutput {
|
|
38
|
+
/** Path relative to the output directory, with forward slashes */
|
|
39
|
+
relPath: string;
|
|
40
|
+
/** Root-relative URL */
|
|
41
|
+
url: string;
|
|
42
|
+
width: number;
|
|
43
|
+
format: ImageOutputFormat;
|
|
44
|
+
quality?: number;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* A copy of a co-located source image under its content-hashed name.
|
|
48
|
+
*/
|
|
49
|
+
export interface CopyPlan {
|
|
50
|
+
key: string;
|
|
51
|
+
/** Path relative to the output directory, with forward slashes */
|
|
52
|
+
relPath: string;
|
|
53
|
+
/** Root-relative URL */
|
|
54
|
+
url: string;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Plans the copy of a co-located image: `/_img/{name}-{hash}.{ext}`.
|
|
58
|
+
*
|
|
59
|
+
* @param filePath - Absolute source path
|
|
60
|
+
* @param sourceHash - SHA-256 of the source bytes
|
|
61
|
+
* @param format - Source format
|
|
62
|
+
*/
|
|
63
|
+
export declare function planCopy(filePath: string, sourceHash: string, format: ImageSourceFormat): CopyPlan;
|
|
64
|
+
/**
|
|
65
|
+
* Generated files for one responsive image, grouped for markup.
|
|
66
|
+
*/
|
|
67
|
+
export interface VariantPlan {
|
|
68
|
+
/** Cache key covering the output name, source bytes, options and encoder */
|
|
69
|
+
key: string;
|
|
70
|
+
/** Every file to generate */
|
|
71
|
+
outputs: PlannedOutput[];
|
|
72
|
+
/** `<source>` elements, one per modern format, in order of preference */
|
|
73
|
+
sources: Array<{
|
|
74
|
+
type: string;
|
|
75
|
+
srcset: string;
|
|
76
|
+
}>;
|
|
77
|
+
/** The `<img>` fallback in the source's own format */
|
|
78
|
+
fallback: {
|
|
79
|
+
src: string;
|
|
80
|
+
srcset: string;
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Inputs for {@link planVariants}.
|
|
85
|
+
*/
|
|
86
|
+
export interface VariantPlanInput {
|
|
87
|
+
filePath: string;
|
|
88
|
+
sourceHash: string;
|
|
89
|
+
format: ImageSourceFormat;
|
|
90
|
+
/** Display width */
|
|
91
|
+
width: number;
|
|
92
|
+
responsive: ResolvedResponsiveConfig;
|
|
93
|
+
/** Encoder identity, so encoder upgrades produce new URLs */
|
|
94
|
+
providerVersion: string;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Plans the responsive variants of one image: `/_img/{name}-{hash}-{width}.{ext}` for every
|
|
98
|
+
* width in each modern format, plus the fallback format.
|
|
99
|
+
*/
|
|
100
|
+
export declare function planVariants(input: VariantPlanInput): VariantPlan;
|
|
101
|
+
//# sourceMappingURL=plan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../src/images/plan.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,KAAK,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC9E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAa5D;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,cAAc,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAU1F;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,iBAAiB,GAAG,iBAAiB,CAE9E;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,iBAAiB,GAAG,iBAAiB,GAAG,MAAM,CAElF;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,CAE7D;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED,wFAAwF;AACxF,MAAM,WAAW,aAAa;IAC5B,kEAAkE;IAClE,OAAO,EAAE,MAAM,CAAC;IAChB,wBAAwB;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,iBAAiB,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,kEAAkE;IAClE,OAAO,EAAE,MAAM,CAAC;IAChB,wBAAwB;IACxB,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CACtB,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,iBAAiB,GACxB,QAAQ,CAMV;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,4EAA4E;IAC5E,GAAG,EAAE,MAAM,CAAC;IACZ,6BAA6B;IAC7B,OAAO,EAAE,aAAa,EAAE,CAAC;IACzB,yEAAyE;IACzE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACjD,sDAAsD;IACtD,QAAQ,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CAC3C;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,oBAAoB;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,wBAAwB,CAAC;IACrC,6DAA6D;IAC7D,eAAe,EAAE,MAAM,CAAC;CACzB;AAaD;;;GAGG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,gBAAgB,GAAG,WAAW,CAiDjE"}
|