@coderminer/vue-markdown 0.0.0-stage → 1.0.1
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/CHANGELOG.md +226 -0
- package/LICENSE +21 -0
- package/README.md +584 -3
- package/README.zh-CN.md +550 -0
- package/dist/chunks/MarkdownBlockquote-DVXziX2t.js +16 -0
- package/dist/chunks/MarkdownBreak-BwCi2Itt.js +16 -0
- package/dist/chunks/MarkdownCode-B1k9tmW5.js +63 -0
- package/dist/chunks/MarkdownConfigProvider-5N3ylrIu.js +49 -0
- package/dist/chunks/MarkdownContent-BAK6dqo7.js +13 -0
- package/dist/chunks/MarkdownCustomTag-lZJHsD6f.js +46 -0
- package/dist/chunks/MarkdownEmphasis-CppivOEu.js +16 -0
- package/dist/chunks/MarkdownEmpty-Av5k6bqa.js +14 -0
- package/dist/chunks/MarkdownError-C0sPs5W0.js +17 -0
- package/dist/chunks/MarkdownFootnoteReference-Dy3Khwyj.js +22 -0
- package/dist/chunks/MarkdownFootnotes-BRPzkbXv.js +21 -0
- package/dist/chunks/MarkdownHeading-DaNcP0_6.js +29 -0
- package/dist/chunks/MarkdownHorizontalRule-QNe_cuUI.js +16 -0
- package/dist/chunks/MarkdownHtml-66lYkvwM.js +13 -0
- package/dist/chunks/MarkdownImage-BRy76svs.js +51 -0
- package/dist/chunks/MarkdownInlineCode-MXZYFwex.js +16 -0
- package/dist/chunks/MarkdownLink-Dbx3NwgV.js +45 -0
- package/dist/chunks/MarkdownList-BJ-_C71k.js +20 -0
- package/dist/chunks/MarkdownListItem-Z1EHIY26.js +16 -0
- package/dist/chunks/MarkdownLoading-D-RYtXxf.js +15 -0
- package/dist/chunks/MarkdownParagraph-BxLSmSaG.js +16 -0
- package/dist/chunks/MarkdownRenderer-OlkdsvI3.js +482 -0
- package/dist/chunks/MarkdownRoot-DEE6iVfh.js +23 -0
- package/dist/chunks/MarkdownStrikethrough-CblvbqDk.js +16 -0
- package/dist/chunks/MarkdownStrong-uU5MzAoJ.js +16 -0
- package/dist/chunks/MarkdownTable-DmBTg_CR.js +16 -0
- package/dist/chunks/MarkdownTableCell-eiCJe847.js +31 -0
- package/dist/chunks/MarkdownTableRow-DuJaPntg.js +16 -0
- package/dist/chunks/MarkdownTableSection-PFHz-R33.js +24 -0
- package/dist/chunks/MarkdownTaskItem-BcmKo1lk.js +38 -0
- package/dist/chunks/MarkdownToc-DHWWoH6t.js +49 -0
- package/dist/chunks/MarkdownTocItem-DT9mR3vL.js +25 -0
- package/dist/chunks/MermaidLiveEditor-1TKkI5bp.js +414 -0
- package/dist/chunks/VueSyntaxHighlighter-BWpCO-cX.js +260 -0
- package/dist/chunks/adapters-CMwX_NEI.js +26 -0
- package/dist/chunks/asyncToGenerator-ChigusFD.js +26 -0
- package/dist/chunks/blank-line-CKKsFeKR.js +88 -0
- package/dist/chunks/codemirror-DyphMAEg.js +82 -0
- package/dist/chunks/config-aRYo2R8_.js +10 -0
- package/dist/chunks/context-8NfW6fxI.js +30 -0
- package/dist/chunks/convert-hast-C4Rg2ZuF.js +6 -0
- package/dist/chunks/default-ZQ5aHh-N.js +3 -0
- package/dist/chunks/diagnostics-CtHoJyiX.js +23 -0
- package/dist/chunks/export-BrgMLgUp.js +1574 -0
- package/dist/chunks/hast-to-nodes-DuZsi4XT.js +29 -0
- package/dist/chunks/hast-util-from-html-D3e_iQ89.js +5088 -0
- package/dist/chunks/highlightjs-BxJFpKS1.js +196 -0
- package/dist/chunks/identity-Bi27FKyx.js +6243 -0
- package/dist/chunks/labels-BtHiUTQI.js +47 -0
- package/dist/chunks/lib-CCnkLL6S.js +252 -0
- package/dist/chunks/longest-streak-DZE_EqsU.js +8 -0
- package/dist/chunks/micromark-factory-space-CpXAnYUY.js +137 -0
- package/dist/chunks/normalize-VKfQXZiK.js +226 -0
- package/dist/chunks/objectSpread2-CtBNx0TF.js +57 -0
- package/dist/chunks/plugin-YWo5uqTh.js +27 -0
- package/dist/chunks/preset-BjaOuJUL.js +44 -0
- package/dist/chunks/registry-B7BfEkuy.js +6150 -0
- package/dist/chunks/render-DAqK0w5J.js +1754 -0
- package/dist/chunks/rolldown-runtime-QGRDbDUS.js +19 -0
- package/dist/chunks/runtime-D95F41zG.js +574 -0
- package/dist/chunks/security-y4EwUyAs.js +212 -0
- package/dist/chunks/shared-NjFDPmkb.js +67 -0
- package/dist/chunks/space-separated-tokens-1ebNqf35.js +1097 -0
- package/dist/chunks/url-D2BoivaE.js +24 -0
- package/dist/chunks/useActiveHeading-CnyGTG1u.js +359 -0
- package/dist/components/CodeBlock.d.ts +73 -0
- package/dist/components/CodeBlock.js +1 -0
- package/dist/components/Icon.d.ts +6 -0
- package/dist/components/MarkdownBlockquote.d.ts +18 -0
- package/dist/components/MarkdownBlockquote.js +1 -0
- package/dist/components/MarkdownBreak.d.ts +8 -0
- package/dist/components/MarkdownBreak.js +1 -0
- package/dist/components/MarkdownChildren.d.ts +17 -0
- package/dist/components/MarkdownCode.d.ts +29 -0
- package/dist/components/MarkdownCode.js +1 -0
- package/dist/components/MarkdownConfigProvider.d.ts +33 -0
- package/dist/components/MarkdownConfigProvider.js +1 -0
- package/dist/components/MarkdownContent.d.ts +16 -0
- package/dist/components/MarkdownContent.js +1 -0
- package/dist/components/MarkdownCustomTag.d.ts +20 -0
- package/dist/components/MarkdownCustomTag.js +1 -0
- package/dist/components/MarkdownEmphasis.d.ts +18 -0
- package/dist/components/MarkdownEmphasis.js +1 -0
- package/dist/components/MarkdownEmpty.d.ts +8 -0
- package/dist/components/MarkdownEmpty.js +1 -0
- package/dist/components/MarkdownError.d.ts +11 -0
- package/dist/components/MarkdownError.js +1 -0
- package/dist/components/MarkdownFootnoteReference.d.ts +19 -0
- package/dist/components/MarkdownFootnoteReference.js +1 -0
- package/dist/components/MarkdownFootnotes.d.ts +17 -0
- package/dist/components/MarkdownFootnotes.js +1 -0
- package/dist/components/MarkdownHeading.d.ts +18 -0
- package/dist/components/MarkdownHeading.js +1 -0
- package/dist/components/MarkdownHorizontalRule.d.ts +8 -0
- package/dist/components/MarkdownHorizontalRule.js +1 -0
- package/dist/components/MarkdownHtml.d.ts +8 -0
- package/dist/components/MarkdownHtml.js +1 -0
- package/dist/components/MarkdownImage.d.ts +15 -0
- package/dist/components/MarkdownImage.js +1 -0
- package/dist/components/MarkdownInlineCode.d.ts +18 -0
- package/dist/components/MarkdownInlineCode.js +1 -0
- package/dist/components/MarkdownLink.d.ts +22 -0
- package/dist/components/MarkdownLink.js +1 -0
- package/dist/components/MarkdownList.d.ts +18 -0
- package/dist/components/MarkdownList.js +1 -0
- package/dist/components/MarkdownListItem.d.ts +18 -0
- package/dist/components/MarkdownListItem.js +1 -0
- package/dist/components/MarkdownLoading.d.ts +8 -0
- package/dist/components/MarkdownLoading.js +1 -0
- package/dist/components/MarkdownMath.d.ts +12 -0
- package/dist/components/MarkdownMath.js +1 -0
- package/dist/components/MarkdownMermaid.d.ts +78 -0
- package/dist/components/MarkdownMermaid.js +1 -0
- package/dist/components/MarkdownParagraph.d.ts +18 -0
- package/dist/components/MarkdownParagraph.js +1 -0
- package/dist/components/MarkdownRenderer.d.ts +167 -0
- package/dist/components/MarkdownRenderer.js +1 -0
- package/dist/components/MarkdownRoot.d.ts +24 -0
- package/dist/components/MarkdownRoot.js +1 -0
- package/dist/components/MarkdownStrikethrough.d.ts +18 -0
- package/dist/components/MarkdownStrikethrough.js +1 -0
- package/dist/components/MarkdownStrong.d.ts +18 -0
- package/dist/components/MarkdownStrong.js +1 -0
- package/dist/components/MarkdownTable.d.ts +18 -0
- package/dist/components/MarkdownTable.js +1 -0
- package/dist/components/MarkdownTableCell.d.ts +20 -0
- package/dist/components/MarkdownTableCell.js +1 -0
- package/dist/components/MarkdownTableRow.d.ts +18 -0
- package/dist/components/MarkdownTableRow.js +1 -0
- package/dist/components/MarkdownTableSection.d.ts +18 -0
- package/dist/components/MarkdownTableSection.js +1 -0
- package/dist/components/MarkdownTaskItem.d.ts +20 -0
- package/dist/components/MarkdownTaskItem.js +1 -0
- package/dist/components/MarkdownToc.d.ts +36 -0
- package/dist/components/MarkdownToc.js +1 -0
- package/dist/components/MarkdownTocItem.d.ts +14 -0
- package/dist/components/MarkdownTocItem.js +1 -0
- package/dist/components/MermaidBlock.d.ts +50 -0
- package/dist/components/MermaidBlock.js +1 -0
- package/dist/components/MermaidLiveEditor.d.ts +44 -0
- package/dist/components/MermaidLiveEditor.js +1 -0
- package/dist/components/VueSyntaxHighlighter.d.ts +39 -0
- package/dist/components/VueSyntaxHighlighter.js +1 -0
- package/dist/components/codeRegion.d.ts +14 -0
- package/dist/components/config.d.ts +7 -0
- package/dist/components/context.d.ts +45 -0
- package/dist/components/index.d.ts +42 -0
- package/dist/components/index.js +38 -0
- package/dist/components/render.d.ts +9 -0
- package/dist/components/scroll-lock.d.ts +7 -0
- package/dist/components/types.d.ts +61 -0
- package/dist/composables/useActiveHeading.d.ts +12 -0
- package/dist/composables/useCodeHighlighter.d.ts +30 -0
- package/dist/composables/useLineWindow.d.ts +38 -0
- package/dist/composables/useMarkdownDocument.d.ts +25 -0
- package/dist/core/adapters.d.ts +7 -0
- package/dist/core/config.d.ts +5 -0
- package/dist/core/diagnostics.d.ts +9 -0
- package/dist/core/finalize.d.ts +18 -0
- package/dist/core/hast-nodes.d.ts +3 -0
- package/dist/core/hast-to-nodes.d.ts +9 -0
- package/dist/core/highlight-lines.d.ts +8 -0
- package/dist/core/identity.d.ts +4 -0
- package/dist/core/labels.d.ts +4 -0
- package/dist/core/manifest.d.ts +38 -0
- package/dist/core/memo.d.ts +5 -0
- package/dist/core/model-hast.d.ts +8 -0
- package/dist/core/model.d.ts +10 -0
- package/dist/core/normalize.d.ts +37 -0
- package/dist/core/parts.d.ts +136 -0
- package/dist/core/preset.d.ts +10 -0
- package/dist/core/run.d.ts +16 -0
- package/dist/core/search.d.ts +5 -0
- package/dist/core/security.d.ts +21 -0
- package/dist/core/slugger.d.ts +13 -0
- package/dist/core/types.d.ts +392 -0
- package/dist/core/url.d.ts +10 -0
- package/dist/editor/codemirror.d.ts +14 -0
- package/dist/editor/index.d.ts +2 -0
- package/dist/editor/index.js +1 -0
- package/dist/export/index.d.ts +6 -0
- package/dist/headless.d.ts +21 -0
- package/dist/headless.js +12 -0
- package/dist/highlight/convert-hast.d.ts +8 -0
- package/dist/highlight/highlightjs.d.ts +7 -0
- package/dist/highlight/index.d.ts +4 -0
- package/dist/highlight/index.js +4 -0
- package/dist/highlight/shared.d.ts +11 -0
- package/dist/highlight/shiki.d.ts +7 -0
- package/dist/highlight/shiki.js +75 -0
- package/dist/html/index.d.ts +17 -0
- package/dist/html/index.js +11 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.js +53 -0
- package/dist/math/index.d.ts +4 -0
- package/dist/math/index.js +585 -0
- package/dist/math/katex.d.ts +4 -0
- package/dist/math/plugin.d.ts +20 -0
- package/dist/mermaid/index.d.ts +6 -0
- package/dist/mermaid/index.js +8 -0
- package/dist/mermaid/plugin.d.ts +17 -0
- package/dist/mermaid/runtime.d.ts +14 -0
- package/dist/mermaid/sanitize-svg-lazy.d.ts +10 -0
- package/dist/mermaid/sanitize-svg.d.ts +3 -0
- package/dist/mermaid/sanitize.d.ts +16 -0
- package/dist/node-components.d.ts +1 -0
- package/dist/node-components.js +39 -0
- package/dist/pipeline/custom.d.ts +8 -0
- package/dist/pipeline/identity.d.ts +12 -0
- package/dist/pipeline/index.d.ts +5 -0
- package/dist/pipeline/official.d.ts +6 -0
- package/dist/pipeline.d.ts +1 -0
- package/dist/pipeline.js +1 -0
- package/dist/plugins/builtin.d.ts +15 -0
- package/dist/plugins/define.d.ts +7 -0
- package/dist/plugins/registry.d.ts +16 -0
- package/dist/plugins/source.d.ts +7 -0
- package/dist/plugins.d.ts +3 -0
- package/dist/plugins.js +1 -0
- package/dist/presets.d.ts +3 -0
- package/dist/presets.js +1 -0
- package/dist/style.css +2 -0
- package/dist/styles/components.css +737 -0
- package/dist/styles/index.d.ts +1 -0
- package/dist/styles/math-full.css +3 -0
- package/dist/styles/math.css +18 -0
- package/dist/styles/tokens.css +96 -0
- package/package.json +214 -6
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { MarkdownNode } from '../core/types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
node: MarkdownNode;
|
|
4
|
+
children?: MarkdownNode[];
|
|
5
|
+
align?: string;
|
|
6
|
+
scope?: string;
|
|
7
|
+
};
|
|
8
|
+
declare var __VLS_7: {};
|
|
9
|
+
type __VLS_Slots = {} & {
|
|
10
|
+
default?: (props: typeof __VLS_7) => any;
|
|
11
|
+
};
|
|
12
|
+
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
14
|
+
declare const _default: typeof __VLS_export;
|
|
15
|
+
export default _default;
|
|
16
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
17
|
+
new (): {
|
|
18
|
+
$slots: S;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as default } from "../chunks/MarkdownTableCell-eiCJe847.js";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { MarkdownNode } from '../core/types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
node: MarkdownNode;
|
|
4
|
+
children?: MarkdownNode[];
|
|
5
|
+
};
|
|
6
|
+
declare var __VLS_1: {};
|
|
7
|
+
type __VLS_Slots = {} & {
|
|
8
|
+
default?: (props: typeof __VLS_1) => any;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
14
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
15
|
+
new (): {
|
|
16
|
+
$slots: S;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as default } from "../chunks/MarkdownTableRow-DuJaPntg.js";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { MarkdownNode } from '../core/types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
node: MarkdownNode;
|
|
4
|
+
children?: MarkdownNode[];
|
|
5
|
+
};
|
|
6
|
+
declare var __VLS_7: {};
|
|
7
|
+
type __VLS_Slots = {} & {
|
|
8
|
+
default?: (props: typeof __VLS_7) => any;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
14
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
15
|
+
new (): {
|
|
16
|
+
$slots: S;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as default } from "../chunks/MarkdownTableSection-PFHz-R33.js";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { MarkdownNode } from '../core/types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
node: MarkdownNode;
|
|
4
|
+
children?: MarkdownNode[];
|
|
5
|
+
checked?: boolean;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
};
|
|
8
|
+
declare var __VLS_1: {};
|
|
9
|
+
type __VLS_Slots = {} & {
|
|
10
|
+
default?: (props: typeof __VLS_1) => any;
|
|
11
|
+
};
|
|
12
|
+
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
14
|
+
declare const _default: typeof __VLS_export;
|
|
15
|
+
export default _default;
|
|
16
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
17
|
+
new (): {
|
|
18
|
+
$slots: S;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as default } from "../chunks/MarkdownTaskItem-BcmKo1lk.js";
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { MarkdownComponentValue, TocItem } from '../core/types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
items: TocItem[];
|
|
4
|
+
activeId?: string;
|
|
5
|
+
label?: string;
|
|
6
|
+
tocItem?: MarkdownComponentValue;
|
|
7
|
+
/** Maximum heading level to show. `0` or omitted means every level. */
|
|
8
|
+
tocDepth?: number;
|
|
9
|
+
};
|
|
10
|
+
declare function navigate(id: string): void;
|
|
11
|
+
declare var __VLS_2: {
|
|
12
|
+
item: TocItem;
|
|
13
|
+
active: boolean;
|
|
14
|
+
navigate: typeof navigate;
|
|
15
|
+
};
|
|
16
|
+
type __VLS_Slots = {} & {
|
|
17
|
+
'toc-item'?: (props: typeof __VLS_2) => any;
|
|
18
|
+
};
|
|
19
|
+
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
20
|
+
navigate: (id: string) => any;
|
|
21
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
22
|
+
onNavigate?: ((id: string) => any) | undefined;
|
|
23
|
+
}>, {
|
|
24
|
+
tocItem: string | object | ((...args: never[]) => unknown);
|
|
25
|
+
label: string;
|
|
26
|
+
activeId: string;
|
|
27
|
+
tocDepth: number;
|
|
28
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
29
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
30
|
+
declare const _default: typeof __VLS_export;
|
|
31
|
+
export default _default;
|
|
32
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
33
|
+
new (): {
|
|
34
|
+
$slots: S;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as default } from "../chunks/MarkdownToc-DHWWoH6t.js";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TocItem } from '../core/types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
item: TocItem;
|
|
4
|
+
active?: boolean;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
7
|
+
navigate: (id: string) => any;
|
|
8
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
9
|
+
onNavigate?: ((id: string) => any) | undefined;
|
|
10
|
+
}>, {
|
|
11
|
+
active: boolean;
|
|
12
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
declare const _default: typeof __VLS_export;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as default } from "../chunks/MarkdownTocItem-DT9mR3vL.js";
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { MarkdownNode, MarkdownTheme, MermaidAction, MermaidRenderResult, MermaidRenderer } from '../core/types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
node?: MarkdownNode;
|
|
4
|
+
source?: string;
|
|
5
|
+
renderer?: MermaidRenderer;
|
|
6
|
+
theme?: MarkdownTheme;
|
|
7
|
+
showErrors?: boolean;
|
|
8
|
+
enableZoom?: boolean;
|
|
9
|
+
allowFullscreen?: boolean;
|
|
10
|
+
compact?: boolean;
|
|
11
|
+
actions?: MermaidAction[];
|
|
12
|
+
};
|
|
13
|
+
declare function render(): Promise<void>;
|
|
14
|
+
declare function copy(): Promise<void>;
|
|
15
|
+
declare function exportPng(): Promise<void>;
|
|
16
|
+
declare function downloadSvg(): void;
|
|
17
|
+
declare function toggleFullscreen(next?: boolean): Promise<void>;
|
|
18
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {
|
|
19
|
+
render: typeof render;
|
|
20
|
+
copy: typeof copy;
|
|
21
|
+
exportPng: typeof exportPng;
|
|
22
|
+
downloadSvg: typeof downloadSvg;
|
|
23
|
+
toggleFullscreen: typeof toggleFullscreen;
|
|
24
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
25
|
+
error: (message: string) => any;
|
|
26
|
+
action: (key: string) => any;
|
|
27
|
+
rendered: (result: MermaidRenderResult) => any;
|
|
28
|
+
fullscreen: (active: boolean) => any;
|
|
29
|
+
copy: (source: string) => any;
|
|
30
|
+
export: (format: "svg" | "png") => any;
|
|
31
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
32
|
+
onError?: ((message: string) => any) | undefined;
|
|
33
|
+
onAction?: ((key: string) => any) | undefined;
|
|
34
|
+
onRendered?: ((result: MermaidRenderResult) => any) | undefined;
|
|
35
|
+
onFullscreen?: ((active: boolean) => any) | undefined;
|
|
36
|
+
onCopy?: ((source: string) => any) | undefined;
|
|
37
|
+
onExport?: ((format: "svg" | "png") => any) | undefined;
|
|
38
|
+
}>, {
|
|
39
|
+
source: string;
|
|
40
|
+
theme: MarkdownTheme;
|
|
41
|
+
actions: MermaidAction[];
|
|
42
|
+
compact: boolean;
|
|
43
|
+
node: MarkdownNode;
|
|
44
|
+
renderer: MermaidRenderer;
|
|
45
|
+
showErrors: boolean;
|
|
46
|
+
enableZoom: boolean;
|
|
47
|
+
allowFullscreen: boolean;
|
|
48
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
49
|
+
declare const _default: typeof __VLS_export;
|
|
50
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { r as default } from "../chunks/render-DAqK0w5J.js";
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { DiagnosticFormatter, MarkdownDiagnostic, MermaidRenderer } from '../core/types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
modelValue?: string;
|
|
4
|
+
debounce?: number;
|
|
5
|
+
theme?: 'light' | 'dark' | 'auto' | 'custom';
|
|
6
|
+
renderer?: MermaidRenderer;
|
|
7
|
+
diagnosticsFormatter?: DiagnosticFormatter;
|
|
8
|
+
compact?: boolean;
|
|
9
|
+
rawDetails?: boolean;
|
|
10
|
+
autoFocus?: boolean;
|
|
11
|
+
initialRatio?: number;
|
|
12
|
+
minRatio?: number;
|
|
13
|
+
};
|
|
14
|
+
declare function toggleFullscreen(): Promise<void>;
|
|
15
|
+
declare function focus(): void;
|
|
16
|
+
/** Apply the current editor value to the preview without waiting for debounce. */
|
|
17
|
+
declare function refreshPreview(): void;
|
|
18
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {
|
|
19
|
+
focus: typeof focus;
|
|
20
|
+
refreshPreview: typeof refreshPreview;
|
|
21
|
+
toggleFullscreen: typeof toggleFullscreen;
|
|
22
|
+
getDiagnostics: () => MarkdownDiagnostic[];
|
|
23
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
24
|
+
error: (diagnostic: MarkdownDiagnostic) => any;
|
|
25
|
+
preview: (value: string) => any;
|
|
26
|
+
"update:modelValue": (value: string) => any;
|
|
27
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
28
|
+
onError?: ((diagnostic: MarkdownDiagnostic) => any) | undefined;
|
|
29
|
+
onPreview?: ((value: string) => any) | undefined;
|
|
30
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
31
|
+
}>, {
|
|
32
|
+
theme: "custom" | "light" | "dark" | "auto";
|
|
33
|
+
diagnosticsFormatter: DiagnosticFormatter;
|
|
34
|
+
autoFocus: boolean;
|
|
35
|
+
compact: boolean;
|
|
36
|
+
renderer: MermaidRenderer;
|
|
37
|
+
modelValue: string;
|
|
38
|
+
debounce: number;
|
|
39
|
+
rawDetails: boolean;
|
|
40
|
+
initialRatio: number;
|
|
41
|
+
minRatio: number;
|
|
42
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
43
|
+
declare const _default: typeof __VLS_export;
|
|
44
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as default } from "../chunks/MermaidLiveEditor-1TKkI5bp.js";
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { HighlightLine, MarkdownDiagnostic, MarkdownHighlighter, MarkdownTheme } from '../core/types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
source: string;
|
|
4
|
+
language?: string;
|
|
5
|
+
theme?: MarkdownTheme;
|
|
6
|
+
highlighter?: MarkdownHighlighter;
|
|
7
|
+
lineNumbers?: boolean;
|
|
8
|
+
highlightLines?: HighlightLine[];
|
|
9
|
+
maxLines?: number;
|
|
10
|
+
virtual?: boolean;
|
|
11
|
+
virtualThreshold?: number;
|
|
12
|
+
lineHeight?: number;
|
|
13
|
+
delay?: number;
|
|
14
|
+
};
|
|
15
|
+
declare function copy(): Promise<void>;
|
|
16
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {
|
|
17
|
+
copy: typeof copy;
|
|
18
|
+
getHighlighted: () => import('..').HighlightResult;
|
|
19
|
+
highlighted: import('vue').ShallowRef<import('..').HighlightResult>;
|
|
20
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
21
|
+
error: (diagnostic: MarkdownDiagnostic) => any;
|
|
22
|
+
copy: (source: string) => any;
|
|
23
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
24
|
+
onError?: ((diagnostic: MarkdownDiagnostic) => any) | undefined;
|
|
25
|
+
onCopy?: ((source: string) => any) | undefined;
|
|
26
|
+
}>, {
|
|
27
|
+
theme: MarkdownTheme;
|
|
28
|
+
highlighter: MarkdownHighlighter;
|
|
29
|
+
lineHeight: number;
|
|
30
|
+
language: string;
|
|
31
|
+
lineNumbers: boolean;
|
|
32
|
+
highlightLines: HighlightLine[];
|
|
33
|
+
maxLines: number;
|
|
34
|
+
virtual: boolean;
|
|
35
|
+
virtualThreshold: number;
|
|
36
|
+
delay: number;
|
|
37
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
38
|
+
declare const _default: typeof __VLS_export;
|
|
39
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as default } from "../chunks/VueSyntaxHighlighter-BWpCO-cX.js";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ComputedRef } from 'vue';
|
|
2
|
+
import { MarkdownComponentValue } from '../core/types';
|
|
3
|
+
export interface UseCodeRegionOptions {
|
|
4
|
+
standalone?: () => boolean;
|
|
5
|
+
ignoreRegion?: () => boolean;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Resolve `regions.codeBlock` for a code component.
|
|
9
|
+
*
|
|
10
|
+
* A region that renders `CodeBlock` (or `MarkdownCode`) internally must not
|
|
11
|
+
* re-enter itself. The provider below marks descendants as already inside a
|
|
12
|
+
* code region, so nested code components always render their own default.
|
|
13
|
+
*/
|
|
14
|
+
export declare function useCodeBlockRegion(options?: UseCodeRegionOptions): ComputedRef<MarkdownComponentValue | undefined>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ComputedRef, InjectionKey } from 'vue';
|
|
2
|
+
import { MarkdownConfig } from '../core/types';
|
|
3
|
+
export declare const MARKDOWN_CONFIG: InjectionKey<ComputedRef<MarkdownConfig>>;
|
|
4
|
+
/** Read the nearest provider configuration, or an empty configuration. */
|
|
5
|
+
export declare function useMarkdownConfig(): ComputedRef<MarkdownConfig>;
|
|
6
|
+
/** Provide a configuration to descendant renderers and providers. */
|
|
7
|
+
export declare function provideMarkdownConfig(config: ComputedRef<MarkdownConfig>): void;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { InjectionKey, Slot, VNodeChild } from 'vue';
|
|
2
|
+
import { DiagnosticFormatter, MarkdownComponentValue, MarkdownDocument, MarkdownExternalLinkTarget, MarkdownHighlighter, MarkdownLabels, MarkdownNode, MarkdownRegionComponents, MarkdownTheme, MathEngine, MermaidRenderer } from '../core/types';
|
|
3
|
+
export interface LinkClickPayload {
|
|
4
|
+
url: string;
|
|
5
|
+
target: string;
|
|
6
|
+
node: MarkdownNode;
|
|
7
|
+
event: MouseEvent;
|
|
8
|
+
}
|
|
9
|
+
export interface CustomTagClickPayload {
|
|
10
|
+
tag: string;
|
|
11
|
+
props: Record<string, unknown>;
|
|
12
|
+
node: MarkdownNode;
|
|
13
|
+
event: MouseEvent;
|
|
14
|
+
}
|
|
15
|
+
export interface TaskChangePayload {
|
|
16
|
+
checked: boolean;
|
|
17
|
+
node: MarkdownNode;
|
|
18
|
+
}
|
|
19
|
+
export interface RenderContext {
|
|
20
|
+
components: Record<string, MarkdownComponentValue>;
|
|
21
|
+
nodeComponents?: Record<string, MarkdownComponentValue>;
|
|
22
|
+
regions?: MarkdownRegionComponents;
|
|
23
|
+
document?: MarkdownDocument;
|
|
24
|
+
theme?: MarkdownTheme;
|
|
25
|
+
labels: MarkdownLabels;
|
|
26
|
+
linkTarget: string;
|
|
27
|
+
externalLinkTarget: MarkdownExternalLinkTarget;
|
|
28
|
+
highlighter?: MarkdownHighlighter;
|
|
29
|
+
mathEngine?: MathEngine;
|
|
30
|
+
mermaidRenderer?: MermaidRenderer;
|
|
31
|
+
diagnosticsFormatter?: DiagnosticFormatter;
|
|
32
|
+
/** Host-authored region slots keyed by documented slot name. */
|
|
33
|
+
slots?: Readonly<Record<string, Slot | undefined>>;
|
|
34
|
+
/** Render a host slot, falling back to the default region when empty. */
|
|
35
|
+
renderHostSlot(name: string, props: Record<string, unknown>, fallback: () => VNodeChild): VNodeChild;
|
|
36
|
+
onLinkClick(payload: LinkClickPayload): void;
|
|
37
|
+
onCustomTagClick(payload: CustomTagClickPayload): void;
|
|
38
|
+
onTaskChange(payload: TaskChangePayload): void;
|
|
39
|
+
onRenderError?(diagnostic: import('../core/types').MarkdownDiagnostic): void;
|
|
40
|
+
onMathError?(diagnostic: import('../core/types').MarkdownDiagnostic): void;
|
|
41
|
+
}
|
|
42
|
+
export declare const RENDER_CONTEXT: InjectionKey<RenderContext>;
|
|
43
|
+
export declare function useRenderContext(): RenderContext;
|
|
44
|
+
/** True when a slot produced no meaningful output and the default should win. */
|
|
45
|
+
export declare function isEmptySlotContent(value: VNodeChild): boolean;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export { default as MarkdownRenderer } from './MarkdownRenderer';
|
|
2
|
+
export { default as MarkdownConfigProvider } from './MarkdownConfigProvider';
|
|
3
|
+
export { default as MarkdownRoot } from './MarkdownRoot';
|
|
4
|
+
export { default as MarkdownContent } from './MarkdownContent';
|
|
5
|
+
export { default as MarkdownToc } from './MarkdownToc';
|
|
6
|
+
export { default as MarkdownTocItem } from './MarkdownTocItem';
|
|
7
|
+
export { default as MarkdownError } from './MarkdownError';
|
|
8
|
+
export { default as MarkdownEmpty } from './MarkdownEmpty';
|
|
9
|
+
export { default as MarkdownLoading } from './MarkdownLoading';
|
|
10
|
+
export { default as MarkdownParagraph } from './MarkdownParagraph';
|
|
11
|
+
export { default as MarkdownHeading } from './MarkdownHeading';
|
|
12
|
+
export { default as MarkdownEmphasis } from './MarkdownEmphasis';
|
|
13
|
+
export { default as MarkdownStrong } from './MarkdownStrong';
|
|
14
|
+
export { default as MarkdownStrikethrough } from './MarkdownStrikethrough';
|
|
15
|
+
export { default as MarkdownLink } from './MarkdownLink';
|
|
16
|
+
export { default as MarkdownImage } from './MarkdownImage';
|
|
17
|
+
export { default as MarkdownList } from './MarkdownList';
|
|
18
|
+
export { default as MarkdownListItem } from './MarkdownListItem';
|
|
19
|
+
export { default as MarkdownBlockquote } from './MarkdownBlockquote';
|
|
20
|
+
export { default as MarkdownHorizontalRule } from './MarkdownHorizontalRule';
|
|
21
|
+
export { default as MarkdownTable } from './MarkdownTable';
|
|
22
|
+
export { default as MarkdownTableSection } from './MarkdownTableSection';
|
|
23
|
+
export { default as MarkdownTableRow } from './MarkdownTableRow';
|
|
24
|
+
export { default as MarkdownTableCell } from './MarkdownTableCell';
|
|
25
|
+
export { default as MarkdownInlineCode } from './MarkdownInlineCode';
|
|
26
|
+
export { default as MarkdownCode } from './MarkdownCode';
|
|
27
|
+
export { default as CodeBlock } from './CodeBlock';
|
|
28
|
+
export { default as VueSyntaxHighlighter } from './VueSyntaxHighlighter';
|
|
29
|
+
export { default as MermaidBlock } from './MermaidBlock';
|
|
30
|
+
export { default as MermaidLiveEditor } from './MermaidLiveEditor';
|
|
31
|
+
export { default as MarkdownTaskItem } from './MarkdownTaskItem';
|
|
32
|
+
export { default as MarkdownFootnoteReference } from './MarkdownFootnoteReference';
|
|
33
|
+
export { default as MarkdownFootnotes } from './MarkdownFootnotes';
|
|
34
|
+
export { default as MarkdownMath } from './MarkdownMath';
|
|
35
|
+
export { default as MarkdownMermaid } from './MarkdownMermaid';
|
|
36
|
+
export { default as MarkdownBreak } from './MarkdownBreak';
|
|
37
|
+
export { default as MarkdownHtml } from './MarkdownHtml';
|
|
38
|
+
export { default as MarkdownCustomTag } from './MarkdownCustomTag';
|
|
39
|
+
export { default as MarkdownChildren } from './MarkdownChildren';
|
|
40
|
+
export * from './context';
|
|
41
|
+
export * from './config';
|
|
42
|
+
export * from './types';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { n as e, r as t, t as n } from "../chunks/config-aRYo2R8_.js";
|
|
2
|
+
import { n as r, r as i, t as a } from "../chunks/context-8NfW6fxI.js";
|
|
3
|
+
import { a as o, i as s, n as c, r as l } from "../chunks/render-DAqK0w5J.js";
|
|
4
|
+
import { t as u } from "../chunks/MarkdownCode-B1k9tmW5.js";
|
|
5
|
+
import { t as d } from "../chunks/MarkdownBlockquote-DVXziX2t.js";
|
|
6
|
+
import { t as f } from "../chunks/MarkdownBreak-BwCi2Itt.js";
|
|
7
|
+
import { t as p } from "../chunks/MarkdownCustomTag-lZJHsD6f.js";
|
|
8
|
+
import { t as m } from "../chunks/MarkdownEmphasis-CppivOEu.js";
|
|
9
|
+
import { t as h } from "../chunks/MarkdownHeading-DaNcP0_6.js";
|
|
10
|
+
import { t as g } from "../chunks/MarkdownHorizontalRule-QNe_cuUI.js";
|
|
11
|
+
import { t as _ } from "../chunks/MarkdownImage-BRy76svs.js";
|
|
12
|
+
import { t as v } from "../chunks/MarkdownInlineCode-MXZYFwex.js";
|
|
13
|
+
import { t as y } from "../chunks/MarkdownLink-Dbx3NwgV.js";
|
|
14
|
+
import { t as b } from "../chunks/MarkdownList-BJ-_C71k.js";
|
|
15
|
+
import { t as x } from "../chunks/MarkdownListItem-Z1EHIY26.js";
|
|
16
|
+
import { t as S } from "../chunks/MarkdownFootnoteReference-Dy3Khwyj.js";
|
|
17
|
+
import { t as C } from "../chunks/MarkdownFootnotes-BRPzkbXv.js";
|
|
18
|
+
import { t as w } from "../chunks/MarkdownParagraph-BxLSmSaG.js";
|
|
19
|
+
import { t as T } from "../chunks/MarkdownStrikethrough-CblvbqDk.js";
|
|
20
|
+
import { t as E } from "../chunks/MarkdownTaskItem-BcmKo1lk.js";
|
|
21
|
+
import { t as D } from "../chunks/MarkdownStrong-uU5MzAoJ.js";
|
|
22
|
+
import { t as O } from "../chunks/MarkdownTable-DmBTg_CR.js";
|
|
23
|
+
import { t as k } from "../chunks/MarkdownTableCell-eiCJe847.js";
|
|
24
|
+
import { t as A } from "../chunks/MarkdownTableRow-DuJaPntg.js";
|
|
25
|
+
import { t as j } from "../chunks/MarkdownTableSection-PFHz-R33.js";
|
|
26
|
+
import { n as M, t as N } from "../chunks/MarkdownRenderer-OlkdsvI3.js";
|
|
27
|
+
import { t as P } from "../chunks/MarkdownContent-BAK6dqo7.js";
|
|
28
|
+
import { t as F } from "../chunks/MarkdownEmpty-Av5k6bqa.js";
|
|
29
|
+
import { t as I } from "../chunks/MarkdownError-C0sPs5W0.js";
|
|
30
|
+
import { t as L } from "../chunks/MarkdownLoading-D-RYtXxf.js";
|
|
31
|
+
import { t as R } from "../chunks/MarkdownRoot-DEE6iVfh.js";
|
|
32
|
+
import { t as z } from "../chunks/MarkdownTocItem-DT9mR3vL.js";
|
|
33
|
+
import { t as B } from "../chunks/MarkdownToc-DHWWoH6t.js";
|
|
34
|
+
import { t as V } from "../chunks/MarkdownConfigProvider-5N3ylrIu.js";
|
|
35
|
+
import { t as H } from "../chunks/VueSyntaxHighlighter-BWpCO-cX.js";
|
|
36
|
+
import { t as U } from "../chunks/MermaidLiveEditor-1TKkI5bp.js";
|
|
37
|
+
import { t as W } from "../chunks/MarkdownHtml-66lYkvwM.js";
|
|
38
|
+
export { o as CodeBlock, n as MARKDOWN_CONFIG, d as MarkdownBlockquote, f as MarkdownBreak, M as MarkdownChildren, u as MarkdownCode, V as MarkdownConfigProvider, P as MarkdownContent, p as MarkdownCustomTag, m as MarkdownEmphasis, F as MarkdownEmpty, I as MarkdownError, S as MarkdownFootnoteReference, C as MarkdownFootnotes, h as MarkdownHeading, g as MarkdownHorizontalRule, W as MarkdownHtml, _ as MarkdownImage, v as MarkdownInlineCode, y as MarkdownLink, b as MarkdownList, x as MarkdownListItem, L as MarkdownLoading, s as MarkdownMath, c as MarkdownMermaid, w as MarkdownParagraph, N as MarkdownRenderer, R as MarkdownRoot, T as MarkdownStrikethrough, D as MarkdownStrong, O as MarkdownTable, k as MarkdownTableCell, A as MarkdownTableRow, j as MarkdownTableSection, E as MarkdownTaskItem, B as MarkdownToc, z as MarkdownTocItem, l as MermaidBlock, U as MermaidLiveEditor, a as RENDER_CONTEXT, H as VueSyntaxHighlighter, r as isEmptySlotContent, e as provideMarkdownConfig, t as useMarkdownConfig, i as useRenderContext };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Component, VNodeChild } from 'vue';
|
|
2
|
+
import { MarkdownNode } from '../core/types';
|
|
3
|
+
import { RenderContext } from './context';
|
|
4
|
+
/** Element tags that map to a semantic node kind. */
|
|
5
|
+
export declare const TAG_TO_KIND: Record<string, string>;
|
|
6
|
+
export declare function resolveTagComponent(tag: string, ctx: RenderContext): Component | string | undefined;
|
|
7
|
+
export declare function resolveKindComponent(kind: string, ctx: RenderContext): Component | string | undefined;
|
|
8
|
+
export declare function renderNode(node: MarkdownNode, ctx: RenderContext): VNodeChild;
|
|
9
|
+
export declare function renderNodes(nodes: readonly MarkdownNode[], ctx: RenderContext): VNodeChild[];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lock page scrolling for every fullscreen surface on the page. The original
|
|
3
|
+
* overflow is restored only when the last surface releases the lock.
|
|
4
|
+
*/
|
|
5
|
+
export declare function lockPageScroll(): void;
|
|
6
|
+
/** Release one page-scroll lock. Safe to call when the caller owns no lock. */
|
|
7
|
+
export declare function unlockPageScroll(): void;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Component, VNodeChild } from 'vue';
|
|
2
|
+
import { MarkdownDiagnostic, MarkdownDocument, MarkdownNode, MarkdownRegionComponents, MermaidRenderResult, SearchChangePayload, TocItem } from '../core/types';
|
|
3
|
+
import { CustomTagClickPayload, LinkClickPayload, RenderContext, TaskChangePayload } from './context';
|
|
4
|
+
/**
|
|
5
|
+
* Typed event map for `MarkdownRenderer`. Payloads are library-owned values:
|
|
6
|
+
* document models, diagnostics, primitives, or plain records. They never
|
|
7
|
+
* contain Vue components, VNodes, DOM nodes, or processor objects. Interaction
|
|
8
|
+
* events also carry the originating DOM `MouseEvent` so listeners can cancel
|
|
9
|
+
* the default behavior. Use the map with `defineEmits` in host wrappers when a
|
|
10
|
+
* single typed contract is preferable to learning each event shape separately.
|
|
11
|
+
*/
|
|
12
|
+
export interface MarkdownRendererEvents {
|
|
13
|
+
'update:source': [source: string];
|
|
14
|
+
'toc-change': [toc: TocItem[]];
|
|
15
|
+
'link-click': [payload: LinkClickPayload];
|
|
16
|
+
'custom-tag-click': [payload: CustomTagClickPayload];
|
|
17
|
+
'task-change': [payload: TaskChangePayload];
|
|
18
|
+
'search-change': [payload: SearchChangePayload];
|
|
19
|
+
'math-error': [diagnostic: MarkdownDiagnostic];
|
|
20
|
+
'render-error': [diagnostic: MarkdownDiagnostic];
|
|
21
|
+
ready: [document: MarkdownDocument];
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Typed event map for `MermaidBlock` and `MarkdownMermaid`. Primitive payloads
|
|
25
|
+
* are used for lightweight UI notifications; `rendered` carries the structured
|
|
26
|
+
* render result so a listener can read the sanitized nodes and SVG.
|
|
27
|
+
*/
|
|
28
|
+
export interface MermaidBlockEvents {
|
|
29
|
+
rendered: [result: MermaidRenderResult];
|
|
30
|
+
error: [message: string];
|
|
31
|
+
copy: [source: string];
|
|
32
|
+
export: [format: 'png' | 'svg'];
|
|
33
|
+
fullscreen: [active: boolean];
|
|
34
|
+
action: [key: string];
|
|
35
|
+
}
|
|
36
|
+
export type VueMarkdownTagComponents = Record<string, Component | string | undefined>;
|
|
37
|
+
export interface MarkdownNodeRenderContext {
|
|
38
|
+
node: MarkdownNode;
|
|
39
|
+
kind: MarkdownNode['kind'];
|
|
40
|
+
/** The element/custom tag, or `undefined` for semantic nodes. */
|
|
41
|
+
tag?: string;
|
|
42
|
+
/** A safe, always-present attribute map for element/custom nodes. */
|
|
43
|
+
attrs: Record<string, string>;
|
|
44
|
+
key: string;
|
|
45
|
+
children: () => VNodeChild;
|
|
46
|
+
defaultRender: () => VNodeChild;
|
|
47
|
+
context: RenderContext;
|
|
48
|
+
}
|
|
49
|
+
export type MarkdownNodeRenderer = (context: MarkdownNodeRenderContext) => VNodeChild;
|
|
50
|
+
export type VueMarkdownNodeComponents = Record<string, Component | string | MarkdownNodeRenderer | undefined>;
|
|
51
|
+
export type VueMarkdownRegionComponents = {
|
|
52
|
+
[K in keyof MarkdownRegionComponents]?: Component | string | undefined;
|
|
53
|
+
};
|
|
54
|
+
/** Exposed instance API of `MarkdownRenderer`. */
|
|
55
|
+
export interface MarkdownRendererInstance {
|
|
56
|
+
scrollToHeading(id: string, options?: ScrollIntoViewOptions): void;
|
|
57
|
+
getDocument(): MarkdownDocument | undefined;
|
|
58
|
+
getToc(): TocItem[];
|
|
59
|
+
refresh(): Promise<void>;
|
|
60
|
+
updateSource(source: string): void;
|
|
61
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { MaybeRefOrGetter } from 'vue';
|
|
2
|
+
export interface UseActiveHeadingOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Scope heading lookups to one rendered document root. Pass this when a
|
|
5
|
+
* page contains multiple renderers that may generate the same heading IDs.
|
|
6
|
+
*/
|
|
7
|
+
root?: MaybeRefOrGetter<Element | Document | null | undefined>;
|
|
8
|
+
}
|
|
9
|
+
/** Find an element by id inside a document or a scoped root element. */
|
|
10
|
+
export declare function findElementById(scope: Element | Document, id: string): HTMLElement | null;
|
|
11
|
+
/** Tracks the heading currently in view without touching the DOM before mount. */
|
|
12
|
+
export declare function useActiveHeading(ids: MaybeRefOrGetter<string[]>, enabled?: MaybeRefOrGetter<boolean>, options?: UseActiveHeadingOptions): import('vue').Ref<string | undefined, string | undefined>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ComputedRef, MaybeRefOrGetter, ShallowRef } from 'vue';
|
|
2
|
+
import { HighlightResult, MarkdownDiagnostic, MarkdownHighlighter, MarkdownTheme } from '../core/types';
|
|
3
|
+
export interface UseCodeHighlighterOptions {
|
|
4
|
+
source: MaybeRefOrGetter<string>;
|
|
5
|
+
language: MaybeRefOrGetter<string>;
|
|
6
|
+
highlighter?: MaybeRefOrGetter<MarkdownHighlighter | undefined>;
|
|
7
|
+
theme?: MaybeRefOrGetter<MarkdownTheme | undefined>;
|
|
8
|
+
/** Nearest provider or render-context theme, below the local `theme` prop. */
|
|
9
|
+
contextTheme?: MaybeRefOrGetter<MarkdownTheme | undefined>;
|
|
10
|
+
/** When false the highlighter is neither loaded nor run (for example, a region replacement). */
|
|
11
|
+
enabled?: MaybeRefOrGetter<boolean>;
|
|
12
|
+
/** Optional debounce in milliseconds. */
|
|
13
|
+
delay?: MaybeRefOrGetter<number>;
|
|
14
|
+
onDiagnostic?: (diagnostic: MarkdownDiagnostic) => void;
|
|
15
|
+
}
|
|
16
|
+
export interface UseCodeHighlighterReturn {
|
|
17
|
+
result: ShallowRef<HighlightResult>;
|
|
18
|
+
active: ShallowRef<MarkdownHighlighter | undefined>;
|
|
19
|
+
resolvedTheme: ComputedRef<MarkdownTheme>;
|
|
20
|
+
refresh: () => Promise<void>;
|
|
21
|
+
getHighlighted: () => HighlightResult;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Shared highlighter state for `CodeBlock` and `VueSyntaxHighlighter`.
|
|
25
|
+
*
|
|
26
|
+
* Keeping the lazy default adapter, theme mapping, readiness loading, and
|
|
27
|
+
* diagnostics in one place prevents the two public components from drifting
|
|
28
|
+
* apart as adapters are added.
|
|
29
|
+
*/
|
|
30
|
+
export declare function useCodeHighlighter(options: UseCodeHighlighterOptions): UseCodeHighlighterReturn;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ComputedRef, MaybeRefOrGetter, Ref } from 'vue';
|
|
2
|
+
import { HighlightLine, MarkdownNode } from '../core/types';
|
|
3
|
+
export interface VisibleLine {
|
|
4
|
+
index: number;
|
|
5
|
+
nodes: MarkdownNode[];
|
|
6
|
+
}
|
|
7
|
+
export interface UseLineWindowOptions {
|
|
8
|
+
nodes: MaybeRefOrGetter<readonly MarkdownNode[]>;
|
|
9
|
+
source: MaybeRefOrGetter<string>;
|
|
10
|
+
maxLines?: MaybeRefOrGetter<number>;
|
|
11
|
+
virtual?: MaybeRefOrGetter<boolean>;
|
|
12
|
+
virtualThreshold?: MaybeRefOrGetter<number>;
|
|
13
|
+
lineHeight?: MaybeRefOrGetter<number>;
|
|
14
|
+
highlightLines?: MaybeRefOrGetter<readonly HighlightLine[] | undefined>;
|
|
15
|
+
}
|
|
16
|
+
export interface UseLineWindowReturn {
|
|
17
|
+
highlightedLines: ComputedRef<MarkdownNode[][]>;
|
|
18
|
+
expanded: Ref<boolean>;
|
|
19
|
+
truncatable: ComputedRef<boolean>;
|
|
20
|
+
totalLines: ComputedRef<number>;
|
|
21
|
+
virtualActive: ComputedRef<boolean>;
|
|
22
|
+
startLine: ComputedRef<number>;
|
|
23
|
+
endLine: ComputedRef<number>;
|
|
24
|
+
visibleLines: ComputedRef<VisibleLine[]>;
|
|
25
|
+
lineHeight: ComputedRef<number>;
|
|
26
|
+
scrollRef: Ref<HTMLElement | undefined>;
|
|
27
|
+
onScroll: (event: Event) => void;
|
|
28
|
+
measure: () => void;
|
|
29
|
+
toggle: () => void;
|
|
30
|
+
isHighlightedLine: (index: number) => boolean;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Shared line windowing used by `CodeBlock` and `VueSyntaxHighlighter`.
|
|
34
|
+
*
|
|
35
|
+
* The composable owns only presentation state: split lines, truncation, and
|
|
36
|
+
* the visible window. Highlighting itself stays in `useCodeHighlighter`.
|
|
37
|
+
*/
|
|
38
|
+
export declare function useLineWindow(options: UseLineWindowOptions): UseLineWindowReturn;
|