markstream-vue2 0.0.44 → 0.0.45

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.
Files changed (51) hide show
  1. package/dist/chunks/{cssMode-86e8d6e4.cjs → cssMode-58e68511.cjs} +1 -1
  2. package/dist/chunks/{cssMode-32774a06.js → cssMode-60d93f28.js} +1 -1
  3. package/dist/chunks/{htmlMode-f84c7583.cjs → htmlMode-87a75897.cjs} +1 -1
  4. package/dist/chunks/{htmlMode-076e483c.js → htmlMode-8d468223.js} +1 -1
  5. package/dist/chunks/{index.legacy-1c6de434.js → index.legacy-010f0006.js} +2318 -1507
  6. package/dist/chunks/index.legacy-e02dc92b.cjs +1 -0
  7. package/dist/chunks/{jsonMode-e60229b9.cjs → jsonMode-2a97b947.cjs} +1 -1
  8. package/dist/chunks/{jsonMode-186d141c.js → jsonMode-307a9a02.js} +1 -1
  9. package/dist/chunks/{tsMode-6444eb2b.js → tsMode-4f227d36.js} +1 -1
  10. package/dist/chunks/{tsMode-5b9a0ba1.cjs → tsMode-b1f6e7cb.cjs} +1 -1
  11. package/dist/index.cjs +1 -1
  12. package/dist/index.css +1 -1
  13. package/dist/index.d.ts +23 -7
  14. package/dist/index.js +3973 -3634
  15. package/dist/index.px.css +1 -1
  16. package/dist/index.tailwind.css +1 -1
  17. package/dist/tailwind.ts +1 -1
  18. package/dist/types/components/CodeBlockNode/CodeBlockNode.vue.d.ts +27 -8
  19. package/dist/types/components/CodeBlockNode/HtmlPreviewFrame.vue.d.ts +2 -0
  20. package/dist/types/components/D2BlockNode/D2BlockNode.vue.d.ts +3 -3
  21. package/dist/types/components/D2BlockNode/d2.d.ts +13 -2
  22. package/dist/types/components/HeadingNode/HeadingNode.vue.d.ts +1 -1
  23. package/dist/types/components/HtmlBlockNode/HtmlBlockNode.vue.d.ts +19 -1
  24. package/dist/types/components/HtmlInlineNode/HtmlInlineNode.vue.d.ts +2 -0
  25. package/dist/types/components/ImageNode/ImageNode.vue.d.ts +2 -15
  26. package/dist/types/components/InfographicBlockNode/InfographicBlockNode.vue.d.ts +4 -3
  27. package/dist/types/components/InfographicBlockNode/infographic.d.ts +13 -1
  28. package/dist/types/components/MarkdownCodeBlockNode/MarkdownCodeBlockNode.vue.d.ts +8 -7
  29. package/dist/types/components/MathInlineNode/katex.d.ts +5 -2
  30. package/dist/types/components/MermaidBlockNode/MermaidBlockNode.vue.d.ts +4 -3
  31. package/dist/types/components/MermaidBlockNode/mermaid.d.ts +16 -2
  32. package/dist/types/components/NestedRenderer/NestedRenderer.vue.d.ts +1 -1
  33. package/dist/types/components/NodeRenderer/LegacyNodesRenderer.vue.d.ts +11 -8
  34. package/dist/types/components/NodeRenderer/NodeRenderer.vue.d.ts +16 -15
  35. package/dist/types/components/ParagraphNode/ParagraphNode.vue.d.ts +1 -0
  36. package/dist/types/components/TableNode/TableNode.vue.d.ts +3 -1
  37. package/dist/types/composables/useSafeI18n.d.ts +3 -3
  38. package/dist/types/composables/viewportPriority.d.ts +4 -3
  39. package/dist/types/exports.d.ts +23 -7
  40. package/dist/types/types/component-props.d.ts +20 -7
  41. package/dist/types/types/index.d.ts +2 -6
  42. package/dist/types/utils/diagramHeight.d.ts +11 -0
  43. package/dist/types/utils/htmlRenderer.d.ts +5 -27
  44. package/dist/types/utils/nestedHtml.d.ts +2 -1
  45. package/dist/types/utils/nestedNodes.d.ts +6 -1
  46. package/dist/types/utils/normalizeKaTeXRenderInput.d.ts +1 -0
  47. package/dist/workers/mermaidParser.worker.js +1 -1
  48. package/package.json +2 -2
  49. package/dist/chunks/index.legacy-70f0e155.cjs +0 -1
  50. package/dist/types/components/SoftBreakNode/SoftBreakNode.vue.d.ts +0 -17
  51. package/dist/types/components/SoftBreakNode/index.d.ts +0 -2
