vue-stream-markdown 0.1.2 → 0.1.4
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/README.md +8 -0
- package/dist/button-D6ccVxGm.js +5 -0
- package/dist/{button-vKhxUL3C.js → button-jFTF378X.js} +1 -1
- package/dist/{code-_dL6Qk0F.js → code-BxWvKFxG.js} +8 -8
- package/dist/code-block-B72JfFy-.js +9 -0
- package/dist/{code-block-wYeMwBck.js → code-block-uZcUI59D.js} +40 -29
- package/dist/{composables-CZ7YmjNl.js → composables-Cx0nvyHl.js} +124 -25
- package/dist/dropdown-oiCw8QVq.js +5 -0
- package/dist/error-component-8y13-fYG.js +4 -0
- package/dist/{error-component-ChEpOmSX.js → error-component-Bhl770lu.js} +4 -3
- package/dist/{image-DB-4Sv8R.js → image-BDtPwitR.js} +6 -5
- package/dist/index.css +58 -73
- package/dist/index.d.ts +112 -53
- package/dist/index.js +76 -19
- package/dist/{inline-math-rChhv_1j.js → inline-math-CAqboT7h.js} +12 -15
- package/dist/{link-CJk67Kbh.js → link-C8BSlPhZ.js} +2 -2
- package/dist/{math-ZLxqHT_f.js → math-CT1TB2pK.js} +12 -15
- package/dist/{mermaid-CNFU7Pg8.js → mermaid-CYrA8rCl.js} +5 -5
- package/dist/{previewers-CMreQ4TA.js → previewers-ByaS2Ksa.js} +1 -1
- package/dist/segmented-B4IEw3wg.js +6 -0
- package/dist/{segmented-RoWxDIP3.js → segmented-DBW9ignu.js} +1 -1
- package/dist/{shiki-4529WbJJ.js → shiki-bQYWLdW3.js} +9 -14
- package/dist/{renderer-CZ41eK_V.js → shiki-token-renderer-D164wC7Y.js} +10 -23
- package/dist/{table-BmGwZIPR.js → table-l_3z210v.js} +6 -5
- package/dist/{tooltip-KcTe6tBF.js → tooltip-3UDC9mw-.js} +1 -1
- package/dist/tooltip-CAoc_U1X.js +4 -0
- package/dist/vanilla-CFWVwBvD.js +39 -0
- package/dist/vanilla-De7W3PpS.js +4 -0
- package/dist/zoom-container-DBgGdbJS.js +6 -0
- package/dist/{zoom-container-D1Mys9gv.js → zoom-container-gjQ0EMyk.js} +18 -5
- package/package.json +1 -1
- package/dist/button-DBgeYAZy.js +0 -5
- package/dist/code-block-DGZ48hb0.js +0 -9
- package/dist/dropdown-DR-uQ215.js +0 -5
- package/dist/error-component-CKCT9gXy.js +0 -4
- package/dist/segmented-63wrfRNo.js +0 -6
- package/dist/tooltip--rusT8LZ.js +0 -4
- package/dist/vanilla-CA9QO96X.js +0 -3
- package/dist/vanilla-DkX6g0dm.js +0 -87
- package/dist/zoom-container-C-CB2LTY.js +0 -6
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as CODE_PREVIEWERS } from "./previewers-
|
|
2
|
-
import { A as transformUrl, B as useContext, C as findNodeParent, D as flow, E as hasShiki, F as DEFAULT_LIGHT_THEME, I as LANGUAGE_ALIAS, L as LANGUAGE_EXTENSIONS, M as ICONS, N as DEFAULT_HARDEN_OPTIONS, O as save, P as DEFAULT_DARK_THEME, R as LANGUAGE_ICONS, S as findLastLeafNode, T as hasMermaid, _ as escapeMarkdownTableCell, a as useMermaid, b as tableDataToMarkdown, c as _defineProperty, d as SUPPORT_LANGUAGES, f as currentLocale, g as useHardenSanitizers, h as localesGlob, i as useShiki, j as SHADCN_SCHEMAS, k as svgToPngBlob, l as useKatex, m as localeMessages, n as useTippy, o as useMathRenderer, p as loadLocaleMessages, r as useTailwindV3Theme, t as useZoom, u as useI18n, v as extractTableDataFromElement, w as hasKatex, x as tableDataToTSV, y as tableDataToCSV, z as useControls } from "./composables-
|
|
1
|
+
import { t as CODE_PREVIEWERS } from "./previewers-ByaS2Ksa.js";
|
|
2
|
+
import { A as transformUrl, B as useContext, C as findNodeParent, D as flow, E as hasShiki, F as DEFAULT_LIGHT_THEME, I as LANGUAGE_ALIAS, L as LANGUAGE_EXTENSIONS, M as ICONS, N as DEFAULT_HARDEN_OPTIONS, O as save, P as DEFAULT_DARK_THEME, R as LANGUAGE_ICONS, S as findLastLeafNode, T as hasMermaid, V as useCodeOptions, _ as escapeMarkdownTableCell, a as useMermaid, b as tableDataToMarkdown, c as _defineProperty, d as SUPPORT_LANGUAGES, f as currentLocale, g as useHardenSanitizers, h as localesGlob, i as useShiki, j as SHADCN_SCHEMAS, k as svgToPngBlob, l as useKatex, m as localeMessages, n as useTippy, o as useMathRenderer, p as loadLocaleMessages, r as useTailwindV3Theme, t as useZoom, u as useI18n, v as extractTableDataFromElement, w as hasKatex, x as tableDataToTSV, y as tableDataToCSV, z as useControls } from "./composables-Cx0nvyHl.js";
|
|
3
3
|
import { t as node_list_default } from "./node-list-CGr_EVtn.js";
|
|
4
4
|
import { computed, createElementBlock, createVNode, defineAsyncComponent, defineComponent, mergeProps, normalizeClass, onBeforeUnmount, openBlock, ref, toRefs, unref, watch } from "vue";
|
|
5
5
|
import mediumZoom from "medium-zoom";
|
|
@@ -51,20 +51,20 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
51
51
|
//#region src/components/renderers/index.ts
|
|
52
52
|
const NODE_RENDERERS = {
|
|
53
53
|
blockquote: defineAsyncComponent(() => import("./blockquote-DdEg2gww.js")),
|
|
54
|
-
code: defineAsyncComponent(() => import("./code-
|
|
54
|
+
code: defineAsyncComponent(() => import("./code-BxWvKFxG.js")),
|
|
55
55
|
delete: defineAsyncComponent(() => import("./delete-BdWzKJCy.js")),
|
|
56
56
|
emphasis: defineAsyncComponent(() => import("./emphasis-CTuGt1Ok.js")),
|
|
57
57
|
heading: defineAsyncComponent(() => import("./heading-2vpQQtTH.js")),
|
|
58
|
-
image: defineAsyncComponent(() => import("./image-
|
|
58
|
+
image: defineAsyncComponent(() => import("./image-BDtPwitR.js")),
|
|
59
59
|
inlineCode: defineAsyncComponent(() => import("./inline-code-CBoqhfz7.js")),
|
|
60
|
-
inlineMath: defineAsyncComponent(() => import("./inline-math-
|
|
61
|
-
link: defineAsyncComponent(() => import("./link-
|
|
60
|
+
inlineMath: defineAsyncComponent(() => import("./inline-math-CAqboT7h.js")),
|
|
61
|
+
link: defineAsyncComponent(() => import("./link-C8BSlPhZ.js")),
|
|
62
62
|
list: defineAsyncComponent(() => import("./list-BCiFKGaz.js")),
|
|
63
63
|
listItem: defineAsyncComponent(() => import("./list-item-p-OLUR_9.js")),
|
|
64
|
-
math: defineAsyncComponent(() => import("./math-
|
|
64
|
+
math: defineAsyncComponent(() => import("./math-CT1TB2pK.js")),
|
|
65
65
|
paragraph: defineAsyncComponent(() => import("./paragraph-DYjqr_Sa.js")),
|
|
66
66
|
strong: defineAsyncComponent(() => import("./strong-CvOjLZiq.js")),
|
|
67
|
-
table: defineAsyncComponent(() => import("./table-
|
|
67
|
+
table: defineAsyncComponent(() => import("./table-l_3z210v.js")),
|
|
68
68
|
text: defineAsyncComponent(() => import("./text-DuONUqRA.js")),
|
|
69
69
|
thematicBreak: defineAsyncComponent(() => import("./thematic-break-CcNPEI9Y.js")),
|
|
70
70
|
yaml: defineAsyncComponent(() => import("./yaml-DJHrmzSe.js"))
|
|
@@ -73,17 +73,17 @@ const NODE_RENDERERS = {
|
|
|
73
73
|
//#endregion
|
|
74
74
|
//#region src/components/index.ts
|
|
75
75
|
const COMMON_COMPONENTS = {
|
|
76
|
-
Button: defineAsyncComponent(() => import("./button-
|
|
77
|
-
CodeBlock: defineAsyncComponent(() => import("./code-block-
|
|
78
|
-
Dropdown: defineAsyncComponent(() => import("./dropdown-
|
|
79
|
-
ErrorComponent: defineAsyncComponent(() => import("./error-component-
|
|
76
|
+
Button: defineAsyncComponent(() => import("./button-D6ccVxGm.js")),
|
|
77
|
+
CodeBlock: defineAsyncComponent(() => import("./code-block-B72JfFy-.js")),
|
|
78
|
+
Dropdown: defineAsyncComponent(() => import("./dropdown-oiCw8QVq.js")),
|
|
79
|
+
ErrorComponent: defineAsyncComponent(() => import("./error-component-8y13-fYG.js")),
|
|
80
80
|
Modal: defineAsyncComponent(() => import("./modal-DcpxxDDX.js")),
|
|
81
81
|
NodeList: defineAsyncComponent(() => import("./node-list-lgY1wbfQ.js")),
|
|
82
|
-
Segmented: defineAsyncComponent(() => import("./segmented-
|
|
82
|
+
Segmented: defineAsyncComponent(() => import("./segmented-B4IEw3wg.js")),
|
|
83
83
|
Spin: defineAsyncComponent(() => import("./spin-Bz4zGBEo.js")),
|
|
84
84
|
Table: defineAsyncComponent(() => import("./table-CZLbUHiJ.js")),
|
|
85
|
-
Tooltip: defineAsyncComponent(() => import("./tooltip
|
|
86
|
-
ZoomContainer: defineAsyncComponent(() => import("./zoom-container-
|
|
85
|
+
Tooltip: defineAsyncComponent(() => import("./tooltip-CAoc_U1X.js")),
|
|
86
|
+
ZoomContainer: defineAsyncComponent(() => import("./zoom-container-DBgGdbJS.js"))
|
|
87
87
|
};
|
|
88
88
|
|
|
89
89
|
//#endregion
|
|
@@ -17536,6 +17536,10 @@ const incompleteLinkTextPattern = /!?\[[^\]]+\]\s*$/;
|
|
|
17536
17536
|
const incompleteUrlPattern = /!?\[[^\]]+\]\([^)]*$/;
|
|
17537
17537
|
const tableRowPattern = /^\|.*\|.*\|/;
|
|
17538
17538
|
const separatorPattern = /^\|[\s:]*-{3,}[\s:]*(?:\|[\s:]*-{3,}[\s:]*)+\|?$/;
|
|
17539
|
+
const standaloneDashPattern = /^\s*-$/;
|
|
17540
|
+
const taskListPattern = /^\s*- \[[x ]\]/i;
|
|
17541
|
+
const quoteStandaloneDashPattern = /^>\s*-$/;
|
|
17542
|
+
const quoteTaskListPattern = /^>\s*- \[[x ]\]/i;
|
|
17539
17543
|
|
|
17540
17544
|
//#endregion
|
|
17541
17545
|
//#region src/preprocess/code.ts
|
|
@@ -18064,6 +18068,48 @@ function generateSeparator(columns) {
|
|
|
18064
18068
|
return `|${parts.join("|")}|`;
|
|
18065
18069
|
}
|
|
18066
18070
|
|
|
18071
|
+
//#endregion
|
|
18072
|
+
//#region src/preprocess/task-list.ts
|
|
18073
|
+
/**
|
|
18074
|
+
* Fix incomplete task list syntax in streaming markdown
|
|
18075
|
+
*
|
|
18076
|
+
* Removes standalone `-` that appears on the last line without `[ ]` or `[x]` syntax.
|
|
18077
|
+
* This prevents AST parsing jitter when task list items are being typed incrementally.
|
|
18078
|
+
* Also handles quote blocks (lines starting with `>`) to prevent leaving `> ` which could
|
|
18079
|
+
* cause the previous line to be misparsed as a heading.
|
|
18080
|
+
*
|
|
18081
|
+
* @param content - Markdown content (potentially incomplete in stream mode)
|
|
18082
|
+
* @returns Content with standalone `-` removed from the last line if incomplete
|
|
18083
|
+
*
|
|
18084
|
+
* @example
|
|
18085
|
+
* fixTaskList('- [ ] Task 1\n-')
|
|
18086
|
+
* // Returns: '- [ ] Task 1\n'
|
|
18087
|
+
*
|
|
18088
|
+
* @example
|
|
18089
|
+
* fixTaskList('- [ ] Task 1\n- [x] Task 2\n-')
|
|
18090
|
+
* // Returns: '- [ ] Task 1\n- [x] Task 2\n'
|
|
18091
|
+
*
|
|
18092
|
+
* @example
|
|
18093
|
+
* fixTaskList('> **Note**: Here\'s a quote with tasks:\n\n> -')
|
|
18094
|
+
* // Returns: '> **Note**: Here\'s a quote with tasks:\n\n'
|
|
18095
|
+
*/
|
|
18096
|
+
function fixTaskList(content$2) {
|
|
18097
|
+
const lines = content$2.split("\n");
|
|
18098
|
+
if (lines.length === 0) return content$2;
|
|
18099
|
+
const lastLine = lines[lines.length - 1];
|
|
18100
|
+
if (quoteStandaloneDashPattern.test(lastLine) && !quoteTaskListPattern.test(lastLine)) {
|
|
18101
|
+
const result = lines.slice(0, -1).join("\n");
|
|
18102
|
+
if (lines.length > 1) return `${result}\n`;
|
|
18103
|
+
return result;
|
|
18104
|
+
}
|
|
18105
|
+
if (standaloneDashPattern.test(lastLine) && !taskListPattern.test(lastLine)) {
|
|
18106
|
+
const result = lines.slice(0, -1).join("\n");
|
|
18107
|
+
if (lines.length > 1) return `${result}\n`;
|
|
18108
|
+
return result;
|
|
18109
|
+
}
|
|
18110
|
+
return content$2;
|
|
18111
|
+
}
|
|
18112
|
+
|
|
18067
18113
|
//#endregion
|
|
18068
18114
|
//#region src/preprocess/vendored/markdown-utils.ts
|
|
18069
18115
|
function preprocessLaTeX(content$2) {
|
|
@@ -18115,6 +18161,7 @@ function preprocess(content$2) {
|
|
|
18115
18161
|
fixCode,
|
|
18116
18162
|
fixTable,
|
|
18117
18163
|
fixInlineMath,
|
|
18164
|
+
fixTaskList,
|
|
18118
18165
|
remend
|
|
18119
18166
|
])(content$2);
|
|
18120
18167
|
}
|
|
@@ -18224,6 +18271,11 @@ var index_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
18224
18271
|
required: false,
|
|
18225
18272
|
default: () => ({})
|
|
18226
18273
|
},
|
|
18274
|
+
icons: {
|
|
18275
|
+
type: Object,
|
|
18276
|
+
required: false,
|
|
18277
|
+
default: () => ({})
|
|
18278
|
+
},
|
|
18227
18279
|
locale: {
|
|
18228
18280
|
type: [String, Object],
|
|
18229
18281
|
required: false,
|
|
@@ -18293,7 +18345,7 @@ var index_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
18293
18345
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
18294
18346
|
const props = __props;
|
|
18295
18347
|
const emits = __emit;
|
|
18296
|
-
const { isDark } = toRefs(props);
|
|
18348
|
+
const { shikiOptions, mermaidOptions, isDark } = toRefs(props);
|
|
18297
18349
|
const containerRef = ref();
|
|
18298
18350
|
const { provideContext } = useContext();
|
|
18299
18351
|
const { initTippy } = useTippy({ isDark });
|
|
@@ -18309,11 +18361,15 @@ var index_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
18309
18361
|
...NODE_RENDERERS,
|
|
18310
18362
|
...props.nodeRenderers
|
|
18311
18363
|
}));
|
|
18364
|
+
const icons = computed(() => ({
|
|
18365
|
+
...ICONS,
|
|
18366
|
+
...props.icons
|
|
18367
|
+
}));
|
|
18312
18368
|
function getContainer() {
|
|
18313
18369
|
return containerRef.value;
|
|
18314
18370
|
}
|
|
18315
|
-
const { preload: preloadShiki, dispose: disposeShiki } = useShiki();
|
|
18316
|
-
const { preload: preloadMermaid, dispose: disposeMermaid } = useMermaid();
|
|
18371
|
+
const { preload: preloadShiki, dispose: disposeShiki } = useShiki({ shikiOptions });
|
|
18372
|
+
const { preload: preloadMermaid, dispose: disposeMermaid } = useMermaid({ mermaidOptions });
|
|
18317
18373
|
const { preload: preloadKatex, dispose: disposeKatex } = useKatex();
|
|
18318
18374
|
async function bootstrap() {
|
|
18319
18375
|
initTippy();
|
|
@@ -18330,6 +18386,7 @@ var index_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
18330
18386
|
watch(() => props.mode, () => markdownParser.updateMode(props.mode));
|
|
18331
18387
|
watch(() => props.locale, () => loadLocaleMessages(props.locale));
|
|
18332
18388
|
provideContext({
|
|
18389
|
+
icons,
|
|
18333
18390
|
isDark,
|
|
18334
18391
|
getContainer,
|
|
18335
18392
|
onCopied: (content$2) => {
|
|
@@ -18371,4 +18428,4 @@ var index_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
18371
18428
|
var src_default = index_vue_vue_type_script_setup_true_lang_default;
|
|
18372
18429
|
|
|
18373
18430
|
//#endregion
|
|
18374
|
-
export { CODE_PREVIEWERS, COMMON_COMPONENTS, DEFAULT_DARK_THEME, DEFAULT_HARDEN_OPTIONS, DEFAULT_LIGHT_THEME, ICONS, LANGUAGE_ALIAS, LANGUAGE_EXTENSIONS, LANGUAGE_ICONS, src_default as Markdown, MarkdownParser, NODE_RENDERERS, SHADCN_SCHEMAS, SUPPORT_LANGUAGES, codeBlockPattern, crlfPattern, currentLocale, doubleAsteriskPattern, doubleDollarPattern, doubleTildePattern, doubleUnderscorePattern, escapeMarkdownTableCell, extractTableDataFromElement, findLastLeafNode, findNodeParent, fixCode, fixDelete, fixEmphasis, fixLink, fixStrong, fixTable, flow, hasKatex, hasMermaid, hasShiki, incompleteBracketPattern, incompleteLinkTextPattern, incompleteUrlPattern, loadLocaleMessages, localeMessages, localesGlob, normalize, postFixText, postprocess, preprocess, preprocessLaTeX, preprocessThinkTag, proprocessContent, remend, save, separatorPattern, singleAsteriskPattern, singleBacktickPattern, singleUnderscorePattern, svgToPngBlob, tableDataToCSV, tableDataToMarkdown, tableDataToTSV, tableRowPattern, trailingBackticksPattern, trailingWhitespacePattern, transformUrl, tripleBacktickPattern, useContext, useControls, useHardenSanitizers, useI18n, useKatex, useMathRenderer, useMermaid, useShiki, useTailwindV3Theme, useTippy, useZoom };
|
|
18431
|
+
export { CODE_PREVIEWERS, COMMON_COMPONENTS, DEFAULT_DARK_THEME, DEFAULT_HARDEN_OPTIONS, DEFAULT_LIGHT_THEME, ICONS, LANGUAGE_ALIAS, LANGUAGE_EXTENSIONS, LANGUAGE_ICONS, src_default as Markdown, MarkdownParser, NODE_RENDERERS, SHADCN_SCHEMAS, SUPPORT_LANGUAGES, codeBlockPattern, crlfPattern, currentLocale, doubleAsteriskPattern, doubleDollarPattern, doubleTildePattern, doubleUnderscorePattern, escapeMarkdownTableCell, extractTableDataFromElement, findLastLeafNode, findNodeParent, fixCode, fixDelete, fixEmphasis, fixLink, fixStrong, fixTable, fixTaskList, flow, hasKatex, hasMermaid, hasShiki, incompleteBracketPattern, incompleteLinkTextPattern, incompleteUrlPattern, loadLocaleMessages, localeMessages, localesGlob, normalize, postFixText, postprocess, preprocess, preprocessLaTeX, preprocessThinkTag, proprocessContent, quoteStandaloneDashPattern, quoteTaskListPattern, remend, save, separatorPattern, singleAsteriskPattern, singleBacktickPattern, singleUnderscorePattern, standaloneDashPattern, svgToPngBlob, tableDataToCSV, tableDataToMarkdown, tableDataToTSV, tableRowPattern, taskListPattern, trailingBackticksPattern, trailingWhitespacePattern, transformUrl, tripleBacktickPattern, useCodeOptions, useContext, useControls, useHardenSanitizers, useI18n, useKatex, useMathRenderer, useMermaid, useShiki, useTailwindV3Theme, useTippy, useZoom };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { o as useMathRenderer } from "./composables-
|
|
2
|
-
import { t as error_component_default } from "./error-component-
|
|
3
|
-
import {
|
|
1
|
+
import { o as useMathRenderer } from "./composables-Cx0nvyHl.js";
|
|
2
|
+
import { t as error_component_default } from "./error-component-Bhl770lu.js";
|
|
3
|
+
import { computed, createBlock, createCommentVNode, createElementBlock, defineComponent, mergeProps, openBlock, resolveDynamicComponent, toRefs, unref } from "vue";
|
|
4
4
|
|
|
5
5
|
//#region src/components/renderers/inline-math.vue?vue&type=script&setup=true&lang.ts
|
|
6
6
|
const _hoisted_1 = ["innerHTML"];
|
|
@@ -86,18 +86,15 @@ var inline_math_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
|
|
|
86
86
|
return ((_katexOptions$value = katexOptions.value) === null || _katexOptions$value === void 0 ? void 0 : _katexOptions$value.errorComponent) ?? error_component_default;
|
|
87
87
|
});
|
|
88
88
|
return (_ctx, _cache) => {
|
|
89
|
-
return openBlock(), createBlock(
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}, null, 8, _hoisted_1))]),
|
|
99
|
-
_: 1
|
|
100
|
-
});
|
|
89
|
+
return unref(error) ? (openBlock(), createBlock(resolveDynamicComponent(Error.value), mergeProps({
|
|
90
|
+
key: 0,
|
|
91
|
+
variant: "katex",
|
|
92
|
+
message: unref(errorMessage)
|
|
93
|
+
}, props), null, 16, ["message"])) : (openBlock(), createElementBlock("span", {
|
|
94
|
+
key: 1,
|
|
95
|
+
"data-stream-markdown": "inline-math",
|
|
96
|
+
innerHTML: unref(html)
|
|
97
|
+
}, null, 8, _hoisted_1));
|
|
101
98
|
};
|
|
102
99
|
}
|
|
103
100
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { g as useHardenSanitizers } from "./composables-
|
|
1
|
+
import { g as useHardenSanitizers } from "./composables-Cx0nvyHl.js";
|
|
2
2
|
import { t as node_list_default } from "./node-list-CGr_EVtn.js";
|
|
3
|
-
import { t as error_component_default } from "./error-component-
|
|
3
|
+
import { t as error_component_default } from "./error-component-Bhl770lu.js";
|
|
4
4
|
import { computed, createBlock, createCommentVNode, createElementBlock, createVNode, defineComponent, mergeProps, openBlock, resolveDynamicComponent, toRefs, unref, withCtx } from "vue";
|
|
5
5
|
|
|
6
6
|
//#region src/components/renderers/link.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { o as useMathRenderer } from "./composables-
|
|
2
|
-
import { t as error_component_default } from "./error-component-
|
|
3
|
-
import {
|
|
1
|
+
import { o as useMathRenderer } from "./composables-Cx0nvyHl.js";
|
|
2
|
+
import { t as error_component_default } from "./error-component-Bhl770lu.js";
|
|
3
|
+
import { computed, createBlock, createCommentVNode, createElementBlock, defineComponent, mergeProps, openBlock, resolveDynamicComponent, toRefs, unref } from "vue";
|
|
4
4
|
|
|
5
5
|
//#region src/components/renderers/math.vue?vue&type=script&setup=true&lang.ts
|
|
6
6
|
const _hoisted_1 = ["innerHTML"];
|
|
@@ -86,18 +86,15 @@ var math_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCom
|
|
|
86
86
|
return ((_katexOptions$value = katexOptions.value) === null || _katexOptions$value === void 0 ? void 0 : _katexOptions$value.errorComponent) ?? error_component_default;
|
|
87
87
|
});
|
|
88
88
|
return (_ctx, _cache) => {
|
|
89
|
-
return openBlock(), createBlock(
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}, null, 8, _hoisted_1))]),
|
|
99
|
-
_: 1
|
|
100
|
-
});
|
|
89
|
+
return unref(error) ? (openBlock(), createBlock(resolveDynamicComponent(Error.value), mergeProps({
|
|
90
|
+
key: 0,
|
|
91
|
+
variant: "katex",
|
|
92
|
+
message: unref(errorMessage)
|
|
93
|
+
}, props), null, 16, ["message"])) : (openBlock(), createElementBlock("div", {
|
|
94
|
+
key: 1,
|
|
95
|
+
"data-stream-markdown": "math",
|
|
96
|
+
innerHTML: unref(html)
|
|
97
|
+
}, null, 8, _hoisted_1));
|
|
101
98
|
};
|
|
102
99
|
}
|
|
103
100
|
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { a as useMermaid, s as throttle, z as useControls } from "./composables-
|
|
2
|
-
import "./tooltip-
|
|
3
|
-
import "./button-
|
|
4
|
-
import { t as error_component_default } from "./error-component-
|
|
1
|
+
import { a as useMermaid, s as throttle, z as useControls } from "./composables-Cx0nvyHl.js";
|
|
2
|
+
import "./tooltip-3UDC9mw-.js";
|
|
3
|
+
import "./button-jFTF378X.js";
|
|
4
|
+
import { t as error_component_default } from "./error-component-Bhl770lu.js";
|
|
5
5
|
import { t as spin_default } from "./spin-Ds5W7qC_.js";
|
|
6
|
-
import { t as zoom_container_default } from "./zoom-container-
|
|
6
|
+
import { t as zoom_container_default } from "./zoom-container-gjQ0EMyk.js";
|
|
7
7
|
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, mergeProps, normalizeStyle, openBlock, ref, resolveDynamicComponent, toRefs, watch, withCtx } from "vue";
|
|
8
8
|
import { useResizeObserver } from "@vueuse/core";
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@ import { defineAsyncComponent } from "vue";
|
|
|
3
3
|
//#region src/components/previewers/index.ts
|
|
4
4
|
const CODE_PREVIEWERS = {
|
|
5
5
|
html: defineAsyncComponent(() => import("./html-DL0PcUXX.js")),
|
|
6
|
-
mermaid: defineAsyncComponent(() => import("./mermaid-
|
|
6
|
+
mermaid: defineAsyncComponent(() => import("./mermaid-CYrA8rCl.js"))
|
|
7
7
|
};
|
|
8
8
|
|
|
9
9
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as button_default } from "./button-
|
|
1
|
+
import { t as button_default } from "./button-jFTF378X.js";
|
|
2
2
|
import { Fragment, createBlock, createElementBlock, defineComponent, mergeModels, openBlock, renderList, useModel } from "vue";
|
|
3
3
|
|
|
4
4
|
//#region src/components/segmented.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as useShiki } from "./composables-
|
|
2
|
-
import { t as vanilla_default } from "./vanilla-
|
|
1
|
+
import { V as useCodeOptions, i as useShiki } from "./composables-Cx0nvyHl.js";
|
|
2
|
+
import { t as vanilla_default } from "./vanilla-CFWVwBvD.js";
|
|
3
3
|
import { computed, createBlock, createCommentVNode, defineAsyncComponent, defineComponent, mergeProps, normalizeProps, openBlock, ref, toRefs, unref, watch } from "vue";
|
|
4
4
|
|
|
5
5
|
//#region src/components/renderers/code/shiki.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -70,12 +70,12 @@ var shiki_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
70
70
|
setup(__props) {
|
|
71
71
|
const props = __props;
|
|
72
72
|
const { shikiOptions, codeOptions, isDark } = toRefs(props);
|
|
73
|
-
const ShikiTokensRenderer = defineAsyncComponent(() => import("./renderer-
|
|
73
|
+
const ShikiTokensRenderer = defineAsyncComponent(() => import("./shiki-token-renderer-D164wC7Y.js"));
|
|
74
74
|
const code = computed(() => props.node.value.trim());
|
|
75
75
|
const lang = computed(() => props.node.lang || "");
|
|
76
|
-
const showLineNumbers =
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
const { showLineNumbers } = useCodeOptions({
|
|
77
|
+
codeOptions,
|
|
78
|
+
language: lang
|
|
79
79
|
});
|
|
80
80
|
const { codeToTokens } = useShiki({
|
|
81
81
|
lang,
|
|
@@ -94,14 +94,9 @@ var shiki_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
94
94
|
return tokens.value ? (openBlock(), createBlock(unref(ShikiTokensRenderer), {
|
|
95
95
|
key: 0,
|
|
96
96
|
"data-stream-markdown": "code",
|
|
97
|
-
"data-show-line-numbers": showLineNumbers
|
|
98
|
-
tokens: tokens.value
|
|
99
|
-
|
|
100
|
-
}, null, 8, [
|
|
101
|
-
"data-show-line-numbers",
|
|
102
|
-
"tokens",
|
|
103
|
-
"show-line-numbers"
|
|
104
|
-
])) : (openBlock(), createBlock(vanilla_default, normalizeProps(mergeProps({ key: 1 }, props)), null, 16));
|
|
97
|
+
"data-show-line-numbers": unref(showLineNumbers),
|
|
98
|
+
tokens: tokens.value
|
|
99
|
+
}, null, 8, ["data-show-line-numbers", "tokens"])) : (openBlock(), createBlock(unref(vanilla_default), normalizeProps(mergeProps({ key: 1 }, props)), null, 16));
|
|
105
100
|
};
|
|
106
101
|
}
|
|
107
102
|
});
|
|
@@ -1,36 +1,23 @@
|
|
|
1
1
|
import { defineComponent, h, renderList } from "vue";
|
|
2
2
|
import { getTokenStyleObject } from "shiki";
|
|
3
3
|
|
|
4
|
-
//#region src/components/renderers/code/renderer.ts
|
|
5
|
-
var
|
|
4
|
+
//#region src/components/renderers/code/shiki-token-renderer.ts
|
|
5
|
+
var shiki_token_renderer_default = defineComponent({
|
|
6
6
|
name: "ShikiTokensRenderer",
|
|
7
|
-
props: {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
},
|
|
12
|
-
showLineNumbers: {
|
|
13
|
-
type: Boolean,
|
|
14
|
-
default: true
|
|
15
|
-
}
|
|
16
|
-
},
|
|
7
|
+
props: { tokens: {
|
|
8
|
+
type: Object,
|
|
9
|
+
required: true
|
|
10
|
+
} },
|
|
17
11
|
setup(props) {
|
|
18
12
|
return () => {
|
|
19
13
|
var _props$tokens$grammar;
|
|
20
14
|
return h("pre", {
|
|
21
15
|
"class": ["shiki", props.tokens.themeName],
|
|
22
16
|
"data-language": (_props$tokens$grammar = props.tokens.grammarState) === null || _props$tokens$grammar === void 0 ? void 0 : _props$tokens$grammar.lang,
|
|
23
|
-
"style": {
|
|
24
|
-
padding: "1rem",
|
|
25
|
-
counterReset: "line"
|
|
26
|
-
}
|
|
17
|
+
"style": { counterReset: "line" }
|
|
27
18
|
}, h("code", renderList(props.tokens.tokens, (line, index) => h("div", {
|
|
28
|
-
|
|
29
|
-
key: index
|
|
30
|
-
style: {
|
|
31
|
-
fontSize: "0.875rem",
|
|
32
|
-
minHeight: "1rem"
|
|
33
|
-
}
|
|
19
|
+
"data-stream-markdown": "code-line",
|
|
20
|
+
"key": index
|
|
34
21
|
}, renderList(line, (token, tokenIndex) => h("span", {
|
|
35
22
|
key: tokenIndex,
|
|
36
23
|
style: token.htmlStyle || getTokenStyleObject(token)
|
|
@@ -40,4 +27,4 @@ var renderer_default = defineComponent({
|
|
|
40
27
|
});
|
|
41
28
|
|
|
42
29
|
//#endregion
|
|
43
|
-
export {
|
|
30
|
+
export { shiki_token_renderer_default as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { B as useContext,
|
|
1
|
+
import { B as useContext, O as save, b as tableDataToMarkdown, u as useI18n, v as extractTableDataFromElement, x as tableDataToTSV, y as tableDataToCSV, z as useControls } from "./composables-Cx0nvyHl.js";
|
|
2
2
|
import { t as node_list_default } from "./node-list-CGr_EVtn.js";
|
|
3
|
-
import "./tooltip-
|
|
4
|
-
import { t as button_default } from "./button-
|
|
3
|
+
import "./tooltip-3UDC9mw-.js";
|
|
4
|
+
import { t as button_default } from "./button-jFTF378X.js";
|
|
5
5
|
import { t as spin_default } from "./spin-Ds5W7qC_.js";
|
|
6
6
|
import { t as table_default$1 } from "./table-4ec9FVB_.js";
|
|
7
7
|
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, mergeProps, openBlock, ref, renderList, withCtx } from "vue";
|
|
@@ -78,6 +78,7 @@ var table_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
78
78
|
setup(__props) {
|
|
79
79
|
const props = __props;
|
|
80
80
|
const { t } = useI18n();
|
|
81
|
+
const { icons } = useContext();
|
|
81
82
|
const { onCopied } = useContext();
|
|
82
83
|
const { copy, copied } = useClipboard({ legacy: true });
|
|
83
84
|
const { isControlEnabled } = useControls({ controls: props.controls });
|
|
@@ -130,7 +131,7 @@ var table_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
130
131
|
const controls = computed(() => [{
|
|
131
132
|
name: t("button.copy"),
|
|
132
133
|
key: "copy",
|
|
133
|
-
icon: copied.value ?
|
|
134
|
+
icon: copied.value ? icons.value.check : icons.value.copy,
|
|
134
135
|
options,
|
|
135
136
|
visible: () => showCopy.value,
|
|
136
137
|
onClick: (_event, item) => {
|
|
@@ -142,7 +143,7 @@ var table_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
142
143
|
}, {
|
|
143
144
|
name: t("button.download"),
|
|
144
145
|
key: "download",
|
|
145
|
-
icon:
|
|
146
|
+
icon: icons.value.download,
|
|
146
147
|
options,
|
|
147
148
|
visible: () => showDownload.value,
|
|
148
149
|
onClick: (_event, item) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as useContext } from "./composables-
|
|
1
|
+
import { B as useContext } from "./composables-Cx0nvyHl.js";
|
|
2
2
|
import { computed, createBlock, createElementVNode, defineComponent, openBlock, ref, renderSlot, toDisplayString, unref, withCtx } from "vue";
|
|
3
3
|
import { Tippy } from "vue-tippy";
|
|
4
4
|
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { V as useCodeOptions } from "./composables-Cx0nvyHl.js";
|
|
2
|
+
import { computed, defineComponent, h, renderList, toRefs } from "vue";
|
|
3
|
+
|
|
4
|
+
//#region src/components/renderers/code/vanilla.ts
|
|
5
|
+
var vanilla_default = defineComponent({
|
|
6
|
+
name: "VanillaRenderer",
|
|
7
|
+
props: {
|
|
8
|
+
node: {
|
|
9
|
+
type: Object,
|
|
10
|
+
required: true
|
|
11
|
+
},
|
|
12
|
+
codeOptions: {
|
|
13
|
+
type: Object,
|
|
14
|
+
default: void 0
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
setup(props) {
|
|
18
|
+
const { codeOptions } = toRefs(props);
|
|
19
|
+
const code = computed(() => props.node.value.trim());
|
|
20
|
+
const lang = computed(() => props.node.lang || "");
|
|
21
|
+
const { showLineNumbers } = useCodeOptions({
|
|
22
|
+
codeOptions,
|
|
23
|
+
language: lang
|
|
24
|
+
});
|
|
25
|
+
const lines = computed(() => code.value.split("\n"));
|
|
26
|
+
return () => h("pre", {
|
|
27
|
+
"data-stream-markdown": "code",
|
|
28
|
+
"data-show-line-numbers": showLineNumbers.value,
|
|
29
|
+
"data-lang": lang.value,
|
|
30
|
+
"style": { counterReset: "line" }
|
|
31
|
+
}, h("code", { translate: "no" }, renderList(lines.value, (line, index) => h("div", {
|
|
32
|
+
"data-stream-markdown": "code-line",
|
|
33
|
+
"key": index
|
|
34
|
+
}, line))));
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
//#endregion
|
|
39
|
+
export { vanilla_default as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as button_default } from "./button-
|
|
1
|
+
import { B as useContext, t as useZoom, u as useI18n } from "./composables-Cx0nvyHl.js";
|
|
2
|
+
import { t as button_default } from "./button-jFTF378X.js";
|
|
3
3
|
import { computed, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, normalizeStyle, openBlock, ref, renderSlot, unref, withModifiers } from "vue";
|
|
4
4
|
|
|
5
5
|
//#region src/components/zoom-container.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -22,7 +22,8 @@ var zoom_container_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
22
22
|
const props = __props;
|
|
23
23
|
const containerRef = ref();
|
|
24
24
|
const { t } = useI18n();
|
|
25
|
-
const {
|
|
25
|
+
const { icons } = useContext();
|
|
26
|
+
const { zoom, isDragging, transformStyle, zoomIn, zoomOut, resetZoom, startDrag, onDrag, stopDrag, handleWheel, handleTouchStart, handleTouchMove, handleTouchEnd } = useZoom();
|
|
26
27
|
const zoomPercent = computed(() => `${Math.round(zoom.value * 100)}%`);
|
|
27
28
|
const controlsStyle = computed(() => {
|
|
28
29
|
switch (props.position) {
|
|
@@ -48,12 +49,24 @@ var zoom_container_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
48
49
|
function onWheel(event) {
|
|
49
50
|
if (containerRef.value) handleWheel(event, containerRef.value);
|
|
50
51
|
}
|
|
52
|
+
function onTouchStart(event) {
|
|
53
|
+
if (containerRef.value) handleTouchStart(event, containerRef.value);
|
|
54
|
+
}
|
|
55
|
+
function onTouchMove(event) {
|
|
56
|
+
if (containerRef.value) handleTouchMove(event, containerRef.value);
|
|
57
|
+
}
|
|
58
|
+
function onTouchEnd(event) {
|
|
59
|
+
handleTouchEnd(event);
|
|
60
|
+
}
|
|
51
61
|
return (_ctx, _cache) => {
|
|
52
62
|
return openBlock(), createElementBlock("div", {
|
|
53
63
|
ref_key: "containerRef",
|
|
54
64
|
ref: containerRef,
|
|
55
65
|
"data-stream-markdown": "zoom-container",
|
|
56
66
|
onWheel,
|
|
67
|
+
onTouchstart: onTouchStart,
|
|
68
|
+
onTouchmove: onTouchMove,
|
|
69
|
+
onTouchend: onTouchEnd,
|
|
57
70
|
onPointerdown: _cache[0] || (_cache[0] = withModifiers((...args) => unref(startDrag) && unref(startDrag)(...args), ["prevent"])),
|
|
58
71
|
onPointermove: _cache[1] || (_cache[1] = withModifiers((...args) => unref(onDrag) && unref(onDrag)(...args), ["prevent"])),
|
|
59
72
|
onPointerup: _cache[2] || (_cache[2] = withModifiers((...args) => unref(stopDrag) && unref(stopDrag)(...args), ["prevent"])),
|
|
@@ -65,7 +78,7 @@ var zoom_container_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
65
78
|
style: normalizeStyle(controlsStyle.value)
|
|
66
79
|
}, [
|
|
67
80
|
createVNode(button_default, {
|
|
68
|
-
icon: unref(
|
|
81
|
+
icon: unref(icons).zoomIn,
|
|
69
82
|
name: unref(t)("button.zoomIn"),
|
|
70
83
|
onClick: unref(zoomIn)
|
|
71
84
|
}, null, 8, [
|
|
@@ -74,7 +87,7 @@ var zoom_container_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
74
87
|
"onClick"
|
|
75
88
|
]),
|
|
76
89
|
createVNode(button_default, {
|
|
77
|
-
icon: unref(
|
|
90
|
+
icon: unref(icons).zoomOut,
|
|
78
91
|
name: unref(t)("button.zoomOut"),
|
|
79
92
|
onClick: unref(zoomOut)
|
|
80
93
|
}, null, 8, [
|
package/package.json
CHANGED
package/dist/button-DBgeYAZy.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import "./previewers-CMreQ4TA.js";
|
|
2
|
-
import "./composables-CZ7YmjNl.js";
|
|
3
|
-
import "./tooltip-KcTe6tBF.js";
|
|
4
|
-
import "./button-vKhxUL3C.js";
|
|
5
|
-
import "./modal-CuQR21UD.js";
|
|
6
|
-
import { t as code_block_default } from "./code-block-wYeMwBck.js";
|
|
7
|
-
import "./segmented-RoWxDIP3.js";
|
|
8
|
-
|
|
9
|
-
export { code_block_default as default };
|
package/dist/tooltip--rusT8LZ.js
DELETED
package/dist/vanilla-CA9QO96X.js
DELETED