@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,260 @@
|
|
|
1
|
+
import { n as e } from "./labels-BtHiUTQI.js";
|
|
2
|
+
import { n as t, t as n } from "./diagnostics-CtHoJyiX.js";
|
|
3
|
+
import { t as r } from "./asyncToGenerator-ChigusFD.js";
|
|
4
|
+
import { r as i } from "./config-aRYo2R8_.js";
|
|
5
|
+
import { n as a, r as o } from "./context-8NfW6fxI.js";
|
|
6
|
+
import { o as s, s as c, t as l } from "./render-DAqK0w5J.js";
|
|
7
|
+
import { computed as u, createElementBlock as d, createElementVNode as f, createVNode as p, defineComponent as m, h, normalizeStyle as g, openBlock as _, unref as v, useSlots as y } from "vue";
|
|
8
|
+
// src/components/VueSyntaxHighlighter.vue?vue&type=script&setup=true&lang.ts
|
|
9
|
+
var b = [
|
|
10
|
+
"data-vmd-theme",
|
|
11
|
+
"data-language",
|
|
12
|
+
"data-highlighter",
|
|
13
|
+
"data-virtual"
|
|
14
|
+
], x = {
|
|
15
|
+
"data-vmd-part": "highlighter-body",
|
|
16
|
+
class: "vmd-highlighter-body"
|
|
17
|
+
}, S = /* @__PURE__ */ m({
|
|
18
|
+
__name: "VueSyntaxHighlighter",
|
|
19
|
+
props: {
|
|
20
|
+
source: {},
|
|
21
|
+
language: { default: "" },
|
|
22
|
+
theme: { default: void 0 },
|
|
23
|
+
highlighter: { default: void 0 },
|
|
24
|
+
lineNumbers: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: !1
|
|
27
|
+
},
|
|
28
|
+
highlightLines: { default: () => [] },
|
|
29
|
+
maxLines: { default: 0 },
|
|
30
|
+
virtual: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: !1
|
|
33
|
+
},
|
|
34
|
+
virtualThreshold: { default: 200 },
|
|
35
|
+
lineHeight: { default: 20 },
|
|
36
|
+
delay: { default: 0 }
|
|
37
|
+
},
|
|
38
|
+
emits: ["copy", "error"],
|
|
39
|
+
setup(S, { expose: C, emit: w }) {
|
|
40
|
+
let T = S, E = w, D = o(), O = i(), k = y();
|
|
41
|
+
function A(e) {
|
|
42
|
+
var t;
|
|
43
|
+
(t = D.onRenderError) == null || t.call(D, e), E("error", e);
|
|
44
|
+
}
|
|
45
|
+
let { result: j, active: M, resolvedTheme: N, getHighlighted: P } = c({
|
|
46
|
+
source: () => T.source,
|
|
47
|
+
language: () => T.language,
|
|
48
|
+
highlighter: () => {
|
|
49
|
+
var e, t;
|
|
50
|
+
return (e = (t = T.highlighter) == null ? D.highlighter : t) == null ? O.value.highlighter : e;
|
|
51
|
+
},
|
|
52
|
+
theme: () => T.theme,
|
|
53
|
+
contextTheme: () => {
|
|
54
|
+
var e;
|
|
55
|
+
return (e = D.theme) == null ? O.value.theme : e;
|
|
56
|
+
},
|
|
57
|
+
delay: () => T.delay,
|
|
58
|
+
onDiagnostic: A
|
|
59
|
+
}), { expanded: F, truncatable: I, totalLines: L, virtualActive: R, startLine: z, endLine: B, visibleLines: V, lineHeight: H, scrollRef: U, onScroll: W, toggle: G, isHighlightedLine: K } = s({
|
|
60
|
+
nodes: () => j.value.nodes,
|
|
61
|
+
source: () => T.source,
|
|
62
|
+
maxLines: () => T.maxLines,
|
|
63
|
+
virtual: () => T.virtual,
|
|
64
|
+
virtualThreshold: () => T.virtualThreshold,
|
|
65
|
+
lineHeight: () => T.lineHeight,
|
|
66
|
+
highlightLines: () => T.highlightLines
|
|
67
|
+
}), q = u(() => j.value.mode === "block");
|
|
68
|
+
function J() {
|
|
69
|
+
return Y.apply(this, arguments);
|
|
70
|
+
}
|
|
71
|
+
function Y() {
|
|
72
|
+
return Y = r(function* () {
|
|
73
|
+
try {
|
|
74
|
+
if (typeof navigator < "u" && navigator.clipboard) yield navigator.clipboard.writeText(T.source);
|
|
75
|
+
else if (typeof document < "u") {
|
|
76
|
+
let e = document.createElement("textarea");
|
|
77
|
+
e.value = T.source, document.body.appendChild(e), e.select();
|
|
78
|
+
let t = document.execCommand("copy");
|
|
79
|
+
if (e.remove(), t === !1) throw Error("The copy command was rejected.");
|
|
80
|
+
} else throw Error("Clipboard access is not available.");
|
|
81
|
+
E("copy", T.source);
|
|
82
|
+
} catch (e) {
|
|
83
|
+
A(n("copy-error", `The source could not be copied to the clipboard: ${t(e)}`, {
|
|
84
|
+
severity: "warning",
|
|
85
|
+
phase: "render"
|
|
86
|
+
}));
|
|
87
|
+
}
|
|
88
|
+
}), Y.apply(this, arguments);
|
|
89
|
+
}
|
|
90
|
+
C({
|
|
91
|
+
copy: J,
|
|
92
|
+
getHighlighted: P,
|
|
93
|
+
highlighted: j
|
|
94
|
+
});
|
|
95
|
+
let X = u(() => ({
|
|
96
|
+
source: T.source,
|
|
97
|
+
language: T.language,
|
|
98
|
+
highlighted: j.value,
|
|
99
|
+
nodes: j.value.nodes,
|
|
100
|
+
lines: V.value,
|
|
101
|
+
actions: { copy: J }
|
|
102
|
+
})), Z = u(() => ({
|
|
103
|
+
source: T.source,
|
|
104
|
+
language: T.language,
|
|
105
|
+
label: e(D.labels.empty),
|
|
106
|
+
actions: { copy: J }
|
|
107
|
+
})), Q = m({ setup() {
|
|
108
|
+
return () => {
|
|
109
|
+
var e;
|
|
110
|
+
let t = k.actions;
|
|
111
|
+
if (t) {
|
|
112
|
+
let e = t(X.value);
|
|
113
|
+
if (!a(e)) return h("span", {
|
|
114
|
+
"data-vmd-part": "highlighter-actions",
|
|
115
|
+
class: "vmd-highlighter-actions"
|
|
116
|
+
}, e);
|
|
117
|
+
}
|
|
118
|
+
let n = (e = D.slots) == null ? void 0 : e.actions;
|
|
119
|
+
if (n) {
|
|
120
|
+
let e = n(X.value);
|
|
121
|
+
if (!a(e)) return h("span", {
|
|
122
|
+
"data-vmd-part": "highlighter-actions",
|
|
123
|
+
class: "vmd-highlighter-actions"
|
|
124
|
+
}, e);
|
|
125
|
+
}
|
|
126
|
+
return null;
|
|
127
|
+
};
|
|
128
|
+
} }), $ = m({ setup() {
|
|
129
|
+
return () => {
|
|
130
|
+
var e, t;
|
|
131
|
+
let n = k.header;
|
|
132
|
+
if (n) {
|
|
133
|
+
let e = n(X.value);
|
|
134
|
+
if (!a(e)) return h("div", {
|
|
135
|
+
"data-vmd-part": "highlighter-header",
|
|
136
|
+
class: "vmd-highlighter-header"
|
|
137
|
+
}, e);
|
|
138
|
+
}
|
|
139
|
+
let r = (e = D.slots) == null ? void 0 : e.header;
|
|
140
|
+
if (r) {
|
|
141
|
+
let e = r(X.value);
|
|
142
|
+
if (!a(e)) return h("div", {
|
|
143
|
+
"data-vmd-part": "highlighter-header",
|
|
144
|
+
class: "vmd-highlighter-header"
|
|
145
|
+
}, e);
|
|
146
|
+
}
|
|
147
|
+
return !k.actions && !((t = D.slots) != null && t.actions) ? null : h("div", {
|
|
148
|
+
"data-vmd-part": "highlighter-header",
|
|
149
|
+
class: "vmd-highlighter-header"
|
|
150
|
+
}, [h("span", { class: "vmd-highlighter-label" }, T.language || "text"), h(Q)]);
|
|
151
|
+
};
|
|
152
|
+
} }), ee = m({ setup() {
|
|
153
|
+
return () => {
|
|
154
|
+
var e;
|
|
155
|
+
let t = k.footer;
|
|
156
|
+
if (t) {
|
|
157
|
+
let e = t(X.value);
|
|
158
|
+
if (!a(e)) return h("div", {
|
|
159
|
+
"data-vmd-part": "highlighter-footer",
|
|
160
|
+
class: "vmd-highlighter-footer"
|
|
161
|
+
}, e);
|
|
162
|
+
}
|
|
163
|
+
let n = (e = D.slots) == null ? void 0 : e.footer;
|
|
164
|
+
if (n) {
|
|
165
|
+
let e = n(X.value);
|
|
166
|
+
if (!a(e)) return h("div", {
|
|
167
|
+
"data-vmd-part": "highlighter-footer",
|
|
168
|
+
class: "vmd-highlighter-footer"
|
|
169
|
+
}, e);
|
|
170
|
+
}
|
|
171
|
+
return null;
|
|
172
|
+
};
|
|
173
|
+
} }), te = m({ setup() {
|
|
174
|
+
return () => D.renderHostSlot("highlighter", {
|
|
175
|
+
source: T.source,
|
|
176
|
+
language: T.language,
|
|
177
|
+
nodes: j.value.nodes,
|
|
178
|
+
lines: V.value,
|
|
179
|
+
highlighted: j.value,
|
|
180
|
+
actions: { copy: J }
|
|
181
|
+
}, () => {
|
|
182
|
+
let t = k.highlighter;
|
|
183
|
+
if (t) {
|
|
184
|
+
let e = t({
|
|
185
|
+
source: T.source,
|
|
186
|
+
language: T.language,
|
|
187
|
+
nodes: j.value.nodes,
|
|
188
|
+
lines: V.value,
|
|
189
|
+
highlighted: j.value,
|
|
190
|
+
actions: { copy: J }
|
|
191
|
+
});
|
|
192
|
+
if (!a(e)) return e;
|
|
193
|
+
}
|
|
194
|
+
if (T.source === "") return D.renderHostSlot("empty", Z.value, () => {
|
|
195
|
+
let t = k.empty;
|
|
196
|
+
if (t) {
|
|
197
|
+
let e = t(Z.value);
|
|
198
|
+
if (!a(e)) return e;
|
|
199
|
+
}
|
|
200
|
+
return h("div", {
|
|
201
|
+
"data-vmd-part": "highlighter-empty",
|
|
202
|
+
class: "vmd-highlighter-empty"
|
|
203
|
+
}, e(D.labels.empty));
|
|
204
|
+
});
|
|
205
|
+
if (q.value) return l(j.value.nodes, D);
|
|
206
|
+
let n = [];
|
|
207
|
+
R.value && z.value > 0 && n.push(h("div", {
|
|
208
|
+
"aria-hidden": "true",
|
|
209
|
+
style: { height: `${z.value * H.value}px` }
|
|
210
|
+
}));
|
|
211
|
+
for (let e of V.value) {
|
|
212
|
+
let t = K(e.index);
|
|
213
|
+
n.push(h("div", {
|
|
214
|
+
class: "vmd-highlighter-line",
|
|
215
|
+
"data-vmd-part": "highlighter-line",
|
|
216
|
+
"data-line": String(e.index + 1),
|
|
217
|
+
"data-highlighted": t ? "true" : void 0
|
|
218
|
+
}, [T.lineNumbers ? h("span", {
|
|
219
|
+
class: "vmd-highlighter-gutter",
|
|
220
|
+
"data-vmd-part": "highlighter-gutter",
|
|
221
|
+
"aria-hidden": "true"
|
|
222
|
+
}, String(e.index + 1)) : null, h("code", { class: "vmd-highlighter-code" }, l(e.nodes, D))]));
|
|
223
|
+
}
|
|
224
|
+
return R.value && B.value < L.value && n.push(h("div", {
|
|
225
|
+
"aria-hidden": "true",
|
|
226
|
+
style: { height: `${(L.value - B.value) * H.value}px` }
|
|
227
|
+
})), I.value && n.push(h("button", {
|
|
228
|
+
type: "button",
|
|
229
|
+
class: "vmd-highlighter-toggle",
|
|
230
|
+
"data-vmd-part": "highlighter-toggle",
|
|
231
|
+
"aria-expanded": F.value ? "true" : "false",
|
|
232
|
+
onClick: G
|
|
233
|
+
}, F.value ? e(D.labels.showLess) : e(D.labels.showAll))), n;
|
|
234
|
+
});
|
|
235
|
+
} });
|
|
236
|
+
return (e, t) => {
|
|
237
|
+
var n;
|
|
238
|
+
return _(), d("div", {
|
|
239
|
+
ref_key: "scrollRef",
|
|
240
|
+
ref: U,
|
|
241
|
+
"data-vmd-part": "highlighter",
|
|
242
|
+
class: "vmd-highlighter",
|
|
243
|
+
"data-vmd-theme": v(N),
|
|
244
|
+
"data-language": S.language || "text",
|
|
245
|
+
"data-highlighter": (n = v(M)) == null ? void 0 : n.id,
|
|
246
|
+
"data-virtual": v(R) ? "true" : void 0,
|
|
247
|
+
style: g(v(R) ? {
|
|
248
|
+
maxHeight: `${v(H) * 20}px`,
|
|
249
|
+
overflow: "auto"
|
|
250
|
+
} : void 0),
|
|
251
|
+
onScroll: t[0] || (t[0] = (...e) => v(W) && v(W)(...e))
|
|
252
|
+
}, [
|
|
253
|
+
p(v($)),
|
|
254
|
+
f("div", x, [p(v(te))]),
|
|
255
|
+
p(v(ee))
|
|
256
|
+
], 44, b);
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
export { S as t };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// src/core/adapters.ts
|
|
2
|
+
function e(e) {
|
|
3
|
+
if (!e || typeof e != "object") return !1;
|
|
4
|
+
let t = e;
|
|
5
|
+
return typeof t.id == "string" && typeof t.highlight == "function";
|
|
6
|
+
}
|
|
7
|
+
function t(e) {
|
|
8
|
+
if (!e || typeof e != "object") return !1;
|
|
9
|
+
let t = e;
|
|
10
|
+
return typeof t.id == "string" && typeof t.render == "function";
|
|
11
|
+
}
|
|
12
|
+
function n(e) {
|
|
13
|
+
if (!e || typeof e != "object") return !1;
|
|
14
|
+
let t = e;
|
|
15
|
+
return typeof t.id == "string" && typeof t.render == "function";
|
|
16
|
+
}
|
|
17
|
+
function r(e) {
|
|
18
|
+
return !e || typeof e != "object" ? !1 : typeof e.format == "function";
|
|
19
|
+
}
|
|
20
|
+
function i(e) {
|
|
21
|
+
return !e || typeof e != "object" ? !1 : typeof e.slug == "function";
|
|
22
|
+
}
|
|
23
|
+
function a(e) {
|
|
24
|
+
return typeof e == "function";
|
|
25
|
+
}
|
|
26
|
+
export { i as a, n as i, e as n, a as o, t as r, r as t };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// \0@oxc-project+runtime@0.155.0/helpers/esm/asyncToGenerator.js
|
|
2
|
+
function e(e, t, n, r, i, a, o) {
|
|
3
|
+
try {
|
|
4
|
+
var s = e[a](o), c = s.value;
|
|
5
|
+
} catch (e) {
|
|
6
|
+
n(e);
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
s.done ? t(c) : Promise.resolve(c).then(r, i);
|
|
10
|
+
}
|
|
11
|
+
function t(t) {
|
|
12
|
+
return function() {
|
|
13
|
+
var n = this, r = arguments;
|
|
14
|
+
return new Promise(function(i, a) {
|
|
15
|
+
var o = t.apply(n, r);
|
|
16
|
+
function s(t) {
|
|
17
|
+
e(o, i, a, s, c, "next", t);
|
|
18
|
+
}
|
|
19
|
+
function c(t) {
|
|
20
|
+
e(o, i, a, s, c, "throw", t);
|
|
21
|
+
}
|
|
22
|
+
s(void 0);
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export { t };
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { _ as e, g as t, h as n, m as r, t as i, v as a } from "./micromark-factory-space-CpXAnYUY.js";
|
|
2
|
+
// node_modules/micromark-util-normalize-identifier/index.js
|
|
3
|
+
function o(e) {
|
|
4
|
+
return e.replace(/[\t\n\r ]+/g, " ").replace(/^ | $/g, "").toLowerCase().toUpperCase();
|
|
5
|
+
}
|
|
6
|
+
// node_modules/mdast-util-to-string/lib/index.js
|
|
7
|
+
var s = {};
|
|
8
|
+
function c(e, t) {
|
|
9
|
+
let n = t || s;
|
|
10
|
+
return l(e, typeof n.includeImageAlt != "boolean" || n.includeImageAlt, typeof n.includeHtml != "boolean" || n.includeHtml);
|
|
11
|
+
}
|
|
12
|
+
function l(e, t, n) {
|
|
13
|
+
if (d(e)) {
|
|
14
|
+
if ("value" in e) return e.type === "html" && !n ? "" : e.value;
|
|
15
|
+
if (t && "alt" in e && e.alt) return e.alt;
|
|
16
|
+
if ("children" in e) return u(e.children, t, n);
|
|
17
|
+
}
|
|
18
|
+
return Array.isArray(e) ? u(e, t, n) : "";
|
|
19
|
+
}
|
|
20
|
+
function u(e, t, n) {
|
|
21
|
+
let r = [], i = -1;
|
|
22
|
+
for (; ++i < e.length;) r[i] = l(e[i], t, n);
|
|
23
|
+
return r.join("");
|
|
24
|
+
}
|
|
25
|
+
function d(e) {
|
|
26
|
+
return !!(e && typeof e == "object");
|
|
27
|
+
}
|
|
28
|
+
// node_modules/micromark-util-classify-character/index.js
|
|
29
|
+
function f(t) {
|
|
30
|
+
if (t === null || n(t) || a(t)) return 1;
|
|
31
|
+
if (e(t)) return 2;
|
|
32
|
+
}
|
|
33
|
+
// node_modules/micromark-util-chunked/index.js
|
|
34
|
+
function p(e, t, n, r) {
|
|
35
|
+
let i = e.length, a = 0, o;
|
|
36
|
+
if (t = t < 0 ? -t > i ? 0 : i + t : t > i ? i : t, n = n > 0 ? n : 0, r.length < 1e4) o = Array.from(r), o.unshift(t, n), e.splice(...o);
|
|
37
|
+
else for (n && e.splice(t, n); a < r.length;) o = r.slice(a, a + 1e4), o.unshift(t, 0), e.splice(...o), a += 1e4, t += 1e4;
|
|
38
|
+
}
|
|
39
|
+
function m(e, t) {
|
|
40
|
+
return e.length > 0 ? (p(e, e.length, 0, t), e) : t;
|
|
41
|
+
}
|
|
42
|
+
// node_modules/micromark-util-combine-extensions/index.js
|
|
43
|
+
var h = {}.hasOwnProperty;
|
|
44
|
+
function g(e) {
|
|
45
|
+
let t = {}, n = -1;
|
|
46
|
+
for (; ++n < e.length;) _(t, e[n]);
|
|
47
|
+
return t;
|
|
48
|
+
}
|
|
49
|
+
function _(e, t) {
|
|
50
|
+
let n;
|
|
51
|
+
for (n in t) {
|
|
52
|
+
let r = (h.call(e, n) ? e[n] : void 0) || (e[n] = {}), i = t[n], a;
|
|
53
|
+
if (i) for (a in i) {
|
|
54
|
+
h.call(r, a) || (r[a] = []);
|
|
55
|
+
let e = i[a];
|
|
56
|
+
v(r[a], Array.isArray(e) ? e : e ? [e] : []);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
function v(e, t) {
|
|
61
|
+
let n = -1, r = [];
|
|
62
|
+
for (; ++n < t.length;) (t[n].add === "after" ? e : r).push(t[n]);
|
|
63
|
+
p(e, 0, 0, r);
|
|
64
|
+
}
|
|
65
|
+
// node_modules/micromark-util-resolve-all/index.js
|
|
66
|
+
function y(e, t, n) {
|
|
67
|
+
let r = [], i = -1;
|
|
68
|
+
for (; ++i < e.length;) {
|
|
69
|
+
let a = e[i].resolveAll;
|
|
70
|
+
a && !r.includes(a) && (t = a(t, n), r.push(a));
|
|
71
|
+
}
|
|
72
|
+
return t;
|
|
73
|
+
}
|
|
74
|
+
// node_modules/micromark-core-commonmark/lib/blank-line.js
|
|
75
|
+
var b = {
|
|
76
|
+
partial: !0,
|
|
77
|
+
tokenize: x
|
|
78
|
+
};
|
|
79
|
+
function x(e, n, a) {
|
|
80
|
+
return o;
|
|
81
|
+
function o(n) {
|
|
82
|
+
return t(n) ? i(e, s, "linePrefix")(n) : s(n);
|
|
83
|
+
}
|
|
84
|
+
function s(e) {
|
|
85
|
+
return e === null || r(e) ? n(e) : a(e);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
export { p as a, o as c, m as i, y as n, f as o, g as r, c as s, b as t };
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { t as e } from "./asyncToGenerator-ChigusFD.js";
|
|
2
|
+
// src/editor/codemirror.ts
|
|
3
|
+
function t() {
|
|
4
|
+
return {
|
|
5
|
+
startState: () => ({}),
|
|
6
|
+
token(e) {
|
|
7
|
+
return e.sol() && e.eatSpace(), e.match(/^\s*(graph|flowchart|sequenceDiagram|classDiagram|stateDiagram|erDiagram|journey|gantt|pie|mindmap|timeline|gitGraph|quadrantChart|requirementDiagram|C4Context)\b/) ? "keyword" : e.match(/%%[^\n]*/) ? (e.skipToEnd(), "comment") : e.match(/"[^"]*"/) ? "string" : e.match(/-->|---|==>|-.->|--x|--o|<\|--|\|\|--|\.\.>/) ? "operator" : e.match(/[{}[\]()]/) ? "bracket" : (e.next(), null);
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
function n(e, t) {
|
|
12
|
+
return r.apply(this, arguments);
|
|
13
|
+
}
|
|
14
|
+
function r() {
|
|
15
|
+
return r = e(function* (e, n) {
|
|
16
|
+
let [r, i, a, o] = yield Promise.all([
|
|
17
|
+
import("@codemirror/view"),
|
|
18
|
+
import("@codemirror/state"),
|
|
19
|
+
import("@codemirror/language"),
|
|
20
|
+
import("@codemirror/commands")
|
|
21
|
+
]), { EditorView: s, keymap: c, placeholder: l } = r, { EditorState: u } = i, { StreamLanguage: d } = a, { defaultKeymap: f, history: p, historyKeymap: m } = o, h = s.theme({
|
|
22
|
+
"&": {
|
|
23
|
+
height: "100%",
|
|
24
|
+
backgroundColor: "var(--vmd-code-bg, #f6f8fa)",
|
|
25
|
+
color: "var(--vmd-code-text, #1f2328)",
|
|
26
|
+
fontSize: "var(--vmd-font-size-sm, 0.875rem)"
|
|
27
|
+
},
|
|
28
|
+
".cm-content": {
|
|
29
|
+
fontFamily: "var(--vmd-font-mono, monospace)",
|
|
30
|
+
padding: "0.75rem"
|
|
31
|
+
},
|
|
32
|
+
".cm-gutters": {
|
|
33
|
+
backgroundColor: "var(--vmd-code-toolbar-bg, #eef1f4)",
|
|
34
|
+
color: "var(--vmd-color-muted, #59636e)",
|
|
35
|
+
border: "none"
|
|
36
|
+
},
|
|
37
|
+
"&.cm-focused": { outline: "none" }
|
|
38
|
+
}), g = new s({
|
|
39
|
+
parent: e,
|
|
40
|
+
state: u.create({
|
|
41
|
+
doc: n.value,
|
|
42
|
+
extensions: [
|
|
43
|
+
p(),
|
|
44
|
+
c.of([...f, ...m]),
|
|
45
|
+
d.define(t()),
|
|
46
|
+
l("Write Mermaid source…"),
|
|
47
|
+
s.lineWrapping,
|
|
48
|
+
h,
|
|
49
|
+
s.updateListener.of((e) => {
|
|
50
|
+
e.docChanged && n.onChange(e.state.doc.toString());
|
|
51
|
+
})
|
|
52
|
+
]
|
|
53
|
+
})
|
|
54
|
+
});
|
|
55
|
+
return {
|
|
56
|
+
destroy() {
|
|
57
|
+
g.destroy();
|
|
58
|
+
},
|
|
59
|
+
focus() {
|
|
60
|
+
g.focus();
|
|
61
|
+
},
|
|
62
|
+
setValue(e) {
|
|
63
|
+
e !== g.state.doc.toString() && g.dispatch({ changes: {
|
|
64
|
+
from: 0,
|
|
65
|
+
to: g.state.doc.length,
|
|
66
|
+
insert: e
|
|
67
|
+
} });
|
|
68
|
+
},
|
|
69
|
+
focusLine(e) {
|
|
70
|
+
let t = g.state.doc.line(Math.max(1, Math.min(e, g.state.doc.lines)));
|
|
71
|
+
g.dispatch({
|
|
72
|
+
selection: {
|
|
73
|
+
anchor: t.from,
|
|
74
|
+
head: t.to
|
|
75
|
+
},
|
|
76
|
+
scrollIntoView: !0
|
|
77
|
+
}), g.focus();
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
}), r.apply(this, arguments);
|
|
81
|
+
}
|
|
82
|
+
export { n as t };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { computed as e, inject as t, provide as n } from "vue";
|
|
2
|
+
// src/components/config.ts
|
|
3
|
+
var r = Symbol("@coderminer/vue-markdown:config");
|
|
4
|
+
function i() {
|
|
5
|
+
return t(r, e(() => ({})));
|
|
6
|
+
}
|
|
7
|
+
function a(e) {
|
|
8
|
+
n(r, e);
|
|
9
|
+
}
|
|
10
|
+
export { a as n, i as r, r as t };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { t as e } from "./labels-BtHiUTQI.js";
|
|
2
|
+
import { Comment as t, Fragment as n, inject as r } from "vue";
|
|
3
|
+
// src/components/context.ts
|
|
4
|
+
var i = Symbol("@coderminer/vue-markdown:render-context"), a = {
|
|
5
|
+
components: {},
|
|
6
|
+
labels: e,
|
|
7
|
+
linkTarget: "_self",
|
|
8
|
+
externalLinkTarget: "_self",
|
|
9
|
+
renderHostSlot(e, t, n) {
|
|
10
|
+
return n();
|
|
11
|
+
},
|
|
12
|
+
onLinkClick() {},
|
|
13
|
+
onCustomTagClick() {},
|
|
14
|
+
onTaskChange() {}
|
|
15
|
+
};
|
|
16
|
+
function o() {
|
|
17
|
+
return r(i, a);
|
|
18
|
+
}
|
|
19
|
+
function s(e) {
|
|
20
|
+
if (e == null) return !0;
|
|
21
|
+
if (typeof e == "string") return e.trim() === "";
|
|
22
|
+
if (Array.isArray(e)) return e.length === 0 || e.every((e) => s(e));
|
|
23
|
+
if (typeof e == "object") {
|
|
24
|
+
let r = e;
|
|
25
|
+
if (r.type === t) return !0;
|
|
26
|
+
if (r.type === n && Array.isArray(r.children)) return r.children.length === 0 || r.children.every((e) => s(e));
|
|
27
|
+
}
|
|
28
|
+
return !1;
|
|
29
|
+
}
|
|
30
|
+
export { s as n, o as r, i as t };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// src/core/diagnostics.ts
|
|
2
|
+
function e(e, t, n = {}) {
|
|
3
|
+
var r;
|
|
4
|
+
return {
|
|
5
|
+
code: e,
|
|
6
|
+
message: t,
|
|
7
|
+
severity: (r = n.severity) == null ? "error" : r,
|
|
8
|
+
phase: n.phase,
|
|
9
|
+
plugin: n.plugin,
|
|
10
|
+
source: n.source,
|
|
11
|
+
details: n.details
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
function t(e) {
|
|
15
|
+
if (e instanceof Error) return e.message;
|
|
16
|
+
if (typeof e == "string") return e;
|
|
17
|
+
try {
|
|
18
|
+
return JSON.stringify(e);
|
|
19
|
+
} catch (t) {
|
|
20
|
+
return String(e);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export { t as n, e as t };
|