@dskripchenko/ui 1.21.0 → 1.23.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.
@@ -40,10 +40,20 @@ export interface UidMarkdownBlockMountHandle {
40
40
  * placeholder until it settles. A thrown error or a rejected promise is
41
41
  * treated like `{ error }`.
42
42
  */
43
- export type UidMarkdownBlockRenderer = (code: string, ctx: {
43
+ export type UidMarkdownBlockRenderer = (code: string, ctx: UidMarkdownBlockRenderContext) => UidMarkdownBlockResult | Promise<UidMarkdownBlockResult>;
44
+ /** What a block renderer knows of the block and of the markdown around it. */
45
+ export interface UidMarkdownBlockRenderContext {
44
46
  language: string;
47
+ /** The block's number among the markdown's code blocks, from 0. */
45
48
  index: number;
46
- }) => UidMarkdownBlockResult | Promise<UidMarkdownBlockResult>;
49
+ /**
50
+ * The markdown's `imageBase` and `linkBase`, when it has them: a block that
51
+ * names files (a ```video with `src: intro.mp4`) resolves relative paths
52
+ * against them, as the markdown's own images and links do.
53
+ */
54
+ imageBase?: string;
55
+ linkBase?: string;
56
+ }
47
57
  /** Block renderers by fence language (lower case). */
48
58
  export type UidMarkdownBlockRenderers = Readonly<Record<string, UidMarkdownBlockRenderer>>;
49
59
  export declare const markdownBlockRenderersKey: InjectionKey<UidMarkdownBlockRenderers>;
@@ -3,4 +3,4 @@ export type { UidMarkdownProps } from './UidMarkdown.vue';
3
3
  export { createSlugger, escapeHtml, renderMarkdown, resolveAgainst, splitMarkdown, } from './markdown.js';
4
4
  export type { MarkdownHeading, MarkdownOptions, MarkdownSegment, Slugger, UidMarkdownCalloutKind, } from './markdown.js';
5
5
  export { markdownBlockRenderersKey, provideMarkdownBlockRenderers, useMarkdownBlockRenderers, } from './blockRenderers.js';
6
- export type { UidMarkdownBlockRenderer, UidMarkdownBlockRenderers, UidMarkdownBlockResult, UidMarkdownBlockMountContext, UidMarkdownBlockMountHandle, } from './blockRenderers.js';
6
+ export type { UidMarkdownBlockRenderer, UidMarkdownBlockRenderContext, UidMarkdownBlockRenderers, UidMarkdownBlockResult, UidMarkdownBlockMountContext, UidMarkdownBlockMountHandle, } from './blockRenderers.js';
@@ -44,6 +44,11 @@ export interface MarkdownOptions {
44
44
  * own links to navigate.
45
45
  */
46
46
  internalLinksInPlace?: boolean;
47
+ /** Read-out names of task checkboxes; English when not given. */
48
+ taskLabels?: {
49
+ done: string;
50
+ open: string;
51
+ };
47
52
  /** Titles of `[!NOTE]`-style callouts; English when not given. */
48
53
  calloutTitles?: Partial<Record<UidMarkdownCalloutKind, string>>;
49
54
  }