@coderminer/vue-markdown 0.0.0-stage → 1.0.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/CHANGELOG.md +110 -0
- package/LICENSE +21 -0
- package/README.md +579 -3
- package/README.zh-CN.md +547 -0
- package/dist/chunks/MarkdownBlockquote-DVXziX2t.js +18 -0
- package/dist/chunks/MarkdownBlockquote-DVXziX2t.js.map +1 -0
- package/dist/chunks/MarkdownBreak-BwCi2Itt.js +18 -0
- package/dist/chunks/MarkdownBreak-BwCi2Itt.js.map +1 -0
- package/dist/chunks/MarkdownCode-B1k9tmW5.js +65 -0
- package/dist/chunks/MarkdownCode-B1k9tmW5.js.map +1 -0
- package/dist/chunks/MarkdownConfigProvider-5N3ylrIu.js +51 -0
- package/dist/chunks/MarkdownConfigProvider-5N3ylrIu.js.map +1 -0
- package/dist/chunks/MarkdownContent-BAK6dqo7.js +15 -0
- package/dist/chunks/MarkdownContent-BAK6dqo7.js.map +1 -0
- package/dist/chunks/MarkdownCustomTag-BBdn3-WO.js +42 -0
- package/dist/chunks/MarkdownCustomTag-BBdn3-WO.js.map +1 -0
- package/dist/chunks/MarkdownEmphasis-CppivOEu.js +18 -0
- package/dist/chunks/MarkdownEmphasis-CppivOEu.js.map +1 -0
- package/dist/chunks/MarkdownEmpty-Av5k6bqa.js +16 -0
- package/dist/chunks/MarkdownEmpty-Av5k6bqa.js.map +1 -0
- package/dist/chunks/MarkdownError-C0sPs5W0.js +19 -0
- package/dist/chunks/MarkdownError-C0sPs5W0.js.map +1 -0
- package/dist/chunks/MarkdownFootnoteReference-Dy3Khwyj.js +24 -0
- package/dist/chunks/MarkdownFootnoteReference-Dy3Khwyj.js.map +1 -0
- package/dist/chunks/MarkdownFootnotes-BRPzkbXv.js +23 -0
- package/dist/chunks/MarkdownFootnotes-BRPzkbXv.js.map +1 -0
- package/dist/chunks/MarkdownHeading-DaNcP0_6.js +31 -0
- package/dist/chunks/MarkdownHeading-DaNcP0_6.js.map +1 -0
- package/dist/chunks/MarkdownHorizontalRule-QNe_cuUI.js +18 -0
- package/dist/chunks/MarkdownHorizontalRule-QNe_cuUI.js.map +1 -0
- package/dist/chunks/MarkdownHtml-66lYkvwM.js +15 -0
- package/dist/chunks/MarkdownHtml-66lYkvwM.js.map +1 -0
- package/dist/chunks/MarkdownImage-BRy76svs.js +53 -0
- package/dist/chunks/MarkdownImage-BRy76svs.js.map +1 -0
- package/dist/chunks/MarkdownInlineCode-MXZYFwex.js +18 -0
- package/dist/chunks/MarkdownInlineCode-MXZYFwex.js.map +1 -0
- package/dist/chunks/MarkdownLink-Dbx3NwgV.js +47 -0
- package/dist/chunks/MarkdownLink-Dbx3NwgV.js.map +1 -0
- package/dist/chunks/MarkdownList-BJ-_C71k.js +22 -0
- package/dist/chunks/MarkdownList-BJ-_C71k.js.map +1 -0
- package/dist/chunks/MarkdownListItem-Z1EHIY26.js +18 -0
- package/dist/chunks/MarkdownListItem-Z1EHIY26.js.map +1 -0
- package/dist/chunks/MarkdownLoading-D-RYtXxf.js +17 -0
- package/dist/chunks/MarkdownLoading-D-RYtXxf.js.map +1 -0
- package/dist/chunks/MarkdownParagraph-BxLSmSaG.js +18 -0
- package/dist/chunks/MarkdownParagraph-BxLSmSaG.js.map +1 -0
- package/dist/chunks/MarkdownRenderer-DLRRfsdI.js +416 -0
- package/dist/chunks/MarkdownRenderer-DLRRfsdI.js.map +1 -0
- package/dist/chunks/MarkdownRoot-DEE6iVfh.js +25 -0
- package/dist/chunks/MarkdownRoot-DEE6iVfh.js.map +1 -0
- package/dist/chunks/MarkdownStrikethrough-CblvbqDk.js +18 -0
- package/dist/chunks/MarkdownStrikethrough-CblvbqDk.js.map +1 -0
- package/dist/chunks/MarkdownStrong-uU5MzAoJ.js +18 -0
- package/dist/chunks/MarkdownStrong-uU5MzAoJ.js.map +1 -0
- package/dist/chunks/MarkdownTable-DmBTg_CR.js +18 -0
- package/dist/chunks/MarkdownTable-DmBTg_CR.js.map +1 -0
- package/dist/chunks/MarkdownTableCell-eiCJe847.js +33 -0
- package/dist/chunks/MarkdownTableCell-eiCJe847.js.map +1 -0
- package/dist/chunks/MarkdownTableRow-DuJaPntg.js +18 -0
- package/dist/chunks/MarkdownTableRow-DuJaPntg.js.map +1 -0
- package/dist/chunks/MarkdownTableSection-PFHz-R33.js +26 -0
- package/dist/chunks/MarkdownTableSection-PFHz-R33.js.map +1 -0
- package/dist/chunks/MarkdownTaskItem-BcmKo1lk.js +40 -0
- package/dist/chunks/MarkdownTaskItem-BcmKo1lk.js.map +1 -0
- package/dist/chunks/MarkdownToc-BdOHF-Yo.js +51 -0
- package/dist/chunks/MarkdownToc-BdOHF-Yo.js.map +1 -0
- package/dist/chunks/MarkdownTocItem-DT9mR3vL.js +27 -0
- package/dist/chunks/MarkdownTocItem-DT9mR3vL.js.map +1 -0
- package/dist/chunks/MermaidLiveEditor-W-qf3G-5.js +416 -0
- package/dist/chunks/MermaidLiveEditor-W-qf3G-5.js.map +1 -0
- package/dist/chunks/VueSyntaxHighlighter-DyLsYMwy.js +262 -0
- package/dist/chunks/VueSyntaxHighlighter-DyLsYMwy.js.map +1 -0
- package/dist/chunks/adapters-CMwX_NEI.js +28 -0
- package/dist/chunks/adapters-CMwX_NEI.js.map +1 -0
- package/dist/chunks/asyncToGenerator-ChigusFD.js +26 -0
- package/dist/chunks/blank-line-Cb-JBP_5.js +90 -0
- package/dist/chunks/blank-line-Cb-JBP_5.js.map +1 -0
- package/dist/chunks/codemirror-DyphMAEg.js +84 -0
- package/dist/chunks/codemirror-DyphMAEg.js.map +1 -0
- package/dist/chunks/config-aRYo2R8_.js +12 -0
- package/dist/chunks/config-aRYo2R8_.js.map +1 -0
- package/dist/chunks/context-8NfW6fxI.js +32 -0
- package/dist/chunks/context-8NfW6fxI.js.map +1 -0
- package/dist/chunks/default-DWVS-I_8.js +23 -0
- package/dist/chunks/default-DWVS-I_8.js.map +1 -0
- package/dist/chunks/diagnostics-CtHoJyiX.js +25 -0
- package/dist/chunks/diagnostics-CtHoJyiX.js.map +1 -0
- package/dist/chunks/export-DZQ3cUry.js +1575 -0
- package/dist/chunks/export-DZQ3cUry.js.map +1 -0
- package/dist/chunks/hast-nodes-C0bX3M5Z.js +35 -0
- package/dist/chunks/hast-nodes-C0bX3M5Z.js.map +1 -0
- package/dist/chunks/highlightjs-BEh-YwEG.js +6041 -0
- package/dist/chunks/highlightjs-BEh-YwEG.js.map +1 -0
- package/dist/chunks/identity-jZEhX2d5.js +6244 -0
- package/dist/chunks/identity-jZEhX2d5.js.map +1 -0
- package/dist/chunks/labels-BtHiUTQI.js +49 -0
- package/dist/chunks/labels-BtHiUTQI.js.map +1 -0
- package/dist/chunks/lib-BQiWGWpu.js +5087 -0
- package/dist/chunks/lib-BQiWGWpu.js.map +1 -0
- package/dist/chunks/lib-LwqA_W3J.js +127 -0
- package/dist/chunks/lib-LwqA_W3J.js.map +1 -0
- package/dist/chunks/longest-streak-DZE_EqsU.js +10 -0
- package/dist/chunks/longest-streak-DZE_EqsU.js.map +1 -0
- package/dist/chunks/micromark-factory-space-Db040TnW.js +139 -0
- package/dist/chunks/micromark-factory-space-Db040TnW.js.map +1 -0
- package/dist/chunks/normalize-CRYv3Wqt.js +220 -0
- package/dist/chunks/normalize-CRYv3Wqt.js.map +1 -0
- package/dist/chunks/objectSpread2-CtBNx0TF.js +57 -0
- package/dist/chunks/plugin-DqkFHyny.js +28 -0
- package/dist/chunks/plugin-DqkFHyny.js.map +1 -0
- package/dist/chunks/preset-BjaOuJUL.js +46 -0
- package/dist/chunks/preset-BjaOuJUL.js.map +1 -0
- package/dist/chunks/registry-DLjr93-V.js +6144 -0
- package/dist/chunks/registry-DLjr93-V.js.map +1 -0
- package/dist/chunks/render-Cs8iKrgz.js +1724 -0
- package/dist/chunks/render-Cs8iKrgz.js.map +1 -0
- package/dist/chunks/runtime-DJMnzjah.js +546 -0
- package/dist/chunks/runtime-DJMnzjah.js.map +1 -0
- package/dist/chunks/security-y4EwUyAs.js +214 -0
- package/dist/chunks/security-y4EwUyAs.js.map +1 -0
- package/dist/chunks/shared-DNAvZ-UY.js +76 -0
- package/dist/chunks/shared-DNAvZ-UY.js.map +1 -0
- package/dist/chunks/space-separated-tokens-CmBjEPdR.js +1099 -0
- package/dist/chunks/space-separated-tokens-CmBjEPdR.js.map +1 -0
- package/dist/chunks/url-D2BoivaE.js +26 -0
- package/dist/chunks/url-D2BoivaE.js.map +1 -0
- package/dist/chunks/useActiveHeading-BaGVMJnB.js +316 -0
- package/dist/chunks/useActiveHeading-BaGVMJnB.js.map +1 -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 +170 -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 +29 -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 +23 -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 +6 -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 +27 -0
- package/dist/core/parts.d.ts +135 -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 +6 -0
- package/dist/core/types.d.ts +390 -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/highlightjs.d.ts +7 -0
- package/dist/highlight/index.d.ts +3 -0
- package/dist/highlight/index.js +3 -0
- package/dist/highlight/shared.d.ts +16 -0
- package/dist/highlight/shiki.d.ts +7 -0
- package/dist/highlight/shiki.js +76 -0
- package/dist/highlight/shiki.js.map +1 -0
- package/dist/html/index.d.ts +17 -0
- package/dist/html/index.js +13 -0
- package/dist/html/index.js.map +1 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.js +55 -0
- package/dist/index.js.map +1 -0
- package/dist/math/index.d.ts +4 -0
- package/dist/math/index.js +583 -0
- package/dist/math/index.js.map +1 -0
- package/dist/math/katex.d.ts +4 -0
- package/dist/math/plugin.d.ts +20 -0
- package/dist/mermaid/index.d.ts +5 -0
- package/dist/mermaid/index.js +3 -0
- package/dist/mermaid/plugin.d.ts +14 -0
- package/dist/mermaid/runtime.d.ts +12 -0
- package/dist/mermaid/sanitize.d.ts +12 -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 +712 -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 +211 -6
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { InjectionKey, Slot, VNodeChild } from 'vue';
|
|
2
|
+
import { DiagnosticFormatter, MarkdownComponentValue, MarkdownDocument, 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: string;
|
|
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-Cs8iKrgz.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-BBdn3-WO.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-DLRRfsdI.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-BdOHF-Yo.js";
|
|
34
|
+
import { t as V } from "../chunks/MarkdownConfigProvider-5N3ylrIu.js";
|
|
35
|
+
import { t as H } from "../chunks/VueSyntaxHighlighter-DyLsYMwy.js";
|
|
36
|
+
import { t as U } from "../chunks/MermaidLiveEditor-W-qf3G-5.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,29 @@
|
|
|
1
|
+
import { Component, VNodeChild } from 'vue';
|
|
2
|
+
import { MarkdownDocument, MarkdownNode, MarkdownRegionComponents, TocItem } from '../core/types';
|
|
3
|
+
import { RenderContext } from './context';
|
|
4
|
+
export type VueMarkdownTagComponents = Record<string, Component | string | undefined>;
|
|
5
|
+
export interface MarkdownNodeRenderContext {
|
|
6
|
+
node: MarkdownNode;
|
|
7
|
+
kind: MarkdownNode['kind'];
|
|
8
|
+
/** The element/custom tag, or `undefined` for semantic nodes. */
|
|
9
|
+
tag?: string;
|
|
10
|
+
/** A safe, always-present attribute map for element/custom nodes. */
|
|
11
|
+
attrs: Record<string, string>;
|
|
12
|
+
key: string;
|
|
13
|
+
children: () => VNodeChild;
|
|
14
|
+
defaultRender: () => VNodeChild;
|
|
15
|
+
context: RenderContext;
|
|
16
|
+
}
|
|
17
|
+
export type MarkdownNodeRenderer = (context: MarkdownNodeRenderContext) => VNodeChild;
|
|
18
|
+
export type VueMarkdownNodeComponents = Record<string, Component | string | MarkdownNodeRenderer | undefined>;
|
|
19
|
+
export type VueMarkdownRegionComponents = {
|
|
20
|
+
[K in keyof MarkdownRegionComponents]?: Component | string | undefined;
|
|
21
|
+
};
|
|
22
|
+
/** Exposed instance API of `MarkdownRenderer`. */
|
|
23
|
+
export interface MarkdownRendererInstance {
|
|
24
|
+
scrollToHeading(id: string, options?: ScrollIntoViewOptions): void;
|
|
25
|
+
getDocument(): MarkdownDocument | undefined;
|
|
26
|
+
getToc(): TocItem[];
|
|
27
|
+
refresh(): Promise<void>;
|
|
28
|
+
updateSource(source: string): void;
|
|
29
|
+
}
|
|
@@ -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;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ComputedRef, MaybeRefOrGetter, ShallowRef } from 'vue';
|
|
2
|
+
import { MarkdownDiagnostic, MarkdownDocument, MarkdownDocumentOptions, MarkdownLabels, MarkdownNodeComponents, MarkdownRegionComponents, MarkdownTagComponents, TocItem } from '../core/types';
|
|
3
|
+
export type MarkdownStatus = 'idle' | 'pending' | 'ready' | 'error';
|
|
4
|
+
export interface UseMarkdownDocumentReturn {
|
|
5
|
+
document: ShallowRef<MarkdownDocument | undefined>;
|
|
6
|
+
toc: ComputedRef<TocItem[]>;
|
|
7
|
+
status: ShallowRef<MarkdownStatus>;
|
|
8
|
+
diagnostics: ShallowRef<MarkdownDiagnostic[]>;
|
|
9
|
+
pipeline: ComputedRef<string>;
|
|
10
|
+
plugins: ComputedRef<string[]>;
|
|
11
|
+
/** Tag components contributed by plugins; local props are merged by the host. */
|
|
12
|
+
resolvedComponents: ComputedRef<MarkdownTagComponents>;
|
|
13
|
+
/** Semantic node components contributed by plugins. */
|
|
14
|
+
resolvedNodeComponents: ComputedRef<MarkdownNodeComponents>;
|
|
15
|
+
/** Structural regions contributed by plugins. */
|
|
16
|
+
resolvedRegions: ComputedRef<MarkdownRegionComponents>;
|
|
17
|
+
/** Labels contributed by plugins. */
|
|
18
|
+
resolvedLabels: ComputedRef<Partial<MarkdownLabels>>;
|
|
19
|
+
/** Design tokens contributed by plugins. */
|
|
20
|
+
resolvedTokens: ComputedRef<Record<string, string>>;
|
|
21
|
+
refresh: () => Promise<void>;
|
|
22
|
+
}
|
|
23
|
+
export declare function useMarkdownDocument(source: MaybeRefOrGetter<string>, options?: MaybeRefOrGetter<MarkdownDocumentOptions>): UseMarkdownDocumentReturn;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DiagnosticFormatter, MarkdownHighlighter, MarkdownSlugger, MarkdownUrlTransform, MathEngine, MermaidRenderer } from './types';
|
|
2
|
+
export declare function isValidHighlighter(value: unknown): value is MarkdownHighlighter;
|
|
3
|
+
export declare function isValidMathEngine(value: unknown): value is MathEngine;
|
|
4
|
+
export declare function isValidMermaidRenderer(value: unknown): value is MermaidRenderer;
|
|
5
|
+
export declare function isValidDiagnosticFormatter(value: unknown): value is DiagnosticFormatter;
|
|
6
|
+
export declare function isValidSlugger(value: unknown): value is MarkdownSlugger;
|
|
7
|
+
export declare function isValidUrlTransform(value: unknown): value is MarkdownUrlTransform;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { MarkdownConfig, MarkdownPreset } from './types';
|
|
2
|
+
/** Merge configuration maps with `next` taking precedence. */
|
|
3
|
+
export declare function mergeMarkdownConfig(base: MarkdownConfig | undefined, next: MarkdownConfig | undefined): MarkdownConfig;
|
|
4
|
+
/** Merge presets; later presets win and plugins are appended in order. */
|
|
5
|
+
export declare function mergeMarkdownPreset(base: MarkdownPreset | undefined, next: MarkdownPreset): MarkdownPreset;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { MarkdownDiagnostic, DiagnosticPhase, SourceRange } from './types';
|
|
2
|
+
export declare function createDiagnostic(code: string, message: string, options?: {
|
|
3
|
+
severity?: MarkdownDiagnostic['severity'];
|
|
4
|
+
phase?: DiagnosticPhase;
|
|
5
|
+
plugin?: string;
|
|
6
|
+
source?: SourceRange;
|
|
7
|
+
details?: string;
|
|
8
|
+
}): MarkdownDiagnostic;
|
|
9
|
+
export declare function errorMessage(error: unknown): string;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { MarkdownDiagnostic, MarkdownDocument, MarkdownDocumentOptions, MarkdownSlugger, PipelineResult } from './types';
|
|
2
|
+
import { ResolvedPlugins } from '../plugins/registry';
|
|
3
|
+
export interface FinalizeDocumentOptions {
|
|
4
|
+
source: string;
|
|
5
|
+
result: PipelineResult;
|
|
6
|
+
options: MarkdownDocumentOptions;
|
|
7
|
+
plugins: ResolvedPlugins;
|
|
8
|
+
pipelineName: string;
|
|
9
|
+
slugger: MarkdownSlugger;
|
|
10
|
+
idPrefix: string;
|
|
11
|
+
diagnostics: MarkdownDiagnostic[];
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Turn a pipeline result into the public document model. Both the reactive
|
|
15
|
+
* composable and static export use this path so filtering, URL policy, heading
|
|
16
|
+
* IDs, and plugin document transforms cannot diverge.
|
|
17
|
+
*/
|
|
18
|
+
export declare function finalizeMarkdownDocument(input: FinalizeDocumentOptions): MarkdownDocument;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { RootContent } from 'hast';
|
|
2
|
+
import { MarkdownNode } from './types';
|
|
3
|
+
/** Convert an already-parsed trusted hast subtree into normalized nodes. */
|
|
4
|
+
export declare function hastToMarkdownNodes(nodes: readonly RootContent[]): MarkdownNode[];
|
|
5
|
+
/** Convert trusted engine HTML into normalized nodes. */
|
|
6
|
+
export declare function htmlToMarkdownNodes(html: string): MarkdownNode[];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { HighlightLine } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Expand numeric lines and `start-end` ranges into a lookup set.
|
|
4
|
+
*
|
|
5
|
+
* Invalid, zero, negative, and reversed entries are ignored. Plain numeric
|
|
6
|
+
* strings are treated as a single line.
|
|
7
|
+
*/
|
|
8
|
+
export declare function resolveHighlightedLines(values: readonly HighlightLine[] | undefined): Set<number>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Stable process-local identity for objects and functions. */
|
|
2
|
+
export declare function identityOf(value: unknown): string;
|
|
3
|
+
export declare function listIdentity(list: readonly unknown[] | undefined): string;
|
|
4
|
+
export declare function stringListIdentity(list: readonly string[] | undefined): string;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { MarkdownLabelContext, MarkdownLabelValue, MarkdownLabels } from '../core/types';
|
|
2
|
+
/** Resolve a static or context-aware label value. */
|
|
3
|
+
export declare function resolveLabel(value: MarkdownLabelValue, context?: MarkdownLabelContext): string;
|
|
4
|
+
export declare const DEFAULT_LABELS: MarkdownLabels;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { MarkdownPart } from './parts';
|
|
2
|
+
/**
|
|
3
|
+
* Machine-readable customization manifest for one public component.
|
|
4
|
+
*
|
|
5
|
+
* Manifests are Vue-free so documentation, the demo inspector, and validation
|
|
6
|
+
* tests can consume them without importing component code.
|
|
7
|
+
*/
|
|
8
|
+
export interface MarkdownComponentManifest {
|
|
9
|
+
name: string;
|
|
10
|
+
parts: readonly MarkdownPart[];
|
|
11
|
+
tokens: readonly string[];
|
|
12
|
+
slots: readonly string[];
|
|
13
|
+
labels: readonly string[];
|
|
14
|
+
overrideKeys: readonly string[];
|
|
15
|
+
tags?: readonly string[];
|
|
16
|
+
behaviors?: readonly string[];
|
|
17
|
+
}
|
|
18
|
+
export type ManifestIssueCode = 'duplicate-manifest' | 'undeclared-part' | 'missing-part' | 'undeclared-label' | 'missing-slot';
|
|
19
|
+
export interface ManifestValidationIssue {
|
|
20
|
+
code: ManifestIssueCode;
|
|
21
|
+
component: string;
|
|
22
|
+
message: string;
|
|
23
|
+
}
|
|
24
|
+
export interface ManifestRenderSnapshot {
|
|
25
|
+
parts?: readonly string[];
|
|
26
|
+
labels?: readonly string[];
|
|
27
|
+
slots?: readonly string[];
|
|
28
|
+
/** `strict` also requires every declared part to be rendered. */
|
|
29
|
+
mode?: 'strict' | 'observed';
|
|
30
|
+
}
|
|
31
|
+
export declare const COMPONENT_MANIFESTS: Record<string, MarkdownComponentManifest>;
|
|
32
|
+
export declare function getComponentManifest(name: string): MarkdownComponentManifest | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* Compare a manifest with rendered output. Missing snapshot fields are skipped
|
|
35
|
+
* so a test can validate only the parts, labels, or slots it can observe.
|
|
36
|
+
*/
|
|
37
|
+
export declare function validateManifest(entry: MarkdownComponentManifest, snapshot: ManifestRenderSnapshot): ManifestValidationIssue[];
|
|
38
|
+
export declare function validateManifestRegistry(manifests?: Record<string, MarkdownComponentManifest>): ManifestValidationIssue[];
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { MarkdownDocument } from './types';
|
|
2
|
+
export declare function memoGet(key: string): MarkdownDocument | undefined;
|
|
3
|
+
export declare function memoSet(key: string, document: MarkdownDocument): void;
|
|
4
|
+
export declare function memoClear(): void;
|
|
5
|
+
export declare function memoSize(): number;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Root } from 'hast';
|
|
2
|
+
import { MarkdownDocument } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Serialize the normalized document model back to hast for static export.
|
|
5
|
+
* The model has already passed sanitization, filtering, URL policy, and plugin
|
|
6
|
+
* document transforms, so this function performs no new trust decisions.
|
|
7
|
+
*/
|
|
8
|
+
export declare function modelToHast(document: MarkdownDocument): Root;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { MarkdownDocument, MarkdownNode } from './types';
|
|
2
|
+
export interface BuildDocumentOptions {
|
|
3
|
+
nodes: MarkdownNode[];
|
|
4
|
+
plugins: string[];
|
|
5
|
+
pipeline: string;
|
|
6
|
+
frontmatter?: Record<string, unknown>;
|
|
7
|
+
}
|
|
8
|
+
export declare function buildDocument(options: BuildDocumentOptions): MarkdownDocument;
|
|
9
|
+
/** Recompute derived collections after a document transform. */
|
|
10
|
+
export declare function withDerivedDocument(document: MarkdownDocument): MarkdownDocument;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Root } from 'hast';
|
|
2
|
+
import { AllowElement, MarkdownDiagnostic, MarkdownDocument, MarkdownNode, MarkdownSlugger, MarkdownUrlTransform, TocItem } from './types';
|
|
3
|
+
export interface NormalizeOptions {
|
|
4
|
+
slugger: MarkdownSlugger;
|
|
5
|
+
idPrefix?: string;
|
|
6
|
+
urlTransform?: MarkdownUrlTransform;
|
|
7
|
+
baseUrl?: string;
|
|
8
|
+
allowedElements?: string[];
|
|
9
|
+
disallowedElements?: string[];
|
|
10
|
+
unwrapDisallowed?: boolean;
|
|
11
|
+
allowElement?: AllowElement;
|
|
12
|
+
diagnostics?: MarkdownDiagnostic[];
|
|
13
|
+
}
|
|
14
|
+
export interface NormalizeResult {
|
|
15
|
+
nodes: MarkdownNode[];
|
|
16
|
+
toc: TocItem[];
|
|
17
|
+
customTags: MarkdownDocument['customTags'];
|
|
18
|
+
}
|
|
19
|
+
export declare function normalizeHast(root: Root, options: NormalizeOptions): NormalizeResult;
|
|
20
|
+
/**
|
|
21
|
+
* Keep headings up to `depth`. A missing, zero, negative, or non-finite depth
|
|
22
|
+
* means all available levels. Values above six are also effectively unlimited.
|
|
23
|
+
*/
|
|
24
|
+
export declare function filterTocByDepth(toc: readonly TocItem[], depth: number | undefined): TocItem[];
|
|
25
|
+
export declare function extractToc(nodes: readonly MarkdownNode[]): TocItem[];
|
|
26
|
+
export declare function collectCustomTags(nodes: readonly MarkdownNode[]): MarkdownDocument['customTags'];
|
|
27
|
+
export declare function walkNodes(nodes: readonly MarkdownNode[], visit: (node: MarkdownNode, parent: MarkdownNode | undefined) => void, parent?: MarkdownNode): void;
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stable part names and token names.
|
|
3
|
+
*
|
|
4
|
+
* Parts are rendered as `class="vmd-<part>"` plus `data-vmd-part="<part>"`.
|
|
5
|
+
* They are stable within a major version and are never generated or hashed.
|
|
6
|
+
*/
|
|
7
|
+
export declare const VMD_CLASS_PREFIX = "vmd-";
|
|
8
|
+
export declare const PARTS: {
|
|
9
|
+
readonly root: "root";
|
|
10
|
+
readonly body: "body";
|
|
11
|
+
readonly tocColumn: "toc-column";
|
|
12
|
+
readonly content: "content";
|
|
13
|
+
readonly toc: "toc";
|
|
14
|
+
readonly tocNav: "toc-nav";
|
|
15
|
+
readonly tocItem: "toc-item";
|
|
16
|
+
readonly paragraph: "paragraph";
|
|
17
|
+
readonly heading: "heading";
|
|
18
|
+
readonly headingAnchor: "heading-anchor";
|
|
19
|
+
readonly emphasis: "emphasis";
|
|
20
|
+
readonly strong: "strong";
|
|
21
|
+
readonly strikethrough: "strikethrough";
|
|
22
|
+
readonly link: "link";
|
|
23
|
+
readonly image: "image";
|
|
24
|
+
readonly list: "list";
|
|
25
|
+
readonly listItem: "list-item";
|
|
26
|
+
readonly blockquote: "blockquote";
|
|
27
|
+
readonly hr: "hr";
|
|
28
|
+
readonly break: "break";
|
|
29
|
+
readonly table: "table";
|
|
30
|
+
readonly tableSection: "table-section";
|
|
31
|
+
readonly tableRow: "table-row";
|
|
32
|
+
readonly tableCell: "table-cell";
|
|
33
|
+
readonly inlineCode: "inline-code";
|
|
34
|
+
readonly code: "code";
|
|
35
|
+
readonly codeHeader: "code-header";
|
|
36
|
+
readonly codeTitle: "code-title";
|
|
37
|
+
readonly codeFileName: "code-file-name";
|
|
38
|
+
readonly codeHeading: "code-heading";
|
|
39
|
+
readonly codeLang: "code-lang";
|
|
40
|
+
readonly codeToolbar: "code-toolbar";
|
|
41
|
+
readonly codeActions: "code-actions";
|
|
42
|
+
readonly codeAction: "code-action";
|
|
43
|
+
readonly codeBody: "code-body";
|
|
44
|
+
readonly codeFeedback: "code-feedback";
|
|
45
|
+
readonly highlighter: "highlighter";
|
|
46
|
+
readonly highlighterHeader: "highlighter-header";
|
|
47
|
+
readonly highlighterActions: "highlighter-actions";
|
|
48
|
+
readonly highlighterFooter: "highlighter-footer";
|
|
49
|
+
readonly highlighterBody: "highlighter-body";
|
|
50
|
+
readonly highlighterGutter: "highlighter-gutter";
|
|
51
|
+
readonly highlighterLine: "highlighter-line";
|
|
52
|
+
readonly highlighterHidden: "highlighter-hidden";
|
|
53
|
+
readonly highlighterEmpty: "highlighter-empty";
|
|
54
|
+
readonly highlighterToggle: "highlighter-toggle";
|
|
55
|
+
readonly math: "math";
|
|
56
|
+
readonly mathError: "math-error";
|
|
57
|
+
readonly mermaid: "mermaid";
|
|
58
|
+
readonly mermaidHeader: "mermaid-header";
|
|
59
|
+
readonly mermaidTabs: "mermaid-tabs";
|
|
60
|
+
readonly mermaidActions: "mermaid-actions";
|
|
61
|
+
readonly mermaidAction: "mermaid-action";
|
|
62
|
+
readonly mermaidPreview: "mermaid-preview";
|
|
63
|
+
readonly mermaidSource: "mermaid-source";
|
|
64
|
+
readonly mermaidPending: "mermaid-pending";
|
|
65
|
+
readonly mermaidError: "mermaid-error";
|
|
66
|
+
readonly mermaidFallback: "mermaid-fallback";
|
|
67
|
+
readonly mermaidFullscreen: "mermaid-fullscreen";
|
|
68
|
+
readonly editor: "editor";
|
|
69
|
+
readonly editorPane: "editor-pane";
|
|
70
|
+
readonly editorDivider: "editor-divider";
|
|
71
|
+
readonly editorPreview: "editor-preview";
|
|
72
|
+
readonly editorDiagnostics: "editor-diagnostics";
|
|
73
|
+
readonly editorEmpty: "editor-empty";
|
|
74
|
+
readonly editorToolbar: "editor-toolbar";
|
|
75
|
+
readonly editorFullscreen: "editor-fullscreen";
|
|
76
|
+
readonly html: "html";
|
|
77
|
+
readonly customTag: "custom-tag";
|
|
78
|
+
readonly taskItem: "task-item";
|
|
79
|
+
readonly taskCheckbox: "task-checkbox";
|
|
80
|
+
readonly footnoteReference: "footnote-reference";
|
|
81
|
+
readonly footnotes: "footnotes";
|
|
82
|
+
readonly searchMatch: "search-match";
|
|
83
|
+
readonly error: "error";
|
|
84
|
+
readonly empty: "empty";
|
|
85
|
+
readonly loading: "loading";
|
|
86
|
+
};
|
|
87
|
+
export type MarkdownPart = (typeof PARTS)[keyof typeof PARTS];
|
|
88
|
+
export declare const TOKENS: {
|
|
89
|
+
readonly fontFamily: "--vmd-font-family";
|
|
90
|
+
readonly fontMono: "--vmd-font-mono";
|
|
91
|
+
readonly fontSize: "--vmd-font-size";
|
|
92
|
+
readonly lineHeight: "--vmd-line-height";
|
|
93
|
+
readonly colorText: "--vmd-color-text";
|
|
94
|
+
readonly colorMuted: "--vmd-color-muted";
|
|
95
|
+
readonly colorBg: "--vmd-color-bg";
|
|
96
|
+
readonly colorSurface: "--vmd-color-surface";
|
|
97
|
+
readonly colorBorder: "--vmd-color-border";
|
|
98
|
+
readonly colorAccent: "--vmd-color-accent";
|
|
99
|
+
readonly colorAccentContrast: "--vmd-color-accent-contrast";
|
|
100
|
+
readonly colorDanger: "--vmd-color-danger";
|
|
101
|
+
readonly colorSuccess: "--vmd-color-success";
|
|
102
|
+
readonly space1: "--vmd-space-1";
|
|
103
|
+
readonly space2: "--vmd-space-2";
|
|
104
|
+
readonly space3: "--vmd-space-3";
|
|
105
|
+
readonly space4: "--vmd-space-4";
|
|
106
|
+
readonly space5: "--vmd-space-5";
|
|
107
|
+
readonly space6: "--vmd-space-6";
|
|
108
|
+
readonly radiusSm: "--vmd-radius-sm";
|
|
109
|
+
readonly radiusMd: "--vmd-radius-md";
|
|
110
|
+
readonly radiusLg: "--vmd-radius-lg";
|
|
111
|
+
readonly shadowSm: "--vmd-shadow-sm";
|
|
112
|
+
readonly shadowMd: "--vmd-shadow-md";
|
|
113
|
+
readonly motionDuration: "--vmd-motion-duration";
|
|
114
|
+
readonly motionEasing: "--vmd-motion-easing";
|
|
115
|
+
readonly codeBg: "--vmd-code-bg";
|
|
116
|
+
readonly codeText: "--vmd-code-text";
|
|
117
|
+
readonly codeBorder: "--vmd-code-border";
|
|
118
|
+
readonly codeToolbarBg: "--vmd-code-toolbar-bg";
|
|
119
|
+
readonly mathColor: "--vmd-math-color";
|
|
120
|
+
readonly mathBg: "--vmd-math-bg";
|
|
121
|
+
readonly mermaidBg: "--vmd-mermaid-bg";
|
|
122
|
+
readonly mermaidBorder: "--vmd-mermaid-border";
|
|
123
|
+
readonly zFullscreen: "--vmd-z-fullscreen";
|
|
124
|
+
};
|
|
125
|
+
export type MarkdownToken = (typeof TOKENS)[keyof typeof TOKENS];
|
|
126
|
+
export interface PartAttributes {
|
|
127
|
+
class: string;
|
|
128
|
+
'data-vmd-part': string;
|
|
129
|
+
}
|
|
130
|
+
/** Build the class and `data-vmd-part` attributes for a documented part. */
|
|
131
|
+
export declare function partAttrs(part: MarkdownPart): PartAttributes;
|
|
132
|
+
/** Merge part attributes with host-provided class names. */
|
|
133
|
+
export declare function partClass(part: MarkdownPart, extra?: string): string;
|
|
134
|
+
export declare const PART_NAMES: readonly MarkdownPart[];
|
|
135
|
+
export declare const TOKEN_NAMES: readonly MarkdownToken[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { MarkdownPreset } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Define a shareable preset. Presets contain components, plugin instances, and
|
|
4
|
+
* functions, so they are declarative and inspectable but not JSON-serializable.
|
|
5
|
+
*/
|
|
6
|
+
export declare function defineMarkdownPreset(preset: MarkdownPreset): MarkdownPreset;
|
|
7
|
+
/** Compose presets in order; later presets override earlier values. */
|
|
8
|
+
export declare function composePresets(...presets: Array<MarkdownPreset | false | null | undefined>): MarkdownPreset;
|
|
9
|
+
/** Resolve a single preset, a preset list, or nothing. */
|
|
10
|
+
export declare function resolvePreset(input: MarkdownPreset | readonly MarkdownPreset[] | undefined): MarkdownPreset | undefined;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { MarkdownDiagnostic, MarkdownDocumentOptions, MarkdownPipeline, MarkdownSlugger, PipelineContext } from './types';
|
|
2
|
+
import { ResolvedPlugins } from '../plugins/registry';
|
|
3
|
+
export interface MarkdownRun {
|
|
4
|
+
pipeline: MarkdownPipeline;
|
|
5
|
+
plugins: ResolvedPlugins;
|
|
6
|
+
source: string;
|
|
7
|
+
context: PipelineContext;
|
|
8
|
+
slugger: MarkdownSlugger;
|
|
9
|
+
diagnostics: MarkdownDiagnostic[];
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Resolve and prepare one non-reactive pipeline run. Export uses this helper so
|
|
13
|
+
* source transforms, plugin resolution, and slugger setup match the
|
|
14
|
+
* composable's run.
|
|
15
|
+
*/
|
|
16
|
+
export declare function prepareMarkdownRun(source: string, options?: MarkdownDocumentOptions, diagnostics?: MarkdownDiagnostic[]): MarkdownRun;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { MarkdownDocument, MarkdownNode, SearchOptions } from './types';
|
|
2
|
+
/** Split text nodes into match/non-match segments without changing structure. */
|
|
3
|
+
export declare function segmentSearch(nodes: readonly MarkdownNode[], options: SearchOptions): void;
|
|
4
|
+
export declare function searchDocument(document: MarkdownDocument, options: SearchOptions): MarkdownDocument;
|
|
5
|
+
export declare function countSearchMatches(nodes: readonly MarkdownNode[]): number;
|