@coldsmirk/inkstone-core 0.11.0 → 0.13.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/README.md CHANGED
@@ -9,6 +9,7 @@ Part of [inkstone](https://github.com/coldsmirk/inkstone). The editor layers ([`
9
9
  - **`getHighlighter()`** — the process-wide `HighlighterCore` promise. JavaScript / TypeScript / JSON / SQL grammars and the catppuccin theme pair load by default.
10
10
  - **`configureHighlighter(config)`** — extend or replace the default grammar / theme set, once, before any editor mounts. `DEFAULT_HIGHLIGHTER_LANGS` is exported so extension is additive.
11
11
  - **`shikiThemeId(dark)`** plus the `INKSTONE_LIGHT_THEME` / `INKSTONE_DARK_THEME` constants — the theme names to pass wherever a Shiki theme id is expected.
12
+ - **`CODE_FONT_FAMILY`** — the shared code font stack both editor engines render with: the page's `--inkstone-font-family-code` CSS token when defined, else the platform's native monospace.
12
13
 
13
14
  ## Install
14
15
 
package/dist/index.d.ts CHANGED
@@ -1,5 +1,14 @@
1
1
  import { HighlighterCore, HighlighterCore as HighlighterCore$1, LanguageInput, ThemeInput } from "shiki/core";
2
2
 
3
+ //#region src/code-font.d.ts
4
+ /**
5
+ * The code font stack every inkstone editor host renders with: the page's
6
+ * `--inkstone-font-family-code` token when defined, else the platform's native monospace.
7
+ * Monaco reads it as a construction-option default, CodeMirror through the chrome theme —
8
+ * one token, one look across both editors.
9
+ */
10
+ declare const CODE_FONT_FAMILY = "var(--inkstone-font-family-code, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace)";
11
+ //#endregion
3
12
  //#region src/shiki.d.ts
4
13
  /**
5
14
  * Shiki theme id inkstone editors use in light mode.
@@ -52,4 +61,4 @@ declare function getHighlighter(): Promise<HighlighterCore$1>;
52
61
  */
53
62
  declare function shikiThemeId(dark: boolean): string;
54
63
  //#endregion
55
- export { DEFAULT_HIGHLIGHTER_LANGS, type HighlighterConfig, type HighlighterCore, INKSTONE_DARK_THEME, INKSTONE_LIGHT_THEME, configureHighlighter, getHighlighter, shikiThemeId };
64
+ export { CODE_FONT_FAMILY, DEFAULT_HIGHLIGHTER_LANGS, type HighlighterConfig, type HighlighterCore, INKSTONE_DARK_THEME, INKSTONE_LIGHT_THEME, configureHighlighter, getHighlighter, shikiThemeId };
package/dist/index.js CHANGED
@@ -6,6 +6,9 @@ import catppuccinLatte from "@shikijs/themes/catppuccin-latte";
6
6
  import catppuccinMacchiato from "@shikijs/themes/catppuccin-macchiato";
7
7
  import { createHighlighterCore } from "shiki/core";
8
8
  import { createJavaScriptRegexEngine } from "shiki/engine/javascript";
9
+ //#region src/code-font.ts
10
+ const CODE_FONT_FAMILY = "var(--inkstone-font-family-code, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace)";
11
+ //#endregion
9
12
  //#region src/shiki.ts
10
13
  const INKSTONE_LIGHT_THEME = "catppuccin-latte";
11
14
  const INKSTONE_DARK_THEME = "catppuccin-macchiato";
@@ -59,4 +62,4 @@ function shikiThemeId(dark) {
59
62
  return dark ? INKSTONE_DARK_THEME : INKSTONE_LIGHT_THEME;
60
63
  }
61
64
  //#endregion
62
- export { DEFAULT_HIGHLIGHTER_LANGS, INKSTONE_DARK_THEME, INKSTONE_LIGHT_THEME, configureHighlighter, getHighlighter, shikiThemeId };
65
+ export { CODE_FONT_FAMILY, DEFAULT_HIGHLIGHTER_LANGS, INKSTONE_DARK_THEME, INKSTONE_LIGHT_THEME, configureHighlighter, getHighlighter, shikiThemeId };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coldsmirk/inkstone-core",
3
- "version": "0.11.0",
3
+ "version": "0.13.0",
4
4
  "description": "Shared Shiki highlighter service for the inkstone editor toolkit: one fine-grained singleton (catppuccin themes, JS regex engine) reused by Monaco, static rendering, and markdown surfaces.",
5
5
  "keywords": [
6
6
  "shiki",