@dskripchenko/ui 1.26.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/components/Markdown/index.d.ts +2 -2
- package/dist/components/Markdown/markdown.d.ts +26 -1
- package/dist/index.cjs +24 -23
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +1082 -1039
- package/dist/styles/all.css +1 -1
- package/dist/styles/index.css +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { default as UidMarkdown } from './UidMarkdown.vue';
|
|
2
2
|
export type { UidMarkdownProps } from './UidMarkdown.vue';
|
|
3
|
-
export { createSlugger, escapeHtml, renderMarkdown, resolveAgainst, splitMarkdown, } from './markdown.js';
|
|
4
|
-
export type { MarkdownHeading, MarkdownOptions, MarkdownSegment, Slugger, UidMarkdownCalloutKind, } from './markdown.js';
|
|
3
|
+
export { createSlugger, escapeHtml, readFrontMatter, renderMarkdown, resolveAgainst, splitMarkdown, } from './markdown.js';
|
|
4
|
+
export type { FrontMatter, FrontMatterValue, MarkdownHeading, MarkdownOptions, MarkdownSegment, Slugger, UidMarkdownCalloutKind, } from './markdown.js';
|
|
5
5
|
export { markdownBlockRenderersKey, provideMarkdownBlockRenderers, useMarkdownBlockRenderers, } from './blockRenderers.js';
|
|
6
6
|
export type { UidMarkdownBlockRenderer, UidMarkdownBlockRenderContext, UidMarkdownBlockRenderers, UidMarkdownBlockResult, UidMarkdownBlockMountContext, UidMarkdownBlockMountHandle, } from './blockRenderers.js';
|
|
@@ -21,13 +21,24 @@ export interface MarkdownOptions {
|
|
|
21
21
|
linkBase?: string | null;
|
|
22
22
|
/** Drops a trailing `.md` from relative links resolved through linkBase. */
|
|
23
23
|
stripMdExtension?: boolean;
|
|
24
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* Reads `[[note]]` internal links (on by default): links with `data-wikilink` for the host to resolve;
|
|
26
|
+
* `![[note]]` is an embed — `<span class="uid-markdown__embed" data-embed>` around the link, for the host to fill.
|
|
27
|
+
*/
|
|
25
28
|
wikiLinks?: boolean;
|
|
26
29
|
/**
|
|
27
30
|
* Reads TeX math (on by default): `$…$` and `\(…\)` in a line, `$$…$$` and
|
|
28
31
|
* `\[…\]` on lines of their own — drawn as MathML by @dskripchenko/math.
|
|
29
32
|
*/
|
|
30
33
|
math?: boolean;
|
|
34
|
+
/** Reads `#tags` (on by default): `<span class="uid-markdown__tag" data-tag="…">` for the host to act on. */
|
|
35
|
+
tags?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Reads a YAML front matter at the start of the source (`---` lines around
|
|
38
|
+
* `key: value`) as the document's properties, drawn as a table. Off by
|
|
39
|
+
* default: a caller rendering a piece of a document says when it is the start.
|
|
40
|
+
*/
|
|
41
|
+
frontMatter?: boolean;
|
|
31
42
|
/** The base relative image paths resolve against. */
|
|
32
43
|
imageBase?: string | null;
|
|
33
44
|
/**
|
|
@@ -50,6 +61,20 @@ export type UidMarkdownCalloutKind = 'note' | 'tip' | 'important' | 'warning' |
|
|
|
50
61
|
* again; an absolute base keeps its origin, a path base yields a path.
|
|
51
62
|
*/
|
|
52
63
|
export declare function resolveAgainst(escapedUrl: string, base: string, stripMd?: boolean): string;
|
|
64
|
+
/** A value of a document's property: text, or a list. */
|
|
65
|
+
export type FrontMatterValue = string | string[];
|
|
66
|
+
/** A document's YAML front matter: its properties, and how long it is in the source. */
|
|
67
|
+
export interface FrontMatter {
|
|
68
|
+
data: Record<string, FrontMatterValue>;
|
|
69
|
+
/** The characters it takes at the start of the source, its `---` lines included. */
|
|
70
|
+
length: number;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* The front matter at the start of a source, read as simple YAML: `key: value`,
|
|
74
|
+
* lists as `[a, b]` or `- a` lines, quoted strings; anything deeper is kept as
|
|
75
|
+
* its text. Null when the source does not start with one.
|
|
76
|
+
*/
|
|
77
|
+
export declare function readFrontMatter(source: string): FrontMatter | null;
|
|
53
78
|
export declare function renderMarkdown(source: string | null | undefined, opts?: MarkdownOptions): string;
|
|
54
79
|
/** A piece of a markdown document: text to render, or a top-level fenced code block. */
|
|
55
80
|
export type MarkdownSegment = {
|