fika-editor 3.0.34 → 3.0.35
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.
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@font-face` CSS with the font files inlined as data URLs, for markup that
|
|
3
|
+
* is rasterised as a standalone SVG image (math booths, mermaid diagrams):
|
|
4
|
+
* an SVG drawn through `<img>` cannot reach the page's web fonts, so any
|
|
5
|
+
* family it names must travel with it.
|
|
6
|
+
*
|
|
7
|
+
* html-to-image only inlines the families the probed node uses, so the probe
|
|
8
|
+
* is a stub naming exactly the requested families. Results are cached per
|
|
9
|
+
* family set; a result without inlined data (stylesheet not parsed yet, font
|
|
10
|
+
* fetch failed) is not cached so the next capture retries.
|
|
11
|
+
*/
|
|
12
|
+
/** Families the document declares via `@font-face` (loaded or not). */
|
|
13
|
+
export declare const declaredFontFamilies: () => Set<string>;
|
|
14
|
+
export declare const fontEmbedCssFor: (families: readonly string[], host?: HTMLElement) => Promise<string>;
|
|
15
|
+
/**
|
|
16
|
+
* Inline every declared web font an SVG names into a `<style>` at its top,
|
|
17
|
+
* so the diagram paints the same through `<img>` as it does in the DOM.
|
|
18
|
+
* Families the document does not declare (system stacks, generics) are left
|
|
19
|
+
* to the renderer.
|
|
20
|
+
*/
|
|
21
|
+
export declare const embedSvgFonts: (svg: string) => Promise<string>;
|
|
@@ -11,8 +11,22 @@ export declare class MermaidRenderSuperseded extends Error {
|
|
|
11
11
|
constructor();
|
|
12
12
|
}
|
|
13
13
|
export declare const isMermaidRenderSuperseded: (err: unknown) => boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Diagram type. Set here, not per diagram: mermaid's directive sanitizer
|
|
16
|
+
* keeps only a single bare family name in `themeVariables.fontFamily`
|
|
17
|
+
* (stacks, quotes and even `sans-serif` are dropped), whereas the initialize
|
|
18
|
+
* config takes the full stack. Inter is the embed's shipped body face and is
|
|
19
|
+
* inlined into image renders by `renderMermaidForImage`.
|
|
20
|
+
*/
|
|
21
|
+
export declare const MERMAID_FONT_FAMILY = "Inter, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif";
|
|
14
22
|
export declare const whenMermaidReady: () => Promise<[MermaidAPI, DOMPurifyAPI]>;
|
|
15
23
|
export declare const prefetchMermaid: () => void;
|
|
16
24
|
export declare const isMermaidReady: () => boolean;
|
|
17
25
|
export declare const renderMermaid: (code: string, key?: string) => Promise<string>;
|
|
26
|
+
/**
|
|
27
|
+
* Diagram SVG for `<img>`/canvas consumers (thumbnails, export): the same
|
|
28
|
+
* markup with the web fonts it names inlined, since an SVG drawn as an image
|
|
29
|
+
* cannot reach the page's `@font-face` rules and would fall back to serif.
|
|
30
|
+
*/
|
|
31
|
+
export declare const renderMermaidForImage: (code: string, key?: string) => Promise<string>;
|
|
18
32
|
export {};
|