@kensio/colophon 2.7.0 → 2.8.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.
@@ -1,6 +1,6 @@
1
1
  import type { HighlightedCode, HighlightOptions } from "./types.js";
2
2
  export { dedent, expandTabs } from "./normalise.js";
3
- export { resolveLanguage, resolveTheme } from "./language.js";
3
+ export { loadTheme, resolveLanguage, resolveTheme } from "./language.js";
4
4
  export type { CodeToken, HighlightedCode, HighlightOptions } from "./types.js";
5
5
  /**
6
6
  * Tokenise a snippet with Shiki and flatten it onto a character grid.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/highlight/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEpE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC9D,YAAY,EAAE,SAAS,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE/E;;;;;GAKG;AACH,wBAAsB,aAAa,CACjC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,eAAe,CAAC,CAoB1B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/highlight/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEpE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AACzE,YAAY,EAAE,SAAS,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE/E;;;;;GAKG;AACH,wBAAsB,aAAa,CACjC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,eAAe,CAAC,CAoB1B"}
@@ -1,9 +1,9 @@
1
1
  import { codeToTokens } from "shiki";
2
2
  import { gridLine } from "./grid.js";
3
- import { resolveLanguage, resolveTheme } from "./language.js";
3
+ import { loadTheme, resolveLanguage } from "./language.js";
4
4
  import { normaliseSnippet } from "./normalise.js";
5
5
  export { dedent, expandTabs } from "./normalise.js";
6
- export { resolveLanguage, resolveTheme } from "./language.js";
6
+ export { loadTheme, resolveLanguage, resolveTheme } from "./language.js";
7
7
  /**
8
8
  * Tokenise a snippet with Shiki and flatten it onto a character grid.
9
9
  *
@@ -13,7 +13,7 @@ export { resolveLanguage, resolveTheme } from "./language.js";
13
13
  export async function highlightCode(code, options) {
14
14
  const result = await codeToTokens(normaliseSnippet(code, options.tabSize), {
15
15
  lang: resolveLanguage(options.language),
16
- theme: resolveTheme(options.theme),
16
+ theme: await loadTheme(options.theme),
17
17
  });
18
18
  let longestLine = 0;
19
19
  const lines = result.tokens.map((tokens) => {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/highlight/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAErC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGlD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAG9D;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,IAAY,EACZ,OAAyB;IAEzB,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,gBAAgB,CAAC,I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,EAAE;QACzE,IAAI,EAAE,eAAe,CAAC,OAAO,CAAC,QAAQ,CAAC;QACvC,KAAK,EAAE,MAAM,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC;KACtC,CAAC,CAAC;IAEH,IAAI,WAAW,GAAG,CAAC,CAAC;IAEpB,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;QACzC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC;QACzC,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;QAC3C,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;IAEH,OAAO;QACL,KAAK;QACL,UAAU,EAAE,MAAM,CAAC,EAAE,IAAI,SAAS;QAClC,UAAU,EAAE,MAAM,CAAC,EAAE,IAAI,SAAS;QAClC,WAAW;KACZ,CAAC;AACJ,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { BundledLanguage, BundledTheme, SpecialLanguage } from "shiki";
1
+ import type { BundledLanguage, BundledTheme, SpecialLanguage, ThemeRegistration } from "shiki";
2
2
  /**
3
3
  * Map a frontmatter language name onto one Shiki understands, falling back to
4
4
  * plain text so an unrecognised language still produces a readable image
@@ -10,4 +10,13 @@ export declare function resolveLanguage(language: string): BundledLanguage | Spe
10
10
  * fall back quietly, but a bad theme is a config mistake worth failing on.
11
11
  */
12
12
  export declare function resolveTheme(theme: string): BundledTheme;
13
+ /**
14
+ * Load a configured theme's data.
15
+ *
16
+ * Shiki takes a theme as a name or as the thing itself, and this hands it the
17
+ * thing, so the only registry either side of the call reads is the one in
18
+ * `themes.ts`. See there for why that matters. The import is cached by the
19
+ * module system, so a build highlighting a hundred snippets loads a theme once.
20
+ */
21
+ export declare function loadTheme(theme: string): Promise<ThemeRegistration>;
13
22
  //# sourceMappingURL=language.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"language.d.ts","sourceRoot":"","sources":["../../src/highlight/language.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AAsB5E;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,MAAM,GACf,eAAe,GAAG,eAAe,CAOnC;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY,CAQxD"}