@@ -1,3 +1,4 @@
1
+ import { CodeBlockPreviewPayload } from '../../types/component-props';
1
2
  declare function __VLS_template(): {
2
3
  attrs: Partial<{}>;
3
4
  slots: {
@@ -92,13 +93,21 @@ declare const __VLS_component: import('vue-demi').DefineComponent<{
92
93
  type: BooleanConstructor;
93
94
  default: any;
94
95
  };
96
+ htmlPreviewAllowScripts: {
97
+ type: BooleanConstructor;
98
+ default: any;
99
+ };
100
+ htmlPreviewSandbox: {
101
+ type: StringConstructor;
102
+ default: any;
103
+ };
95
104
  customId: {
96
105
  type: StringConstructor;
97
106
  default: any;
98
107
  };
99
108
  }, {}, {}, {}, {}, import('vue-demi').ComponentOptionsMixin, import('vue-demi').ComponentOptionsMixin, {
100
- copy: (...args: any[]) => void;
101
- previewCode: (...args: any[]) => void;
109
+ previewCode: (payload: CodeBlockPreviewPayload) => void;
110
+ copy: (code: string) => void;
102
111
  }, string, Readonly<import('vue-demi').ExtractPropTypes<{
103
112
  node: {
104
113
  type: ObjectConstructor;
@@ -176,6 +185,14 @@ declare const __VLS_component: import('vue-demi').DefineComponent<{
176
185
  type: BooleanConstructor;
177
186
  default: any;
178
187
  };
188
+ htmlPreviewAllowScripts: {
189
+ type: BooleanConstructor;
190
+ default: any;
191
+ };
192
+ htmlPreviewSandbox: {
193
+ type: StringConstructor;
194
+ default: any;
195
+ };
179
196
  customId: {
180
197
  type: StringConstructor;
181
198
  default: any;
@@ -186,20 +203,22 @@ declare const __VLS_component: import('vue-demi').DefineComponent<{
186
203
  customId: string;
187
204
  isDark: boolean;
188
205
  loading: boolean;
189
- showHeader: boolean;
190
- showCopyButton: boolean;
191
- showCollapseButton: boolean;
192
- maxWidth: string | number;
193
- minWidth: string | number;
194
206
  stream: boolean;
195
207
  darkTheme: string | Record<string, any>;
196
208
  lightTheme: string | Record<string, any>;
197
- monacoOptions: Record<string, any>;
198
209
  isShowPreview: boolean;
210
+ monacoOptions: Record<string, any>;
199
211
  enableFontSizeControl: boolean;
212
+ minWidth: string | number;
213
+ maxWidth: string | number;
214
+ showHeader: boolean;
215
+ showCopyButton: boolean;
200
216
  showExpandButton: boolean;
201
217
  showPreviewButton: boolean;
218
+ showCollapseButton: boolean;
202
219
  showFontSizeButtons: boolean;
220
+ htmlPreviewAllowScripts: boolean;
221
+ htmlPreviewSandbox: string;
203
222
  }>;
204
223
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
205
224
  export default _default;
@@ -1,6 +1,8 @@
1
1
  type __VLS_Props = {
2
2
  code: string;
3
3
  isDark?: boolean;
4
+ htmlPreviewAllowScripts?: boolean;
5
+ htmlPreviewSandbox?: string;
4
6
  onClose?: () => void;
5
7
  title?: string;
6
8
  };
@@ -37,12 +37,12 @@ declare const _default: import('vue-demi').DefineComponent<__VLS_WithDefaults<__
37
37
  showCollapseButton: boolean;
38
38
  }>>>, {
39
39
  loading: boolean;
40
- maxHeight: string | number | null;
41
40
  showHeader: boolean;
42
- showModeToggle: boolean;
43
41
  showCopyButton: boolean;
44
- showExportButton: boolean;
45
42
  showCollapseButton: boolean;
43
+ maxHeight: string | number | null;
44
+ showModeToggle: boolean;
45
+ showExportButton: boolean;
46
46
  progressiveRender: boolean;
47
47
  progressiveIntervalMs: number;
48
48
  }>;
@@ -1,6 +1,17 @@
1
- export type D2Loader = () => Promise<any> | any;
1
+ export interface D2Instance {
2
+ D2?: D2Constructor;
3
+ compile?: (source: string, options?: Record<string, unknown>) => Promise<unknown> | unknown;
4
+ render?: (input: unknown, options?: Record<string, unknown>) => Promise<unknown> | unknown;
5
+ }
6
+ export interface D2Constructor {
7
+ new (): D2Instance;
8
+ D2?: D2Constructor;
9
+ compile?: D2Instance['compile'];
10
+ }
11
+ export type D2Module = D2Constructor | D2Instance;
12
+ export type D2Loader = () => Promise<unknown> | unknown;
2
13
  export declare function setD2Loader(loader: D2Loader | null): void;
3
14
  export declare function enableD2(loader?: D2Loader): void;
4
15
  export declare function disableD2(): void;
5
16
  export declare function isD2Enabled(): boolean;
6
- export declare function getD2(): Promise<any>;
17
+ export declare function getD2(): Promise<D2Module | null>;
@@ -15,7 +15,7 @@ type __VLS_Props = {
15
15
  customId?: string;
16
16
  indexKey?: number | string;
17
17
  };
18
- declare const _default: import('vue-demi').DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {}, {}, {}, {}, import('vue-demi').ComponentOptionsMixin, import('vue-demi').ComponentOptionsMixin, {}, string, Readonly<import('vue-demi').ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
18
+ declare const _default: import('../../../vue-demi').DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {}, {}, {}, {}, import('../../../vue-demi').ComponentOptionsMixin, import('../../../vue-demi').ComponentOptionsMixin, {}, string, Readonly<import('../../../vue-demi').ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
19
19
  export default _default;
20
20
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
21
21
  type __VLS_TypePropsToOption<T> = {
@@ -1,10 +1,15 @@
1
+ import { HtmlPolicy } from 'stream-markdown-parser';
1
2
  type __VLS_Props = {
2
3
  node: {
3
4
  content: string;
5
+ raw?: string;
6
+ tag?: string;
4
7
  attrs?: [string, string][] | null;
8
+ children?: any[];
5
9
  loading?: boolean;
6
10
  };
7
11
  customId?: string;
12
+ htmlPolicy?: HtmlPolicy;
8
13
  };
9
14
  declare function __VLS_template(): {
10
15
  attrs: Partial<{}>;
@@ -12,7 +17,20 @@ declare function __VLS_template(): {
12
17
  placeholder?(_: {
13
18
  node: {
14
19
  content: string;
20
+ raw?: string;
21
+ tag?: string;
15
22
  attrs?: [string, string][] | null;
23
+ children?: any[];
24
+ loading?: boolean;
25
+ };
26
+ }): any;
27
+ placeholder?(_: {
28
+ node: {
29
+ content: string;
30
+ raw?: string;
31
+ tag?: string;
32
+ attrs?: [string, string][] | null;
33
+ children?: any[];
16
34
  loading?: boolean;
17
35
  };
18
36
  }): any;
@@ -20,7 +38,7 @@ declare function __VLS_template(): {
20
38
  refs: {
21
39
  htmlRef: HTMLDivElement;
22
40
  };
23
- rootEl: HTMLDivElement;
41
+ rootEl: any;
24
42
  };
25
43
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
26
44
  declare const __VLS_component: import('vue-demi').DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {}, {}, {}, {}, import('vue-demi').ComponentOptionsMixin, import('vue-demi').ComponentOptionsMixin, {}, string, Readonly<import('vue-demi').ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
@@ -1,3 +1,4 @@
1
+ import { HtmlPolicy } from 'stream-markdown-parser';
1
2
  type __VLS_Props = {
2
3
  node: {
3
4
  type: 'html_inline';
@@ -7,6 +8,7 @@ type __VLS_Props = {
7
8
  autoClosed?: boolean;
8
9
  };
9
10
  customId?: string;
11
+ htmlPolicy?: HtmlPolicy;
10
12
  };
11
13
  declare const _default: import('vue-demi').DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {}, {}, {}, {}, import('vue-demi').ComponentOptionsMixin, import('vue-demi').ComponentOptionsMixin, {}, string, Readonly<import('vue-demi').ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
12
14
  export default _default;
@@ -8,11 +8,8 @@ interface ImageNodeProps {
8
8
  loading?: boolean;
9
9
  };
10
10
  fallbackSrc?: string;
11
- showCaption?: boolean;
12
11
  lazy?: boolean;
13
- svgMinHeight?: string;
14
12
  usePlaceholder?: boolean;
15
- inline?: boolean;
16
13
  }
17
14
  declare function __VLS_template(): {
18
15
  attrs: Partial<{}>;
@@ -31,7 +28,6 @@ declare function __VLS_template(): {
31
28
  hasError: boolean;
32
29
  fallbackSrc: string;
33
30
  lazy: boolean;
34
- isSvg: boolean;
35
31
  }): any;
36
32
  error?(_: {
37
33
  node: {
@@ -47,20 +43,15 @@ declare function __VLS_template(): {
47
43
  hasError: true;
48
44
  fallbackSrc: string;
49
45
  lazy: boolean;
50
- isSvg: boolean;
51
46
  }): any;
52
47
  };
53
- refs: {
54
- figureRef: unknown;
55
- };
56
- rootEl: any;
48
+ refs: {};
49
+ rootEl: Element;
57
50
  };
58
51
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
59
52
  declare const __VLS_component: import('vue-demi').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<ImageNodeProps>, {
60
53
  fallbackSrc: string;
61
- showCaption: boolean;
62
54
  lazy: boolean;
63
- svgMinHeight: string;
64
55
  usePlaceholder: boolean;
65
56
  }>, {}, {}, {}, {}, import('vue-demi').ComponentOptionsMixin, import('vue-demi').ComponentOptionsMixin, {
66
57
  load: (src: string) => void;
@@ -68,15 +59,11 @@ declare const __VLS_component: import('vue-demi').DefineComponent<__VLS_WithDefa
68
59
  click: (payload: [Event, string]) => void;
69
60
  }, string, Readonly<import('vue-demi').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<ImageNodeProps>, {
70
61
  fallbackSrc: string;
71
- showCaption: boolean;
72
62
  lazy: boolean;
73
- svgMinHeight: string;
74
63
  usePlaceholder: boolean;
75
64
  }>>>, {
76
65
  fallbackSrc: string;
77
- showCaption: boolean;
78
66
  lazy: boolean;
79
- svgMinHeight: string;
80
67
  usePlaceholder: boolean;
81
68
  }>;
82
69
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
@@ -1,6 +1,7 @@
1
1
  interface InfographicBlockNodeProps {
2
2
  node: any;
3
3
  maxHeight?: string | null;
4
+ estimatedPreviewHeightPx?: number;
4
5
  loading?: boolean;
5
6
  isDark?: boolean;
6
7
  showHeader?: boolean;
@@ -51,13 +52,13 @@ declare const __VLS_component: import('vue-demi').DefineComponent<__VLS_WithDefa
51
52
  showZoomControls: boolean;
52
53
  }>>>, {
53
54
  loading: boolean;
54
- maxHeight: string | null;
55
55
  showHeader: boolean;
56
- showModeToggle: boolean;
57
56
  showCopyButton: boolean;
57
+ showCollapseButton: boolean;
58
+ maxHeight: string | null;
59
+ showModeToggle: boolean;
58
60
  showExportButton: boolean;
59
61
  showFullscreenButton: boolean;
60
- showCollapseButton: boolean;
61
62
  showZoomControls: boolean;
62
63
  }>;
63
64
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
@@ -1 +1,13 @@
1
- export declare function getInfographic(): Promise<any>;
1
+ export interface InfographicInstance {
2
+ render: (source: string) => unknown;
3
+ destroy?: () => unknown;
4
+ on?: (event: string, handler: (payload: unknown) => void) => unknown;
5
+ }
6
+ export interface InfographicConstructor {
7
+ new (options: {
8
+ container: HTMLElement;
9
+ width?: string | number;
10
+ height?: string | number;
11
+ }): InfographicInstance;
12
+ }
13
+ export declare function getInfographic(): Promise<InfographicConstructor | null>;
@@ -1,3 +1,4 @@
1
+ import { MarkdownCodeBlockPreviewPayload } from '../../types/component-props';
1
2
  declare function __VLS_template(): {
2
3
  attrs: Partial<{}>;
3
4
  slots: {
@@ -90,8 +91,8 @@ declare const __VLS_component: import('vue-demi').DefineComponent<{
90
91
  default: any;
91
92
  };
92
93
  }, {}, {}, {}, {}, import('vue-demi').ComponentOptionsMixin, import('vue-demi').ComponentOptionsMixin, {
93
- copy: (...args: any[]) => void;
94
- previewCode: (...args: any[]) => void;
94
+ previewCode: (payload: MarkdownCodeBlockPreviewPayload) => void;
95
+ copy: (code: string) => void;
95
96
  }, string, Readonly<import('vue-demi').ExtractPropTypes<{
96
97
  node: {
97
98
  type: ObjectConstructor;
@@ -170,18 +171,18 @@ declare const __VLS_component: import('vue-demi').DefineComponent<{
170
171
  showTooltips: boolean;
171
172
  isDark: boolean;
172
173
  loading: boolean;
173
- showHeader: boolean;
174
- showCopyButton: boolean;
175
- showCollapseButton: boolean;
176
- maxWidth: string | number;
177
- minWidth: string | number;
178
174
  stream: boolean;
179
175
  darkTheme: string;
180
176
  lightTheme: string;
181
177
  isShowPreview: boolean;
182
178
  enableFontSizeControl: boolean;
179
+ minWidth: string | number;
180
+ maxWidth: string | number;
181
+ showHeader: boolean;
182
+ showCopyButton: boolean;
183
183
  showExpandButton: boolean;
184
184
  showPreviewButton: boolean;
185
+ showCollapseButton: boolean;
185
186
  showFontSizeButtons: boolean;
186
187
  }>;
187
188
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
@@ -1,6 +1,9 @@
1
- export type KatexLoader = () => Promise<any> | any;
1
+ export interface KatexModule {
2
+ renderToString: (content: string, options?: Record<string, unknown>) => string;
3
+ }
4
+ export type KatexLoader = () => Promise<unknown> | unknown;
2
5
  export declare function setKatexLoader(loader: KatexLoader | null): void;
3
6
  export declare function enableKatex(loader?: KatexLoader): void;
4
7
  export declare function disableKatex(): void;
5
8
  export declare function isKatexEnabled(): boolean;
6
- export declare function getKatex(): Promise<any>;
9
+ export declare function getKatex(): Promise<KatexModule | null>;
@@ -1,6 +1,7 @@
1
1
  interface MermaidBlockNodeProps {
2
2
  node: any;
3
3
  maxHeight?: string | null;
4
+ estimatedPreviewHeightPx?: number;
4
5
  loading?: boolean;
5
6
  isDark?: boolean;
6
7
  workerTimeoutMs?: number;
@@ -88,6 +89,9 @@ declare const __VLS_component: import('vue-demi').DefineComponent<__VLS_WithDefa
88
89
  isStrict: boolean;
89
90
  }>>>, {
90
91
  loading: boolean;
92
+ showHeader: boolean;
93
+ showCopyButton: boolean;
94
+ showCollapseButton: boolean;
91
95
  maxHeight: string | null;
92
96
  workerTimeoutMs: number;
93
97
  parseTimeoutMs: number;
@@ -98,12 +102,9 @@ declare const __VLS_component: import('vue-demi').DefineComponent<__VLS_WithDefa
98
102
  previewPollDelayMs: number;
99
103
  previewPollMaxDelayMs: number;
100
104
  previewPollMaxAttempts: number;
101
- showHeader: boolean;
102
105
  showModeToggle: boolean;
103
- showCopyButton: boolean;
104
106
  showExportButton: boolean;
105
107
  showFullscreenButton: boolean;
106
- showCollapseButton: boolean;
107
108
  showZoomControls: boolean;
108
109
  enableWheelZoom: boolean;
109
110
  isStrict: boolean;
@@ -1,6 +1,20 @@
1
- export type MermaidLoader = () => Promise<any> | any;
1
+ export interface MermaidModule {
2
+ render: (id: string, source: string) => Promise<MermaidRenderResult> | MermaidRenderResult;
3
+ parse?: (source: string) => Promise<unknown> | unknown;
4
+ initialize?: (config?: Record<string, unknown>) => unknown;
5
+ mermaidAPI?: {
6
+ render?: MermaidModule['render'];
7
+ parse?: MermaidModule['parse'];
8
+ initialize?: MermaidModule['initialize'];
9
+ };
10
+ }
11
+ export type MermaidRenderResult = string | {
12
+ svg?: string;
13
+ bindFunctions?: (element: Element) => unknown;
14
+ };
15
+ export type MermaidLoader = () => Promise<unknown> | unknown;
2
16
  export declare function setMermaidLoader(loader: MermaidLoader | null): void;
3
17
  export declare function enableMermaid(loader?: MermaidLoader): void;
4
18
  export declare function disableMermaid(): void;
5
19
  export declare function isMermaidEnabled(): boolean;
6
- export declare function getMermaid(): Promise<any>;
20
+ export declare function getMermaid(): Promise<MermaidModule | null>;
@@ -24,7 +24,7 @@ declare const _default: import('vue-demi').DefineComponent<{
24
24
  customHtmlTags: () => readonly string[] | undefined;
25
25
  customMarkdownIt: () => ((md: MarkdownIt) => MarkdownIt) | undefined;
26
26
  }>>, {
27
- final: boolean;
28
27
  loading: boolean;
28
+ final: boolean;
29
29
  }>;
30
30
  export default _default;
@@ -1,4 +1,5 @@
1
- import { BaseNode } from 'stream-markdown-parser';
1
+ import { BaseNode, HtmlPolicy } from 'stream-markdown-parser';
2
+ import { CodeBlockMonacoOptions, CodeBlockMonacoTheme, CodeBlockNodeProps, CodeBlockPreviewPayload } from '../../types/component-props';
2
3
  type __VLS_Props = {
3
4
  nodes?: BaseNode[];
4
5
  customId?: string;
@@ -6,24 +7,26 @@ type __VLS_Props = {
6
7
  typewriter?: boolean;
7
8
  showTooltips?: boolean;
8
9
  codeBlockStream?: boolean;
9
- codeBlockDarkTheme?: any;
10
- codeBlockLightTheme?: any;
11
- codeBlockMonacoOptions?: Record<string, any>;
10
+ codeBlockDarkTheme?: CodeBlockMonacoTheme;
11
+ codeBlockLightTheme?: CodeBlockMonacoTheme;
12
+ codeBlockMonacoOptions?: CodeBlockMonacoOptions;
12
13
  codeBlockMinWidth?: string | number;
13
14
  codeBlockMaxWidth?: string | number;
14
- codeBlockProps?: Record<string, any>;
15
+ codeBlockProps?: Partial<Omit<CodeBlockNodeProps, 'node'>>;
15
16
  renderCodeBlocksAsPre?: boolean;
16
- themes?: string[];
17
+ themes?: CodeBlockMonacoTheme[];
17
18
  isDark?: boolean;
18
19
  customHtmlTags?: readonly string[];
20
+ htmlPolicy?: HtmlPolicy;
19
21
  };
20
22
  declare const _default: import('vue-demi').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
21
23
  codeBlockStream: boolean;
22
24
  showTooltips: boolean;
23
25
  typewriter: boolean;
24
26
  }>, {}, {}, {}, {}, import('vue-demi').ComponentOptionsMixin, import('vue-demi').ComponentOptionsMixin, {
25
- copy: (...args: any[]) => void;
26
- handleArtifactClick: (...args: any[]) => void;
27
+ copy: (code: string) => void;
28
+ handleArtifactClick: (payload: CodeBlockPreviewPayload) => void;
29
+ click: (event: MouseEvent) => void;
27
30
  }, string, Readonly<import('vue-demi').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
28
31
  codeBlockStream: boolean;
29
32
  showTooltips: boolean;
@@ -1,5 +1,5 @@
1
- import { BaseNode, MarkdownIt, ParseOptions } from 'stream-markdown-parser';
2
- import { D2BlockNodeProps, InfographicBlockNodeProps, MermaidBlockNodeProps } from '../../types/component-props';
1
+ import { BaseNode, HtmlPolicy, MarkdownIt, ParseOptions } from 'stream-markdown-parser';
2
+ import { CodeBlockMonacoOptions, CodeBlockMonacoTheme, CodeBlockNodeProps, CodeBlockPreviewPayload, D2BlockNodeProps, InfographicBlockNodeProps, MermaidBlockNodeProps } from '../../types/component-props';
3
3
  export interface NodeRendererProps {
4
4
  content?: string;
5
5
  nodes?: BaseNode[];
@@ -18,6 +18,7 @@ export interface NodeRendererProps {
18
18
  * and are emitted as custom nodes (e.g. ['thinking']). Forwarded to `getMarkdown()`.
19
19
  */
20
20
  customHtmlTags?: readonly string[];
21
+ htmlPolicy?: HtmlPolicy;
21
22
  /** Enable priority rendering for visible viewport area */
22
23
  viewportPriority?: boolean;
23
24
  /**
@@ -26,9 +27,9 @@ export interface NodeRendererProps {
26
27
  * Default: true
27
28
  */
28
29
  codeBlockStream?: boolean;
29
- codeBlockDarkTheme?: any;
30
- codeBlockLightTheme?: any;
31
- codeBlockMonacoOptions?: Record<string, any>;
30
+ codeBlockDarkTheme?: CodeBlockMonacoTheme;
31
+ codeBlockLightTheme?: CodeBlockMonacoTheme;
32
+ codeBlockMonacoOptions?: CodeBlockMonacoOptions;
32
33
  /** If true, render all `code_block` nodes as plain <pre><code> blocks instead of the full CodeBlockNode */
33
34
  renderCodeBlocksAsPre?: boolean;
34
35
  /** Minimum width forwarded to CodeBlockNode (px or CSS unit) */
@@ -36,7 +37,7 @@ export interface NodeRendererProps {
36
37
  /** Maximum width forwarded to CodeBlockNode (px or CSS unit) */
37
38
  codeBlockMaxWidth?: string | number;
38
39
  /** Arbitrary props to forward to every CodeBlockNode */
39
- codeBlockProps?: Record<string, any>;
40
+ codeBlockProps?: Partial<Omit<CodeBlockNodeProps, 'node'>>;
40
41
  /** Props forwarded to MermaidBlockNode for mermaid fences */
41
42
  mermaidProps?: Partial<Omit<MermaidBlockNodeProps, 'node' | 'loading' | 'isDark'>>;
42
43
  /** Props forwarded to D2BlockNode for d2/d2lang fences */
@@ -45,7 +46,7 @@ export interface NodeRendererProps {
45
46
  infographicProps?: Partial<Omit<InfographicBlockNodeProps, 'node' | 'loading' | 'isDark'>>;
46
47
  /** Global tooltip toggle for link/code-block renderers (default: true) */
47
48
  showTooltips?: boolean;
48
- themes?: string[];
49
+ themes?: CodeBlockMonacoTheme[];
49
50
  isDark?: boolean;
50
51
  customId?: string;
51
52
  indexKey?: number | string;
@@ -70,7 +71,7 @@ export interface NodeRendererProps {
70
71
  /** Number of nodes to keep before/after focus. Default: 60 */
71
72
  liveNodeBuffer?: number;
72
73
  }
73
- declare const _default: import('vue-demi').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<NodeRendererProps>, {
74
+ declare const _default: import('../../../vue-demi').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<NodeRendererProps>, {
74
75
  codeBlockStream: boolean;
75
76
  showTooltips: boolean;
76
77
  typewriter: boolean;
@@ -84,13 +85,13 @@ declare const _default: import('vue-demi').DefineComponent<__VLS_WithDefaults<__
84
85
  deferNodesUntilVisible: boolean;
85
86
  maxLiveNodes: number;
86
87
  liveNodeBuffer: number;
87
- }>, {}, {}, {}, {}, import('vue-demi').ComponentOptionsMixin, import('vue-demi').ComponentOptionsMixin, {
88
- copy: (...args: any[]) => void;
89
- handleArtifactClick: (...args: any[]) => void;
90
- click: (...args: any[]) => void;
91
- mouseover: (...args: any[]) => void;
92
- mouseout: (...args: any[]) => void;
93
- }, string, Readonly<import('vue-demi').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<NodeRendererProps>, {
88
+ }>, {}, {}, {}, {}, import('../../../vue-demi').ComponentOptionsMixin, import('../../../vue-demi').ComponentOptionsMixin, {
89
+ copy: (code: string) => void;
90
+ handleArtifactClick: (payload: CodeBlockPreviewPayload) => void;
91
+ click: (event: MouseEvent) => void;
92
+ mouseover: (event: MouseEvent) => void;
93
+ mouseout: (event: MouseEvent) => void;
94
+ }, string, Readonly<import('../../../vue-demi').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<NodeRendererProps>, {
94
95
  codeBlockStream: boolean;
95
96
  showTooltips: boolean;
96
97
  typewriter: boolean;
@@ -11,6 +11,7 @@ type __VLS_Props = {
11
11
  };
12
12
  customId?: string;
13
13
  indexKey?: number | string;
14
+ customHtmlTags?: readonly string[];
14
15
  };
15
16
  declare const _default: import('vue-demi').DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {}, {}, {}, {}, import('vue-demi').ComponentOptionsMixin, import('vue-demi').ComponentOptionsMixin, {}, string, Readonly<import('vue-demi').ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
16
17
  export default _default;
@@ -34,7 +34,9 @@ declare function __VLS_template(): {
34
34
  isLoading: true;
35
35
  }): any;
36
36
  };
37
- refs: {};
37
+ refs: {
38
+ tableRef: HTMLTableElement;
39
+ };
38
40
  rootEl: HTMLDivElement;
39
41
  };
40
42
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
@@ -1,10 +1,10 @@
1
1
  declare const defaultMap: Record<string, string>;
2
2
  /**
3
- * Replace the entire default translation map.
3
+ * Replace default fallback translations.
4
4
  * Consumers can call this to provide their own fallback translations (e.g. Chinese).
5
5
  */
6
- export declare function setDefaultI18nMap(map: Record<keyof typeof defaultMap, string>): void;
6
+ export declare function setDefaultI18nMap(map: Partial<Record<keyof typeof defaultMap, string>>): void;
7
7
  export declare function useSafeI18n(): {
8
- t: any;
8
+ t(key: string): string;
9
9
  };
10
10
  export {};
@@ -9,12 +9,13 @@ export type RegisterFn = (el: HTMLElement, opts?: {
9
9
  threshold?: number;
10
10
  }) => VisibilityHandle;
11
11
  /**
12
- * Provide a shared IntersectionObserver based visibility registrar.
13
- * If disabled or not in browser, registers resolve immediately.
12
+ * Provide a shared viewport-priority registrar.
13
+ * Targets resolve immediately when they enter the viewport and otherwise
14
+ * trickle through during browser idle so heavy nodes can prerender offscreen.
14
15
  */
15
16
  export declare function provideViewportPriority(getRootEl: (target?: HTMLElement | null) => HTMLElement | null | undefined, enabled: Ref<boolean> | boolean): RegisterFn;
16
17
  /**
17
- * Child components call this to register an element and await visibility.
18
+ * Child components call this to register an element and await priority.
18
19
  * If provider is missing, returns a no-op registrar that resolves immediately.
19
20
  */
20
21
  export declare function useViewportPriority(): RegisterFn;
@@ -1,4 +1,6 @@
1
+ import { Component } from 'vue-demi';
1
2
  import { CustomComponents as MarkstreamCustomComponents } from './types';
3
+ import { MathOptions } from 'stream-markdown-parser';
2
4
  import { LanguageIconResolver } from './utils/languageIcon';
3
5
  import { default as AdmonitionNode } from './components/AdmonitionNode';
4
6
  import { default as BlockquoteNode } from './components/BlockquoteNode';
@@ -35,7 +37,6 @@ import { default as NestedRenderer } from './components/NestedRenderer';
35
37
  import { default as ParagraphNode } from './components/ParagraphNode';
36
38
  import { default as PreCodeNode } from './components/PreCodeNode';
37
39
  import { default as ReferenceNode } from './components/ReferenceNode';
38
- import { default as SoftBreakNode } from './components/SoftBreakNode';
39
40
  import { default as StrikethroughNode } from './components/StrikethroughNode';
40
41
  import { default as StrongNode } from './components/StrongNode';
41
42
  import { default as SubscriptNode } from './components/SubscriptNode';
@@ -51,7 +52,7 @@ export type { D2Loader } from './components/D2BlockNode/d2';
51
52
  export type { KatexLoader } from './components/MathInlineNode/katex';
52
53
  export type { MermaidLoader } from './components/MermaidBlockNode/mermaid';
53
54
  export type { NodeRendererProps } from './components/NodeRenderer/NodeRenderer.vue';
54
- export type { CodeBlockDiffAppearance, CodeBlockDiffHideUnchangedRegions, CodeBlockDiffHideUnchangedRegionsOptions, CodeBlockDiffHunkActionContext, CodeBlockDiffHunkActionKind, CodeBlockDiffHunkSide, CodeBlockDiffLineStyle, CodeBlockDiffUnchangedRegionStyle, CodeBlockMonacoLanguage, CodeBlockMonacoOptions, CodeBlockMonacoTheme, CodeBlockMonacoThemeObject, CodeBlockNodeProps, D2BlockNodeProps, ImageNodeProps, InfographicBlockNodeProps, LinkNodeProps, MathBlockNodeProps, MathInlineNodeProps, MermaidBlockEvent, MermaidBlockNodeProps, PreCodeNodeProps, } from './types/component-props';
55
+ export type { CodeBlockDiffAppearance, CodeBlockDiffHideUnchangedRegions, CodeBlockDiffHideUnchangedRegionsOptions, CodeBlockDiffHunkActionContext, CodeBlockDiffHunkActionKind, CodeBlockDiffHunkSide, CodeBlockDiffLineStyle, CodeBlockDiffUnchangedRegionStyle, CodeBlockMonacoLanguage, CodeBlockMonacoOptions, CodeBlockMonacoTheme, CodeBlockMonacoThemeObject, CodeBlockNodeProps, CodeBlockPreviewPayload, D2BlockNodeProps, ImageNodeProps, InfographicBlockNodeProps, LinkNodeProps, MathBlockNodeProps, MathInlineNodeProps, MarkdownCodeBlockPreviewPayload, MermaidBlockEvent, MermaidBlockNodeProps, PreCodeNodeProps, } from './types/component-props';
55
56
  export * from './utils';
56
57
  export * from './workers/katexCdnWorker';
57
58
  export * from './workers/katexWorkerClient';
@@ -61,11 +62,26 @@ export { KATEX_COMMANDS, normalizeStandaloneBackslashT, setDefaultMathOptions }
61
62
  export type { MathOptions } from 'stream-markdown-parser';
62
63
  export interface CustomComponents extends MarkstreamCustomComponents {
63
64
  }
64
- export { AdmonitionNode, BlockquoteNode, CheckboxNode, clearGlobalCustomComponents, CodeBlockNode, D2BlockNode, DefinitionListNode, disableD2, disableKatex, disableMermaid, EmojiNode, EmphasisNode, enableD2, enableKatex, enableMermaid, FootnoteAnchorNode, FootnoteNode, FootnoteReferenceNode, getCustomNodeComponents, HardBreakNode, HeadingNode, HighlightNode, HtmlBlockNode, HtmlInlineNode, ImageNode, InfographicBlockNode, InlineCodeNode, InsertNode, isD2Enabled, isKatexEnabled, isMermaidEnabled, LinkNode, ListItemNode, ListNode, MarkdownCodeBlockNode, MarkdownRender, MathBlockNode, MathInlineNode, MermaidBlockNode, NestedRenderer, ParagraphNode, PreCodeNode, ReferenceNode, SoftBreakNode, removeCustomComponents, setCustomComponents, setD2Loader, setDefaultI18nMap, setKatexLoader, setMermaidLoader, StrikethroughNode, StrongNode, SubscriptNode, SuperscriptNode, TableNode, TextNode, ThematicBreakNode, Tooltip, VmrContainerNode, };
65
+ export interface MarkstreamVue2PluginOptions {
66
+ getLanguageIcon?: LanguageIconResolver;
67
+ mathOptions?: MathOptions;
68
+ }
69
+ interface Vue2InstanceLike {
70
+ _setupProxy?: unknown;
71
+ }
72
+ interface Vue2ConstructorLike {
73
+ version?: string;
74
+ prototype: Record<string, unknown>;
75
+ component: (name: string, component: Component) => void;
76
+ mixin: (mixin: {
77
+ beforeCreate?: (this: Vue2InstanceLike) => void;
78
+ }) => void;
79
+ __composition_api_installed__?: boolean;
80
+ __compositionApiInstalled?: boolean;
81
+ __markstreamVue2SetupProxyPatched?: boolean;
82
+ }
83
+ export { AdmonitionNode, BlockquoteNode, CheckboxNode, clearGlobalCustomComponents, CodeBlockNode, D2BlockNode, DefinitionListNode, disableD2, disableKatex, disableMermaid, EmojiNode, EmphasisNode, enableD2, enableKatex, enableMermaid, FootnoteAnchorNode, FootnoteNode, FootnoteReferenceNode, getCustomNodeComponents, HardBreakNode, HeadingNode, HighlightNode, HtmlBlockNode, HtmlInlineNode, ImageNode, InfographicBlockNode, InlineCodeNode, InsertNode, isD2Enabled, isKatexEnabled, isMermaidEnabled, LinkNode, ListItemNode, ListNode, MarkdownCodeBlockNode, MarkdownRender, MathBlockNode, MathInlineNode, MermaidBlockNode, NestedRenderer, ParagraphNode, PreCodeNode, ReferenceNode, removeCustomComponents, setCustomComponents, setD2Loader, setDefaultI18nMap, setKatexLoader, setMermaidLoader, StrikethroughNode, StrongNode, SubscriptNode, SuperscriptNode, TableNode, TextNode, ThematicBreakNode, Tooltip, VmrContainerNode, };
65
84
  export default MarkdownRender;
66
85
  export declare const VueRendererMarkdown: {
67
- install(Vue: any, options?: {
68
- getLanguageIcon?: LanguageIconResolver;
69
- mathOptions?: any;
70
- }): void;
86
+ install(Vue: Vue2ConstructorLike, options?: MarkstreamVue2PluginOptions): void;
71
87
  };