markstream-vue2 0.0.53 → 0.1.0-beta.2
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 +27 -24
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +2 -3
- package/dist/index.js +679 -2006
- package/dist/index.px.css +1 -1
- package/dist/index.tailwind.css +1 -1
- package/dist/tailwind.ts +1 -1
- package/dist/types/components/CodeBlockNode/CodeBlockNode.vue.d.ts +38 -19
- package/dist/types/components/CodeBlockNode/streamDiffs.d.ts +9 -0
- package/dist/types/components/MarkdownRenderCompat.vue.d.ts +11 -14
- package/dist/types/components/NodeRenderer/CodeBlockNodeLoading.vue.d.ts +0 -9
- package/dist/types/components/NodeRenderer/LegacyNodesRenderer.vue.d.ts +9 -20
- package/dist/types/components/NodeRenderer/NodeRenderer.vue.d.ts +10 -20
- package/dist/types/composables/useSingletonTooltip.d.ts +1 -1
- package/dist/types/exports.d.ts +2 -3
- package/dist/types/types/component-props.d.ts +59 -69
- package/dist/types/utils/index.d.ts +1 -1
- package/dist/types/utils/languageIcon.d.ts +1 -1
- package/package.json +7 -15
- package/dist/chunks/andromeeda-0e066d27.js +0 -4
- package/dist/chunks/andromeeda-beebe2f9.cjs +0 -1
- package/dist/chunks/aurora-x-7d279c8e.cjs +0 -1
- package/dist/chunks/aurora-x-e4f2fe1b.js +0 -4
- package/dist/chunks/ayu-dark-349c357c.js +0 -4
- package/dist/chunks/ayu-dark-5e86208e.cjs +0 -1
- package/dist/chunks/ayu-light-18928686.cjs +0 -1
- package/dist/chunks/ayu-light-bfc150f8.js +0 -4
- package/dist/chunks/ayu-mirage-3383fcd0.js +0 -4
- package/dist/chunks/ayu-mirage-3af5c477.cjs +0 -1
- package/dist/chunks/catppuccin-frappe-32dd8ebe.js +0 -4
- package/dist/chunks/catppuccin-frappe-5990e1cc.cjs +0 -1
- package/dist/chunks/catppuccin-latte-7dd9ec26.cjs +0 -1
- package/dist/chunks/catppuccin-latte-842c8be1.js +0 -4
- package/dist/chunks/catppuccin-macchiato-0c355ced.js +0 -4
- package/dist/chunks/catppuccin-macchiato-12297a0c.cjs +0 -1
- package/dist/chunks/catppuccin-mocha-164bffb5.cjs +0 -1
- package/dist/chunks/catppuccin-mocha-840be6a5.js +0 -4
- package/dist/chunks/dark-plus-37515867.cjs +0 -1
- package/dist/chunks/dark-plus-51ee0d5e.js +0 -4
- package/dist/chunks/dracula-6e5c19a8.js +0 -4
- package/dist/chunks/dracula-ad0b94e0.cjs +0 -1
- package/dist/chunks/dracula-soft-223c44b5.cjs +0 -1
- package/dist/chunks/dracula-soft-744d21b1.js +0 -4
- package/dist/chunks/everforest-dark-3a566062.js +0 -4
- package/dist/chunks/everforest-dark-630f597e.cjs +0 -1
- package/dist/chunks/everforest-light-92583419.js +0 -4
- package/dist/chunks/everforest-light-ba8af69c.cjs +0 -1
- package/dist/chunks/github-dark-44cb1819.cjs +0 -1
- package/dist/chunks/github-dark-cb4e8bb4.js +0 -4
- package/dist/chunks/github-dark-default-d50179ae.js +0 -4
- package/dist/chunks/github-dark-default-f99477eb.cjs +0 -1
- package/dist/chunks/github-dark-dimmed-96ccf893.cjs +0 -1
- package/dist/chunks/github-dark-dimmed-ebbb9420.js +0 -4
- package/dist/chunks/github-dark-high-contrast-5cc08661.js +0 -4
- package/dist/chunks/github-dark-high-contrast-adcd4e61.cjs +0 -1
- package/dist/chunks/github-light-42f759a4.cjs +0 -1
- package/dist/chunks/github-light-555bd325.js +0 -4
- package/dist/chunks/github-light-default-50fa37cd.cjs +0 -1
- package/dist/chunks/github-light-default-9c006cf6.js +0 -4
- package/dist/chunks/github-light-high-contrast-15a9bb5a.cjs +0 -1
- package/dist/chunks/github-light-high-contrast-ffa0564e.js +0 -4
- package/dist/chunks/gruvbox-dark-hard-4412389e.js +0 -4
- package/dist/chunks/gruvbox-dark-hard-cc007dcd.cjs +0 -1
- package/dist/chunks/gruvbox-dark-medium-415e09f2.cjs +0 -1
- package/dist/chunks/gruvbox-dark-medium-fa0eeef7.js +0 -4
- package/dist/chunks/gruvbox-dark-soft-3125d894.cjs +0 -1
- package/dist/chunks/gruvbox-dark-soft-a4600b2a.js +0 -4
- package/dist/chunks/gruvbox-light-hard-4c8c0395.cjs +0 -1
- package/dist/chunks/gruvbox-light-hard-8e736562.js +0 -4
- package/dist/chunks/gruvbox-light-medium-0c0cbf5d.js +0 -4
- package/dist/chunks/gruvbox-light-medium-abf52b0c.cjs +0 -1
- package/dist/chunks/gruvbox-light-soft-0e7ed903.cjs +0 -1
- package/dist/chunks/gruvbox-light-soft-a35d50d0.js +0 -4
- package/dist/chunks/horizon-31da8ee5.js +0 -4
- package/dist/chunks/horizon-bright-bb8b03f8.js +0 -4
- package/dist/chunks/horizon-bright-d2ea0b12.cjs +0 -1
- package/dist/chunks/horizon-f8b833c3.cjs +0 -1
- package/dist/chunks/houston-20eb8cbf.cjs +0 -1
- package/dist/chunks/houston-d3d3c60d.js +0 -4
- package/dist/chunks/index-42602bc0.js +0 -18739
- package/dist/chunks/index-b485917b.cjs +0 -1
- package/dist/chunks/index-c958c796.cjs +0 -1
- package/dist/chunks/index-fce73667.js +0 -1702
- package/dist/chunks/kanagawa-dragon-0246ed94.cjs +0 -1
- package/dist/chunks/kanagawa-dragon-324edcdc.js +0 -4
- package/dist/chunks/kanagawa-lotus-61838bd3.cjs +0 -1
- package/dist/chunks/kanagawa-lotus-a847832a.js +0 -4
- package/dist/chunks/kanagawa-wave-2b426416.cjs +0 -1
- package/dist/chunks/kanagawa-wave-7b8409ec.js +0 -4
- package/dist/chunks/laserwave-538ee8e3.js +0 -4
- package/dist/chunks/laserwave-d5e6cfa6.cjs +0 -1
- package/dist/chunks/light-plus-471df294.cjs +0 -1
- package/dist/chunks/light-plus-a0703fa7.js +0 -4
- package/dist/chunks/material-theme-686d9ffc.js +0 -4
- package/dist/chunks/material-theme-9d859633.cjs +0 -1
- package/dist/chunks/material-theme-darker-cac9360e.js +0 -4
- package/dist/chunks/material-theme-darker-fe8dd38a.cjs +0 -1
- package/dist/chunks/material-theme-lighter-03523bbb.js +0 -4
- package/dist/chunks/material-theme-lighter-879be29a.cjs +0 -1
- package/dist/chunks/material-theme-ocean-37052f40.js +0 -4
- package/dist/chunks/material-theme-ocean-c1caeaa4.cjs +0 -1
- package/dist/chunks/material-theme-palenight-70bbf617.js +0 -4
- package/dist/chunks/material-theme-palenight-ef8b2399.cjs +0 -1
- package/dist/chunks/min-dark-0baaa2b0.cjs +0 -1
- package/dist/chunks/min-dark-16b503e6.js +0 -4
- package/dist/chunks/min-light-0c4ea4ec.js +0 -4
- package/dist/chunks/min-light-f65395e0.cjs +0 -1
- package/dist/chunks/monokai-32171550.js +0 -4
- package/dist/chunks/monokai-b9c22257.cjs +0 -1
- package/dist/chunks/night-owl-5eeb6e45.cjs +0 -1
- package/dist/chunks/night-owl-cb71e64c.js +0 -4
- package/dist/chunks/night-owl-light-3b4be46f.js +0 -4
- package/dist/chunks/night-owl-light-f04fad9f.cjs +0 -1
- package/dist/chunks/nord-0b42b6b4.cjs +0 -1
- package/dist/chunks/nord-b2f653cd.js +0 -4
- package/dist/chunks/one-dark-pro-611d46bc.js +0 -4
- package/dist/chunks/one-dark-pro-6ac63500.cjs +0 -1
- package/dist/chunks/one-light-2f27f0f0.cjs +0 -1
- package/dist/chunks/one-light-f2b411cc.js +0 -4
- package/dist/chunks/pierre-dark-9c2ca7e3.cjs +0 -1
- package/dist/chunks/pierre-dark-f4c18c96.js +0 -4
- package/dist/chunks/pierre-dark-protanopia-deuteranopia-31face57.js +0 -4
- package/dist/chunks/pierre-dark-protanopia-deuteranopia-67028f58.cjs +0 -1
- package/dist/chunks/pierre-dark-soft-3103370a.js +0 -4
- package/dist/chunks/pierre-dark-soft-59e1d5bc.cjs +0 -1
- package/dist/chunks/pierre-dark-tritanopia-b2966d75.js +0 -4
- package/dist/chunks/pierre-dark-tritanopia-d87f3323.cjs +0 -1
- package/dist/chunks/pierre-dark-vibrant-4de6032d.js +0 -4
- package/dist/chunks/pierre-dark-vibrant-f4553619.cjs +0 -1
- package/dist/chunks/pierre-light-45d08543.js +0 -4
- package/dist/chunks/pierre-light-ae152c30.cjs +0 -1
- package/dist/chunks/pierre-light-protanopia-deuteranopia-78f5453c.cjs +0 -1
- package/dist/chunks/pierre-light-protanopia-deuteranopia-816a3304.js +0 -4
- package/dist/chunks/pierre-light-soft-2a7b83ed.cjs +0 -1
- package/dist/chunks/pierre-light-soft-9c96aa07.js +0 -4
- package/dist/chunks/pierre-light-tritanopia-22534644.cjs +0 -1
- package/dist/chunks/pierre-light-tritanopia-b49f3566.js +0 -4
- package/dist/chunks/pierre-light-vibrant-178f2e13.cjs +0 -1
- package/dist/chunks/pierre-light-vibrant-1d779afc.js +0 -4
- package/dist/chunks/plastic-050a5288.js +0 -4
- package/dist/chunks/plastic-ab5115cb.cjs +0 -1
- package/dist/chunks/poimandres-9b9bffc0.cjs +0 -1
- package/dist/chunks/poimandres-e7807ea4.js +0 -4
- package/dist/chunks/red-58c74b50.cjs +0 -1
- package/dist/chunks/red-8b5bb9fd.js +0 -4
- package/dist/chunks/rose-pine-dawn-c54a297c.js +0 -4
- package/dist/chunks/rose-pine-dawn-dcd06a2d.cjs +0 -1
- package/dist/chunks/rose-pine-e3dfc7b6.js +0 -4
- package/dist/chunks/rose-pine-e443c3f3.cjs +0 -1
- package/dist/chunks/rose-pine-moon-c4ae0bee.cjs +0 -1
- package/dist/chunks/rose-pine-moon-ff747b44.js +0 -4
- package/dist/chunks/slack-dark-119fdcba.cjs +0 -1
- package/dist/chunks/slack-dark-cba39ccf.js +0 -4
- package/dist/chunks/slack-ochin-4a97383e.js +0 -4
- package/dist/chunks/slack-ochin-e53abb89.cjs +0 -1
- package/dist/chunks/snazzy-light-863adb77.js +0 -4
- package/dist/chunks/snazzy-light-aacd1ca8.cjs +0 -1
- package/dist/chunks/solarized-dark-18286b81.js +0 -4
- package/dist/chunks/solarized-dark-6c53ecf9.cjs +0 -1
- package/dist/chunks/solarized-light-abef5a54.cjs +0 -1
- package/dist/chunks/solarized-light-e7adfa5b.js +0 -4
- package/dist/chunks/synthwave-84-26ebbfca.js +0 -4
- package/dist/chunks/synthwave-84-ddb2c535.cjs +0 -1
- package/dist/chunks/tokyo-night-25368f86.js +0 -4
- package/dist/chunks/tokyo-night-6e0b49fd.cjs +0 -1
- package/dist/chunks/vesper-0ba44279.js +0 -4
- package/dist/chunks/vesper-a2e0b586.cjs +0 -1
- package/dist/chunks/vitesse-black-2be67ba4.cjs +0 -1
- package/dist/chunks/vitesse-black-33005deb.js +0 -4
- package/dist/chunks/vitesse-dark-82a14fc3.cjs +0 -1
- package/dist/chunks/vitesse-dark-9bb81e7a.js +0 -4
- package/dist/chunks/vitesse-light-2f9f7ba9.js +0 -4
- package/dist/chunks/vitesse-light-ee2c704b.cjs +0 -1
- package/dist/chunks/wasm-4cd10f60.cjs +0 -1
- package/dist/chunks/wasm-cb55701e.js +0 -30
- package/dist/types/components/CodeBlockNode/monaco.d.ts +0 -1
- package/dist/types/components/CodeBlockNode/monacoThemeScheduler.d.ts +0 -3
- package/dist/types/components/MarkdownCodeBlockNode/MarkdownCodeBlockNode.vue.d.ts +0 -233
- package/dist/types/components/MarkdownCodeBlockNode/index.d.ts +0 -2
- /package/dist/types/components/NodeRenderer/{preloadMonaco.d.ts → preloadStreamDiffs.d.ts} +0 -0
package/dist/tailwind.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export const safeList = `admonition is-dark admonition-header [_setup.iconMap[_setup.props.node.kind] admonition-icon admonition-title admonition-toggle show v-show !collapsed admonition-content
|
|
1
|
+
export const safeList = `auto component [] copy admonition is-dark admonition-header [_setup.iconMap[_setup.props.node.kind] admonition-icon admonition-title admonition-toggle show v-show !collapsed admonition-content f9c1d6b9 checkbox-node checkbox-input checkbox checked stream-markdown-parser vue-demi code-pre-fallback container code-block-container my-4 rounded-lg border overflow-hidden shadow-sm border-gray-700/30 bg-gray-900 border-gray-200 bg-white is-plain-text ready pending code-block-header flex justify-between items-center code-header-main icon-slot h-4 w-4 flex-shrink-0 code-header-copy code-header-title header-right code-header-actions code-action-btn transition-colors mouseenter focus action-icon none currentColor round m9 click m14 evenodd !isCollapsed code-editor-layer codeEditor code-editor-container code-height-placeholder"] void !stream loading code-loading-placeholder loading-skeleton skeleton-line short sr-only polite status footnote-reference footnote-link cursor-pointer dl definition-list entry.className entry.key entry.nodes b089ea12 footnote-node text-sm leading-relaxed border-t border-[var(--footnote-border,#eaecef)] pt-2 flex-1 emoji-node de55dc97 d2-block-container text-gray-100 text-gray-900 d2-block-header px-4 py-2.5 border-b border-gray-400/5 gap-x-2 gap-x-1 rounded-md p-0.5 bg-gray-700 bg-gray-100 mode-btn px-2 py-1 text-xs rounded is-active preview source d2-action-btn p-2 hover:bg-[var(--vscode-editor-selectionBackground)] w-3 h-3 bodyRef d2-block-body d2-source py-4 d2-code d2-error mt-2 d2-render d2-svg pb-3 font-medium font-mono fdf24c90 emphasis-node child emphasis footnote-anchor hover:underline mark highlight-node highlight hard-break heading-node heading ffb7cf51 structured htmlRef html-block-node html-block-node__placeholder html-block-node__placeholder-bar w-4/5 w-2/3 dynamic node html-inline-node text innerHTML e6ed4c9f inline text-[85%] px-1 py-0.5 bg-[hsl(var(--secondary))] whitespace-normal break-words max-w-full before:content-[''] after:content-[''] segment.id segment.fading animationend transition img-switch out-in image image-node__img h-auto transition-opacity duration-200 ease-in-out image-node__img--inline opacity-0 opacity-100 ?? lazy eager async placeholder placeholder-layer placeholder-layer--inline inline-flex justify-center gap-2 rounded-full border-2 border-solid border-current border-t-transparent animate-spin whitespace-nowrap text-gray-500 [_vm._v(_vm._s(_vm.node.raw))])]] error image-node__error image-node__error--inline py-2 text-red-500 is-rendering infographic-block-header bg-gray-800 bg-gray-50 [_vm.$slots["header-left"] [_vm._t("header-left")] my-0 truncate text-gray-400 text-gray-600 [_vm._t("header-center")] px-2.5 bg-gray-600 text-gray-200 text-gray-700 hover:text-gray-200 hover:text-gray-700 m16 [_vm._t("header-right")] opacity-50 cursor-not-allowed m7 p-4 whitespace-pre-wrap text-gray-300 relative absolute top-2 right-2 z-10 backdrop-blur hover:bg-gray-700 hover:bg-gray-200"] in m21 out zoom infographic-preview min-h-[360px] transition-all duration-100 block inset-0 cursor-grab infographicContainer w-full text-center min-h-full markstream-vue infographic-dialog fixed z-50 bg-black/70 dialog-panel h-full max-h-full shadow-lg top-6 right-6 modalContent insert-node insert ab1ec9bc list-node list-disc item index anchorEl link-node noopener noreferrer link-text link-loading items-baseline gap-1.5 link-text-wrapper leading-[normal] link-loading-indicator list-item pl-1.5 my-2 containerEl math-block overflow-x-auto min-h-[40px] math-block__content math-block__fallback math-loading-overlay math-loading-spinner math-inline-wrapper math-inline math-inline--fallback math-inline__loading math-inline__spinner isLoading text-node text-node-center markstream-pre--line-numbers markstream-pre--diff-preview markstream-pre--diff-inline markstream-pre__diff-code no pane.key markstream-pre__diff-pane line.key markstream-pre__diff-line line.empty markstream-pre__diff-rail markstream-pre__diff-number markstream-pre__diff-content markstream-pre__diff-content-inner markstream-pre__line-numbers markstream-pre__line-numbers-text markstream-pre__code textContent strong-node custom-id af3ce037 strikethrough-node strikethrough table-node-wrapper tableRef my-8 table-node col border-[var(--table-border,#cbd5e1)] font-semibold p-[calc(4/7*1em)] right text-right cell.align center text-left cell.children table-node__resize-handle columns and pointerdown table-node-fade table-node__loading table-node__spinner hr-node reference-node bg-[hsl(var(--muted))] px-1.5 mx-0.5 hover:bg-[hsl(var(--secondary))] mouseEnter mouseleave mouseLeave markstream-vue2 tooltip visible z-[9999] inline-block text-base px-3 shadow-md pointer-events-none tooltip-element text-white border-gray-700 border"] paragraph-node mermaid-block-header space-x-2 space-x-1 modeContainerRef mermaidContainer transition-[height] duration-150 ease-out mermaidContent mermaid-dialog superscript-node superscript-child [_setup.nodeComponents[child.type] child.raw ef2512b4 subscript-node subscript-child vmr-container is common alias note smooth dt definition-term dd definition-desc previewCode preview-code plaintext monospace number maxHeight padding tabSize theme themes themeType language languages stream disableFileHeader onThemeChange renderCustomHeader renderHeaderMetadata renderHeaderPrefix object split line-info diff single [markstream-vue2] stream-diffs not blocks will use basic enhanced editor to initialize typeof diffs-container pre[data-file] hidden navigator.clipboard navigator.clipboard.writeText top post string vitesse-dark vitesse-light dark night moon black dracula mocha frappe macchiato palenight ocean poimandres monokai laserwave tokyo slack-dark rose-pine github-dark material-theme one-dark catppuccin-mocha catppuccin-frappe catppuccin-macchiato light latte dawn lotus boolean unified fontSize lineHeight paddingBottom paddingTop resolvedCodeBlockOptions.value.overflow scroll pre-wrap wrap nextOptions.unsafeCSS resize href name xlink:href markstream-d2-root-svg instance.render instance missing render returned empty window.requestAnimationFrame markdown-renderer legacy-nodes-renderer item.renderKey node-slot item.index item.node.type node-content item.node item.node.loading item.indexKey markstreamHtmlPolicy safe escape load primary failed fallback markstreamFade markstreamTextStreamState raw index-key inline-code-stream-delta--a inline-code-stream-delta--b event.clientY pointermove mousemove infinite openModal element found keydown transform ease fullscreen library p-4">Failed instanceof error.message infographic-action-btn hover:bg-gray-200 $$ markstreamStreamVersion text-node-stream-delta--a text-node-stream-delta--b code[start] hunk !options.preserveBlankKind context removed added markstream-pre__diff-pane--inline original markstream-pre__diff-pane--original modified markstream-pre__diff-pane--modified pointerup pointercancel paragraph custom-html-tags html_block child.type html_inline toggleMode strict loose mermaid configure default abort timed error?.message gantt viewBox width height get [data-mermaid-wrapper] open-modal toggle-mode transitionend retry mermaid-action-btn html-preview-frame__backdrop html-preview-frame html-preview-frame__header html-preview-frame__title html-preview-frame__dot html-preview-frame__label html-preview-frame__close html-preview-frame__iframe no-referrer srcdoc markstream-core copy-code handleArtifactClick markstreamTypewriter legacy-renderer builtinCodeBlockExtraProps.value.showLineNumbers unknown node.type code_block infographic d2 lang d2lang list containerRef mouseout fade handle-artifact-click item.bindings node-spacer node-placeholder typewriterCursorRef typewriter-cursor ebe176a0 unknown-node htmlPreviewSandbox contains both allow-scripts this only fully trusted content served an isolated en utf-8 viewport content="width=device-width initial-scale=1 e.key rootRef portal-root code-block-loading code-block-loading__header code-block-loading__icon code-block-loading__actions code-block-loading-pre minHeight mouseover show-tooltips markstreamSmoothStreaming markstreamShowTooltips globalThis.process globalThis.process?.env?.NODE_ENV test reverse too-many-targets console viewportPriority virtualization this.isDark mermaid-preview-area peer dependencies are back preformatted enable rendering please install list_item definition_list footnote [data-node-index] math_block [data-node-type="code_block"] [data-node-type="admonition"] [data-node-type="table"] [data-node-type="math_block"] [data-node-type="html_block"] [data-node-type="image"]`
|
|
2
2
|
module.exports = safeList;
|
|
3
3
|
export default safeList;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PropType } from 'vue-demi';
|
|
2
|
+
import { CodeBlockOptions, CodeBlockPreviewPayload, CodeBlockThemeProp, CodeBlockThemes } from '../../types/component-props';
|
|
2
3
|
declare function __VLS_template(): {
|
|
3
4
|
attrs: Partial<{}>;
|
|
4
5
|
slots: {
|
|
@@ -33,22 +34,30 @@ declare const __VLS_component: import('vue-demi').DefineComponent<{
|
|
|
33
34
|
type: BooleanConstructor;
|
|
34
35
|
default: boolean;
|
|
35
36
|
};
|
|
37
|
+
codeBlockOptions: {
|
|
38
|
+
type: () => CodeBlockOptions | undefined;
|
|
39
|
+
default: any;
|
|
40
|
+
};
|
|
41
|
+
showLineNumbers: {
|
|
42
|
+
type: BooleanConstructor;
|
|
43
|
+
default: any;
|
|
44
|
+
};
|
|
45
|
+
theme: {
|
|
46
|
+
type: PropType<CodeBlockThemeProp>;
|
|
47
|
+
default: any;
|
|
48
|
+
};
|
|
36
49
|
darkTheme: {
|
|
37
|
-
type:
|
|
50
|
+
type: StringConstructor;
|
|
38
51
|
default: any;
|
|
39
52
|
};
|
|
40
53
|
lightTheme: {
|
|
41
|
-
type:
|
|
54
|
+
type: StringConstructor;
|
|
42
55
|
default: any;
|
|
43
56
|
};
|
|
44
57
|
isShowPreview: {
|
|
45
58
|
type: BooleanConstructor;
|
|
46
59
|
default: boolean;
|
|
47
60
|
};
|
|
48
|
-
monacoOptions: {
|
|
49
|
-
type: ObjectConstructor;
|
|
50
|
-
default: any;
|
|
51
|
-
};
|
|
52
61
|
enableFontSizeControl: {
|
|
53
62
|
type: BooleanConstructor;
|
|
54
63
|
default: boolean;
|
|
@@ -62,7 +71,7 @@ declare const __VLS_component: import('vue-demi').DefineComponent<{
|
|
|
62
71
|
default: any;
|
|
63
72
|
};
|
|
64
73
|
themes: {
|
|
65
|
-
type:
|
|
74
|
+
type: PropType<CodeBlockThemes>;
|
|
66
75
|
default: any;
|
|
67
76
|
};
|
|
68
77
|
showHeader: {
|
|
@@ -137,22 +146,30 @@ declare const __VLS_component: import('vue-demi').DefineComponent<{
|
|
|
137
146
|
type: BooleanConstructor;
|
|
138
147
|
default: boolean;
|
|
139
148
|
};
|
|
149
|
+
codeBlockOptions: {
|
|
150
|
+
type: () => CodeBlockOptions | undefined;
|
|
151
|
+
default: any;
|
|
152
|
+
};
|
|
153
|
+
showLineNumbers: {
|
|
154
|
+
type: BooleanConstructor;
|
|
155
|
+
default: any;
|
|
156
|
+
};
|
|
157
|
+
theme: {
|
|
158
|
+
type: PropType<CodeBlockThemeProp>;
|
|
159
|
+
default: any;
|
|
160
|
+
};
|
|
140
161
|
darkTheme: {
|
|
141
|
-
type:
|
|
162
|
+
type: StringConstructor;
|
|
142
163
|
default: any;
|
|
143
164
|
};
|
|
144
165
|
lightTheme: {
|
|
145
|
-
type:
|
|
166
|
+
type: StringConstructor;
|
|
146
167
|
default: any;
|
|
147
168
|
};
|
|
148
169
|
isShowPreview: {
|
|
149
170
|
type: BooleanConstructor;
|
|
150
171
|
default: boolean;
|
|
151
172
|
};
|
|
152
|
-
monacoOptions: {
|
|
153
|
-
type: ObjectConstructor;
|
|
154
|
-
default: any;
|
|
155
|
-
};
|
|
156
173
|
enableFontSizeControl: {
|
|
157
174
|
type: BooleanConstructor;
|
|
158
175
|
default: boolean;
|
|
@@ -166,7 +183,7 @@ declare const __VLS_component: import('vue-demi').DefineComponent<{
|
|
|
166
183
|
default: any;
|
|
167
184
|
};
|
|
168
185
|
themes: {
|
|
169
|
-
type:
|
|
186
|
+
type: PropType<CodeBlockThemes>;
|
|
170
187
|
default: any;
|
|
171
188
|
};
|
|
172
189
|
showHeader: {
|
|
@@ -222,17 +239,19 @@ declare const __VLS_component: import('vue-demi').DefineComponent<{
|
|
|
222
239
|
default: any;
|
|
223
240
|
};
|
|
224
241
|
}>>, {
|
|
225
|
-
|
|
242
|
+
codeBlockOptions: any;
|
|
243
|
+
showLineNumbers: boolean;
|
|
226
244
|
isDark: boolean;
|
|
227
245
|
loading: boolean;
|
|
228
246
|
stream: boolean;
|
|
229
|
-
|
|
230
|
-
|
|
247
|
+
theme: CodeBlockThemeProp;
|
|
248
|
+
darkTheme: string;
|
|
249
|
+
lightTheme: string;
|
|
231
250
|
isShowPreview: boolean;
|
|
232
|
-
monacoOptions: Record<string, any>;
|
|
233
251
|
enableFontSizeControl: boolean;
|
|
234
252
|
minWidth: string | number;
|
|
235
253
|
maxWidth: string | number;
|
|
254
|
+
themes: CodeBlockThemes;
|
|
236
255
|
showPreviewButton: boolean;
|
|
237
256
|
showCollapseButton: boolean;
|
|
238
257
|
showFontSizeButtons: boolean;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve the optional stream-diffs code-block runtime.
|
|
3
|
+
*
|
|
4
|
+
* stream-diffs is the only supported enhanced code/diff renderer for
|
|
5
|
+
* markstream-vue2. If it is not installed we return null and the caller falls
|
|
6
|
+
* back to plain `<pre><code>` rendering (PreCodeNode).
|
|
7
|
+
*/
|
|
8
|
+
export declare function getStreamDiffsRuntime(): Promise<any>;
|
|
9
|
+
export declare function preloadCodeBlockRuntime(): Promise<boolean>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BaseNode, MarkdownIt, ParseOptions } from 'stream-markdown-parser';
|
|
2
|
+
import { CodeBlockOptions, CodeBlockTheme, CodeBlockThemes } from '../types/component-props';
|
|
2
3
|
import { NodeRendererProps } from './NodeRenderer/NodeRenderer.vue';
|
|
3
4
|
declare const _default: import('vue-demi').DefineComponent<{
|
|
4
5
|
content: StringConstructor;
|
|
@@ -13,16 +14,15 @@ declare const _default: import('vue-demi').DefineComponent<{
|
|
|
13
14
|
type: BooleanConstructor;
|
|
14
15
|
default: boolean;
|
|
15
16
|
};
|
|
16
|
-
codeBlockDarkTheme:
|
|
17
|
-
codeBlockLightTheme:
|
|
18
|
-
codeBlockMonacoOptions: () => Record<string, any> | undefined;
|
|
17
|
+
codeBlockDarkTheme: () => CodeBlockTheme | undefined;
|
|
18
|
+
codeBlockLightTheme: () => CodeBlockTheme | undefined;
|
|
19
19
|
renderCodeBlocksAsPre: BooleanConstructor;
|
|
20
20
|
codeBlockMinWidth: (NumberConstructor | StringConstructor)[];
|
|
21
21
|
codeBlockMaxWidth: (NumberConstructor | StringConstructor)[];
|
|
22
|
-
|
|
22
|
+
codeBlockOptions: () => CodeBlockOptions | undefined;
|
|
23
|
+
codeBlockProps: () => NodeRendererProps["codeBlockProps"];
|
|
23
24
|
showTooltips: BooleanConstructor;
|
|
24
|
-
themes: () =>
|
|
25
|
-
langs: () => string[] | undefined;
|
|
25
|
+
themes: () => CodeBlockThemes | undefined;
|
|
26
26
|
isDark: BooleanConstructor;
|
|
27
27
|
customId: (NumberConstructor | StringConstructor)[];
|
|
28
28
|
indexKey: (NumberConstructor | StringConstructor)[];
|
|
@@ -60,16 +60,15 @@ declare const _default: import('vue-demi').DefineComponent<{
|
|
|
60
60
|
type: BooleanConstructor;
|
|
61
61
|
default: boolean;
|
|
62
62
|
};
|
|
63
|
-
codeBlockDarkTheme:
|
|
64
|
-
codeBlockLightTheme:
|
|
65
|
-
codeBlockMonacoOptions: () => Record<string, any> | undefined;
|
|
63
|
+
codeBlockDarkTheme: () => CodeBlockTheme | undefined;
|
|
64
|
+
codeBlockLightTheme: () => CodeBlockTheme | undefined;
|
|
66
65
|
renderCodeBlocksAsPre: BooleanConstructor;
|
|
67
66
|
codeBlockMinWidth: (NumberConstructor | StringConstructor)[];
|
|
68
67
|
codeBlockMaxWidth: (NumberConstructor | StringConstructor)[];
|
|
69
|
-
|
|
68
|
+
codeBlockOptions: () => CodeBlockOptions | undefined;
|
|
69
|
+
codeBlockProps: () => NodeRendererProps["codeBlockProps"];
|
|
70
70
|
showTooltips: BooleanConstructor;
|
|
71
|
-
themes: () =>
|
|
72
|
-
langs: () => string[] | undefined;
|
|
71
|
+
themes: () => CodeBlockThemes | undefined;
|
|
73
72
|
isDark: BooleanConstructor;
|
|
74
73
|
customId: (NumberConstructor | StringConstructor)[];
|
|
75
74
|
indexKey: (NumberConstructor | StringConstructor)[];
|
|
@@ -93,8 +92,6 @@ declare const _default: import('vue-demi').DefineComponent<{
|
|
|
93
92
|
codeBlockStream: boolean;
|
|
94
93
|
typewriter: boolean;
|
|
95
94
|
fade: boolean;
|
|
96
|
-
codeBlockDarkTheme: any;
|
|
97
|
-
codeBlockLightTheme: any;
|
|
98
95
|
renderCodeBlocksAsPre: boolean;
|
|
99
96
|
batchRendering: boolean;
|
|
100
97
|
debugPerformance: boolean;
|
|
@@ -11,10 +11,6 @@ declare const _default: import('vue-demi').DefineComponent<{
|
|
|
11
11
|
type: BooleanConstructor;
|
|
12
12
|
default: boolean;
|
|
13
13
|
};
|
|
14
|
-
monacoOptions: {
|
|
15
|
-
type: ObjectConstructor;
|
|
16
|
-
default: any;
|
|
17
|
-
};
|
|
18
14
|
minWidth: {
|
|
19
15
|
type: (NumberConstructor | StringConstructor)[];
|
|
20
16
|
default: any;
|
|
@@ -52,10 +48,6 @@ declare const _default: import('vue-demi').DefineComponent<{
|
|
|
52
48
|
type: BooleanConstructor;
|
|
53
49
|
default: boolean;
|
|
54
50
|
};
|
|
55
|
-
monacoOptions: {
|
|
56
|
-
type: ObjectConstructor;
|
|
57
|
-
default: any;
|
|
58
|
-
};
|
|
59
51
|
minWidth: {
|
|
60
52
|
type: (NumberConstructor | StringConstructor)[];
|
|
61
53
|
default: any;
|
|
@@ -83,7 +75,6 @@ declare const _default: import('vue-demi').DefineComponent<{
|
|
|
83
75
|
}>>, {
|
|
84
76
|
isDark: boolean;
|
|
85
77
|
loading: boolean;
|
|
86
|
-
monacoOptions: Record<string, any>;
|
|
87
78
|
minWidth: string | number;
|
|
88
79
|
maxWidth: string | number;
|
|
89
80
|
estimatedHeightPx: number;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { BaseNode, HtmlPolicy } from 'stream-markdown-parser';
|
|
2
|
-
import {
|
|
3
|
-
type
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import { CodeBlockNodeProps, CodeBlockOptions, CodeBlockPreviewPayload, CodeBlockTheme, CodeBlockThemes } from '../../types/component-props';
|
|
3
|
+
type NodeRendererCodeBlockProps = Partial<Omit<CodeBlockNodeProps, 'node' | 'themes' | 'codeBlockOptions'>> & {
|
|
4
|
+
themes?: CodeBlockThemes;
|
|
5
|
+
codeBlockOptions?: never;
|
|
6
6
|
} & Record<string, unknown>;
|
|
7
7
|
type __VLS_Props = {
|
|
8
8
|
nodes?: BaseNode[];
|
|
@@ -12,26 +12,15 @@ type __VLS_Props = {
|
|
|
12
12
|
fade?: boolean;
|
|
13
13
|
showTooltips?: boolean;
|
|
14
14
|
codeBlockStream?: boolean;
|
|
15
|
-
codeBlockDarkTheme?:
|
|
16
|
-
codeBlockLightTheme?:
|
|
17
|
-
codeBlockMonacoOptions?: CodeBlockMonacoOptions;
|
|
15
|
+
codeBlockDarkTheme?: CodeBlockTheme;
|
|
16
|
+
codeBlockLightTheme?: CodeBlockTheme;
|
|
18
17
|
codeBlockMinWidth?: string | number;
|
|
19
18
|
codeBlockMaxWidth?: string | number;
|
|
19
|
+
codeBlockOptions?: CodeBlockOptions;
|
|
20
20
|
codeBlockProps?: NodeRendererCodeBlockProps;
|
|
21
21
|
renderCodeBlocksAsPre?: boolean;
|
|
22
|
-
/**
|
|
23
|
-
|
|
24
|
-
* When Shiki code blocks are used, only string theme names are forwarded to
|
|
25
|
-
* MarkdownCodeBlockNode / stream-markdown; theme objects are ignored.
|
|
26
|
-
*/
|
|
27
|
-
themes?: CodeBlockMonacoTheme[];
|
|
28
|
-
/**
|
|
29
|
-
* Shiki language preload list forwarded to MarkdownCodeBlockNode.
|
|
30
|
-
*
|
|
31
|
-
* Vue2's default code block renderer is Monaco-backed. This prop is used
|
|
32
|
-
* when a custom `code_block` or language renderer uses MarkdownCodeBlockNode.
|
|
33
|
-
*/
|
|
34
|
-
langs?: readonly string[];
|
|
22
|
+
/** Theme-name tuple ordered as `[dark, light]` for enhanced code blocks. */
|
|
23
|
+
themes?: CodeBlockThemes;
|
|
35
24
|
isDark?: boolean;
|
|
36
25
|
customHtmlTags?: readonly string[];
|
|
37
26
|
htmlPolicy?: HtmlPolicy;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BaseNode, HtmlPolicy, MarkdownIt, ParseOptions } from 'stream-markdown-parser';
|
|
2
2
|
import { SmoothMarkdownStreamOptions } from '../../composables/useSmoothMarkdownStream';
|
|
3
|
-
import {
|
|
4
|
-
type
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
import { CodeBlockNodeProps, CodeBlockOptions, CodeBlockPreviewPayload, CodeBlockTheme, CodeBlockThemes, D2BlockNodeProps, InfographicBlockNodeProps, MermaidBlockNodeProps } from '../../types/component-props';
|
|
4
|
+
type NodeRendererCodeBlockProps = Partial<Omit<CodeBlockNodeProps, 'node' | 'themes' | 'codeBlockOptions'>> & {
|
|
5
|
+
themes?: CodeBlockThemes;
|
|
6
|
+
codeBlockOptions?: never;
|
|
7
7
|
} & Record<string, unknown>;
|
|
8
8
|
export interface NodeRendererProps {
|
|
9
9
|
content?: string;
|
|
@@ -32,15 +32,16 @@ export interface NodeRendererProps {
|
|
|
32
32
|
* Default: true
|
|
33
33
|
*/
|
|
34
34
|
codeBlockStream?: boolean;
|
|
35
|
-
codeBlockDarkTheme?:
|
|
36
|
-
codeBlockLightTheme?:
|
|
37
|
-
codeBlockMonacoOptions?: CodeBlockMonacoOptions;
|
|
35
|
+
codeBlockDarkTheme?: CodeBlockTheme;
|
|
36
|
+
codeBlockLightTheme?: CodeBlockTheme;
|
|
38
37
|
/** If true, render all `code_block` nodes as plain <pre><code> blocks instead of the full CodeBlockNode */
|
|
39
38
|
renderCodeBlocksAsPre?: boolean;
|
|
40
39
|
/** Minimum width forwarded to CodeBlockNode (px or CSS unit) */
|
|
41
40
|
codeBlockMinWidth?: string | number;
|
|
42
41
|
/** Maximum width forwarded to CodeBlockNode (px or CSS unit) */
|
|
43
42
|
codeBlockMaxWidth?: string | number;
|
|
43
|
+
/** Options forwarded to the built-in stream-diffs CodeBlockNode. */
|
|
44
|
+
codeBlockOptions?: CodeBlockOptions;
|
|
44
45
|
/** Arbitrary props to forward to every CodeBlockNode */
|
|
45
46
|
codeBlockProps?: NodeRendererCodeBlockProps;
|
|
46
47
|
/** Props forwarded to MermaidBlockNode for mermaid fences */
|
|
@@ -51,19 +52,8 @@ export interface NodeRendererProps {
|
|
|
51
52
|
infographicProps?: Partial<Omit<InfographicBlockNodeProps, 'node' | 'loading' | 'isDark'>>;
|
|
52
53
|
/** Global tooltip toggle for link/code-block renderers (default: true) */
|
|
53
54
|
showTooltips?: boolean;
|
|
54
|
-
/**
|
|
55
|
-
|
|
56
|
-
* When Shiki code blocks are used, only string theme names are forwarded to
|
|
57
|
-
* MarkdownCodeBlockNode / stream-markdown; theme objects are ignored.
|
|
58
|
-
*/
|
|
59
|
-
themes?: CodeBlockMonacoTheme[];
|
|
60
|
-
/**
|
|
61
|
-
* Shiki language preload list forwarded to MarkdownCodeBlockNode.
|
|
62
|
-
*
|
|
63
|
-
* Vue2's default code block renderer is Monaco-backed. This prop is used
|
|
64
|
-
* when a custom `code_block` or language renderer uses MarkdownCodeBlockNode.
|
|
65
|
-
*/
|
|
66
|
-
langs?: readonly string[];
|
|
55
|
+
/** Theme-name tuple ordered as `[dark, light]` for enhanced code blocks. */
|
|
56
|
+
themes?: CodeBlockThemes;
|
|
67
57
|
isDark?: boolean;
|
|
68
58
|
customId?: string;
|
|
69
59
|
indexKey?: number | string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as VueModule from 'vue-demi';
|
|
2
|
-
declare const placement: VueModule.Ref<"
|
|
2
|
+
declare const placement: VueModule.Ref<"top" | "bottom" | "left" | "right">;
|
|
3
3
|
export declare function ensureTooltipMounted(): Promise<void>;
|
|
4
4
|
export declare function showTooltipForAnchor(el: HTMLElement | null, text: string, place?: typeof placement.value, immediate?: boolean, origin?: {
|
|
5
5
|
x: number;
|
package/dist/types/exports.d.ts
CHANGED
|
@@ -26,7 +26,6 @@ import { default as InsertNode } from './components/InsertNode';
|
|
|
26
26
|
import { default as LinkNode } from './components/LinkNode';
|
|
27
27
|
import { default as ListItemNode } from './components/ListItemNode';
|
|
28
28
|
import { default as ListNode } from './components/ListNode';
|
|
29
|
-
import { default as MarkdownCodeBlockNode } from './components/MarkdownCodeBlockNode';
|
|
30
29
|
import { default as MarkdownRender } from './components/MarkdownRenderCompat.vue';
|
|
31
30
|
import { default as MathBlockNode } from './components/MathBlockNode';
|
|
32
31
|
import { default as MathInlineNode } from './components/MathInlineNode';
|
|
@@ -54,7 +53,7 @@ export type { KatexLoader } from './components/MathInlineNode/katex';
|
|
|
54
53
|
export type { MermaidLoader } from './components/MermaidBlockNode/mermaid';
|
|
55
54
|
export type { NodeRendererProps } from './components/NodeRenderer/NodeRenderer.vue';
|
|
56
55
|
export type { SmoothMarkdownStreamController, SmoothMarkdownStreamControllerVue2, SmoothMarkdownStreamOptions, } from './composables/useSmoothMarkdownStream';
|
|
57
|
-
export type {
|
|
56
|
+
export type { CodeBlockDiffHideUnchangedRegions, CodeBlockDiffHideUnchangedRegionsOptions, CodeBlockNodeProps, CodeBlockOptions, CodeBlockPreviewPayload, CodeBlockTheme, CodeBlockThemePair, CodeBlockThemeProp, CodeBlockThemes, D2BlockNodeProps, ImageNodeProps, InfographicBlockNodeProps, LinkNodeProps, MathBlockNodeProps, MathInlineNodeProps, MermaidBlockEvent, MermaidBlockNodeProps, PreCodeNodeProps, } from './types/component-props';
|
|
58
57
|
export * from './utils';
|
|
59
58
|
export * from './workers/katexCdnWorker';
|
|
60
59
|
export * from './workers/katexWorkerClient';
|
|
@@ -82,7 +81,7 @@ interface Vue2ConstructorLike {
|
|
|
82
81
|
__compositionApiInstalled?: boolean;
|
|
83
82
|
__markstreamVue2SetupProxyPatched?: boolean;
|
|
84
83
|
}
|
|
85
|
-
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,
|
|
84
|
+
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, MarkdownRender, MathBlockNode, MathInlineNode, MermaidBlockNode, NestedRenderer, ParagraphNode, PreCodeNode, ReferenceNode, removeCustomComponents, setCustomComponents, setD2Loader, setDefaultI18nMap, setKatexLoader, setMermaidLoader, StrikethroughNode, StrongNode, SubscriptNode, SuperscriptNode, TableNode, TextNode, ThematicBreakNode, Tooltip, useSmoothMarkdownStream, VmrContainerNode, };
|
|
86
85
|
export default MarkdownRender;
|
|
87
86
|
export declare const VueRendererMarkdown: {
|
|
88
87
|
install(Vue: Vue2ConstructorLike, options?: MarkstreamVue2PluginOptions): void;
|
|
@@ -1,27 +1,16 @@
|
|
|
1
1
|
import { CodeBlockNode } from 'stream-markdown-parser';
|
|
2
|
-
export interface
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
inherit?: boolean;
|
|
6
|
-
colors?: Record<string, string>;
|
|
7
|
-
rules?: Array<Record<string, unknown>>;
|
|
8
|
-
[key: string]: unknown;
|
|
2
|
+
export interface CodeBlockThemePair {
|
|
3
|
+
dark: string;
|
|
4
|
+
light: string;
|
|
9
5
|
}
|
|
10
|
-
export type
|
|
11
|
-
export type
|
|
6
|
+
export type CodeBlockTheme = string;
|
|
7
|
+
export type CodeBlockThemeProp = CodeBlockTheme | CodeBlockThemePair;
|
|
8
|
+
export type CodeBlockThemes = readonly [dark: CodeBlockTheme, light: CodeBlockTheme];
|
|
12
9
|
export interface CommonCodeBlockProps {
|
|
13
10
|
showHeader?: boolean;
|
|
14
11
|
showCopyButton?: boolean;
|
|
15
12
|
showExpandButton?: boolean;
|
|
16
13
|
}
|
|
17
|
-
export interface ShikiCodeBlockProps extends CommonCodeBlockProps {
|
|
18
|
-
themes?: readonly string[];
|
|
19
|
-
/**
|
|
20
|
-
* Shiki language preload request forwarded to stream-markdown's registerHighlight().
|
|
21
|
-
* This is not a rendering allow-list; already available Shiki languages may still highlight.
|
|
22
|
-
*/
|
|
23
|
-
langs?: readonly string[];
|
|
24
|
-
}
|
|
25
14
|
export interface CodeBlockDiffHideUnchangedRegionsOptions {
|
|
26
15
|
enabled?: boolean;
|
|
27
16
|
contextLineCount?: number;
|
|
@@ -29,67 +18,73 @@ export interface CodeBlockDiffHideUnchangedRegionsOptions {
|
|
|
29
18
|
revealLineCount?: number;
|
|
30
19
|
}
|
|
31
20
|
export type CodeBlockDiffHideUnchangedRegions = boolean | CodeBlockDiffHideUnchangedRegionsOptions;
|
|
32
|
-
export
|
|
33
|
-
export type CodeBlockDiffAppearance = 'auto' | 'light' | 'dark';
|
|
34
|
-
export type CodeBlockDiffUnchangedRegionStyle = 'line-info' | 'line-info-basic' | 'metadata' | 'simple';
|
|
35
|
-
export type CodeBlockDiffHunkActionKind = 'revert' | 'stage';
|
|
36
|
-
export type CodeBlockDiffHunkSide = 'upper' | 'lower';
|
|
37
|
-
export interface CodeBlockDiffHunkActionContext {
|
|
38
|
-
action: CodeBlockDiffHunkActionKind;
|
|
39
|
-
side: CodeBlockDiffHunkSide;
|
|
40
|
-
lineChange: unknown;
|
|
41
|
-
originalModel: unknown;
|
|
42
|
-
modifiedModel: unknown;
|
|
43
|
-
}
|
|
44
|
-
export interface CodeBlockMonacoOptions {
|
|
45
|
-
MAX_HEIGHT?: number | string;
|
|
21
|
+
export interface CodeBlockOptions {
|
|
46
22
|
fontSize?: number;
|
|
47
23
|
lineHeight?: number;
|
|
48
24
|
fontFamily?: string;
|
|
25
|
+
maxHeight?: number;
|
|
26
|
+
padding?: number;
|
|
49
27
|
tabSize?: number;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
28
|
+
disableLineNumbers?: boolean;
|
|
29
|
+
overflow?: 'scroll' | 'wrap';
|
|
30
|
+
disableVirtualizationBuffers?: boolean;
|
|
31
|
+
preferredHighlighter?: 'shiki-js' | 'shiki-wasm';
|
|
32
|
+
useCSSClasses?: boolean;
|
|
33
|
+
useTokenTransformer?: boolean;
|
|
34
|
+
tokenizeMaxLineLength?: number;
|
|
35
|
+
tokenizeMaxLength?: number;
|
|
36
|
+
unsafeCSS?: string;
|
|
37
|
+
diffStyle?: 'unified' | 'split';
|
|
38
|
+
diffIndicators?: 'classic' | 'bars' | 'none';
|
|
39
|
+
disableBackground?: boolean;
|
|
40
|
+
hunkSeparators?: 'simple' | 'metadata' | 'line-info' | 'line-info-basic';
|
|
41
|
+
expandUnchanged?: boolean;
|
|
42
|
+
collapsedContextThreshold?: number;
|
|
43
|
+
lineDiffType?: 'word-alt' | 'word' | 'char' | 'none';
|
|
44
|
+
maxLineDiffLength?: number;
|
|
45
|
+
expansionLineCount?: number;
|
|
46
|
+
parseDiffOptions?: Record<string, unknown>;
|
|
47
|
+
lineHoverHighlight?: 'disabled' | 'both' | 'number' | 'line';
|
|
48
|
+
enableTokenInteractionsOnWhitespace?: boolean;
|
|
49
|
+
enableGutterUtility?: boolean;
|
|
50
|
+
enableLineSelection?: boolean;
|
|
51
|
+
controlledSelection?: boolean;
|
|
52
|
+
onGutterUtilityClick?: (...args: any[]) => unknown;
|
|
53
|
+
onLineClick?: (...args: any[]) => unknown;
|
|
54
|
+
onLineNumberClick?: (...args: any[]) => unknown;
|
|
55
|
+
onLineEnter?: (...args: any[]) => unknown;
|
|
56
|
+
onLineLeave?: (...args: any[]) => unknown;
|
|
57
|
+
onTokenClick?: (...args: any[]) => unknown;
|
|
58
|
+
onTokenEnter?: (...args: any[]) => unknown;
|
|
59
|
+
onTokenLeave?: (...args: any[]) => unknown;
|
|
60
|
+
onLineSelected?: (...args: any[]) => unknown;
|
|
61
|
+
onLineSelectionStart?: (...args: any[]) => unknown;
|
|
62
|
+
onLineSelectionChange?: (...args: any[]) => unknown;
|
|
63
|
+
onLineSelectionEnd?: (...args: any[]) => unknown;
|
|
64
|
+
getLineIndex?: (...args: any[]) => unknown;
|
|
65
|
+
renderAnnotation?: (...args: any[]) => unknown;
|
|
66
|
+
renderGutterUtility?: (...args: any[]) => unknown;
|
|
67
|
+
onPostRender?: (...args: any[]) => unknown;
|
|
68
|
+
mergeConflict?: boolean;
|
|
69
|
+
lineAnnotations?: unknown[];
|
|
70
|
+
onController?: (controller: any) => void;
|
|
71
|
+
workerManager?: unknown;
|
|
79
72
|
}
|
|
80
73
|
export interface CodeBlockNodeProps extends CommonCodeBlockProps {
|
|
81
74
|
node: CodeBlockNode;
|
|
75
|
+
codeBlockOptions?: CodeBlockOptions;
|
|
76
|
+
showLineNumbers?: boolean;
|
|
82
77
|
isDark?: boolean;
|
|
83
78
|
loading?: boolean;
|
|
84
79
|
stream?: boolean;
|
|
85
|
-
|
|
86
|
-
|
|
80
|
+
theme?: CodeBlockThemeProp;
|
|
81
|
+
darkTheme?: CodeBlockTheme;
|
|
82
|
+
lightTheme?: CodeBlockTheme;
|
|
87
83
|
isShowPreview?: boolean;
|
|
88
|
-
monacoOptions?: CodeBlockMonacoOptions;
|
|
89
84
|
enableFontSizeControl?: boolean;
|
|
90
85
|
minWidth?: string | number;
|
|
91
86
|
maxWidth?: string | number;
|
|
92
|
-
themes?:
|
|
87
|
+
themes?: CodeBlockThemes;
|
|
93
88
|
showPreviewButton?: boolean;
|
|
94
89
|
showCollapseButton?: boolean;
|
|
95
90
|
showFontSizeButtons?: boolean;
|
|
@@ -178,11 +173,6 @@ export interface CodeBlockPreviewPayload {
|
|
|
178
173
|
artifactTitle: string;
|
|
179
174
|
id: string;
|
|
180
175
|
}
|
|
181
|
-
export interface MarkdownCodeBlockPreviewPayload {
|
|
182
|
-
type: 'text/html' | 'image/svg+xml';
|
|
183
|
-
content: string;
|
|
184
|
-
title: string;
|
|
185
|
-
}
|
|
186
176
|
export interface MermaidBlockEvent<TPayload = unknown> {
|
|
187
177
|
payload?: TPayload;
|
|
188
178
|
defaultPrevented: boolean;
|
|
@@ -2,7 +2,7 @@ export type LanguageIconResolver = (lang: string) => string | undefined | null;
|
|
|
2
2
|
export declare const languageIconsRevision: import('vue-demi').Ref<number>;
|
|
3
3
|
export declare function setLanguageIconResolver(resolver?: LanguageIconResolver | null): void;
|
|
4
4
|
export declare function normalizeLanguageIdentifier(lang?: string | null): string;
|
|
5
|
-
export declare function
|
|
5
|
+
export declare function resolveLanguageId(lang?: string | null): string;
|
|
6
6
|
export declare function preloadExtendedLanguageIcons(): Promise<void>;
|
|
7
7
|
export declare function getLanguageIcon(lang: string): string;
|
|
8
8
|
export declare const languageMap: Record<string, string>;
|