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.css
CHANGED
|
@@ -24,20 +24,6 @@
|
|
|
24
24
|
padding: 0;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
.stream-markdown .tippy-box {
|
|
28
|
-
background: var(--popover);
|
|
29
|
-
color: var(--popover-foreground);
|
|
30
|
-
border: 1px solid var(--border);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.stream-markdown .tippy-arrow {
|
|
34
|
-
color: var(--popover);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.stream-markdown .tippy-box > .tippy-svg-arrow {
|
|
38
|
-
border-top-color: var(--popover);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
27
|
.stream-markdown ::-webkit-scrollbar {
|
|
42
28
|
width: 6px;
|
|
43
29
|
height: 6px;
|
|
@@ -57,6 +43,20 @@
|
|
|
57
43
|
opacity: 0.5;
|
|
58
44
|
}
|
|
59
45
|
|
|
46
|
+
.stream-markdown .tippy-box {
|
|
47
|
+
background: var(--popover);
|
|
48
|
+
color: var(--popover-foreground);
|
|
49
|
+
border: 1px solid var(--border);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.stream-markdown .tippy-arrow {
|
|
53
|
+
color: var(--popover);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.stream-markdown .tippy-box > .tippy-svg-arrow {
|
|
57
|
+
border-top-color: var(--popover);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
60
|
.stream-markdown [data-stream-markdown='button'] {
|
|
61
61
|
display: flex;
|
|
62
62
|
align-items: center;
|
|
@@ -160,15 +160,6 @@
|
|
|
160
160
|
overflow: auto;
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
-
.stream-markdown .modal-enter-from,
|
|
164
|
-
.stream-markdown .modal-leave-to {
|
|
165
|
-
opacity: 0;
|
|
166
|
-
}
|
|
167
|
-
.stream-markdown .modal-enter-active,
|
|
168
|
-
.stream-markdown .modal-leave-active {
|
|
169
|
-
transition: opacity var(--default-transition-duration) ease;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
163
|
.stream-markdown [data-stream-markdown='modal-header'] > :first-child {
|
|
173
164
|
flex: 1;
|
|
174
165
|
}
|
|
@@ -215,15 +206,6 @@
|
|
|
215
206
|
animation: spin 1s linear infinite;
|
|
216
207
|
}
|
|
217
208
|
|
|
218
|
-
@keyframes spin {
|
|
219
|
-
from {
|
|
220
|
-
transform: rotate(0deg);
|
|
221
|
-
}
|
|
222
|
-
to {
|
|
223
|
-
transform: rotate(360deg);
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
|
|
227
209
|
.stream-markdown [data-stream-markdown='table'] {
|
|
228
210
|
width: 100%;
|
|
229
211
|
border-collapse: collapse;
|
|
@@ -335,7 +317,7 @@
|
|
|
335
317
|
|
|
336
318
|
@media (max-width: 1024px) {
|
|
337
319
|
.stream-markdown [data-stream-markdown='code-block-header'] {
|
|
338
|
-
padding-inline: 0.
|
|
320
|
+
padding-inline: 0.75rem;
|
|
339
321
|
}
|
|
340
322
|
}
|
|
341
323
|
|
|
@@ -488,23 +470,6 @@
|
|
|
488
470
|
right: 0.5rem;
|
|
489
471
|
}
|
|
490
472
|
|
|
491
|
-
.stream-markdown .img-switch-enter-active,
|
|
492
|
-
.stream-markdown .img-switch-leave-active {
|
|
493
|
-
transition:
|
|
494
|
-
opacity var(--default-transition-duration) ease,
|
|
495
|
-
transform var(--default-transition-duration) ease;
|
|
496
|
-
}
|
|
497
|
-
.stream-markdown .img-switch-enter-from,
|
|
498
|
-
.stream-markdown .img-switch-leave-to {
|
|
499
|
-
opacity: 0;
|
|
500
|
-
transform: translateY(6px);
|
|
501
|
-
}
|
|
502
|
-
.stream-markdown .img-switch-enter-to,
|
|
503
|
-
.stream-markdown .img-switch-leave-from {
|
|
504
|
-
opacity: 1;
|
|
505
|
-
transform: translateY(0);
|
|
506
|
-
}
|
|
507
|
-
|
|
508
473
|
.stream-markdown [data-stream-markdown='inline-code'] {
|
|
509
474
|
background-color: var(--muted);
|
|
510
475
|
border-radius: 0.25rem;
|
|
@@ -517,16 +482,6 @@
|
|
|
517
482
|
overflow-wrap: break-word;
|
|
518
483
|
}
|
|
519
484
|
|
|
520
|
-
.stream-markdown .inline-math-enter-active,
|
|
521
|
-
.stream-markdown .inline-math-leave-active {
|
|
522
|
-
transition: opacity var (--default-transition-duration) ease;
|
|
523
|
-
}
|
|
524
|
-
|
|
525
|
-
.stream-markdown .inline-math-enter-from,
|
|
526
|
-
.stream-markdown .inline-math-leave-to {
|
|
527
|
-
opacity: 0;
|
|
528
|
-
}
|
|
529
|
-
|
|
530
485
|
.stream-markdown [data-stream-markdown='link'] {
|
|
531
486
|
color: var(--primary);
|
|
532
487
|
text-decoration: underline;
|
|
@@ -579,16 +534,6 @@
|
|
|
579
534
|
margin-block: 1rem;
|
|
580
535
|
}
|
|
581
536
|
|
|
582
|
-
.stream-markdown .math-enter-active,
|
|
583
|
-
.stream-markdown .math-leave-active {
|
|
584
|
-
transition: opacity var (--default-transition-duration) ease;
|
|
585
|
-
}
|
|
586
|
-
|
|
587
|
-
.stream-markdown .math-enter-from,
|
|
588
|
-
.stream-markdown .math-leave-to {
|
|
589
|
-
opacity: 0;
|
|
590
|
-
}
|
|
591
|
-
|
|
592
537
|
.stream-markdown [data-stream-markdown='paragraph'] {
|
|
593
538
|
margin-bottom: 1rem;
|
|
594
539
|
vertical-align: middle;
|
|
@@ -639,14 +584,17 @@
|
|
|
639
584
|
.stream-markdown [data-stream-markdown='code'],
|
|
640
585
|
.stream-markdown [data-stream-markdown='code'] code {
|
|
641
586
|
font-family: var(--font-mono);
|
|
587
|
+
font-size: 0.875rem;
|
|
642
588
|
}
|
|
643
589
|
|
|
644
|
-
.stream-markdown [data-stream-markdown='code']
|
|
590
|
+
.stream-markdown [data-stream-markdown='code'] [data-stream-markdown='code-line'] {
|
|
645
591
|
display: block;
|
|
646
592
|
position: relative;
|
|
593
|
+
font-size: 0.875rem;
|
|
594
|
+
min-height: 1rem;
|
|
647
595
|
}
|
|
648
596
|
|
|
649
|
-
.stream-markdown [data-stream-markdown='code']
|
|
597
|
+
.stream-markdown [data-stream-markdown='code'] [data-stream-markdown='code-line']::before {
|
|
650
598
|
display: inline-block;
|
|
651
599
|
width: 1rem;
|
|
652
600
|
margin-right: 1rem;
|
|
@@ -659,10 +607,47 @@
|
|
|
659
607
|
user-select: none;
|
|
660
608
|
}
|
|
661
609
|
|
|
662
|
-
.stream-markdown
|
|
610
|
+
.stream-markdown
|
|
611
|
+
[data-stream-markdown='code'][data-show-line-numbers='false']
|
|
612
|
+
[data-stream-markdown='code-line']::before {
|
|
663
613
|
display: none;
|
|
664
614
|
}
|
|
665
615
|
|
|
666
616
|
.stream-markdown [data-stream-markdown='code'] {
|
|
667
617
|
padding: 1rem;
|
|
668
618
|
}
|
|
619
|
+
|
|
620
|
+
.stream-markdown .modal-enter-from,
|
|
621
|
+
.stream-markdown .modal-leave-to {
|
|
622
|
+
opacity: 0;
|
|
623
|
+
}
|
|
624
|
+
.stream-markdown .modal-enter-active,
|
|
625
|
+
.stream-markdown .modal-leave-active {
|
|
626
|
+
transition: opacity var(--default-transition-duration) ease;
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
.stream-markdown .img-switch-enter-active,
|
|
630
|
+
.stream-markdown .img-switch-leave-active {
|
|
631
|
+
transition:
|
|
632
|
+
opacity var(--default-transition-duration) ease,
|
|
633
|
+
transform var(--default-transition-duration) ease;
|
|
634
|
+
}
|
|
635
|
+
.stream-markdown .img-switch-enter-from,
|
|
636
|
+
.stream-markdown .img-switch-leave-to {
|
|
637
|
+
opacity: 0;
|
|
638
|
+
transform: translateY(6px);
|
|
639
|
+
}
|
|
640
|
+
.stream-markdown .img-switch-enter-to,
|
|
641
|
+
.stream-markdown .img-switch-leave-from {
|
|
642
|
+
opacity: 1;
|
|
643
|
+
transform: translateY(0);
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
@keyframes spin {
|
|
647
|
+
from {
|
|
648
|
+
transform: rotate(0deg);
|
|
649
|
+
}
|
|
650
|
+
to {
|
|
651
|
+
transform: rotate(360deg);
|
|
652
|
+
}
|
|
653
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as vue29 from "vue";
|
|
2
2
|
import { Component, MaybeRef, MaybeRefOrGetter } from "vue";
|
|
3
3
|
import "tippy.js/dist/tippy.css";
|
|
4
4
|
import "tippy.js/themes/light.css";
|
|
@@ -131,11 +131,51 @@ interface LocaleConfig {
|
|
|
131
131
|
};
|
|
132
132
|
}
|
|
133
133
|
//#endregion
|
|
134
|
+
//#region src/constants/code.d.ts
|
|
135
|
+
declare const DEFAULT_LIGHT_THEME = "github-light";
|
|
136
|
+
declare const DEFAULT_DARK_THEME = "github-dark";
|
|
137
|
+
declare const LANGUAGE_ALIAS: Record<string, BuiltinLanguage>;
|
|
138
|
+
declare const LANGUAGE_EXTENSIONS: Partial<Record<BuiltinLanguage, string>>;
|
|
139
|
+
declare const LANGUAGE_ICONS: Partial<Record<BuiltinLanguage | SpecialLanguage, Component>>;
|
|
140
|
+
//#endregion
|
|
141
|
+
//#region src/constants/harden.d.ts
|
|
142
|
+
declare const DEFAULT_HARDEN_OPTIONS: HardenOptions;
|
|
143
|
+
//#endregion
|
|
144
|
+
//#region src/constants/icons.d.ts
|
|
145
|
+
declare const ICONS: {
|
|
146
|
+
readonly check: vue29.FunctionalComponent<vue29.SVGAttributes, {}, any, {}>;
|
|
147
|
+
readonly code: vue29.FunctionalComponent<vue29.SVGAttributes, {}, any, {}>;
|
|
148
|
+
readonly collapse: vue29.FunctionalComponent<vue29.SVGAttributes, {}, any, {}>;
|
|
149
|
+
readonly copy: vue29.FunctionalComponent<vue29.SVGAttributes, {}, any, {}>;
|
|
150
|
+
readonly download: vue29.FunctionalComponent<vue29.SVGAttributes, {}, any, {}>;
|
|
151
|
+
readonly error: vue29.FunctionalComponent<vue29.SVGAttributes, {}, any, {}>;
|
|
152
|
+
readonly image: vue29.FunctionalComponent<vue29.SVGAttributes, {}, any, {}>;
|
|
153
|
+
readonly link: vue29.FunctionalComponent<vue29.SVGAttributes, {}, any, {}>;
|
|
154
|
+
readonly maximize: vue29.FunctionalComponent<vue29.SVGAttributes, {}, any, {}>;
|
|
155
|
+
readonly mermaid: vue29.FunctionalComponent<vue29.SVGAttributes, {}, any, {}>;
|
|
156
|
+
readonly minimize: vue29.FunctionalComponent<vue29.SVGAttributes, {}, any, {}>;
|
|
157
|
+
readonly preview: vue29.FunctionalComponent<vue29.SVGAttributes, {}, any, {}>;
|
|
158
|
+
readonly zoomIn: vue29.FunctionalComponent<vue29.SVGAttributes, {}, any, {}>;
|
|
159
|
+
readonly zoomOut: vue29.FunctionalComponent<vue29.SVGAttributes, {}, any, {}>;
|
|
160
|
+
};
|
|
161
|
+
//#endregion
|
|
162
|
+
//#region src/constants/theme.d.ts
|
|
163
|
+
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"];
|
|
164
|
+
//#endregion
|
|
165
|
+
//#region src/types/shared.d.ts
|
|
166
|
+
type IconName = keyof typeof ICONS;
|
|
167
|
+
interface SelectItem {
|
|
168
|
+
label: string;
|
|
169
|
+
value: string;
|
|
170
|
+
icon?: Component;
|
|
171
|
+
}
|
|
172
|
+
//#endregion
|
|
134
173
|
//#region src/types/context.d.ts
|
|
135
174
|
interface StreamMarkdownProps extends StreamMarkdownContext, MarkdownParserOptions {
|
|
136
175
|
mode?: 'static' | 'streaming';
|
|
137
176
|
content?: string;
|
|
138
177
|
nodeRenderers?: NodeRenderers;
|
|
178
|
+
icons?: Partial<Record<IconName, Component>>;
|
|
139
179
|
locale?: string | LocaleConfig;
|
|
140
180
|
}
|
|
141
181
|
interface MarkdownParserOptions {
|
|
@@ -184,10 +224,12 @@ type ControlsConfig = boolean | {
|
|
|
184
224
|
image?: boolean | ImageControlsConfig;
|
|
185
225
|
mermaid?: boolean | ZoomControlsConfig;
|
|
186
226
|
};
|
|
187
|
-
type PreviewerConfig = boolean | {
|
|
188
|
-
html?: boolean | Component;
|
|
227
|
+
type PreviewerConfig = boolean | ({
|
|
189
228
|
mermaid?: boolean | Component;
|
|
190
|
-
|
|
229
|
+
html?: boolean | Component;
|
|
230
|
+
} & {
|
|
231
|
+
[key: string]: Component;
|
|
232
|
+
});
|
|
191
233
|
interface ShikiOptions {
|
|
192
234
|
theme?: [BuiltinTheme, BuiltinTheme];
|
|
193
235
|
langAlias?: Record<string, string>;
|
|
@@ -211,6 +253,21 @@ interface CodeOptions {
|
|
|
211
253
|
languageIcon?: boolean;
|
|
212
254
|
languageName?: boolean;
|
|
213
255
|
lineNumbers?: boolean;
|
|
256
|
+
/**
|
|
257
|
+
* Language specific code options
|
|
258
|
+
* @example
|
|
259
|
+
* {
|
|
260
|
+
* mermaid: {
|
|
261
|
+
* languageIcon: false,
|
|
262
|
+
* languageName: false,
|
|
263
|
+
* lineNumbers: true,
|
|
264
|
+
* },
|
|
265
|
+
* }
|
|
266
|
+
*/
|
|
267
|
+
language?: Record<string, CodeOptionsLanguage>;
|
|
268
|
+
}
|
|
269
|
+
interface CodeOptionsLanguage extends Omit<CodeOptions, 'languageIcon'> {
|
|
270
|
+
languageIcon?: boolean | Component;
|
|
214
271
|
}
|
|
215
272
|
interface HardenOptions {
|
|
216
273
|
defaultOrigin?: string;
|
|
@@ -336,22 +393,28 @@ interface InlineMathNodeRendererProps extends NodeRendererProps {
|
|
|
336
393
|
node: InlineMathNode;
|
|
337
394
|
}
|
|
338
395
|
//#endregion
|
|
339
|
-
//#region src/types/shared.d.ts
|
|
340
|
-
interface SelectItem {
|
|
341
|
-
label: string;
|
|
342
|
-
value: string;
|
|
343
|
-
icon?: Component;
|
|
344
|
-
}
|
|
345
|
-
//#endregion
|
|
346
396
|
//#region src/components/renderers/index.d.ts
|
|
347
397
|
declare const NODE_RENDERERS: NodeRenderers;
|
|
348
398
|
//#endregion
|
|
349
399
|
//#region src/components/index.d.ts
|
|
350
400
|
declare const COMMON_COMPONENTS: Record<string, Component>;
|
|
351
401
|
//#endregion
|
|
402
|
+
//#region src/composables/use-code-options.d.ts
|
|
403
|
+
interface UseCodeOptionsOptions {
|
|
404
|
+
codeOptions?: MaybeRef<CodeOptions | undefined>;
|
|
405
|
+
language?: MaybeRef<string>;
|
|
406
|
+
}
|
|
407
|
+
declare function useCodeOptions(options: UseCodeOptionsOptions): {
|
|
408
|
+
languageCodeOptions: vue29.ComputedRef<CodeOptionsLanguage | undefined>;
|
|
409
|
+
showLanguageIcon: vue29.ComputedRef<boolean>;
|
|
410
|
+
showLanguageName: vue29.ComputedRef<boolean>;
|
|
411
|
+
showLineNumbers: vue29.ComputedRef<boolean>;
|
|
412
|
+
};
|
|
413
|
+
//#endregion
|
|
352
414
|
//#region src/composables/use-context.d.ts
|
|
353
415
|
interface Context {
|
|
354
416
|
isDark?: MaybeRef<boolean>;
|
|
417
|
+
icons?: MaybeRef<Record<IconName, Component>>;
|
|
355
418
|
getContainer?: () => HTMLElement | undefined;
|
|
356
419
|
onCopied?: (content: string) => void;
|
|
357
420
|
}
|
|
@@ -359,7 +422,8 @@ declare function useContext(): {
|
|
|
359
422
|
context: Context;
|
|
360
423
|
provideContext: (ctx: Partial<Context>) => void;
|
|
361
424
|
injectContext: () => Context;
|
|
362
|
-
|
|
425
|
+
icons: vue29.ComputedRef<Record<string, Component>>;
|
|
426
|
+
isDark: vue29.ComputedRef<boolean>;
|
|
363
427
|
readonly getContainer: () => HTMLElement | undefined;
|
|
364
428
|
readonly onCopied: (content: string) => void;
|
|
365
429
|
};
|
|
@@ -381,10 +445,10 @@ interface UseHardenSanitizersOptions {
|
|
|
381
445
|
isImage?: MaybeRef<boolean | undefined>;
|
|
382
446
|
}
|
|
383
447
|
declare function useHardenSanitizers(options: UseHardenSanitizersOptions): {
|
|
384
|
-
hardenOptions:
|
|
448
|
+
hardenOptions: vue29.ComputedRef<HardenOptions>;
|
|
385
449
|
transformHardenUrl: (url: string) => string | null;
|
|
386
|
-
transformedUrl:
|
|
387
|
-
isHardenUrl:
|
|
450
|
+
transformedUrl: vue29.ComputedRef<string | null>;
|
|
451
|
+
isHardenUrl: vue29.ComputedRef<boolean>;
|
|
388
452
|
};
|
|
389
453
|
//#endregion
|
|
390
454
|
//#region src/composables/use-i18n.d.ts
|
|
@@ -394,7 +458,7 @@ declare function useI18n(): {
|
|
|
394
458
|
//#endregion
|
|
395
459
|
//#region src/composables/use-katex.d.ts
|
|
396
460
|
declare function useKatex(): {
|
|
397
|
-
installed:
|
|
461
|
+
installed: vue29.Ref<boolean, boolean>;
|
|
398
462
|
render: (code: string, options?: KatexOptions$1) => Promise<{
|
|
399
463
|
html?: string;
|
|
400
464
|
error?: string;
|
|
@@ -410,9 +474,9 @@ interface UseMathRendererOptions {
|
|
|
410
474
|
throttle?: MaybeRef<number>;
|
|
411
475
|
}
|
|
412
476
|
declare function useMathRenderer(options: UseMathRendererOptions): {
|
|
413
|
-
html:
|
|
414
|
-
error:
|
|
415
|
-
errorMessage:
|
|
477
|
+
html: vue29.Ref<string, string>;
|
|
478
|
+
error: vue29.ComputedRef<boolean>;
|
|
479
|
+
errorMessage: vue29.Ref<string, string>;
|
|
416
480
|
};
|
|
417
481
|
//#endregion
|
|
418
482
|
//#region src/composables/use-mermaid.d.ts
|
|
@@ -421,7 +485,7 @@ interface UseMermaidOptions {
|
|
|
421
485
|
isDark?: MaybeRef<boolean>;
|
|
422
486
|
}
|
|
423
487
|
declare function useMermaid(options?: UseMermaidOptions): {
|
|
424
|
-
installed:
|
|
488
|
+
installed: vue29.Ref<boolean, boolean>;
|
|
425
489
|
getMermaid: () => Promise<Mermaid>;
|
|
426
490
|
parseMermaid: (code: string) => Promise<boolean>;
|
|
427
491
|
renderMermaid: (code: string) => Promise<string | null>;
|
|
@@ -437,7 +501,7 @@ interface UseShikiOptions {
|
|
|
437
501
|
isDark?: MaybeRef<boolean>;
|
|
438
502
|
}
|
|
439
503
|
declare function useShiki(options?: UseShikiOptions): {
|
|
440
|
-
installed:
|
|
504
|
+
installed: vue29.Ref<boolean, boolean>;
|
|
441
505
|
getHighlighter: () => Promise<Highlighter>;
|
|
442
506
|
codeToTokens: (code: string) => Promise<TokensResult>;
|
|
443
507
|
preload: () => Promise<void>;
|
|
@@ -450,12 +514,12 @@ interface UseTailwindV3ThemeOptions {
|
|
|
450
514
|
styleScope?: MaybeRef<string>;
|
|
451
515
|
}
|
|
452
516
|
declare function useTailwindV3Theme(options: UseTailwindV3ThemeOptions): {
|
|
453
|
-
element:
|
|
517
|
+
element: vue29.ComputedRef<Element | undefined>;
|
|
454
518
|
id: string;
|
|
455
|
-
css:
|
|
519
|
+
css: vue29.ShallowRef<string>;
|
|
456
520
|
load: () => void;
|
|
457
521
|
unload: () => void;
|
|
458
|
-
isLoaded: Readonly<
|
|
522
|
+
isLoaded: Readonly<vue29.ShallowRef<boolean>>;
|
|
459
523
|
generateCSS: () => void;
|
|
460
524
|
};
|
|
461
525
|
//#endregion
|
|
@@ -484,11 +548,11 @@ interface ZoomPanState {
|
|
|
484
548
|
translateY: number;
|
|
485
549
|
}
|
|
486
550
|
declare function useZoom(options?: UseZoomOptions): {
|
|
487
|
-
zoom:
|
|
488
|
-
translateX:
|
|
489
|
-
translateY:
|
|
490
|
-
isDragging:
|
|
491
|
-
transformStyle:
|
|
551
|
+
zoom: vue29.Ref<number, number>;
|
|
552
|
+
translateX: vue29.Ref<number, number>;
|
|
553
|
+
translateY: vue29.Ref<number, number>;
|
|
554
|
+
isDragging: vue29.Ref<boolean, boolean>;
|
|
555
|
+
transformStyle: vue29.ComputedRef<{
|
|
492
556
|
transform: string;
|
|
493
557
|
}>;
|
|
494
558
|
zoomIn: () => void;
|
|
@@ -501,48 +565,36 @@ declare function useZoom(options?: UseZoomOptions): {
|
|
|
501
565
|
handleWheel: (event: WheelEvent, containerElement: HTMLElement) => void;
|
|
502
566
|
getState: () => ZoomPanState;
|
|
503
567
|
setState: (state: Partial<ZoomPanState>) => void;
|
|
568
|
+
handleTouchStart: (event: TouchEvent, containerElement: HTMLElement) => void;
|
|
569
|
+
handleTouchMove: (event: TouchEvent, containerElement: HTMLElement) => void;
|
|
570
|
+
handleTouchEnd: (event: TouchEvent) => void;
|
|
504
571
|
};
|
|
505
572
|
//#endregion
|
|
506
|
-
//#region src/constants/code.d.ts
|
|
507
|
-
declare const DEFAULT_LIGHT_THEME = "github-light";
|
|
508
|
-
declare const DEFAULT_DARK_THEME = "github-dark";
|
|
509
|
-
declare const LANGUAGE_ALIAS: Record<string, BuiltinLanguage>;
|
|
510
|
-
declare const LANGUAGE_EXTENSIONS: Partial<Record<BuiltinLanguage, string>>;
|
|
511
|
-
declare const LANGUAGE_ICONS: Partial<Record<BuiltinLanguage | SpecialLanguage, Component>>;
|
|
512
|
-
//#endregion
|
|
513
|
-
//#region src/constants/harden.d.ts
|
|
514
|
-
declare const DEFAULT_HARDEN_OPTIONS: HardenOptions;
|
|
515
|
-
//#endregion
|
|
516
|
-
//#region src/constants/icons.d.ts
|
|
517
|
-
declare const ICONS: Record<string, Component>;
|
|
518
|
-
//#endregion
|
|
519
|
-
//#region src/constants/theme.d.ts
|
|
520
|
-
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"];
|
|
521
|
-
//#endregion
|
|
522
573
|
//#region src/index.vue.d.ts
|
|
523
|
-
declare const __VLS_export:
|
|
574
|
+
declare const __VLS_export: vue29.DefineComponent<StreamMarkdownProps, {
|
|
524
575
|
getMarkdownParser: () => MarkdownParser;
|
|
525
576
|
getParsedNodes: () => ParsedNode[];
|
|
526
|
-
}, {}, {}, {},
|
|
577
|
+
}, {}, {}, {}, vue29.ComponentOptionsMixin, vue29.ComponentOptionsMixin, {} & {
|
|
527
578
|
copied: (content: string) => any;
|
|
528
|
-
}, string,
|
|
579
|
+
}, string, vue29.PublicProps, Readonly<StreamMarkdownProps> & Readonly<{
|
|
529
580
|
onCopied?: ((content: string) => any) | undefined;
|
|
530
581
|
}>, {
|
|
531
582
|
mode: "static" | "streaming";
|
|
532
583
|
content: string;
|
|
533
|
-
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",
|
|
584
|
+
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", Component>>;
|
|
585
|
+
icons: Partial<Record<IconName, Component>>;
|
|
534
586
|
locale: string | LocaleConfig;
|
|
535
587
|
controls: ControlsConfig;
|
|
536
588
|
previewers: PreviewerConfig;
|
|
537
589
|
isDark: boolean;
|
|
538
|
-
}, {}, {}, {}, string,
|
|
590
|
+
}, {}, {}, {}, string, vue29.ComponentProvideOptions, false, {}, any>;
|
|
539
591
|
declare const _default: typeof __VLS_export;
|
|
540
592
|
//#endregion
|
|
541
593
|
//#region src/locales/index.d.ts
|
|
542
594
|
declare const SUPPORT_LANGUAGES: string[];
|
|
543
595
|
declare const localesGlob: Record<string, () => Promise<unknown>>;
|
|
544
|
-
declare const localeMessages:
|
|
545
|
-
declare const currentLocale:
|
|
596
|
+
declare const localeMessages: vue29.Ref<LocaleConfig | undefined, LocaleConfig | undefined>;
|
|
597
|
+
declare const currentLocale: vue29.Ref<string, string>;
|
|
546
598
|
declare function loadLocaleMessages(language: string | LocaleConfig): Promise<void>;
|
|
547
599
|
//#endregion
|
|
548
600
|
//#region src/postprocess/text.d.ts
|
|
@@ -708,6 +760,9 @@ declare function fixStrong(content: string): string;
|
|
|
708
760
|
*/
|
|
709
761
|
declare function fixTable(content: string): string;
|
|
710
762
|
//#endregion
|
|
763
|
+
//#region src/preprocess/task-list.d.ts
|
|
764
|
+
declare function fixTaskList(content: string): string;
|
|
765
|
+
//#endregion
|
|
711
766
|
//#region src/preprocess/vendored/markdown-utils.d.ts
|
|
712
767
|
declare function preprocessLaTeX(content: string): string;
|
|
713
768
|
declare function preprocessThinkTag(content: string): string;
|
|
@@ -730,6 +785,10 @@ declare const incompleteLinkTextPattern: RegExp;
|
|
|
730
785
|
declare const incompleteUrlPattern: RegExp;
|
|
731
786
|
declare const tableRowPattern: RegExp;
|
|
732
787
|
declare const separatorPattern: RegExp;
|
|
788
|
+
declare const standaloneDashPattern: RegExp;
|
|
789
|
+
declare const taskListPattern: RegExp;
|
|
790
|
+
declare const quoteStandaloneDashPattern: RegExp;
|
|
791
|
+
declare const quoteTaskListPattern: RegExp;
|
|
733
792
|
//#endregion
|
|
734
793
|
//#region src/preprocess/index.d.ts
|
|
735
794
|
declare function proprocessContent(content: string): string;
|
|
@@ -773,4 +832,4 @@ declare function tableDataToTSV(data: TableData): string;
|
|
|
773
832
|
declare function escapeMarkdownTableCell(cell: string): string;
|
|
774
833
|
declare function tableDataToMarkdown(data: TableData): string;
|
|
775
834
|
//#endregion
|
|
776
|
-
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, ZoomControlPosition, 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 };
|
|
835
|
+
export { BlockquoteNode, BlockquoteNodeRendererProps, BreakNode, BreakNodeRendererProps, CODE_PREVIEWERS, COMMON_COMPONENTS, CodeControlsConfig, CodeNode, CodeNodeRendererProps, CodeOptions, CodeOptionsLanguage, 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, IconName, 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, ZoomControlPosition, ZoomControlsConfig, ZoomPanState, 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 };
|