@tin.so/core 0.3.0 → 0.5.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
@@ -1,6 +1,6 @@
1
1
  # @tin.so/core
2
2
 
3
- Renders code images from a JSON spec, to SVG and PNG. One image can show several snippets: windows next to each other or below each other, panes in a window, and popovers that point to a word. It has 14 editor themes such as GitHub, Dracula, Nord and Catppuccin, a default background for each theme and mode, backgrounds as CSS gradients, line highlights, text styles and colors, tabs with file icons, and fixed aspect ratios for social media.
3
+ Renders code images from a JSON spec, to SVG and PNG. One image can show several snippets: windows next to each other or below each other, panes in a window, and popovers that point to a word. It has 14 editor themes such as GitHub, Dracula, Nord and Catppuccin, backgrounds as CSS gradients, line highlights, text styles and colors, tabs with file icons, and fixed aspect ratios for social media.
4
4
 
5
5
  The pipeline is `spec → Shiki tokens → layout → SVG → PNG` and needs no browser. The layout puts every character on a monospace grid with the metrics of the bundled fonts, and [resvg](https://github.com/linebender/resvg) (WebAssembly) rasterizes the SVG. The same code runs in Node and in the browser.
6
6
 
@@ -84,6 +84,15 @@ type Token = {
84
84
  type HighlightedLine = Array<Token>;
85
85
  declare const PLAIN_TEXT = "text";
86
86
  declare const LANGUAGE_IDS: string[];
87
+ /** A language with its display name and its other names, such as "bash" for the shell */
88
+ type LanguageInfo = {
89
+ id: string;
90
+ name: string;
91
+ aliases: Array<string>;
92
+ };
93
+ declare const LANGUAGES: Array<LanguageInfo>;
94
+ /** The display name of a language, such as "TypeScript" for "typescript" */
95
+ declare function languageName(language: string): string;
87
96
  /**
88
97
  * Whether the language is a language id, an alias or a file extension that this package knows.
89
98
  * The check ignores the case, as the resolution of the language does.
@@ -1236,4 +1245,4 @@ type SvgOptions = {
1236
1245
  };
1237
1246
  /** Writes the scene as a standalone SVG document */
1238
1247
  declare function toSvg(scene: Scene, options?: SvgOptions): string;
1239
- export { WindowBox as $, resolveMode as $t, addPngMetadata as A, AMBIENT_ENABLED as At, isSpecSchemaUrl as B, isKnownLanguage as Bt, schemaVersion as C, getFace as Ct, PNG_KEYWORDS as D, BackgroundPreset as Dt, METADATA_BY_DEFAULT as E, BACKGROUNDS as Et, createLink as F, LANGUAGE_IDS as Ft, LayoutOptions as G, Mode as Gt, isCssBackground as H, DEFAULT_THEME as Ht, decodeSpec as I, PLAIN_TEXT as It, Rect as J, THEME_IDS as Jt, POPOVER as K, Syntax as Kt, encodeSpec as L, Token as Lt, readImageSpec as M, ambientPreviewCss as Mt, DEFAULT_APP_URL as N, isAmbientBackground as Nt, SOFTWARE as O, themeBackground as Ot, DecodeOptions as P, HighlightedLine as Pt, WINDOW_RADIUS as Q, getTheme as Qt, readLink as R, highlight as Rt, IMPLICIT_SPEC_VERSION as S, getCodeFont as St, ImageMetadata as T, measureUiText as Tt, FONT_SIZE as U, EditorWindow as Ut, specJsonSchema as V, resolveLanguage as Vt, LINE_HEIGHT as W, FrameColors as Wt, TAB_HEADER as X, getFrameColors as Xt, Scene as Y, Theme as Yt, TextMetrics as Z, getSyntax as Zt, initPng as _, FontLoader as _t, MARK_STYLES as a, FILE_ICON as at, svgToPng as b, UiFont as bt, SPEC_LIMITS as c, NO_ICON as ct, SpecInput as d, CODE_FONTS as dt, cellCount as et, SpecSchema as f, CODE_FONT_IDS as ft, PngOptions as g, FontFace as gt, parseSpec as h, Font as ht, LATEST_SPEC_VERSION as i, AUTO_ICON as it, createImageMetadata as j, AmbientBackground as jt, SVG_NAMESPACE as k, AMBIENT_BACKGROUNDS as kt, Spec as l, getIcon as lt, expandLineRanges as m, DEFAULT_CODE_FONT as mt, toSvg as n, normalizeCode as nt, MarkStyle as o, ICON_IDS as ot, WindowSpec as p, CodeFont as pt, PaneBox as q, THEMES as qt, ANNOTATION_TYPES as r, MAC_HEADER as rt, PaneSpec as s, Icon as st, SvgOptions as t, layout as tt, SpecError as u, resolveIcon as ut, loadSceneFonts as v, FontMetrics as vt, stampSpecVersion as w, measureCodeText as wt, EXTENSION_PREFIX as x, cssFontFamily as xt, sceneFontFiles as y, UI_FONT as yt, SPEC_SCHEMA_URL as z, inferLanguage as zt };
1248
+ export { WindowBox as $, getFrameColors as $t, addPngMetadata as A, AMBIENT_ENABLED as At, isSpecSchemaUrl as B, highlight as Bt, schemaVersion as C, getFace as Ct, PNG_KEYWORDS as D, BackgroundPreset as Dt, METADATA_BY_DEFAULT as E, BACKGROUNDS as Et, createLink as F, LANGUAGES as Ft, LayoutOptions as G, DEFAULT_THEME as Gt, isCssBackground as H, isKnownLanguage as Ht, decodeSpec as I, LANGUAGE_IDS as It, Rect as J, Mode as Jt, POPOVER as K, EditorWindow as Kt, encodeSpec as L, LanguageInfo as Lt, readImageSpec as M, ambientPreviewCss as Mt, DEFAULT_APP_URL as N, isAmbientBackground as Nt, SOFTWARE as O, themeBackground as Ot, DecodeOptions as P, HighlightedLine as Pt, WINDOW_RADIUS as Q, Theme as Qt, readLink as R, PLAIN_TEXT as Rt, IMPLICIT_SPEC_VERSION as S, getCodeFont as St, ImageMetadata as T, measureUiText as Tt, FONT_SIZE as U, languageName as Ut, specJsonSchema as V, inferLanguage as Vt, LINE_HEIGHT as W, resolveLanguage as Wt, TAB_HEADER as X, THEMES as Xt, Scene as Y, Syntax as Yt, TextMetrics as Z, THEME_IDS as Zt, initPng as _, FontLoader as _t, MARK_STYLES as a, FILE_ICON as at, svgToPng as b, UiFont as bt, SPEC_LIMITS as c, NO_ICON as ct, SpecInput as d, CODE_FONTS as dt, getSyntax as en, cellCount as et, SpecSchema as f, CODE_FONT_IDS as ft, PngOptions as g, FontFace as gt, parseSpec as h, Font as ht, LATEST_SPEC_VERSION as i, AUTO_ICON as it, createImageMetadata as j, AmbientBackground as jt, SVG_NAMESPACE as k, AMBIENT_BACKGROUNDS as kt, Spec as l, getIcon as lt, expandLineRanges as m, DEFAULT_CODE_FONT as mt, toSvg as n, resolveMode as nn, normalizeCode as nt, MarkStyle as o, ICON_IDS as ot, WindowSpec as p, CodeFont as pt, PaneBox as q, FrameColors as qt, ANNOTATION_TYPES as r, MAC_HEADER as rt, PaneSpec as s, Icon as st, SvgOptions as t, getTheme as tn, layout as tt, SpecError as u, resolveIcon as ut, loadSceneFonts as v, FontMetrics as vt, stampSpecVersion as w, measureCodeText as wt, EXTENSION_PREFIX as x, cssFontFamily as xt, sceneFontFiles as y, UI_FONT as yt, SPEC_SCHEMA_URL as z, Token as zt };
package/dist/index.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { $ as WindowBox, $t as resolveMode, A as addPngMetadata, At as AMBIENT_ENABLED, B as isSpecSchemaUrl, Bt as isKnownLanguage, C as schemaVersion, Ct as getFace, D as PNG_KEYWORDS, Dt as BackgroundPreset, E as METADATA_BY_DEFAULT, Et as BACKGROUNDS, F as createLink, Ft as LANGUAGE_IDS, G as LayoutOptions, Gt as Mode, H as isCssBackground, Ht as DEFAULT_THEME, I as decodeSpec, It as PLAIN_TEXT, J as Rect, Jt as THEME_IDS, K as POPOVER, Kt as Syntax, L as encodeSpec, Lt as Token, M as readImageSpec, Mt as ambientPreviewCss, N as DEFAULT_APP_URL, Nt as isAmbientBackground, O as SOFTWARE, Ot as themeBackground, P as DecodeOptions, Pt as HighlightedLine, Q as WINDOW_RADIUS, Qt as getTheme, R as readLink, Rt as highlight, S as IMPLICIT_SPEC_VERSION, St as getCodeFont, T as ImageMetadata, Tt as measureUiText, U as FONT_SIZE, Ut as EditorWindow, V as specJsonSchema, Vt as resolveLanguage, W as LINE_HEIGHT, Wt as FrameColors, X as TAB_HEADER, Xt as getFrameColors, Y as Scene, Yt as Theme, Z as TextMetrics, Zt as getSyntax, _ as initPng, _t as FontLoader, a as MARK_STYLES, at as FILE_ICON, b as svgToPng, bt as UiFont, c as SPEC_LIMITS, ct as NO_ICON, d as SpecInput, dt as CODE_FONTS, et as cellCount, f as SpecSchema, ft as CODE_FONT_IDS, g as PngOptions, gt as FontFace, h as parseSpec, ht as Font, i as LATEST_SPEC_VERSION, it as AUTO_ICON, j as createImageMetadata, jt as AmbientBackground, k as SVG_NAMESPACE, kt as AMBIENT_BACKGROUNDS, l as Spec, lt as getIcon, m as expandLineRanges, mt as DEFAULT_CODE_FONT, n as toSvg, nt as normalizeCode, o as MarkStyle, ot as ICON_IDS, p as WindowSpec, pt as CodeFont, q as PaneBox, qt as THEMES, r as ANNOTATION_TYPES, rt as MAC_HEADER, s as PaneSpec, st as Icon, t as SvgOptions, tt as layout, u as SpecError, ut as resolveIcon, v as loadSceneFonts, vt as FontMetrics, w as stampSpecVersion, wt as measureCodeText, x as EXTENSION_PREFIX, xt as cssFontFamily, y as sceneFontFiles, yt as UI_FONT, z as SPEC_SCHEMA_URL, zt as inferLanguage } from "./index-eoLihZJ2.mjs";
2
- export { AMBIENT_BACKGROUNDS, AMBIENT_ENABLED, ANNOTATION_TYPES, AUTO_ICON, type AmbientBackground, BACKGROUNDS, type BackgroundPreset, CODE_FONTS, CODE_FONT_IDS, CodeFont, DEFAULT_APP_URL, DEFAULT_CODE_FONT, DEFAULT_THEME, type DecodeOptions, EXTENSION_PREFIX, EditorWindow, FILE_ICON, FONT_SIZE, Font, FontFace, FontLoader, FontMetrics, FrameColors, type HighlightedLine, ICON_IDS, IMPLICIT_SPEC_VERSION, type Icon, type ImageMetadata, LANGUAGE_IDS, LATEST_SPEC_VERSION, LINE_HEIGHT, type LayoutOptions, MAC_HEADER, MARK_STYLES, METADATA_BY_DEFAULT, type MarkStyle, Mode, NO_ICON, PLAIN_TEXT, PNG_KEYWORDS, POPOVER, type PaneBox, type PaneSpec, type PngOptions, type Rect, SOFTWARE, SPEC_LIMITS, SPEC_SCHEMA_URL, SVG_NAMESPACE, type Scene, type Spec, SpecError, type SpecInput, SpecSchema, type SvgOptions, Syntax, TAB_HEADER, THEMES, THEME_IDS, type TextMetrics, Theme, type Token, UI_FONT, UiFont, WINDOW_RADIUS, type WindowBox, type WindowSpec, addPngMetadata, ambientPreviewCss, cellCount, createImageMetadata, createLink, cssFontFamily, decodeSpec, encodeSpec, expandLineRanges, getCodeFont, getFace, getFrameColors, getIcon, getSyntax, getTheme, highlight, inferLanguage, initPng, isAmbientBackground, isCssBackground, isKnownLanguage, isSpecSchemaUrl, layout, loadSceneFonts, measureCodeText, measureUiText, normalizeCode, parseSpec, readImageSpec, readLink, resolveIcon, resolveLanguage, resolveMode, sceneFontFiles, schemaVersion, specJsonSchema, stampSpecVersion, svgToPng, themeBackground, toSvg };
1
+ import { $ as WindowBox, $t as getFrameColors, A as addPngMetadata, At as AMBIENT_ENABLED, B as isSpecSchemaUrl, Bt as highlight, C as schemaVersion, Ct as getFace, D as PNG_KEYWORDS, Dt as BackgroundPreset, E as METADATA_BY_DEFAULT, Et as BACKGROUNDS, F as createLink, Ft as LANGUAGES, G as LayoutOptions, Gt as DEFAULT_THEME, H as isCssBackground, Ht as isKnownLanguage, I as decodeSpec, It as LANGUAGE_IDS, J as Rect, Jt as Mode, K as POPOVER, Kt as EditorWindow, L as encodeSpec, Lt as LanguageInfo, M as readImageSpec, Mt as ambientPreviewCss, N as DEFAULT_APP_URL, Nt as isAmbientBackground, O as SOFTWARE, Ot as themeBackground, P as DecodeOptions, Pt as HighlightedLine, Q as WINDOW_RADIUS, Qt as Theme, R as readLink, Rt as PLAIN_TEXT, S as IMPLICIT_SPEC_VERSION, St as getCodeFont, T as ImageMetadata, Tt as measureUiText, U as FONT_SIZE, Ut as languageName, V as specJsonSchema, Vt as inferLanguage, W as LINE_HEIGHT, Wt as resolveLanguage, X as TAB_HEADER, Xt as THEMES, Y as Scene, Yt as Syntax, Z as TextMetrics, Zt as THEME_IDS, _ as initPng, _t as FontLoader, a as MARK_STYLES, at as FILE_ICON, b as svgToPng, bt as UiFont, c as SPEC_LIMITS, ct as NO_ICON, d as SpecInput, dt as CODE_FONTS, en as getSyntax, et as cellCount, f as SpecSchema, ft as CODE_FONT_IDS, g as PngOptions, gt as FontFace, h as parseSpec, ht as Font, i as LATEST_SPEC_VERSION, it as AUTO_ICON, j as createImageMetadata, jt as AmbientBackground, k as SVG_NAMESPACE, kt as AMBIENT_BACKGROUNDS, l as Spec, lt as getIcon, m as expandLineRanges, mt as DEFAULT_CODE_FONT, n as toSvg, nn as resolveMode, nt as normalizeCode, o as MarkStyle, ot as ICON_IDS, p as WindowSpec, pt as CodeFont, q as PaneBox, qt as FrameColors, r as ANNOTATION_TYPES, rt as MAC_HEADER, s as PaneSpec, st as Icon, t as SvgOptions, tn as getTheme, tt as layout, u as SpecError, ut as resolveIcon, v as loadSceneFonts, vt as FontMetrics, w as stampSpecVersion, wt as measureCodeText, x as EXTENSION_PREFIX, xt as cssFontFamily, y as sceneFontFiles, yt as UI_FONT, z as SPEC_SCHEMA_URL, zt as Token } from "./index-Bjaw7_tu.mjs";
2
+ export { AMBIENT_BACKGROUNDS, AMBIENT_ENABLED, ANNOTATION_TYPES, AUTO_ICON, type AmbientBackground, BACKGROUNDS, type BackgroundPreset, CODE_FONTS, CODE_FONT_IDS, CodeFont, DEFAULT_APP_URL, DEFAULT_CODE_FONT, DEFAULT_THEME, type DecodeOptions, EXTENSION_PREFIX, EditorWindow, FILE_ICON, FONT_SIZE, Font, FontFace, FontLoader, FontMetrics, FrameColors, type HighlightedLine, ICON_IDS, IMPLICIT_SPEC_VERSION, type Icon, type ImageMetadata, LANGUAGES, LANGUAGE_IDS, LATEST_SPEC_VERSION, LINE_HEIGHT, type LanguageInfo, type LayoutOptions, MAC_HEADER, MARK_STYLES, METADATA_BY_DEFAULT, type MarkStyle, Mode, NO_ICON, PLAIN_TEXT, PNG_KEYWORDS, POPOVER, type PaneBox, type PaneSpec, type PngOptions, type Rect, SOFTWARE, SPEC_LIMITS, SPEC_SCHEMA_URL, SVG_NAMESPACE, type Scene, type Spec, SpecError, type SpecInput, SpecSchema, type SvgOptions, Syntax, TAB_HEADER, THEMES, THEME_IDS, type TextMetrics, Theme, type Token, UI_FONT, UiFont, WINDOW_RADIUS, type WindowBox, type WindowSpec, addPngMetadata, ambientPreviewCss, cellCount, createImageMetadata, createLink, cssFontFamily, decodeSpec, encodeSpec, expandLineRanges, getCodeFont, getFace, getFrameColors, getIcon, getSyntax, getTheme, highlight, inferLanguage, initPng, isAmbientBackground, isCssBackground, isKnownLanguage, isSpecSchemaUrl, languageName, layout, loadSceneFonts, measureCodeText, measureUiText, normalizeCode, parseSpec, readImageSpec, readLink, resolveIcon, resolveLanguage, resolveMode, sceneFontFiles, schemaVersion, specJsonSchema, stampSpecVersion, svgToPng, themeBackground, toSvg };
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- export { rt as AMBIENT_BACKGROUNDS, it as AMBIENT_ENABLED, T as ANNOTATION_TYPES, J as AUTO_ICON, tt as BACKGROUNDS, mt as CODE_FONTS, ht as CODE_FONT_IDS, z as DEFAULT_APP_URL, gt as DEFAULT_CODE_FONT, st as DEFAULT_THEME, W as EXTENSION_PREFIX, Y as FILE_ICON, p as FONT_SIZE, X as ICON_IDS, G as IMPLICIT_SPEC_VERSION, N as LANGUAGE_IDS, E as LATEST_SPEC_VERSION, m as LINE_HEIGHT, x as MAC_HEADER, D as MARK_STYLES, o as METADATA_BY_DEFAULT, Z as NO_ICON, P as PLAIN_TEXT, s as PNG_KEYWORDS, h as POPOVER, c as SOFTWARE, O as SPEC_LIMITS, S as SPEC_SCHEMA_URL, l as SVG_NAMESPACE, k as SpecError, A as SpecSchema, g as TAB_HEADER, ct as THEMES, lt as THEME_IDS, _t as UI_FONT, _ as WINDOW_RADIUS, u as addPngMetadata, at as ambientPreviewCss, v as cellCount, d as createImageMetadata, B as createLink, vt as cssFontFamily, V as decodeSpec, H as encodeSpec, j as expandLineRanges, yt as getCodeFont, bt as getFace, ut as getFrameColors, Q as getIcon, dt as getSyntax, ft as getTheme, F as highlight, I as inferLanguage, n as initPng, ot as isAmbientBackground, et as isCssBackground, L as isKnownLanguage, C as isSpecSchemaUrl, y as layout, r as loadSceneFonts, xt as measureCodeText, St as measureUiText, b as normalizeCode, M as parseSpec, f as readImageSpec, U as readLink, $ as resolveIcon, R as resolveLanguage, pt as resolveMode, i as sceneFontFiles, K as schemaVersion, w as specJsonSchema, q as stampSpecVersion, a as svgToPng, nt as themeBackground, t as toSvg } from "./src-Bn8Hly8W.mjs";
1
+ export { it as AMBIENT_BACKGROUNDS, at as AMBIENT_ENABLED, T as ANNOTATION_TYPES, X as AUTO_ICON, nt as BACKGROUNDS, gt as CODE_FONTS, _t as CODE_FONT_IDS, V as DEFAULT_APP_URL, vt as DEFAULT_CODE_FONT, ct as DEFAULT_THEME, K as EXTENSION_PREFIX, Z as FILE_ICON, p as FONT_SIZE, Q as ICON_IDS, q as IMPLICIT_SPEC_VERSION, N as LANGUAGES, P as LANGUAGE_IDS, E as LATEST_SPEC_VERSION, m as LINE_HEIGHT, x as MAC_HEADER, D as MARK_STYLES, o as METADATA_BY_DEFAULT, $ as NO_ICON, F as PLAIN_TEXT, s as PNG_KEYWORDS, h as POPOVER, c as SOFTWARE, O as SPEC_LIMITS, S as SPEC_SCHEMA_URL, l as SVG_NAMESPACE, k as SpecError, A as SpecSchema, g as TAB_HEADER, lt as THEMES, ut as THEME_IDS, yt as UI_FONT, _ as WINDOW_RADIUS, u as addPngMetadata, ot as ambientPreviewCss, v as cellCount, d as createImageMetadata, H as createLink, bt as cssFontFamily, U as decodeSpec, W as encodeSpec, j as expandLineRanges, xt as getCodeFont, St as getFace, dt as getFrameColors, et as getIcon, ft as getSyntax, pt as getTheme, I as highlight, L as inferLanguage, n as initPng, st as isAmbientBackground, ht as isCssBackground, R as isKnownLanguage, C as isSpecSchemaUrl, z as languageName, y as layout, r as loadSceneFonts, Ct as measureCodeText, wt as measureUiText, b as normalizeCode, M as parseSpec, f as readImageSpec, G as readLink, tt as resolveIcon, B as resolveLanguage, mt as resolveMode, i as sceneFontFiles, J as schemaVersion, w as specJsonSchema, Y as stampSpecVersion, a as svgToPng, rt as themeBackground, t as toSvg } from "./src-B_SjzWhY.mjs";
package/dist/node.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as WindowBox, $t as resolveMode, A as addPngMetadata, At as AMBIENT_ENABLED, B as isSpecSchemaUrl, Bt as isKnownLanguage, C as schemaVersion, Ct as getFace, D as PNG_KEYWORDS, Dt as BackgroundPreset, E as METADATA_BY_DEFAULT, Et as BACKGROUNDS, F as createLink, Ft as LANGUAGE_IDS, G as LayoutOptions, Gt as Mode, H as isCssBackground, Ht as DEFAULT_THEME, I as decodeSpec, It as PLAIN_TEXT, J as Rect, Jt as THEME_IDS, K as POPOVER, Kt as Syntax, L as encodeSpec, Lt as Token, M as readImageSpec, Mt as ambientPreviewCss, N as DEFAULT_APP_URL, Nt as isAmbientBackground, O as SOFTWARE, Ot as themeBackground, P as DecodeOptions, Pt as HighlightedLine, Q as WINDOW_RADIUS, Qt as getTheme, R as readLink, Rt as highlight, S as IMPLICIT_SPEC_VERSION, St as getCodeFont, T as ImageMetadata, Tt as measureUiText, U as FONT_SIZE, Ut as EditorWindow, V as specJsonSchema, Vt as resolveLanguage, W as LINE_HEIGHT, Wt as FrameColors, X as TAB_HEADER, Xt as getFrameColors, Y as Scene, Yt as Theme, Z as TextMetrics, Zt as getSyntax, _ as initPng, _t as FontLoader, a as MARK_STYLES, at as FILE_ICON, b as svgToPng, bt as UiFont, c as SPEC_LIMITS, ct as NO_ICON, d as SpecInput, dt as CODE_FONTS, et as cellCount, f as SpecSchema, ft as CODE_FONT_IDS, g as PngOptions, gt as FontFace, h as parseSpec, ht as Font, i as LATEST_SPEC_VERSION, it as AUTO_ICON, j as createImageMetadata, jt as AmbientBackground, k as SVG_NAMESPACE, kt as AMBIENT_BACKGROUNDS, l as Spec, lt as getIcon, m as expandLineRanges, mt as DEFAULT_CODE_FONT, n as toSvg, nt as normalizeCode, o as MarkStyle, ot as ICON_IDS, p as WindowSpec, pt as CodeFont, q as PaneBox, qt as THEMES, r as ANNOTATION_TYPES, rt as MAC_HEADER, s as PaneSpec, st as Icon, t as SvgOptions, tt as layout, u as SpecError, ut as resolveIcon, v as loadSceneFonts, vt as FontMetrics, w as stampSpecVersion, wt as measureCodeText, x as EXTENSION_PREFIX, xt as cssFontFamily, y as sceneFontFiles, yt as UI_FONT, z as SPEC_SCHEMA_URL, zt as inferLanguage } from "./index-eoLihZJ2.mjs";
1
+ import { $ as WindowBox, $t as getFrameColors, A as addPngMetadata, At as AMBIENT_ENABLED, B as isSpecSchemaUrl, Bt as highlight, C as schemaVersion, Ct as getFace, D as PNG_KEYWORDS, Dt as BackgroundPreset, E as METADATA_BY_DEFAULT, Et as BACKGROUNDS, F as createLink, Ft as LANGUAGES, G as LayoutOptions, Gt as DEFAULT_THEME, H as isCssBackground, Ht as isKnownLanguage, I as decodeSpec, It as LANGUAGE_IDS, J as Rect, Jt as Mode, K as POPOVER, Kt as EditorWindow, L as encodeSpec, Lt as LanguageInfo, M as readImageSpec, Mt as ambientPreviewCss, N as DEFAULT_APP_URL, Nt as isAmbientBackground, O as SOFTWARE, Ot as themeBackground, P as DecodeOptions, Pt as HighlightedLine, Q as WINDOW_RADIUS, Qt as Theme, R as readLink, Rt as PLAIN_TEXT, S as IMPLICIT_SPEC_VERSION, St as getCodeFont, T as ImageMetadata, Tt as measureUiText, U as FONT_SIZE, Ut as languageName, V as specJsonSchema, Vt as inferLanguage, W as LINE_HEIGHT, Wt as resolveLanguage, X as TAB_HEADER, Xt as THEMES, Y as Scene, Yt as Syntax, Z as TextMetrics, Zt as THEME_IDS, _ as initPng, _t as FontLoader, a as MARK_STYLES, at as FILE_ICON, b as svgToPng, bt as UiFont, c as SPEC_LIMITS, ct as NO_ICON, d as SpecInput, dt as CODE_FONTS, en as getSyntax, et as cellCount, f as SpecSchema, ft as CODE_FONT_IDS, g as PngOptions, gt as FontFace, h as parseSpec, ht as Font, i as LATEST_SPEC_VERSION, it as AUTO_ICON, j as createImageMetadata, jt as AmbientBackground, k as SVG_NAMESPACE, kt as AMBIENT_BACKGROUNDS, l as Spec, lt as getIcon, m as expandLineRanges, mt as DEFAULT_CODE_FONT, n as toSvg, nn as resolveMode, nt as normalizeCode, o as MarkStyle, ot as ICON_IDS, p as WindowSpec, pt as CodeFont, q as PaneBox, qt as FrameColors, r as ANNOTATION_TYPES, rt as MAC_HEADER, s as PaneSpec, st as Icon, t as SvgOptions, tn as getTheme, tt as layout, u as SpecError, ut as resolveIcon, v as loadSceneFonts, vt as FontMetrics, w as stampSpecVersion, wt as measureCodeText, x as EXTENSION_PREFIX, xt as cssFontFamily, y as sceneFontFiles, yt as UI_FONT, z as SPEC_SCHEMA_URL, zt as Token } from "./index-Bjaw7_tu.mjs";
2
2
  export type RenderFormat = "png" | "svg";
3
3
  export type RenderOptions = {
4
4
  format?: RenderFormat;
@@ -18,4 +18,4 @@ export declare const loadFont: FontLoader;
18
18
  export declare function render(spec: unknown, options?: RenderOptions): Promise<Uint8Array>;
19
19
  /** Renders the scene of a layout, so that a caller that needs the scene lays out only once */
20
20
  export declare function renderScene(scene: Scene, options?: RenderSceneOptions): Promise<Uint8Array>;
21
- export { AMBIENT_BACKGROUNDS, AMBIENT_ENABLED, ANNOTATION_TYPES, AUTO_ICON, type AmbientBackground, BACKGROUNDS, type BackgroundPreset, CODE_FONTS, CODE_FONT_IDS, CodeFont, DEFAULT_APP_URL, DEFAULT_CODE_FONT, DEFAULT_THEME, type DecodeOptions, EXTENSION_PREFIX, EditorWindow, FILE_ICON, FONT_SIZE, Font, FontFace, FontLoader, FontMetrics, FrameColors, type HighlightedLine, ICON_IDS, IMPLICIT_SPEC_VERSION, type Icon, type ImageMetadata, LANGUAGE_IDS, LATEST_SPEC_VERSION, LINE_HEIGHT, type LayoutOptions, MAC_HEADER, MARK_STYLES, METADATA_BY_DEFAULT, type MarkStyle, Mode, NO_ICON, PLAIN_TEXT, PNG_KEYWORDS, POPOVER, type PaneBox, type PaneSpec, type PngOptions, type Rect, SOFTWARE, SPEC_LIMITS, SPEC_SCHEMA_URL, SVG_NAMESPACE, type Scene, type Spec, SpecError, type SpecInput, SpecSchema, type SvgOptions, Syntax, TAB_HEADER, THEMES, THEME_IDS, type TextMetrics, Theme, type Token, UI_FONT, UiFont, WINDOW_RADIUS, type WindowBox, type WindowSpec, addPngMetadata, ambientPreviewCss, cellCount, createImageMetadata, createLink, cssFontFamily, decodeSpec, encodeSpec, expandLineRanges, getCodeFont, getFace, getFrameColors, getIcon, getSyntax, getTheme, highlight, inferLanguage, initPng, isAmbientBackground, isCssBackground, isKnownLanguage, isSpecSchemaUrl, layout, loadSceneFonts, measureCodeText, measureUiText, normalizeCode, parseSpec, readImageSpec, readLink, resolveIcon, resolveLanguage, resolveMode, sceneFontFiles, schemaVersion, specJsonSchema, stampSpecVersion, svgToPng, themeBackground, toSvg };
21
+ export { AMBIENT_BACKGROUNDS, AMBIENT_ENABLED, ANNOTATION_TYPES, AUTO_ICON, type AmbientBackground, BACKGROUNDS, type BackgroundPreset, CODE_FONTS, CODE_FONT_IDS, CodeFont, DEFAULT_APP_URL, DEFAULT_CODE_FONT, DEFAULT_THEME, type DecodeOptions, EXTENSION_PREFIX, EditorWindow, FILE_ICON, FONT_SIZE, Font, FontFace, FontLoader, FontMetrics, FrameColors, type HighlightedLine, ICON_IDS, IMPLICIT_SPEC_VERSION, type Icon, type ImageMetadata, LANGUAGES, LANGUAGE_IDS, LATEST_SPEC_VERSION, LINE_HEIGHT, type LanguageInfo, type LayoutOptions, MAC_HEADER, MARK_STYLES, METADATA_BY_DEFAULT, type MarkStyle, Mode, NO_ICON, PLAIN_TEXT, PNG_KEYWORDS, POPOVER, type PaneBox, type PaneSpec, type PngOptions, type Rect, SOFTWARE, SPEC_LIMITS, SPEC_SCHEMA_URL, SVG_NAMESPACE, type Scene, type Spec, SpecError, type SpecInput, SpecSchema, type SvgOptions, Syntax, TAB_HEADER, THEMES, THEME_IDS, type TextMetrics, Theme, type Token, UI_FONT, UiFont, WINDOW_RADIUS, type WindowBox, type WindowSpec, addPngMetadata, ambientPreviewCss, cellCount, createImageMetadata, createLink, cssFontFamily, decodeSpec, encodeSpec, expandLineRanges, getCodeFont, getFace, getFrameColors, getIcon, getSyntax, getTheme, highlight, inferLanguage, initPng, isAmbientBackground, isCssBackground, isKnownLanguage, isSpecSchemaUrl, languageName, layout, loadSceneFonts, measureCodeText, measureUiText, normalizeCode, parseSpec, readImageSpec, readLink, resolveIcon, resolveLanguage, resolveMode, sceneFontFiles, schemaVersion, specJsonSchema, stampSpecVersion, svgToPng, themeBackground, toSvg };
package/dist/node.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as resolveIcon, A as SpecSchema, B as createLink, C as isSpecSchemaUrl, D as MARK_STYLES, E as LATEST_SPEC_VERSION, F as highlight, G as IMPLICIT_SPEC_VERSION, H as encodeSpec, I as inferLanguage, J as AUTO_ICON, K as schemaVersion, L as isKnownLanguage, M as parseSpec, N as LANGUAGE_IDS, O as SPEC_LIMITS, P as PLAIN_TEXT, Q as getIcon, R as resolveLanguage, S as SPEC_SCHEMA_URL, St as measureUiText, T as ANNOTATION_TYPES, U as readLink, V as decodeSpec, W as EXTENSION_PREFIX, X as ICON_IDS, Y as FILE_ICON, Z as NO_ICON, _ as WINDOW_RADIUS, _t as UI_FONT, a as svgToPng, at as ambientPreviewCss, b as normalizeCode, bt as getFace, c as SOFTWARE, ct as THEMES, d as createImageMetadata, dt as getSyntax, et as isCssBackground, f as readImageSpec, ft as getTheme, g as TAB_HEADER, gt as DEFAULT_CODE_FONT, h as POPOVER, ht as CODE_FONT_IDS, i as sceneFontFiles, it as AMBIENT_ENABLED, j as expandLineRanges, k as SpecError, l as SVG_NAMESPACE, lt as THEME_IDS, m as LINE_HEIGHT, mt as CODE_FONTS, n as initPng, nt as themeBackground, o as METADATA_BY_DEFAULT, ot as isAmbientBackground, p as FONT_SIZE, pt as resolveMode, q as stampSpecVersion, r as loadSceneFonts, rt as AMBIENT_BACKGROUNDS, s as PNG_KEYWORDS, st as DEFAULT_THEME, t as toSvg, tt as BACKGROUNDS, u as addPngMetadata, ut as getFrameColors, v as cellCount, vt as cssFontFamily, w as specJsonSchema, x as MAC_HEADER, xt as measureCodeText, y as layout, yt as getCodeFont, z as DEFAULT_APP_URL } from "./src-Bn8Hly8W.mjs";
1
+ import { $ as NO_ICON, A as SpecSchema, B as resolveLanguage, C as isSpecSchemaUrl, Ct as measureCodeText, D as MARK_STYLES, E as LATEST_SPEC_VERSION, F as PLAIN_TEXT, G as readLink, H as createLink, I as highlight, J as schemaVersion, K as EXTENSION_PREFIX, L as inferLanguage, M as parseSpec, N as LANGUAGES, O as SPEC_LIMITS, P as LANGUAGE_IDS, Q as ICON_IDS, R as isKnownLanguage, S as SPEC_SCHEMA_URL, St as getFace, T as ANNOTATION_TYPES, U as decodeSpec, V as DEFAULT_APP_URL, W as encodeSpec, X as AUTO_ICON, Y as stampSpecVersion, Z as FILE_ICON, _ as WINDOW_RADIUS, _t as CODE_FONT_IDS, a as svgToPng, at as AMBIENT_ENABLED, b as normalizeCode, bt as cssFontFamily, c as SOFTWARE, ct as DEFAULT_THEME, d as createImageMetadata, dt as getFrameColors, et as getIcon, f as readImageSpec, ft as getSyntax, g as TAB_HEADER, gt as CODE_FONTS, h as POPOVER, ht as isCssBackground, i as sceneFontFiles, it as AMBIENT_BACKGROUNDS, j as expandLineRanges, k as SpecError, l as SVG_NAMESPACE, lt as THEMES, m as LINE_HEIGHT, mt as resolveMode, n as initPng, nt as BACKGROUNDS, o as METADATA_BY_DEFAULT, ot as ambientPreviewCss, p as FONT_SIZE, pt as getTheme, q as IMPLICIT_SPEC_VERSION, r as loadSceneFonts, rt as themeBackground, s as PNG_KEYWORDS, st as isAmbientBackground, t as toSvg, tt as resolveIcon, u as addPngMetadata, ut as THEME_IDS, v as cellCount, vt as DEFAULT_CODE_FONT, w as specJsonSchema, wt as measureUiText, x as MAC_HEADER, xt as getCodeFont, y as layout, yt as UI_FONT, z as languageName } from "./src-B_SjzWhY.mjs";
2
2
  import { createRequire } from "node:module";
3
3
  import { readFile } from "node:fs/promises";
4
4
  // src/node.ts
@@ -28,4 +28,4 @@ async function renderScene(scene, options = {}) {
28
28
  metadata
29
29
  });
