vue-stream-markdown 0.0.0-alpha.0 → 0.1.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/README.md +18 -19
- package/dist/{button-D8xx1WIP.js → button-DRLfKbvc.js} +1 -1
- package/dist/button-DYIERZf1.js +5 -0
- package/dist/{code-CP6mPwkq.js → code-D5-TPyJ2.js} +7 -7
- package/dist/code-block-Cs17aZ52.js +9 -0
- package/dist/{code-block-C4D_QNTq.js → code-block-fsdBN3mX.js} +5 -5
- package/dist/{composables-qhB1h_ed.js → composables-5Y9QWb9D.js} +97 -13
- package/dist/dropdown-BegRJmej.js +5 -0
- package/dist/error-component-BkdZ6n2L.js +4 -0
- package/dist/{error-component-CzarUjhh.js → error-component-DftqHZwH.js} +1 -1
- package/dist/{image-heJSlrNv.js → image-dNQ1WKcM.js} +53 -49
- package/dist/index.d.ts +45 -33
- package/dist/index.js +23 -324
- package/dist/{inline-math-B4XO1wMP.js → inline-math-D8LY9Xgq.js} +2 -2
- package/dist/{link-DOtoFtxu.js → link-Dkfv0bTE.js} +2 -2
- package/dist/{math-Byka28HI.js → math-G8p5HNSV.js} +2 -2
- package/dist/{mermaid-X0AFRzfF.js → mermaid-BAFHxaTS.js} +12 -8
- package/dist/{previewers-Drlf7IQF.js → previewers-CZxK6T54.js} +1 -1
- package/dist/{segmented-BEtO1eyl.js → segmented-CpwUFPie.js} +1 -1
- package/dist/segmented-DQFlS2_3.js +6 -0
- package/dist/{shiki-vToM7Pz1.js → shiki-CxPfBPEr.js} +1 -1
- package/dist/{table-DjkiVd9L.js → table-BSGtENN1.js} +9 -4
- package/dist/{tooltip-RiXixMIt.js → tooltip-CTUn3Ask.js} +1 -1
- package/dist/tooltip-TCy0JVGe.js +4 -0
- package/dist/{zoom-container-BfUO3Ocp.js → zoom-container-BR9gRA9_.js} +2 -2
- package/dist/zoom-container-qe4wO3zY.js +6 -0
- package/package.json +13 -9
- package/dist/button-BClRCjnc.js +0 -5
- package/dist/code-block-Dzw63Lki.js +0 -9
- package/dist/dropdown-Ca_PKF_d.js +0 -5
- package/dist/error-component-CLEJmPmM.js +0 -4
- package/dist/segmented-CWoQcX-H.js +0 -6
- package/dist/tooltip-Ac_2x9ps.js +0 -4
- package/dist/zoom-container-BDEP09K9.js +0 -6
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { Component, MaybeRef } from "vue";
|
|
1
|
+
import * as vue10 from "vue";
|
|
2
|
+
import { Component, MaybeRef, MaybeRefOrGetter } from "vue";
|
|
3
3
|
import "tippy.js/dist/tippy.css";
|
|
4
4
|
import "tippy.js/themes/light.css";
|
|
5
5
|
import "tippy.js/dist/border.css";
|
|
@@ -7,7 +7,7 @@ import "tippy.js/dist/svg-arrow.css";
|
|
|
7
7
|
import { Zoom } from "medium-zoom";
|
|
8
8
|
import { MarkdownItAsync } from "markdown-it-async";
|
|
9
9
|
import { KatexOptions as KatexOptions$1 } from "katex";
|
|
10
|
-
import "
|
|
10
|
+
import remend from "remend";
|
|
11
11
|
import { BuiltinLanguage, BuiltinTheme, BundledLanguage, BundledTheme, CodeToTokensOptions, Highlighter, SpecialLanguage, TokensResult } from "shiki";
|
|
12
12
|
import { Mermaid, MermaidConfig } from "mermaid";
|
|
13
13
|
import { Extension, fromMarkdown } from "mdast-util-from-markdown";
|
|
@@ -169,7 +169,6 @@ type CodeControlsConfig = boolean | {
|
|
|
169
169
|
copy?: boolean;
|
|
170
170
|
download?: boolean;
|
|
171
171
|
fullscreen?: boolean;
|
|
172
|
-
lineNumbers?: boolean;
|
|
173
172
|
};
|
|
174
173
|
type ImageControlsConfig = boolean | {
|
|
175
174
|
download?: boolean;
|
|
@@ -358,7 +357,7 @@ declare function useContext(): {
|
|
|
358
357
|
context: Context;
|
|
359
358
|
provideContext: (ctx: Partial<Context>) => void;
|
|
360
359
|
injectContext: () => Context;
|
|
361
|
-
isDark:
|
|
360
|
+
isDark: vue10.ComputedRef<boolean>;
|
|
362
361
|
readonly getContainer: () => HTMLElement | undefined;
|
|
363
362
|
readonly onCopied: (content: string) => void;
|
|
364
363
|
};
|
|
@@ -369,6 +368,7 @@ interface UseControlsOptions {
|
|
|
369
368
|
}
|
|
370
369
|
declare function useControls(options: UseControlsOptions): {
|
|
371
370
|
isControlEnabled: (key: string) => boolean;
|
|
371
|
+
getControlValue: <T = any>(key: string) => T | undefined;
|
|
372
372
|
};
|
|
373
373
|
//#endregion
|
|
374
374
|
//#region src/composables/use-harden-sanitizers.d.ts
|
|
@@ -379,15 +379,12 @@ interface UseHardenSanitizersOptions {
|
|
|
379
379
|
isImage?: MaybeRef<boolean | undefined>;
|
|
380
380
|
}
|
|
381
381
|
declare function useHardenSanitizers(options: UseHardenSanitizersOptions): {
|
|
382
|
-
hardenOptions:
|
|
382
|
+
hardenOptions: vue10.ComputedRef<HardenOptions>;
|
|
383
383
|
transformHardenUrl: (url: string) => string | null;
|
|
384
|
-
transformedUrl:
|
|
385
|
-
isHardenUrl:
|
|
384
|
+
transformedUrl: vue10.ComputedRef<string | null>;
|
|
385
|
+
isHardenUrl: vue10.ComputedRef<boolean>;
|
|
386
386
|
};
|
|
387
387
|
//#endregion
|
|
388
|
-
//#region src/composables/use-hsl-theme.d.ts
|
|
389
|
-
declare function useHslTheme(): void;
|
|
390
|
-
//#endregion
|
|
391
388
|
//#region src/composables/use-i18n.d.ts
|
|
392
389
|
declare function useI18n(): {
|
|
393
390
|
t: (key: string) => string;
|
|
@@ -395,7 +392,7 @@ declare function useI18n(): {
|
|
|
395
392
|
//#endregion
|
|
396
393
|
//#region src/composables/use-katex.d.ts
|
|
397
394
|
declare function useKatex(): {
|
|
398
|
-
installed:
|
|
395
|
+
installed: vue10.Ref<boolean, boolean>;
|
|
399
396
|
render: (code: string, options?: KatexOptions$1) => Promise<{
|
|
400
397
|
html?: string;
|
|
401
398
|
error?: string;
|
|
@@ -411,9 +408,9 @@ interface UseMathRendererOptions {
|
|
|
411
408
|
throttle?: MaybeRef<number>;
|
|
412
409
|
}
|
|
413
410
|
declare function useMathRenderer(options: UseMathRendererOptions): {
|
|
414
|
-
html:
|
|
415
|
-
error:
|
|
416
|
-
errorMessage:
|
|
411
|
+
html: vue10.Ref<string, string>;
|
|
412
|
+
error: vue10.ComputedRef<boolean>;
|
|
413
|
+
errorMessage: vue10.Ref<string, string>;
|
|
417
414
|
};
|
|
418
415
|
//#endregion
|
|
419
416
|
//#region src/composables/use-mermaid.d.ts
|
|
@@ -422,7 +419,7 @@ interface UseMermaidOptions {
|
|
|
422
419
|
isDark?: MaybeRef<boolean>;
|
|
423
420
|
}
|
|
424
421
|
declare function useMermaid(options?: UseMermaidOptions): {
|
|
425
|
-
installed:
|
|
422
|
+
installed: vue10.Ref<boolean, boolean>;
|
|
426
423
|
getMermaid: () => Promise<Mermaid>;
|
|
427
424
|
parseMermaid: (code: string) => Promise<boolean>;
|
|
428
425
|
renderMermaid: (code: string) => Promise<string | null>;
|
|
@@ -438,13 +435,28 @@ interface UseShikiOptions {
|
|
|
438
435
|
isDark?: MaybeRef<boolean>;
|
|
439
436
|
}
|
|
440
437
|
declare function useShiki(options?: UseShikiOptions): {
|
|
441
|
-
installed:
|
|
438
|
+
installed: vue10.Ref<boolean, boolean>;
|
|
442
439
|
getHighlighter: () => Promise<Highlighter>;
|
|
443
440
|
codeToTokens: (code: string) => Promise<TokensResult>;
|
|
444
441
|
preload: () => Promise<void>;
|
|
445
442
|
dispose: () => void;
|
|
446
443
|
};
|
|
447
444
|
//#endregion
|
|
445
|
+
//#region src/composables/use-tailwind-v3-theme.d.ts
|
|
446
|
+
interface UseTailwindV3ThemeOptions {
|
|
447
|
+
element?: MaybeRefOrGetter<HTMLElement | undefined>;
|
|
448
|
+
styleScope?: MaybeRef<string>;
|
|
449
|
+
}
|
|
450
|
+
declare function useTailwindV3Theme(options: UseTailwindV3ThemeOptions): {
|
|
451
|
+
element: vue10.ComputedRef<Element | undefined>;
|
|
452
|
+
id: string;
|
|
453
|
+
css: vue10.ShallowRef<string>;
|
|
454
|
+
load: () => void;
|
|
455
|
+
unload: () => void;
|
|
456
|
+
isLoaded: Readonly<vue10.ShallowRef<boolean>>;
|
|
457
|
+
generateCSS: () => void;
|
|
458
|
+
};
|
|
459
|
+
//#endregion
|
|
448
460
|
//#region src/composables/use-tippy.d.ts
|
|
449
461
|
interface UseTippyOptions {
|
|
450
462
|
isDark?: MaybeRef<boolean>;
|
|
@@ -470,11 +482,11 @@ interface ZoomPanState {
|
|
|
470
482
|
translateY: number;
|
|
471
483
|
}
|
|
472
484
|
declare function useZoom(options?: UseZoomOptions): {
|
|
473
|
-
zoom:
|
|
474
|
-
translateX:
|
|
475
|
-
translateY:
|
|
476
|
-
isDragging:
|
|
477
|
-
transformStyle:
|
|
485
|
+
zoom: vue10.Ref<number, number>;
|
|
486
|
+
translateX: vue10.Ref<number, number>;
|
|
487
|
+
translateY: vue10.Ref<number, number>;
|
|
488
|
+
isDragging: vue10.Ref<boolean, boolean>;
|
|
489
|
+
transformStyle: vue10.ComputedRef<{
|
|
478
490
|
transform: string;
|
|
479
491
|
}>;
|
|
480
492
|
zoomIn: () => void;
|
|
@@ -502,30 +514,33 @@ declare const DEFAULT_HARDEN_OPTIONS: HardenOptions;
|
|
|
502
514
|
//#region src/constants/icons.d.ts
|
|
503
515
|
declare const ICONS: Record<string, Component>;
|
|
504
516
|
//#endregion
|
|
517
|
+
//#region src/constants/theme.d.ts
|
|
518
|
+
declare const SHADCN_SCHEMAS: readonly ["background", "foreground", "card", "card-foreground", "popover", "popover-foreground", "primary", "primary-foreground", "secondary", "secondary-foreground", "muted", "muted-foreground", "accent", "accent-foreground", "destructive", "border", "input", "ring", "chart-1", "chart-2", "chart-3", "chart-4", "chart-5", "sidebar", "sidebar-foreground", "sidebar-primary", "sidebar-primary-foreground", "sidebar-accent", "sidebar-accent-foreground", "sidebar-border", "sidebar-ring"];
|
|
519
|
+
//#endregion
|
|
505
520
|
//#region src/index.vue.d.ts
|
|
506
|
-
declare const __VLS_export:
|
|
521
|
+
declare const __VLS_export: vue10.DefineComponent<StreamMarkdownProps, {
|
|
507
522
|
getMarkdownParser: () => MarkdownParser;
|
|
508
523
|
getParsedNodes: () => ParsedNode[];
|
|
509
|
-
}, {}, {}, {},
|
|
524
|
+
}, {}, {}, {}, vue10.ComponentOptionsMixin, vue10.ComponentOptionsMixin, {} & {
|
|
510
525
|
copied: (content: string) => any;
|
|
511
|
-
}, string,
|
|
526
|
+
}, string, vue10.PublicProps, Readonly<StreamMarkdownProps> & Readonly<{
|
|
512
527
|
onCopied?: ((content: string) => any) | undefined;
|
|
513
528
|
}>, {
|
|
514
529
|
mode: "static" | "streaming";
|
|
515
530
|
content: string;
|
|
516
|
-
nodeRenderers: Partial<Record<"blockquote" | "break" | "code" | "definition" | "delete" | "emphasis" | "footnoteDefinition" | "footnoteReference" | "heading" | "html" | "image" | "imageReference" | "inlineCode" | "link" | "linkReference" | "list" | "listItem" | "paragraph" | "strong" | "table" | "tableCell" | "tableRow" | "text" | "thematicBreak" | "yaml" | "inlineMath" | "math",
|
|
531
|
+
nodeRenderers: Partial<Record<"blockquote" | "break" | "code" | "definition" | "delete" | "emphasis" | "footnoteDefinition" | "footnoteReference" | "heading" | "html" | "image" | "imageReference" | "inlineCode" | "link" | "linkReference" | "list" | "listItem" | "paragraph" | "strong" | "table" | "tableCell" | "tableRow" | "text" | "thematicBreak" | "yaml" | "inlineMath" | "math", vue10.Component>>;
|
|
517
532
|
locale: string | LocaleConfig;
|
|
518
533
|
controls: ControlsConfig;
|
|
519
534
|
previewers: PreviewerConfig;
|
|
520
535
|
isDark: boolean;
|
|
521
|
-
}, {}, {}, {}, string,
|
|
536
|
+
}, {}, {}, {}, string, vue10.ComponentProvideOptions, false, {}, any>;
|
|
522
537
|
declare const _default: typeof __VLS_export;
|
|
523
538
|
//#endregion
|
|
524
539
|
//#region src/locales/index.d.ts
|
|
525
540
|
declare const SUPPORT_LANGUAGES: string[];
|
|
526
541
|
declare const localesGlob: Record<string, () => Promise<unknown>>;
|
|
527
|
-
declare const localeMessages:
|
|
528
|
-
declare const currentLocale:
|
|
542
|
+
declare const localeMessages: vue10.Ref<LocaleConfig | undefined, LocaleConfig | undefined>;
|
|
543
|
+
declare const currentLocale: vue10.Ref<string, string>;
|
|
529
544
|
declare function loadLocaleMessages(language: string | LocaleConfig): Promise<void>;
|
|
530
545
|
//#endregion
|
|
531
546
|
//#region src/postprocess/text.d.ts
|
|
@@ -695,9 +710,6 @@ declare function fixTable(content: string): string;
|
|
|
695
710
|
declare function preprocessLaTeX(content: string): string;
|
|
696
711
|
declare function preprocessThinkTag(content: string): string;
|
|
697
712
|
//#endregion
|
|
698
|
-
//#region src/preprocess/vendored/parse-incomplete-markdown.d.ts
|
|
699
|
-
declare function parseIncompleteMarkdown(text: string): string;
|
|
700
|
-
//#endregion
|
|
701
713
|
//#region src/preprocess/pattern.d.ts
|
|
702
714
|
declare const crlfPattern: RegExp;
|
|
703
715
|
declare const trailingBackticksPattern: RegExp;
|
|
@@ -759,4 +771,4 @@ declare function tableDataToTSV(data: TableData): string;
|
|
|
759
771
|
declare function escapeMarkdownTableCell(cell: string): string;
|
|
760
772
|
declare function tableDataToMarkdown(data: TableData): string;
|
|
761
773
|
//#endregion
|
|
762
|
-
export { BlockquoteNode, BlockquoteNodeRendererProps, BreakNode, BreakNodeRendererProps, CODE_PREVIEWERS, COMMON_COMPONENTS, CodeControlsConfig, CodeNode, CodeNodeRendererProps, CodeOptions, ControlsConfig, DEFAULT_DARK_THEME, DEFAULT_HARDEN_OPTIONS, DEFAULT_LIGHT_THEME, DefinitionNode, DefinitionNodeRendererProps, DeleteNode, DeleteNodeRendererProps, EmphasisNode, EmphasisNodeRendererProps, FootnoteDefinitionNode, FootnoteDefinitionNodeRendererProps, FootnoteReferenceNode, FootnoteReferenceNodeRendererProps, HardenOptions, HeadingNode, HeadingNodeRendererProps, HtmlNode, HtmlNodeRendererProps, ICONS, ImageControlsConfig, ImageNode, ImageNodeRendererProps, ImageOptions, ImageReferenceNode, ImageReferenceNodeRendererProps, InlineCodeNode, InlineCodeNodeRendererProps, InlineMathNode, InlineMathNodeRendererProps, KatexOptions, LANGUAGE_ALIAS, LANGUAGE_EXTENSIONS, LANGUAGE_ICONS, LinkNode, LinkNodeRendererProps, LinkReferenceNode, LinkReferenceNodeRendererProps, ListItemNode, ListItemNodeRendererProps, ListNode, ListNodeRendererProps, LocaleConfig, _default as Markdown, MarkdownParser, MarkdownParserOptions, MathNode, MathNodeRendererProps, MdastOptions, MermaidOptions, NODE_RENDERERS, NodeRendererListProps, NodeRendererProps, NodeRenderers, NodeType, Options, ParagraphNode, ParagraphNodeRendererProps, ParsedNode, PreviewerConfig, SUPPORT_LANGUAGES, SelectItem, ShikiOptions, StreamMarkdownContext, StreamMarkdownProps, StrongNode, StrongNodeRendererProps, SyntaxTree, TableCellNode, TableCellNodeRendererProps, TableControlsConfig, TableData, TableNode, TableNodeRendererProps, TableRowNode, TableRowNodeRendererProps, TextNode, TextNodeRendererProps, ThematicBreakNode, ThematicBreakNodeRendererProps, UseMathRendererOptions, UseZoomOptions, YamlNode, YamlNodeRendererProps, ZoomControlsConfig, ZoomPanState, 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,
|
|
774
|
+
export { BlockquoteNode, BlockquoteNodeRendererProps, BreakNode, BreakNodeRendererProps, CODE_PREVIEWERS, COMMON_COMPONENTS, CodeControlsConfig, CodeNode, CodeNodeRendererProps, CodeOptions, ControlsConfig, DEFAULT_DARK_THEME, DEFAULT_HARDEN_OPTIONS, DEFAULT_LIGHT_THEME, DefinitionNode, DefinitionNodeRendererProps, DeleteNode, DeleteNodeRendererProps, EmphasisNode, EmphasisNodeRendererProps, FootnoteDefinitionNode, FootnoteDefinitionNodeRendererProps, FootnoteReferenceNode, FootnoteReferenceNodeRendererProps, HardenOptions, HeadingNode, HeadingNodeRendererProps, HtmlNode, HtmlNodeRendererProps, ICONS, ImageControlsConfig, ImageNode, ImageNodeRendererProps, ImageOptions, ImageReferenceNode, ImageReferenceNodeRendererProps, InlineCodeNode, InlineCodeNodeRendererProps, InlineMathNode, InlineMathNodeRendererProps, KatexOptions, LANGUAGE_ALIAS, LANGUAGE_EXTENSIONS, LANGUAGE_ICONS, LinkNode, LinkNodeRendererProps, LinkReferenceNode, LinkReferenceNodeRendererProps, ListItemNode, ListItemNodeRendererProps, ListNode, ListNodeRendererProps, LocaleConfig, _default as Markdown, MarkdownParser, MarkdownParserOptions, MathNode, MathNodeRendererProps, MdastOptions, MermaidOptions, NODE_RENDERERS, NodeRendererListProps, NodeRendererProps, NodeRenderers, NodeType, Options, ParagraphNode, ParagraphNodeRendererProps, ParsedNode, PreviewerConfig, SHADCN_SCHEMAS, SUPPORT_LANGUAGES, SelectItem, ShikiOptions, StreamMarkdownContext, StreamMarkdownProps, StrongNode, StrongNodeRendererProps, SyntaxTree, TableCellNode, TableCellNodeRendererProps, TableControlsConfig, TableData, TableNode, TableNodeRendererProps, TableRowNode, TableRowNodeRendererProps, TextNode, TextNodeRendererProps, ThematicBreakNode, ThematicBreakNodeRendererProps, UseMathRendererOptions, UseZoomOptions, YamlNode, YamlNodeRendererProps, ZoomControlsConfig, ZoomPanState, 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 };
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { t as CODE_PREVIEWERS } from "./previewers-
|
|
2
|
-
import { A as transformUrl, C as findNodeParent, D as flow, E as hasShiki, F as
|
|
1
|
+
import { t as CODE_PREVIEWERS } from "./previewers-CZxK6T54.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, _ 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-5Y9QWb9D.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";
|
|
6
6
|
import { MarkdownItAsync } from "markdown-it-async";
|
|
7
|
-
import "
|
|
7
|
+
import remend from "remend";
|
|
8
8
|
|
|
9
9
|
//#region rolldown:runtime
|
|
10
10
|
var __create = Object.create;
|
|
@@ -50,20 +50,20 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
50
50
|
//#region src/components/renderers/index.ts
|
|
51
51
|
const NODE_RENDERERS = {
|
|
52
52
|
blockquote: defineAsyncComponent(() => import("./blockquote-DdEg2gww.js")),
|
|
53
|
-
code: defineAsyncComponent(() => import("./code-
|
|
53
|
+
code: defineAsyncComponent(() => import("./code-D5-TPyJ2.js")),
|
|
54
54
|
delete: defineAsyncComponent(() => import("./delete-BdWzKJCy.js")),
|
|
55
55
|
emphasis: defineAsyncComponent(() => import("./emphasis-CTuGt1Ok.js")),
|
|
56
56
|
heading: defineAsyncComponent(() => import("./heading-2vpQQtTH.js")),
|
|
57
|
-
image: defineAsyncComponent(() => import("./image-
|
|
57
|
+
image: defineAsyncComponent(() => import("./image-dNQ1WKcM.js")),
|
|
58
58
|
inlineCode: defineAsyncComponent(() => import("./inline-code-CBoqhfz7.js")),
|
|
59
|
-
inlineMath: defineAsyncComponent(() => import("./inline-math-
|
|
60
|
-
link: defineAsyncComponent(() => import("./link-
|
|
59
|
+
inlineMath: defineAsyncComponent(() => import("./inline-math-D8LY9Xgq.js")),
|
|
60
|
+
link: defineAsyncComponent(() => import("./link-Dkfv0bTE.js")),
|
|
61
61
|
list: defineAsyncComponent(() => import("./list-BCiFKGaz.js")),
|
|
62
62
|
listItem: defineAsyncComponent(() => import("./list-item-p-OLUR_9.js")),
|
|
63
|
-
math: defineAsyncComponent(() => import("./math-
|
|
63
|
+
math: defineAsyncComponent(() => import("./math-G8p5HNSV.js")),
|
|
64
64
|
paragraph: defineAsyncComponent(() => import("./paragraph-DYjqr_Sa.js")),
|
|
65
65
|
strong: defineAsyncComponent(() => import("./strong-CvOjLZiq.js")),
|
|
66
|
-
table: defineAsyncComponent(() => import("./table-
|
|
66
|
+
table: defineAsyncComponent(() => import("./table-BSGtENN1.js")),
|
|
67
67
|
text: defineAsyncComponent(() => import("./text-DuONUqRA.js")),
|
|
68
68
|
thematicBreak: defineAsyncComponent(() => import("./thematic-break-CcNPEI9Y.js")),
|
|
69
69
|
yaml: defineAsyncComponent(() => import("./yaml-DJHrmzSe.js"))
|
|
@@ -72,17 +72,17 @@ const NODE_RENDERERS = {
|
|
|
72
72
|
//#endregion
|
|
73
73
|
//#region src/components/index.ts
|
|
74
74
|
const COMMON_COMPONENTS = {
|
|
75
|
-
Button: defineAsyncComponent(() => import("./button-
|
|
76
|
-
CodeBlock: defineAsyncComponent(() => import("./code-block-
|
|
77
|
-
Dropdown: defineAsyncComponent(() => import("./dropdown-
|
|
78
|
-
ErrorComponent: defineAsyncComponent(() => import("./error-component-
|
|
75
|
+
Button: defineAsyncComponent(() => import("./button-DYIERZf1.js")),
|
|
76
|
+
CodeBlock: defineAsyncComponent(() => import("./code-block-Cs17aZ52.js")),
|
|
77
|
+
Dropdown: defineAsyncComponent(() => import("./dropdown-BegRJmej.js")),
|
|
78
|
+
ErrorComponent: defineAsyncComponent(() => import("./error-component-BkdZ6n2L.js")),
|
|
79
79
|
Modal: defineAsyncComponent(() => import("./modal-DcpxxDDX.js")),
|
|
80
80
|
NodeList: defineAsyncComponent(() => import("./node-list-lgY1wbfQ.js")),
|
|
81
|
-
Segmented: defineAsyncComponent(() => import("./segmented-
|
|
81
|
+
Segmented: defineAsyncComponent(() => import("./segmented-DQFlS2_3.js")),
|
|
82
82
|
Spin: defineAsyncComponent(() => import("./spin-Bz4zGBEo.js")),
|
|
83
83
|
Table: defineAsyncComponent(() => import("./table-CZLbUHiJ.js")),
|
|
84
|
-
Tooltip: defineAsyncComponent(() => import("./tooltip-
|
|
85
|
-
ZoomContainer: defineAsyncComponent(() => import("./zoom-container-
|
|
84
|
+
Tooltip: defineAsyncComponent(() => import("./tooltip-TCy0JVGe.js")),
|
|
85
|
+
ZoomContainer: defineAsyncComponent(() => import("./zoom-container-qe4wO3zY.js"))
|
|
86
86
|
};
|
|
87
87
|
|
|
88
88
|
//#endregion
|
|
@@ -17705,15 +17705,15 @@ function fixDelete(content$2) {
|
|
|
17705
17705
|
const matches = lastParagraph.match(doubleTildePattern);
|
|
17706
17706
|
const count = matches ? matches.length : 0;
|
|
17707
17707
|
if (content$2.endsWith("~") && !content$2.endsWith("~~")) {
|
|
17708
|
-
const
|
|
17708
|
+
const contentWithoutLastTilde = content$2.slice(0, -1);
|
|
17709
|
+
const lastParagraphWithoutTilde = contentWithoutLastTilde.split("\n").slice(paragraphStartIndex).join("\n");
|
|
17709
17710
|
const matchesWithoutTilde = lastParagraphWithoutTilde.match(doubleTildePattern);
|
|
17710
17711
|
if ((matchesWithoutTilde ? matchesWithoutTilde.length : 0) % 2 === 1) {
|
|
17711
17712
|
const lastTildePos = lastParagraphWithoutTilde.lastIndexOf("~~");
|
|
17712
17713
|
if (lastTildePos >= 0) {
|
|
17713
17714
|
if (lastParagraphWithoutTilde.substring(lastTildePos + 2).length > 0) return `${content$2}~`;
|
|
17714
17715
|
}
|
|
17715
|
-
}
|
|
17716
|
-
return content$2;
|
|
17716
|
+
} else return contentWithoutLastTilde;
|
|
17717
17717
|
}
|
|
17718
17718
|
if (count % 2 === 1) {
|
|
17719
17719
|
const lastTildePos = lastParagraph.lastIndexOf("~~");
|
|
@@ -18093,307 +18093,6 @@ function preprocessThinkTag(content$2) {
|
|
|
18093
18093
|
])(content$2);
|
|
18094
18094
|
}
|
|
18095
18095
|
|
|
18096
|
-
//#endregion
|
|
18097
|
-
//#region src/preprocess/vendored/parse-incomplete-markdown.ts
|
|
18098
|
-
const boldPattern = /(\*\*)([^*]*)$/;
|
|
18099
|
-
const italicPattern = /(__)([^_]*)$/;
|
|
18100
|
-
const boldItalicPattern = /(\*\*\*)([^*]*)$/;
|
|
18101
|
-
const singleAsteriskPattern$1 = /(\*)([^*]*)$/;
|
|
18102
|
-
const singleUnderscorePattern$1 = /(_)([^_]*)$/;
|
|
18103
|
-
const inlineCodePattern = /(`)([^`]*)$/;
|
|
18104
|
-
const strikethroughPattern = /(~~)([^~]*)$/;
|
|
18105
|
-
const whitespaceOrMarkersPattern = /^[\s_~*`]*$/;
|
|
18106
|
-
const listItemPattern = /^\s*[-*+]\s+$/;
|
|
18107
|
-
const letterNumberUnderscorePattern = /[\p{L}\p{N}_]/u;
|
|
18108
|
-
const inlineTripleBacktickPattern = /^```[^`\n]*```?$/;
|
|
18109
|
-
const fourOrMoreAsterisksPattern = /^\*{4,}$/;
|
|
18110
|
-
function isWordChar(char) {
|
|
18111
|
-
if (!char) return false;
|
|
18112
|
-
const code$2 = char.charCodeAt(0);
|
|
18113
|
-
if (code$2 >= 48 && code$2 <= 57 || code$2 >= 65 && code$2 <= 90 || code$2 >= 97 && code$2 <= 122 || code$2 === 95) return true;
|
|
18114
|
-
return letterNumberUnderscorePattern.test(char);
|
|
18115
|
-
}
|
|
18116
|
-
function hasCompleteCodeBlock(text$4) {
|
|
18117
|
-
const tripleBackticks = (text$4.match(/```/g) || []).length;
|
|
18118
|
-
return tripleBackticks > 0 && tripleBackticks % 2 === 0 && text$4.includes("\n");
|
|
18119
|
-
}
|
|
18120
|
-
function findMatchingOpeningBracket(text$4, closeIndex) {
|
|
18121
|
-
let depth = 1;
|
|
18122
|
-
for (let i = closeIndex - 1; i >= 0; i -= 1) if (text$4[i] === "]") depth += 1;
|
|
18123
|
-
else if (text$4[i] === "[") {
|
|
18124
|
-
depth -= 1;
|
|
18125
|
-
if (depth === 0) return i;
|
|
18126
|
-
}
|
|
18127
|
-
return -1;
|
|
18128
|
-
}
|
|
18129
|
-
function findMatchingClosingBracket(text$4, openIndex) {
|
|
18130
|
-
let depth = 1;
|
|
18131
|
-
for (let i = openIndex + 1; i < text$4.length; i += 1) if (text$4[i] === "[") depth += 1;
|
|
18132
|
-
else if (text$4[i] === "]") {
|
|
18133
|
-
depth -= 1;
|
|
18134
|
-
if (depth === 0) return i;
|
|
18135
|
-
}
|
|
18136
|
-
return -1;
|
|
18137
|
-
}
|
|
18138
|
-
function isInsideCodeBlock(text$4, position$1) {
|
|
18139
|
-
let inInlineCode = false;
|
|
18140
|
-
let inMultilineCode = false;
|
|
18141
|
-
for (let i = 0; i < position$1; i += 1) {
|
|
18142
|
-
if (text$4.substring(i, i + 3) === "```") {
|
|
18143
|
-
inMultilineCode = !inMultilineCode;
|
|
18144
|
-
i += 2;
|
|
18145
|
-
continue;
|
|
18146
|
-
}
|
|
18147
|
-
if (!inMultilineCode && text$4[i] === "`") inInlineCode = !inInlineCode;
|
|
18148
|
-
}
|
|
18149
|
-
return inInlineCode || inMultilineCode;
|
|
18150
|
-
}
|
|
18151
|
-
function handleIncompleteLinksAndImages(text$4) {
|
|
18152
|
-
const lastParenIndex = text$4.lastIndexOf("](");
|
|
18153
|
-
if (lastParenIndex !== -1 && !isInsideCodeBlock(text$4, lastParenIndex)) {
|
|
18154
|
-
if (!text$4.substring(lastParenIndex + 2).includes(")")) {
|
|
18155
|
-
const openBracketIndex = findMatchingOpeningBracket(text$4, lastParenIndex);
|
|
18156
|
-
if (openBracketIndex !== -1 && !isInsideCodeBlock(text$4, openBracketIndex)) {
|
|
18157
|
-
const isImage = openBracketIndex > 0 && text$4[openBracketIndex - 1] === "!";
|
|
18158
|
-
const startIndex = isImage ? openBracketIndex - 1 : openBracketIndex;
|
|
18159
|
-
const beforeLink = text$4.substring(0, startIndex);
|
|
18160
|
-
const linkText = text$4.substring(openBracketIndex + 1, lastParenIndex);
|
|
18161
|
-
if (isImage) return beforeLink;
|
|
18162
|
-
return `${beforeLink}[${linkText}](streamdown:incomplete-link)`;
|
|
18163
|
-
}
|
|
18164
|
-
}
|
|
18165
|
-
}
|
|
18166
|
-
for (let i = text$4.length - 1; i >= 0; i -= 1) if (text$4[i] === "[" && !isInsideCodeBlock(text$4, i)) {
|
|
18167
|
-
const isImage = i > 0 && text$4[i - 1] === "!";
|
|
18168
|
-
const openIndex = isImage ? i - 1 : i;
|
|
18169
|
-
if (!text$4.substring(i + 1).includes("]")) {
|
|
18170
|
-
const beforeLink = text$4.substring(0, openIndex);
|
|
18171
|
-
if (isImage) return beforeLink;
|
|
18172
|
-
return `${text$4}](streamdown:incomplete-link)`;
|
|
18173
|
-
}
|
|
18174
|
-
if (findMatchingClosingBracket(text$4, i) === -1) {
|
|
18175
|
-
const beforeLink = text$4.substring(0, openIndex);
|
|
18176
|
-
if (isImage) return beforeLink;
|
|
18177
|
-
return `${text$4}](streamdown:incomplete-link)`;
|
|
18178
|
-
}
|
|
18179
|
-
}
|
|
18180
|
-
return text$4;
|
|
18181
|
-
}
|
|
18182
|
-
function handleIncompleteBold(text$4) {
|
|
18183
|
-
if (hasCompleteCodeBlock(text$4)) return text$4;
|
|
18184
|
-
const boldMatch = text$4.match(boldPattern);
|
|
18185
|
-
if (boldMatch) {
|
|
18186
|
-
const contentAfterMarker = boldMatch[2];
|
|
18187
|
-
if (!contentAfterMarker || whitespaceOrMarkersPattern.test(contentAfterMarker)) return text$4;
|
|
18188
|
-
const markerIndex = text$4.lastIndexOf(boldMatch[1]);
|
|
18189
|
-
const lastNewlineBeforeMarker = text$4.substring(0, markerIndex).lastIndexOf("\n");
|
|
18190
|
-
const lineStart = lastNewlineBeforeMarker === -1 ? 0 : lastNewlineBeforeMarker + 1;
|
|
18191
|
-
const lineBeforeMarker = text$4.substring(lineStart, markerIndex);
|
|
18192
|
-
if (listItemPattern.test(lineBeforeMarker)) {
|
|
18193
|
-
if (contentAfterMarker.includes("\n")) return text$4;
|
|
18194
|
-
}
|
|
18195
|
-
if ((text$4.match(/\*\*/g) || []).length % 2 === 1) return `${text$4}**`;
|
|
18196
|
-
}
|
|
18197
|
-
return text$4;
|
|
18198
|
-
}
|
|
18199
|
-
function handleIncompleteDoubleUnderscoreItalic(text$4) {
|
|
18200
|
-
const italicMatch = text$4.match(italicPattern);
|
|
18201
|
-
if (italicMatch) {
|
|
18202
|
-
const contentAfterMarker = italicMatch[2];
|
|
18203
|
-
if (!contentAfterMarker || whitespaceOrMarkersPattern.test(contentAfterMarker)) return text$4;
|
|
18204
|
-
const markerIndex = text$4.lastIndexOf(italicMatch[1]);
|
|
18205
|
-
const lastNewlineBeforeMarker = text$4.substring(0, markerIndex).lastIndexOf("\n");
|
|
18206
|
-
const lineStart = lastNewlineBeforeMarker === -1 ? 0 : lastNewlineBeforeMarker + 1;
|
|
18207
|
-
const lineBeforeMarker = text$4.substring(lineStart, markerIndex);
|
|
18208
|
-
if (listItemPattern.test(lineBeforeMarker)) {
|
|
18209
|
-
if (contentAfterMarker.includes("\n")) return text$4;
|
|
18210
|
-
}
|
|
18211
|
-
if ((text$4.match(/__/g) || []).length % 2 === 1) return `${text$4}__`;
|
|
18212
|
-
}
|
|
18213
|
-
return text$4;
|
|
18214
|
-
}
|
|
18215
|
-
function countSingleAsterisks(text$4) {
|
|
18216
|
-
let count = 0;
|
|
18217
|
-
const len = text$4.length;
|
|
18218
|
-
for (let index$1 = 0; index$1 < len; index$1 += 1) {
|
|
18219
|
-
if (text$4[index$1] !== "*") continue;
|
|
18220
|
-
const prevChar = index$1 > 0 ? text$4[index$1 - 1] : "";
|
|
18221
|
-
const nextChar = index$1 < len - 1 ? text$4[index$1 + 1] : "";
|
|
18222
|
-
if (prevChar === "\\") continue;
|
|
18223
|
-
if (prevChar === "*" || nextChar === "*") continue;
|
|
18224
|
-
if (prevChar && nextChar && isWordChar(prevChar) && isWordChar(nextChar)) continue;
|
|
18225
|
-
let lineStartIndex = 0;
|
|
18226
|
-
for (let i = index$1 - 1; i >= 0; i -= 1) if (text$4[i] === "\n") {
|
|
18227
|
-
lineStartIndex = i + 1;
|
|
18228
|
-
break;
|
|
18229
|
-
}
|
|
18230
|
-
let isListMarker = true;
|
|
18231
|
-
for (let i = lineStartIndex; i < index$1; i += 1) if (text$4[i] !== " " && text$4[i] !== " ") {
|
|
18232
|
-
isListMarker = false;
|
|
18233
|
-
break;
|
|
18234
|
-
}
|
|
18235
|
-
if (isListMarker && (nextChar === " " || nextChar === " ")) continue;
|
|
18236
|
-
count += 1;
|
|
18237
|
-
}
|
|
18238
|
-
return count;
|
|
18239
|
-
}
|
|
18240
|
-
function handleIncompleteSingleAsteriskItalic(text$4) {
|
|
18241
|
-
if (hasCompleteCodeBlock(text$4)) return text$4;
|
|
18242
|
-
if (text$4.match(singleAsteriskPattern$1)) {
|
|
18243
|
-
let firstSingleAsteriskIndex = -1;
|
|
18244
|
-
for (let i = 0; i < text$4.length; i += 1) if (text$4[i] === "*" && text$4[i - 1] !== "*" && text$4[i + 1] !== "*" && text$4[i - 1] !== "\\") {
|
|
18245
|
-
const prevChar = i > 0 ? text$4[i - 1] : "";
|
|
18246
|
-
const nextChar = i < text$4.length - 1 ? text$4[i + 1] : "";
|
|
18247
|
-
if (prevChar && nextChar && isWordChar(prevChar) && isWordChar(nextChar)) continue;
|
|
18248
|
-
firstSingleAsteriskIndex = i;
|
|
18249
|
-
break;
|
|
18250
|
-
}
|
|
18251
|
-
if (firstSingleAsteriskIndex === -1) return text$4;
|
|
18252
|
-
const contentAfterFirstAsterisk = text$4.substring(firstSingleAsteriskIndex + 1);
|
|
18253
|
-
if (!contentAfterFirstAsterisk || whitespaceOrMarkersPattern.test(contentAfterFirstAsterisk)) return text$4;
|
|
18254
|
-
if (countSingleAsterisks(text$4) % 2 === 1) return `${text$4}*`;
|
|
18255
|
-
}
|
|
18256
|
-
return text$4;
|
|
18257
|
-
}
|
|
18258
|
-
function isWithinMathBlock(text$4, position$1) {
|
|
18259
|
-
let inInlineMath = false;
|
|
18260
|
-
let inBlockMath = false;
|
|
18261
|
-
for (let i = 0; i < text$4.length && i < position$1; i += 1) {
|
|
18262
|
-
if (text$4[i] === "\\" && text$4[i + 1] === "$") {
|
|
18263
|
-
i += 1;
|
|
18264
|
-
continue;
|
|
18265
|
-
}
|
|
18266
|
-
if (text$4[i] === "$") {
|
|
18267
|
-
if (text$4[i + 1] === "$") {
|
|
18268
|
-
inBlockMath = !inBlockMath;
|
|
18269
|
-
i += 1;
|
|
18270
|
-
inInlineMath = false;
|
|
18271
|
-
} else if (!inBlockMath) inInlineMath = !inInlineMath;
|
|
18272
|
-
}
|
|
18273
|
-
}
|
|
18274
|
-
return inInlineMath || inBlockMath;
|
|
18275
|
-
}
|
|
18276
|
-
function countSingleUnderscores(text$4) {
|
|
18277
|
-
const hasMathBlocks = text$4.includes("$");
|
|
18278
|
-
let count = 0;
|
|
18279
|
-
const len = text$4.length;
|
|
18280
|
-
for (let index$1 = 0; index$1 < len; index$1 += 1) {
|
|
18281
|
-
if (text$4[index$1] !== "_") continue;
|
|
18282
|
-
const prevChar = index$1 > 0 ? text$4[index$1 - 1] : "";
|
|
18283
|
-
const nextChar = index$1 < len - 1 ? text$4[index$1 + 1] : "";
|
|
18284
|
-
if (prevChar === "\\") continue;
|
|
18285
|
-
if (hasMathBlocks && isWithinMathBlock(text$4, index$1)) continue;
|
|
18286
|
-
if (prevChar === "_" || nextChar === "_") continue;
|
|
18287
|
-
if (prevChar && nextChar && isWordChar(prevChar) && isWordChar(nextChar)) continue;
|
|
18288
|
-
count += 1;
|
|
18289
|
-
}
|
|
18290
|
-
return count;
|
|
18291
|
-
}
|
|
18292
|
-
function handleIncompleteSingleUnderscoreItalic(text$4) {
|
|
18293
|
-
if (hasCompleteCodeBlock(text$4)) return text$4;
|
|
18294
|
-
if (text$4.match(singleUnderscorePattern$1)) {
|
|
18295
|
-
let firstSingleUnderscoreIndex = -1;
|
|
18296
|
-
for (let i = 0; i < text$4.length; i += 1) if (text$4[i] === "_" && text$4[i - 1] !== "_" && text$4[i + 1] !== "_" && text$4[i - 1] !== "\\" && !isWithinMathBlock(text$4, i)) {
|
|
18297
|
-
const prevChar = i > 0 ? text$4[i - 1] : "";
|
|
18298
|
-
const nextChar = i < text$4.length - 1 ? text$4[i + 1] : "";
|
|
18299
|
-
if (prevChar && nextChar && isWordChar(prevChar) && isWordChar(nextChar)) continue;
|
|
18300
|
-
firstSingleUnderscoreIndex = i;
|
|
18301
|
-
break;
|
|
18302
|
-
}
|
|
18303
|
-
if (firstSingleUnderscoreIndex === -1) return text$4;
|
|
18304
|
-
const contentAfterFirstUnderscore = text$4.substring(firstSingleUnderscoreIndex + 1);
|
|
18305
|
-
if (!contentAfterFirstUnderscore || whitespaceOrMarkersPattern.test(contentAfterFirstUnderscore)) return text$4;
|
|
18306
|
-
if (countSingleUnderscores(text$4) % 2 === 1) {
|
|
18307
|
-
let endIndex = text$4.length;
|
|
18308
|
-
while (endIndex > 0 && text$4[endIndex - 1] === "\n") endIndex -= 1;
|
|
18309
|
-
if (endIndex < text$4.length) return `${text$4.slice(0, endIndex)}_${text$4.slice(endIndex)}`;
|
|
18310
|
-
return `${text$4}_`;
|
|
18311
|
-
}
|
|
18312
|
-
}
|
|
18313
|
-
return text$4;
|
|
18314
|
-
}
|
|
18315
|
-
function isPartOfTripleBacktick(text$4, i) {
|
|
18316
|
-
const isTripleStart = text$4.substring(i, i + 3) === "```";
|
|
18317
|
-
const isTripleMiddle = i > 0 && text$4.substring(i - 1, i + 2) === "```";
|
|
18318
|
-
const isTripleEnd = i > 1 && text$4.substring(i - 2, i + 1) === "```";
|
|
18319
|
-
return isTripleStart || isTripleMiddle || isTripleEnd;
|
|
18320
|
-
}
|
|
18321
|
-
function countSingleBackticks(text$4) {
|
|
18322
|
-
let count = 0;
|
|
18323
|
-
for (let i = 0; i < text$4.length; i += 1) if (text$4[i] === "`" && !isPartOfTripleBacktick(text$4, i)) count += 1;
|
|
18324
|
-
return count;
|
|
18325
|
-
}
|
|
18326
|
-
function handleIncompleteInlineCode(text$4) {
|
|
18327
|
-
if (text$4.match(inlineTripleBacktickPattern) && !text$4.includes("\n")) {
|
|
18328
|
-
if (text$4.endsWith("``") && !text$4.endsWith("```")) return `${text$4}\``;
|
|
18329
|
-
return text$4;
|
|
18330
|
-
}
|
|
18331
|
-
const allTripleBackticks = (text$4.match(/```/g) || []).length;
|
|
18332
|
-
const insideIncompleteCodeBlock = allTripleBackticks % 2 === 1;
|
|
18333
|
-
if (allTripleBackticks > 0 && allTripleBackticks % 2 === 0 && text$4.includes("\n")) return text$4;
|
|
18334
|
-
if ((text$4.endsWith("```\n") || text$4.endsWith("```")) && allTripleBackticks % 2 === 0) return text$4;
|
|
18335
|
-
const inlineCodeMatch = text$4.match(inlineCodePattern);
|
|
18336
|
-
if (inlineCodeMatch && !insideIncompleteCodeBlock) {
|
|
18337
|
-
const contentAfterMarker = inlineCodeMatch[2];
|
|
18338
|
-
if (!contentAfterMarker || whitespaceOrMarkersPattern.test(contentAfterMarker)) return text$4;
|
|
18339
|
-
if (countSingleBackticks(text$4) % 2 === 1) return `${text$4}\``;
|
|
18340
|
-
}
|
|
18341
|
-
return text$4;
|
|
18342
|
-
}
|
|
18343
|
-
function handleIncompleteStrikethrough(text$4) {
|
|
18344
|
-
const strikethroughMatch = text$4.match(strikethroughPattern);
|
|
18345
|
-
if (strikethroughMatch) {
|
|
18346
|
-
const contentAfterMarker = strikethroughMatch[2];
|
|
18347
|
-
if (!contentAfterMarker || whitespaceOrMarkersPattern.test(contentAfterMarker)) return text$4;
|
|
18348
|
-
if ((text$4.match(/~~/g) || []).length % 2 === 1) return `${text$4}~~`;
|
|
18349
|
-
}
|
|
18350
|
-
return text$4;
|
|
18351
|
-
}
|
|
18352
|
-
function handleIncompleteBlockKatex(text$4) {
|
|
18353
|
-
if ((text$4.match(/\$\$/g) || []).length % 2 === 0) return text$4;
|
|
18354
|
-
const firstDollarIndex = text$4.indexOf("$$");
|
|
18355
|
-
if (firstDollarIndex !== -1 && text$4.includes("\n", firstDollarIndex) && !text$4.endsWith("\n")) return `${text$4}\n$$`;
|
|
18356
|
-
return `${text$4}$$`;
|
|
18357
|
-
}
|
|
18358
|
-
function countTripleAsterisks(text$4) {
|
|
18359
|
-
let count = 0;
|
|
18360
|
-
let consecutiveAsterisks = 0;
|
|
18361
|
-
for (let i = 0; i < text$4.length; i += 1) if (text$4[i] === "*") consecutiveAsterisks += 1;
|
|
18362
|
-
else {
|
|
18363
|
-
if (consecutiveAsterisks >= 3) count += Math.floor(consecutiveAsterisks / 3);
|
|
18364
|
-
consecutiveAsterisks = 0;
|
|
18365
|
-
}
|
|
18366
|
-
if (consecutiveAsterisks >= 3) count += Math.floor(consecutiveAsterisks / 3);
|
|
18367
|
-
return count;
|
|
18368
|
-
}
|
|
18369
|
-
function handleIncompleteBoldItalic(text$4) {
|
|
18370
|
-
if (hasCompleteCodeBlock(text$4)) return text$4;
|
|
18371
|
-
if (fourOrMoreAsterisksPattern.test(text$4)) return text$4;
|
|
18372
|
-
const boldItalicMatch = text$4.match(boldItalicPattern);
|
|
18373
|
-
if (boldItalicMatch) {
|
|
18374
|
-
const contentAfterMarker = boldItalicMatch[2];
|
|
18375
|
-
if (!contentAfterMarker || whitespaceOrMarkersPattern.test(contentAfterMarker)) return text$4;
|
|
18376
|
-
if (countTripleAsterisks(text$4) % 2 === 1) return `${text$4}***`;
|
|
18377
|
-
}
|
|
18378
|
-
return text$4;
|
|
18379
|
-
}
|
|
18380
|
-
function parseIncompleteMarkdown(text$4) {
|
|
18381
|
-
if (!text$4 || typeof text$4 !== "string") return text$4;
|
|
18382
|
-
let result = text$4;
|
|
18383
|
-
const processedResult = handleIncompleteLinksAndImages(result);
|
|
18384
|
-
if (processedResult.endsWith("](streamdown:incomplete-link)")) return processedResult;
|
|
18385
|
-
result = processedResult;
|
|
18386
|
-
result = handleIncompleteBoldItalic(result);
|
|
18387
|
-
result = handleIncompleteBold(result);
|
|
18388
|
-
result = handleIncompleteDoubleUnderscoreItalic(result);
|
|
18389
|
-
result = handleIncompleteSingleAsteriskItalic(result);
|
|
18390
|
-
result = handleIncompleteSingleUnderscoreItalic(result);
|
|
18391
|
-
result = handleIncompleteInlineCode(result);
|
|
18392
|
-
result = handleIncompleteStrikethrough(result);
|
|
18393
|
-
result = handleIncompleteBlockKatex(result);
|
|
18394
|
-
return result;
|
|
18395
|
-
}
|
|
18396
|
-
|
|
18397
18096
|
//#endregion
|
|
18398
18097
|
//#region src/preprocess/index.ts
|
|
18399
18098
|
function proprocessContent(content$2) {
|
|
@@ -18415,7 +18114,7 @@ function preprocess(content$2) {
|
|
|
18415
18114
|
fixCode,
|
|
18416
18115
|
fixTable,
|
|
18417
18116
|
fixInlineMath,
|
|
18418
|
-
|
|
18117
|
+
remend
|
|
18419
18118
|
])(content$2);
|
|
18420
18119
|
}
|
|
18421
18120
|
|
|
@@ -18593,11 +18292,11 @@ var index_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
18593
18292
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
18594
18293
|
const props = __props;
|
|
18595
18294
|
const emits = __emit;
|
|
18596
|
-
const { provideContext } = useContext();
|
|
18597
18295
|
const { isDark } = toRefs(props);
|
|
18598
18296
|
const containerRef = ref();
|
|
18599
|
-
const
|
|
18297
|
+
const { provideContext } = useContext();
|
|
18600
18298
|
const { initTippy } = useTippy({ isDark });
|
|
18299
|
+
const zoom = mediumZoom("[data-zoomable]", { background: "color-mix(in oklab, var(--background) 80%, transparent)" });
|
|
18601
18300
|
const markdownParser = new MarkdownParser({
|
|
18602
18301
|
mode: props.mode,
|
|
18603
18302
|
mdastOptions: props.mdastOptions,
|
|
@@ -18671,4 +18370,4 @@ var index_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
18671
18370
|
var src_default = index_vue_vue_type_script_setup_true_lang_default;
|
|
18672
18371
|
|
|
18673
18372
|
//#endregion
|
|
18674
|
-
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, 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,
|
|
18373
|
+
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 };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as error_component_default } from "./error-component-
|
|
1
|
+
import { o as useMathRenderer } from "./composables-5Y9QWb9D.js";
|
|
2
|
+
import { t as error_component_default } from "./error-component-DftqHZwH.js";
|
|
3
3
|
import { Transition, computed, createBlock, createCommentVNode, createElementBlock, defineComponent, mergeProps, openBlock, resolveDynamicComponent, toRefs, unref, withCtx } from "vue";
|
|
4
4
|
|
|
5
5
|
//#region src/components/renderers/inline-math.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { g as useHardenSanitizers } from "./composables-
|
|
1
|
+
import { g as useHardenSanitizers } from "./composables-5Y9QWb9D.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-DftqHZwH.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,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as error_component_default } from "./error-component-
|
|
1
|
+
import { o as useMathRenderer } from "./composables-5Y9QWb9D.js";
|
|
2
|
+
import { t as error_component_default } from "./error-component-DftqHZwH.js";
|
|
3
3
|
import { Transition, computed, createBlock, createCommentVNode, createElementBlock, defineComponent, mergeProps, openBlock, resolveDynamicComponent, toRefs, unref, withCtx } from "vue";
|
|
4
4
|
|
|
5
5
|
//#region src/components/renderers/math.vue?vue&type=script&setup=true&lang.ts
|