1
+ {"version":3,"file":"language.d.ts","sourceRoot":"","sources":["../../src/highlight/language.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,YAAY,EACZ,eAAe,EACf,iBAAiB,EAClB,MAAM,OAAO,CAAC;AAwBf;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,MAAM,GACf,eAAe,GAAG,eAAe,CAOnC;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY,CAQxD;AAED;;;;;;;GAOG;AACH,wBAAsB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAKzE"}
@@ -1,4 +1,5 @@
1
- import { bundledLanguages, bundledThemes } from "shiki";
1
+ import { bundledLanguages } from "shiki";
2
+ import { codeThemes } from "./themes.js";
2
3
  /**
3
4
  * Language names that differ between Pygments (which the original Python
4
5
  * script used) and Shiki. Everything else is passed through, since Shiki
@@ -33,9 +34,22 @@ export function resolveLanguage(language) {
33
34
  * fall back quietly, but a bad theme is a config mistake worth failing on.
34
35
  */
35
36
  export function resolveTheme(theme) {
36
- if (!Object.hasOwn(bundledThemes, theme)) {
37
+ if (!Object.hasOwn(codeThemes, theme)) {
37
38
  throw new Error(`Unknown code theme "${theme}". See https://shiki.style/themes for the available names.`);
38
39
  }
39
40
  return theme;
40
41
  }
42
+ /**
43
+ * Load a configured theme's data.
44
+ *
45
+ * Shiki takes a theme as a name or as the thing itself, and this hands it the
46
+ * thing, so the only registry either side of the call reads is the one in
47
+ * `themes.ts`. See there for why that matters. The import is cached by the
48
+ * module system, so a build highlighting a hundred snippets loads a theme once.
49
+ */
50
+ export async function loadTheme(theme) {
51
+ const load = codeThemes[resolveTheme(theme)];
52
+ const loaded = await load();
53
+ return loaded.default;
54
+ }
41
55
  //# sourceMappingURL=language.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"language.js","sourceRoot":"","sources":["../../src/highlight/language.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAExD;;;;;GAKG;AACH,MAAM,eAAe,GAAgC,IAAI,GAAG,CAAC;IAC3D,CAAC,iBAAiB,EAAE,YAAY,CAAC;IACjC,CAAC,aAAa,EAAE,YAAY,CAAC;IAC7B,CAAC,YAAY,EAAE,YAAY,CAAC;IAC5B,CAAC,UAAU,EAAE,KAAK,CAAC;IACnB,CAAC,SAAS,EAAE,cAAc,CAAC;IAC3B,CAAC,eAAe,EAAE,cAAc,CAAC;IACjC,CAAC,MAAM,EAAE,WAAW,CAAC;IACrB,CAAC,OAAO,EAAE,WAAW,CAAC;CACvB,CAAC,CAAC;AAEH,MAAM,SAAS,GAAoB,WAAW,CAAC;AAE/C;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAC7B,QAAgB;IAEhB,MAAM,UAAU,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACjD,MAAM,OAAO,GAAG,eAAe,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,UAAU,CAAC;IAE9D,OAAO,MAAM,CAAC,MAAM,CAAC,gBAAgB,EAAE,OAAO,CAAC;QAC7C,CAAC,CAAE,OAA2B;QAC9B,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,KAAa;IACxC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE,KA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D,CACzF,CAAC;IACJ,CAAC;IAED,OAAO,KAAqB,CAAC;AAC/B,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,KAAa;IAC3C,MAAM,IAAI,GAAG,UAAU,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;IAC7C,MAAM,MAAM,GAAG,MAAM,IAAI,EAAE,CAAC;IAE5B,OAAO,MAAM,CAAC,OAAO,CAAC;AACxB,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare const probeFromInfo: {
2
+ [k: string]: import("shiki").DynamicImportThemeRegistration;
3
+ };
4
+ //# sourceMappingURL=probe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"probe.d.ts","sourceRoot":"","sources":["../../src/highlight/probe.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,aAAa;;CAEzB,CAAC"}
@@ -0,0 +1,4 @@
1
+ /* eslint-disable */
2
+ import { bundledThemesInfo } from "shiki";
3
+ export const probeFromInfo = Object.fromEntries(bundledThemesInfo.map((i) => [i.id, i.import]));
4
+ //# sourceMappingURL=probe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"probe.js","sourceRoot":"","sources":["../../src/highlight/probe.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE1C,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,WAAW,CAC7C,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAC/C,CAAC"}
@@ -0,0 +1,27 @@
1
+ import type { BundledTheme, ThemeRegistration } from "shiki";
2
+ /** Loads one theme's data, which is a chunk of its own in a bundle. */
3
+ export type CodeThemeLoader = () => Promise<{
4
+ default: ThemeRegistration;
5
+ }>;
6
+ /**
7
+ * Every theme Shiki bundles, as a registry of Colophon's own.
8
+ *
9
+ * Shiki has this map already, and reading it was what this used to do. It does
10
+ * not survive every browser build. Expressive Code, which a Starlight site runs
11
+ * by default, rewrites Shiki's own `themes.mjs` during the build to drop every
12
+ * theme its configuration does not name, under an option called
13
+ * `removeUnusedThemes`. That transform applies to the file rather than to one
14
+ * importer of it, so a second Shiki caller in the same build, which is what
15
+ * Colophon is on a site with a browser playground, is left with an empty
16
+ * registry: every theme name is unknown, including the default nobody typed.
17
+ *
18
+ * Owning the map is what makes that irrelevant, since these imports are
19
+ * Colophon's own and nothing rewrites them. The loaded theme is then passed to
20
+ * `codeToTokens` as an object rather than as a name, so Shiki's registry is not
21
+ * consulted on the way through either.
22
+ *
23
+ * The type is what keeps the list honest: `Record<BundledTheme, ...>` fails to
24
+ * compile if a Shiki upgrade adds a theme that is missing here, or renames one.
25
+ */
26
+ export declare const codeThemes: Record<BundledTheme, CodeThemeLoader>;
27
+ //# sourceMappingURL=themes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"themes.d.ts","sourceRoot":"","sources":["../../src/highlight/themes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE7D,uEAAuE;AACvE,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,CAAC;IAAE,OAAO,EAAE,iBAAiB,CAAA;CAAE,CAAC,CAAC;AAE5E;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,YAAY,EAAE,eAAe,CAuE5D,CAAC"}
@@ -0,0 +1,88 @@
1
+ /**
2
+ * Every theme Shiki bundles, as a registry of Colophon's own.
3
+ *
4
+ * Shiki has this map already, and reading it was what this used to do. It does
5
+ * not survive every browser build. Expressive Code, which a Starlight site runs
6
+ * by default, rewrites Shiki's own `themes.mjs` during the build to drop every
7
+ * theme its configuration does not name, under an option called
8
+ * `removeUnusedThemes`. That transform applies to the file rather than to one
9
+ * importer of it, so a second Shiki caller in the same build, which is what
10
+ * Colophon is on a site with a browser playground, is left with an empty
11
+ * registry: every theme name is unknown, including the default nobody typed.
12
+ *
13
+ * Owning the map is what makes that irrelevant, since these imports are
14
+ * Colophon's own and nothing rewrites them. The loaded theme is then passed to
15
+ * `codeToTokens` as an object rather than as a name, so Shiki's registry is not
16
+ * consulted on the way through either.
17
+ *
18
+ * The type is what keeps the list honest: `Record<BundledTheme, ...>` fails to
19
+ * compile if a Shiki upgrade adds a theme that is missing here, or renames one.
20
+ */
21
+ export const codeThemes = {
22
+ andromeeda: () => import("@shikijs/themes/andromeeda"),
23
+ "aurora-x": () => import("@shikijs/themes/aurora-x"),
24
+ "ayu-dark": () => import("@shikijs/themes/ayu-dark"),
25
+ "ayu-light": () => import("@shikijs/themes/ayu-light"),
26
+ "ayu-mirage": () => import("@shikijs/themes/ayu-mirage"),
27
+ "catppuccin-frappe": () => import("@shikijs/themes/catppuccin-frappe"),
28
+ "catppuccin-latte": () => import("@shikijs/themes/catppuccin-latte"),
29
+ "catppuccin-macchiato": () => import("@shikijs/themes/catppuccin-macchiato"),
30
+ "catppuccin-mocha": () => import("@shikijs/themes/catppuccin-mocha"),
31
+ "dark-plus": () => import("@shikijs/themes/dark-plus"),
32
+ dracula: () => import("@shikijs/themes/dracula"),
33
+ "dracula-soft": () => import("@shikijs/themes/dracula-soft"),
34
+ "everforest-dark": () => import("@shikijs/themes/everforest-dark"),
35
+ "everforest-light": () => import("@shikijs/themes/everforest-light"),
36
+ "github-dark": () => import("@shikijs/themes/github-dark"),
37
+ "github-dark-default": () => import("@shikijs/themes/github-dark-default"),
38
+ "github-dark-dimmed": () => import("@shikijs/themes/github-dark-dimmed"),
39
+ "github-dark-high-contrast": () => import("@shikijs/themes/github-dark-high-contrast"),
40
+ "github-light": () => import("@shikijs/themes/github-light"),
41
+ "github-light-default": () => import("@shikijs/themes/github-light-default"),
42
+ "github-light-high-contrast": () => import("@shikijs/themes/github-light-high-contrast"),
43
+ "gruvbox-dark-hard": () => import("@shikijs/themes/gruvbox-dark-hard"),
44
+ "gruvbox-dark-medium": () => import("@shikijs/themes/gruvbox-dark-medium"),
45
+ "gruvbox-dark-soft": () => import("@shikijs/themes/gruvbox-dark-soft"),
46
+ "gruvbox-light-hard": () => import("@shikijs/themes/gruvbox-light-hard"),
47
+ "gruvbox-light-medium": () => import("@shikijs/themes/gruvbox-light-medium"),
48
+ "gruvbox-light-soft": () => import("@shikijs/themes/gruvbox-light-soft"),
49
+ horizon: () => import("@shikijs/themes/horizon"),
50
+ "horizon-bright": () => import("@shikijs/themes/horizon-bright"),
51
+ houston: () => import("@shikijs/themes/houston"),
52
+ "kanagawa-dragon": () => import("@shikijs/themes/kanagawa-dragon"),
53
+ "kanagawa-lotus": () => import("@shikijs/themes/kanagawa-lotus"),
54
+ "kanagawa-wave": () => import("@shikijs/themes/kanagawa-wave"),
55
+ laserwave: () => import("@shikijs/themes/laserwave"),
56
+ "light-plus": () => import("@shikijs/themes/light-plus"),
57
+ "material-theme": () => import("@shikijs/themes/material-theme"),
58
+ "material-theme-darker": () => import("@shikijs/themes/material-theme-darker"),
59
+ "material-theme-lighter": () => import("@shikijs/themes/material-theme-lighter"),
60
+ "material-theme-ocean": () => import("@shikijs/themes/material-theme-ocean"),
61
+ "material-theme-palenight": () => import("@shikijs/themes/material-theme-palenight"),
62
+ "min-dark": () => import("@shikijs/themes/min-dark"),
63
+ "min-light": () => import("@shikijs/themes/min-light"),
64
+ monokai: () => import("@shikijs/themes/monokai"),
65
+ "night-owl": () => import("@shikijs/themes/night-owl"),
66
+ "night-owl-light": () => import("@shikijs/themes/night-owl-light"),
67
+ nord: () => import("@shikijs/themes/nord"),
68
+ "one-dark-pro": () => import("@shikijs/themes/one-dark-pro"),
69
+ "one-light": () => import("@shikijs/themes/one-light"),
70
+ plastic: () => import("@shikijs/themes/plastic"),
71
+ poimandres: () => import("@shikijs/themes/poimandres"),
72
+ red: () => import("@shikijs/themes/red"),
73
+ "rose-pine": () => import("@shikijs/themes/rose-pine"),
74
+ "rose-pine-dawn": () => import("@shikijs/themes/rose-pine-dawn"),
75
+ "rose-pine-moon": () => import("@shikijs/themes/rose-pine-moon"),
76
+ "slack-dark": () => import("@shikijs/themes/slack-dark"),
77
+ "slack-ochin": () => import("@shikijs/themes/slack-ochin"),
78
+ "snazzy-light": () => import("@shikijs/themes/snazzy-light"),
79
+ "solarized-dark": () => import("@shikijs/themes/solarized-dark"),
80
+ "solarized-light": () => import("@shikijs/themes/solarized-light"),
81
+ "synthwave-84": () => import("@shikijs/themes/synthwave-84"),
82
+ "tokyo-night": () => import("@shikijs/themes/tokyo-night"),
83
+ vesper: () => import("@shikijs/themes/vesper"),
84
+ "vitesse-black": () => import("@shikijs/themes/vitesse-black"),
85
+ "vitesse-dark": () => import("@shikijs/themes/vitesse-dark"),
86
+ "vitesse-light": () => import("@shikijs/themes/vitesse-light"),
87
+ };
88
+ //# sourceMappingURL=themes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"themes.js","sourceRoot":"","sources":["../../src/highlight/themes.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,MAAM,UAAU,GAA0C;IAC/D,UAAU,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,4BAA4B,CAAC;IACtD,UAAU,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,0BAA0B,CAAC;IACpD,UAAU,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,0BAA0B,CAAC;IACpD,WAAW,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,2BAA2B,CAAC;IACtD,YAAY,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,4BAA4B,CAAC;IACxD,mBAAmB,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,mCAAmC,CAAC;IACtE,kBAAkB,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,kCAAkC,CAAC;IACpE,sBAAsB,EAAE,GAAG,EAAE,CAAC,M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}
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  },
9
9
  "homepage": "https://github.com/KensioSoftware/colophon#readme",
10
10
  "license": "Apache-2.0",
11
- "version": "2.7.0",
11
+ "version": "2.8.0",
12
12
  "type": "module",
13
13
  "main": "./dist/index.js",
14
14
  "types": "./dist/index.d.ts",
@@ -98,6 +98,7 @@
98
98
  },
99
99
  "dependencies": {
100
100
  "@resvg/resvg-js": "^2.6.2",
101
+ "@shikijs/themes": "^4.3.1",
101
102
  "fontkit": "^2.0.4",
102
103
  "gray-matter": "^4.0.3",
103
104
  "sharp": "^0.35.3",