30
30
  }
31
- export { AMBIENT_BACKGROUNDS, AMBIENT_ENABLED, ANNOTATION_TYPES, AUTO_ICON, BACKGROUNDS, CODE_FONTS, CODE_FONT_IDS, DEFAULT_APP_URL, DEFAULT_CODE_FONT, DEFAULT_THEME, EXTENSION_PREFIX, FILE_ICON, FONT_SIZE, ICON_IDS, IMPLICIT_SPEC_VERSION, LANGUAGE_IDS, LATEST_SPEC_VERSION, LINE_HEIGHT, MAC_HEADER, MARK_STYLES, METADATA_BY_DEFAULT, NO_ICON, PLAIN_TEXT, PNG_KEYWORDS, POPOVER, SOFTWARE, SPEC_LIMITS, SPEC_SCHEMA_URL, SVG_NAMESPACE, SpecError, SpecSchema, TAB_HEADER, THEMES, THEME_IDS, UI_FONT, WINDOW_RADIUS, addPngMetadata, ambientPreviewCss, cellCount, createImageMetadata, createLink, cssFontFamily, decodeSpec, encodeSpec, expandLineRanges, getCodeFont, getFace, getFrameColors, getIcon, getSyntax, getTheme, highlight, inferLanguage, initPng, isAmbientBackground, isCssBackground, isKnownLanguage, isSpecSchemaUrl, layout, loadFont, loadSceneFonts, measureCodeText, measureUiText, normalizeCode, parseSpec, readImageSpec, readLink, render, renderScene, resolveIcon, resolveLanguage, resolveMode, sceneFontFiles, schemaVersion, specJsonSchema, stampSpecVersion, svgToPng, themeBackground, toSvg };
31
+ export { AMBIENT_BACKGROUNDS, AMBIENT_ENABLED, ANNOTATION_TYPES, AUTO_ICON, BACKGROUNDS, CODE_FONTS, CODE_FONT_IDS, DEFAULT_APP_URL, DEFAULT_CODE_FONT, DEFAULT_THEME, EXTENSION_PREFIX, FILE_ICON, FONT_SIZE, ICON_IDS, IMPLICIT_SPEC_VERSION, LANGUAGES, LANGUAGE_IDS, LATEST_SPEC_VERSION, LINE_HEIGHT, MAC_HEADER, MARK_STYLES, METADATA_BY_DEFAULT, NO_ICON, PLAIN_TEXT, PNG_KEYWORDS, POPOVER, SOFTWARE, SPEC_LIMITS, SPEC_SCHEMA_URL, SVG_NAMESPACE, SpecError, SpecSchema, TAB_HEADER, THEMES, THEME_IDS, UI_FONT, WINDOW_RADIUS, addPngMetadata, ambientPreviewCss, cellCount, createImageMetadata, createLink, cssFontFamily, decodeSpec, encodeSpec, expandLineRanges, getCodeFont, getFace, getFrameColors, getIcon, getSyntax, getTheme, highlight, inferLanguage, initPng, isAmbientBackground, isCssBackground, isKnownLanguage, isSpecSchemaUrl, languageName, layout, loadFont, loadSceneFonts, measureCodeText, measureUiText, normalizeCode, parseSpec, readImageSpec, readLink, render, renderScene, resolveIcon, resolveLanguage, resolveMode, sceneFontFiles, schemaVersion, specJsonSchema, stampSpecVersion, svgToPng, themeBackground, toSvg };