markstream-react 0.0.32 → 0.0.33
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 +11 -0
- package/dist/Tooltip-CjIRU2iQ.js +209 -0
- package/dist/index-BQw8Blc5.js +87 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +65 -622
- package/dist/index.js +1 -211
- package/dist/index.px.css +1 -1
- package/dist/index.tailwind.css +1 -1
- package/dist/languageIcon-BiAQ6aSb.js +3 -0
- package/dist/markstream-react.css +1 -0
- package/dist/next.d.ts +737 -0
- package/dist/next.js +2 -0
- package/dist/server.d.ts +543 -0
- package/dist/server.js +1 -0
- package/dist/tailwind.ts +1 -1
- package/dist/types/components/AdmonitionNode/AdmonitionNode.d.ts +11 -0
- package/dist/types/components/BlockquoteNode/BlockquoteNode.d.ts +7 -0
- package/dist/types/components/CheckboxNode/CheckboxNode.d.ts +6 -0
- package/dist/types/components/CodeBlockNode/CodeBlockNode.d.ts +13 -0
- package/dist/types/components/CodeBlockNode/HtmlPreviewFrame.d.ts +9 -0
- package/dist/types/components/CodeBlockNode/PreCodeNode.d.ts +2 -0
- package/dist/types/components/CodeBlockNode/monaco.d.ts +1 -0
- package/dist/types/components/CodeBlockNode/monacoThemeRegistry.d.ts +7 -0
- package/dist/types/components/CodeBlockNode/monacoThemeScheduler.d.ts +4 -0
- package/dist/types/components/D2BlockNode/D2BlockNode.d.ts +2 -0
- package/dist/types/components/D2BlockNode/d2.d.ts +6 -0
- package/dist/types/components/D2BlockNode/index.d.ts +2 -0
- package/dist/types/components/DefinitionListNode/DefinitionListNode.d.ts +6 -0
- package/dist/types/components/EmojiNode/EmojiNode.d.ts +7 -0
- package/dist/types/components/EmphasisNode/EmphasisNode.d.ts +5 -0
- package/dist/types/components/FootnoteAnchorNode/FootnoteAnchorNode.d.ts +6 -0
- package/dist/types/components/FootnoteNode/FootnoteNode.d.ts +8 -0
- package/dist/types/components/FootnoteReferenceNode/FootnoteReferenceNode.d.ts +6 -0
- package/dist/types/components/HardBreakNode/HardBreakNode.d.ts +5 -0
- package/dist/types/components/HeadingNode/HeadingNode.d.ts +9 -0
- package/dist/types/components/HighlightNode/HighlightNode.d.ts +5 -0
- package/dist/types/components/HtmlBlockNode/HtmlBlockNode.d.ts +12 -0
- package/dist/types/components/HtmlInlineNode/HtmlInlineNode.d.ts +8 -0
- package/dist/types/components/ImageNode/ImageNode.d.ts +9 -0
- package/dist/types/components/InfographicBlockNode/InfographicBlockNode.d.ts +15 -0
- package/dist/types/components/InfographicBlockNode/index.d.ts +2 -0
- package/dist/types/components/InfographicBlockNode/infographic.d.ts +1 -0
- package/dist/types/components/InlineCodeNode/InlineCodeNode.d.ts +6 -0
- package/dist/types/components/InsertNode/InsertNode.d.ts +5 -0
- package/dist/types/components/LinkNode/LinkNode.d.ts +21 -0
- package/dist/types/components/ListItemNode/ListItemNode.d.ts +12 -0
- package/dist/types/components/ListNode/ListNode.d.ts +8 -0
- package/dist/types/components/MarkdownCodeBlockNode/MarkdownCodeBlockNode.d.ts +36 -0
- package/dist/types/components/Math/MathBlockNode.d.ts +2 -0
- package/dist/types/components/Math/MathInlineNode.d.ts +2 -0
- package/dist/types/components/Math/katex.d.ts +1 -0
- package/dist/types/components/MathBlockNode/MathBlockNode.d.ts +2 -0
- package/dist/types/components/MathInlineNode/MathInlineNode.d.ts +2 -0
- package/dist/types/components/MermaidBlockNode/MermaidBlockNode.d.ts +15 -0
- package/dist/types/components/MermaidBlockNode/index.d.ts +2 -0
- package/dist/types/components/MermaidBlockNode/mermaid.d.ts +1 -0
- package/dist/types/components/NodeRenderer/FallbackComponent.d.ts +5 -0
- package/dist/types/components/NodeRenderer/preloadMonaco.d.ts +1 -0
- package/dist/types/components/NodeRenderer.d.ts +4 -0
- package/dist/types/components/ParagraphNode/ParagraphNode.d.ts +7 -0
- package/dist/types/components/PreCodeNode/PreCodeNode.d.ts +2 -0
- package/dist/types/components/ReferenceNode/ReferenceNode.d.ts +15 -0
- package/dist/types/components/StrikethroughNode/StrikethroughNode.d.ts +5 -0
- package/dist/types/components/StrongNode/StrongNode.d.ts +5 -0
- package/dist/types/components/SubscriptNode/SubscriptNode.d.ts +5 -0
- package/dist/types/components/SuperscriptNode/SuperscriptNode.d.ts +5 -0
- package/dist/types/components/TableNode/TableNode.d.ts +8 -0
- package/dist/types/components/TextNode/TextNode.d.ts +7 -0
- package/dist/types/components/ThematicBreakNode/ThematicBreakNode.d.ts +2 -0
- package/dist/types/components/Tooltip/Tooltip.d.ts +15 -0
- package/dist/types/components/VmrContainerNode/VmrContainerNode.d.ts +9 -0
- package/dist/types/context/viewportPriority.d.ts +17 -0
- package/dist/types/customComponents.d.ts +9 -0
- package/dist/types/i18n/useSafeI18n.d.ts +10 -0
- package/dist/types/index.d.ts +65 -0
- package/dist/types/next.d.ts +297 -0
- package/dist/types/renderers/renderChildren.d.ts +7 -0
- package/dist/types/renderers/renderNode.d.ts +4 -0
- package/dist/types/server-renderer/html.d.ts +2 -0
- package/dist/types/server-renderer/index.d.ts +166 -0
- package/dist/types/server-renderer/katex.d.ts +1 -0
- package/dist/types/server.d.ts +54 -0
- package/dist/types/tailwind-entry.d.ts +1 -0
- package/dist/types/tooltip/singletonTooltip.d.ts +7 -0
- package/dist/types/types/component-props.d.ts +208 -0
- package/dist/types/types/node-component.d.ts +12 -0
- package/dist/types/types.d.ts +82 -0
- package/dist/types/utils/languageIcon.d.ts +8 -0
- package/dist/types/utils/languageIconExtended.d.ts +1 -0
- package/dist/types/utils/performanceMonitor.d.ts +78 -0
- package/dist/types/utils/safeRaf.d.ts +2 -0
- package/dist/types/utils/streamingTextState.d.ts +23 -0
- package/dist/types/workers/katexRenderer.worker.d.ts +0 -0
- package/dist/types/workers/katexWorkerClient.d.ts +31 -0
- package/dist/types/workers/mermaidParser.worker.d.ts +1 -0
- package/dist/types/workers/mermaidWorkerClient.d.ts +14 -0
- package/package.json +11 -3
package/dist/next.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import a,{useState as s,useEffect as e}from"react";import{A as r,B as o,C as t,a as n,D as i,b as m,E as l,c as u,F as c,d,e as g,f,H as p,g as C,h as T,i as k,j as D,k as E,I as K,l as M,m as I,n as W,L as _,o as L,p as R,q as X,r as b,s as y,t as S,N as h,P as x,u as A,R as B,S as N,v,w as j,x as O,T as P,y as w,z,G as F,V as Y}from"./Tooltip-CjIRU2iQ.js";import{M as q,W as G,J as H,K as U,O as V,Q as $,U as J,X as Q,Y as Z,ag as aa,Z as sa,_ as ea,$ as ra,a0 as oa,a1 as ta,a2 as na,a3 as ia,a4 as ma,a5 as la,a6 as ua,a7 as ca,a8 as da,a9 as ga,aa as fa,ab as pa,ac as Ca,ad as Ta,ae as ka,af as Da}from"./Tooltip-CjIRU2iQ.js";import{c as Ea,g as Ka,a as Ma,l as Ia,n as Wa,p as _a,r as La,b as Ra,s as Xa,d as ba,e as ya}from"./languageIcon-BiAQ6aSb.js";import{A as Sa,B as ha,C as xa,a as Aa,D as Ba,b as Na,E as va,c as ja,F as Oa,d as Pa,e as wa,f as za,H as Fa,g as Ya,h as qa,i as Ga,j as Ha,k as Ua,I as Va,l as $a,m as Ja,n as Qa,L as Za,o as as,p as ss,M as es,q as rs,r as os,s as ts,N as ns,P as is,t as ms,R as ls,S as us,u as cs,v as ds,w as gs,T as fs,x as ps,y as Cs,z as Ts,V as ks}from"./index-BQw8Blc5.js";function Ds(r,o){function t(t){const[n,i]=s(!1);return e(()=>{i(!0)},[]),n?a.createElement(r,t):function(a){const s="__MARKSTREAM_REACT_DISABLE_SYNC_KATEX__",e=globalThis,r=e[s];e[s]=!0;try{return o(a)}finally{void 0===r?delete e[s]:e[s]=r}}(t)}return t.displayName=`MarkstreamNextEntry(${r.displayName||r.name||"Component"})`,t}const Es=Ds(r,Sa),Ks=Ds(o,ha),Ms=Ds(t,xa),Is=Ds(n,Aa),Ws=Is,_s=Ds(E,Ua),Ls=Ds(i,Ba),Rs=Ds(m,Na),Xs=Ds(l,va),bs=Ds(u,ja),ys=Ds(d,Pa),Ss=Ds(g,wa),hs=Ds(f,za),xs=Ds(p,Fa),As=Ds(C,Ya),Bs=Ds(T,qa),Ns=Ds(k,Ga),vs=Ds(D,Ha),js=Ds(K,Va),Os=Ds(M,$a),Ps=Ds(I,Ja),ws=Ds(W,Qa),zs=Ds(_,Za),Fs=Ds(L,as),Ys=Ds(R,ss),qs=Ds(X,es),Gs=Ds(b,rs),Hs=Ds(y,os),Us=Ds(S,ts),Vs=Ds(h,ns),$s=Ds(c,Oa),Js=Ds(x,is),Qs=Ds(A,ms),Zs=Ds(B,ls),ae=Ds(N,us),se=Ds(v,cs),ee=Ds(j,ds),re=Ds(O,gs),oe=Ds(P,fs),te=Ds(w,ps),ne=Ds(z,Cs),ie=Ds(F,Ts),me=Ds(Y,ks);export{Es as AdmonitionNode,Ks as BlockquoteNode,Ms as CheckboxNode,Is as CodeBlockNode,Ls as D2BlockNode,Rs as DefinitionListNode,Xs as EmojiNode,bs as EmphasisNode,$s as FallbackComponent,ys as FootnoteAnchorNode,Ss as FootnoteNode,hs as FootnoteReferenceNode,xs as HardBreakNode,As as HeadingNode,Bs as HighlightNode,Ns as HtmlBlockNode,vs as HtmlInlineNode,_s as HtmlPreviewFrame,js as ImageNode,Os as InfographicBlockNode,Ps as InlineCodeNode,ws as InsertNode,zs as LinkNode,Fs as ListItemNode,Ys as ListNode,q as MERMAID_WORKER_BUSY_CODE,qs as MarkdownCodeBlockNode,Gs as MathBlockNode,Hs as MathInlineNode,Us as MermaidBlockNode,Vs as NodeRenderer,Js as ParagraphNode,Qs as PreCodeNode,Ws as ReactCodeBlockNode,Zs as ReferenceNode,ae as StrikethroughNode,se as StrongNode,ee as SubscriptNode,re as SuperscriptNode,oe as TableNode,te as TextNode,ne as ThematicBreakNode,ie as Tooltip,me as VmrContainerNode,G as WORKER_BUSY_CODE,H as canParseOffthread,Ea as clearGlobalCustomComponents,U as clearKaTeXCache,V as clearKaTeXWorker,$ as clearMermaidWorker,Vs as default,J as disableD2,Q as enableD2,Z as findPrefixOffthread,Ka as getCustomNodeComponents,aa as getD2,sa as getKaTeXBackpressureDefaults,Ma as getLanguageIcon,ea as getMermaidWorkerLoad,ra as isD2Enabled,Ia as languageMap,Wa as normalizeLanguageIdentifier,_a as preloadExtendedLanguageIcons,La as removeCustomComponents,oa as renderKaTeXInWorker,ta as renderKaTeXWithBackpressure,na as renderNode,Ra as resolveMonacoLanguageId,Xa as setCustomComponents,ia as setD2Loader,ma as setDefaultI18nMap,la as setKaTeXBackpressureDefaults,ua as setKaTeXCache,ca as setKaTeXConcurrencyLimit,da as setKaTeXWorker,ga as setKaTeXWorkerDebug,ba as setLanguageIconResolver,fa as setMermaidWorker,pa as setMermaidWorkerClientDebug,Ca as setMermaidWorkerMaxConcurrency,ya as subscribeLanguageIconsRevision,Ta as terminateWorker,ka as useSafeI18n,Da as waitForKaTeXWorkerSlot};
|
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1,543 @@
|
|
|
1
|
+
import { CodeBlockNode as CodeBlockNode$1, BaseNode, ParseOptions, MarkdownIt, ParsedNode } from 'stream-markdown-parser';
|
|
2
|
+
import React, { ComponentType } from 'react';
|
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
interface HtmlPreviewFrameProps {
|
|
6
|
+
code: string;
|
|
7
|
+
isDark?: boolean;
|
|
8
|
+
onClose?: () => void;
|
|
9
|
+
title?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface CodeBlockMonacoThemeObject {
|
|
13
|
+
name: string;
|
|
14
|
+
base?: string;
|
|
15
|
+
inherit?: boolean;
|
|
16
|
+
colors?: Record<string, string>;
|
|
17
|
+
rules?: Array<Record<string, unknown>>;
|
|
18
|
+
[key: string]: unknown;
|
|
19
|
+
}
|
|
20
|
+
type CodeBlockMonacoTheme = string | CodeBlockMonacoThemeObject;
|
|
21
|
+
type CodeBlockMonacoLanguage = string | ((...args: any[]) => unknown);
|
|
22
|
+
interface CodeBlockDiffHideUnchangedRegionsOptions {
|
|
23
|
+
enabled?: boolean;
|
|
24
|
+
contextLineCount?: number;
|
|
25
|
+
minimumLineCount?: number;
|
|
26
|
+
revealLineCount?: number;
|
|
27
|
+
}
|
|
28
|
+
type CodeBlockDiffHideUnchangedRegions = boolean | CodeBlockDiffHideUnchangedRegionsOptions;
|
|
29
|
+
type CodeBlockDiffLineStyle = 'background' | 'bar';
|
|
30
|
+
type CodeBlockDiffAppearance = 'auto' | 'light' | 'dark';
|
|
31
|
+
type CodeBlockDiffUnchangedRegionStyle = 'line-info' | 'line-info-basic' | 'metadata' | 'simple';
|
|
32
|
+
type CodeBlockDiffHunkActionKind = 'revert' | 'stage';
|
|
33
|
+
type CodeBlockDiffHunkSide = 'upper' | 'lower';
|
|
34
|
+
interface CodeBlockDiffHunkActionContext {
|
|
35
|
+
action: CodeBlockDiffHunkActionKind;
|
|
36
|
+
side: CodeBlockDiffHunkSide;
|
|
37
|
+
lineChange: unknown;
|
|
38
|
+
originalModel: unknown;
|
|
39
|
+
modifiedModel: unknown;
|
|
40
|
+
}
|
|
41
|
+
interface CodeBlockMonacoOptions {
|
|
42
|
+
MAX_HEIGHT?: number | string;
|
|
43
|
+
fontSize?: number;
|
|
44
|
+
lineHeight?: number;
|
|
45
|
+
fontFamily?: string;
|
|
46
|
+
tabSize?: number;
|
|
47
|
+
readOnly?: boolean;
|
|
48
|
+
wordWrap?: 'off' | 'on' | 'wordWrapColumn' | 'bounded' | string;
|
|
49
|
+
wrappingIndent?: 'none' | 'same' | 'indent' | 'deepIndent' | string;
|
|
50
|
+
theme?: string;
|
|
51
|
+
themes?: CodeBlockMonacoTheme[];
|
|
52
|
+
languages?: CodeBlockMonacoLanguage[];
|
|
53
|
+
renderSideBySide?: boolean;
|
|
54
|
+
enableSplitViewResizing?: boolean;
|
|
55
|
+
ignoreTrimWhitespace?: boolean;
|
|
56
|
+
maxComputationTime?: number;
|
|
57
|
+
diffAlgorithm?: string;
|
|
58
|
+
renderIndicators?: boolean;
|
|
59
|
+
originalEditable?: boolean;
|
|
60
|
+
revealDebounceMs?: number;
|
|
61
|
+
revealStrategy?: 'bottom' | 'centerIfOutside' | 'center';
|
|
62
|
+
revealBatchOnIdleMs?: number;
|
|
63
|
+
updateThrottleMs?: number;
|
|
64
|
+
diffUpdateThrottleMs?: number;
|
|
65
|
+
diffAutoScroll?: boolean;
|
|
66
|
+
diffHideUnchangedRegions?: CodeBlockDiffHideUnchangedRegions;
|
|
67
|
+
diffLineStyle?: CodeBlockDiffLineStyle;
|
|
68
|
+
diffAppearance?: CodeBlockDiffAppearance;
|
|
69
|
+
diffUnchangedRegionStyle?: CodeBlockDiffUnchangedRegionStyle;
|
|
70
|
+
diffHunkActionsOnHover?: boolean;
|
|
71
|
+
diffHunkHoverHideDelayMs?: number;
|
|
72
|
+
onDiffHunkAction?: (context: CodeBlockDiffHunkActionContext) => void | boolean | Promise<void | boolean>;
|
|
73
|
+
scrollbar?: Record<string, any>;
|
|
74
|
+
[key: string]: any;
|
|
75
|
+
}
|
|
76
|
+
interface CodeBlockNodeProps {
|
|
77
|
+
node: CodeBlockNode$1;
|
|
78
|
+
isDark?: boolean;
|
|
79
|
+
loading?: boolean;
|
|
80
|
+
stream?: boolean;
|
|
81
|
+
darkTheme?: CodeBlockMonacoTheme;
|
|
82
|
+
lightTheme?: CodeBlockMonacoTheme;
|
|
83
|
+
isShowPreview?: boolean;
|
|
84
|
+
monacoOptions?: CodeBlockMonacoOptions;
|
|
85
|
+
enableFontSizeControl?: boolean;
|
|
86
|
+
minWidth?: string | number;
|
|
87
|
+
maxWidth?: string | number;
|
|
88
|
+
themes?: CodeBlockMonacoTheme[];
|
|
89
|
+
showHeader?: boolean;
|
|
90
|
+
showCopyButton?: boolean;
|
|
91
|
+
showExpandButton?: boolean;
|
|
92
|
+
showPreviewButton?: boolean;
|
|
93
|
+
showCollapseButton?: boolean;
|
|
94
|
+
showFontSizeButtons?: boolean;
|
|
95
|
+
showTooltips?: boolean;
|
|
96
|
+
customId?: string;
|
|
97
|
+
}
|
|
98
|
+
interface ImageNodeProps {
|
|
99
|
+
node: {
|
|
100
|
+
type: 'image';
|
|
101
|
+
src: string;
|
|
102
|
+
alt: string;
|
|
103
|
+
title: string | null;
|
|
104
|
+
raw: string;
|
|
105
|
+
loading?: boolean;
|
|
106
|
+
};
|
|
107
|
+
fallbackSrc?: string;
|
|
108
|
+
showCaption?: boolean;
|
|
109
|
+
lazy?: boolean;
|
|
110
|
+
svgMinHeight?: string;
|
|
111
|
+
usePlaceholder?: boolean;
|
|
112
|
+
}
|
|
113
|
+
interface LinkNodeProps {
|
|
114
|
+
node: {
|
|
115
|
+
type: 'link';
|
|
116
|
+
href: string;
|
|
117
|
+
title: string | null;
|
|
118
|
+
text: string;
|
|
119
|
+
attrs?: [string, string][];
|
|
120
|
+
children: {
|
|
121
|
+
type: string;
|
|
122
|
+
raw: string;
|
|
123
|
+
}[];
|
|
124
|
+
raw: string;
|
|
125
|
+
loading?: boolean;
|
|
126
|
+
};
|
|
127
|
+
indexKey: number | string;
|
|
128
|
+
customId?: string;
|
|
129
|
+
showTooltip?: boolean;
|
|
130
|
+
color?: string;
|
|
131
|
+
underlineHeight?: number;
|
|
132
|
+
underlineBottom?: number | string;
|
|
133
|
+
animationDuration?: number;
|
|
134
|
+
animationOpacity?: number;
|
|
135
|
+
animationTiming?: string;
|
|
136
|
+
animationIteration?: string | number;
|
|
137
|
+
}
|
|
138
|
+
interface PreCodeNodeProps {
|
|
139
|
+
node: CodeBlockNode$1;
|
|
140
|
+
}
|
|
141
|
+
interface MermaidBlockNodeProps {
|
|
142
|
+
node: CodeBlockNode$1;
|
|
143
|
+
maxHeight?: string | null;
|
|
144
|
+
loading?: boolean;
|
|
145
|
+
isDark?: boolean;
|
|
146
|
+
workerTimeoutMs?: number;
|
|
147
|
+
parseTimeoutMs?: number;
|
|
148
|
+
renderTimeoutMs?: number;
|
|
149
|
+
fullRenderTimeoutMs?: number;
|
|
150
|
+
renderDebounceMs?: number;
|
|
151
|
+
contentStableDelayMs?: number;
|
|
152
|
+
previewPollDelayMs?: number;
|
|
153
|
+
previewPollMaxDelayMs?: number;
|
|
154
|
+
previewPollMaxAttempts?: number;
|
|
155
|
+
showHeader?: boolean;
|
|
156
|
+
showModeToggle?: boolean;
|
|
157
|
+
showCopyButton?: boolean;
|
|
158
|
+
showExportButton?: boolean;
|
|
159
|
+
showFullscreenButton?: boolean;
|
|
160
|
+
showCollapseButton?: boolean;
|
|
161
|
+
showZoomControls?: boolean;
|
|
162
|
+
enableWheelZoom?: boolean;
|
|
163
|
+
isStrict?: boolean;
|
|
164
|
+
showTooltips?: boolean;
|
|
165
|
+
onRenderError?: (error: unknown, code: string, container: HTMLElement) => boolean | void;
|
|
166
|
+
}
|
|
167
|
+
interface MermaidBlockEvent<TPayload = any> {
|
|
168
|
+
payload?: TPayload;
|
|
169
|
+
defaultPrevented: boolean;
|
|
170
|
+
preventDefault: () => void;
|
|
171
|
+
svgElement?: SVGElement | null;
|
|
172
|
+
svgString?: string | null;
|
|
173
|
+
}
|
|
174
|
+
interface D2BlockNodeProps {
|
|
175
|
+
node: CodeBlockNode$1;
|
|
176
|
+
maxHeight?: string | null;
|
|
177
|
+
loading?: boolean;
|
|
178
|
+
isDark?: boolean;
|
|
179
|
+
progressiveRender?: boolean;
|
|
180
|
+
progressiveIntervalMs?: number;
|
|
181
|
+
themeId?: number | null;
|
|
182
|
+
darkThemeId?: number | null;
|
|
183
|
+
showHeader?: boolean;
|
|
184
|
+
showModeToggle?: boolean;
|
|
185
|
+
showCopyButton?: boolean;
|
|
186
|
+
showExportButton?: boolean;
|
|
187
|
+
showCollapseButton?: boolean;
|
|
188
|
+
}
|
|
189
|
+
interface MathBlockNodeProps {
|
|
190
|
+
node: {
|
|
191
|
+
type: 'math_block';
|
|
192
|
+
content: string;
|
|
193
|
+
raw: string;
|
|
194
|
+
loading?: boolean;
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
interface MathInlineNodeProps {
|
|
198
|
+
node: {
|
|
199
|
+
type: 'math_inline';
|
|
200
|
+
content: string;
|
|
201
|
+
raw: string;
|
|
202
|
+
loading?: boolean;
|
|
203
|
+
markup?: string;
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
interface InfographicBlockNodeProps {
|
|
207
|
+
node: CodeBlockNode$1;
|
|
208
|
+
maxHeight?: string | null;
|
|
209
|
+
loading?: boolean;
|
|
210
|
+
isDark?: boolean;
|
|
211
|
+
showHeader?: boolean;
|
|
212
|
+
showModeToggle?: boolean;
|
|
213
|
+
showCopyButton?: boolean;
|
|
214
|
+
showCollapseButton?: boolean;
|
|
215
|
+
showExportButton?: boolean;
|
|
216
|
+
showFullscreenButton?: boolean;
|
|
217
|
+
showZoomControls?: boolean;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
interface NodeRendererProps {
|
|
221
|
+
content?: string;
|
|
222
|
+
nodes?: readonly BaseNode[] | null;
|
|
223
|
+
/**
|
|
224
|
+
* Whether the input stream is complete (end-of-stream). When true, the parser
|
|
225
|
+
* can stop emitting streaming "loading" nodes for unfinished constructs.
|
|
226
|
+
*/
|
|
227
|
+
final?: boolean;
|
|
228
|
+
parseOptions?: ParseOptions;
|
|
229
|
+
customMarkdownIt?: (md: MarkdownIt) => MarkdownIt;
|
|
230
|
+
/** Log parse/render timing stats (dev only). */
|
|
231
|
+
debugPerformance?: boolean;
|
|
232
|
+
/**
|
|
233
|
+
* Custom HTML-like tags that should be emitted as custom nodes (e.g. ['thinking']).
|
|
234
|
+
* Forwarded to `getMarkdown()` and merged into parseOptions.
|
|
235
|
+
*/
|
|
236
|
+
customHtmlTags?: readonly string[];
|
|
237
|
+
viewportPriority?: boolean;
|
|
238
|
+
codeBlockStream?: boolean;
|
|
239
|
+
codeBlockDarkTheme?: CodeBlockMonacoTheme;
|
|
240
|
+
codeBlockLightTheme?: CodeBlockMonacoTheme;
|
|
241
|
+
codeBlockMonacoOptions?: CodeBlockMonacoOptions;
|
|
242
|
+
renderCodeBlocksAsPre?: boolean;
|
|
243
|
+
codeBlockMinWidth?: string | number;
|
|
244
|
+
codeBlockMaxWidth?: string | number;
|
|
245
|
+
codeBlockProps?: Record<string, any>;
|
|
246
|
+
mermaidProps?: Partial<Omit<MermaidBlockNodeProps, 'node' | 'loading' | 'isDark'>>;
|
|
247
|
+
d2Props?: Partial<Omit<D2BlockNodeProps, 'node' | 'loading' | 'isDark'>>;
|
|
248
|
+
infographicProps?: Partial<Omit<InfographicBlockNodeProps, 'node' | 'loading' | 'isDark'>>;
|
|
249
|
+
showTooltips?: boolean;
|
|
250
|
+
themes?: CodeBlockMonacoTheme[];
|
|
251
|
+
isDark?: boolean;
|
|
252
|
+
customId?: string;
|
|
253
|
+
indexKey?: number | string;
|
|
254
|
+
typewriter?: boolean;
|
|
255
|
+
batchRendering?: boolean;
|
|
256
|
+
initialRenderBatchSize?: number;
|
|
257
|
+
renderBatchSize?: number;
|
|
258
|
+
renderBatchDelay?: number;
|
|
259
|
+
renderBatchBudgetMs?: number;
|
|
260
|
+
renderBatchIdleTimeoutMs?: number;
|
|
261
|
+
deferNodesUntilVisible?: boolean;
|
|
262
|
+
maxLiveNodes?: number;
|
|
263
|
+
liveNodeBuffer?: number;
|
|
264
|
+
onCopy?: (code: string) => void;
|
|
265
|
+
onHandleArtifactClick?: (payload: any) => void;
|
|
266
|
+
onClick?: (event: React.MouseEvent<HTMLDivElement>) => void;
|
|
267
|
+
onMouseOver?: (event: React.MouseEvent<HTMLElement>) => void;
|
|
268
|
+
onMouseOut?: (event: React.MouseEvent<HTMLElement>) => void;
|
|
269
|
+
}
|
|
270
|
+
interface RenderContext {
|
|
271
|
+
customId?: string;
|
|
272
|
+
isDark?: boolean;
|
|
273
|
+
indexKey?: string;
|
|
274
|
+
typewriter?: boolean;
|
|
275
|
+
textStreamState?: Map<string, string>;
|
|
276
|
+
streamRenderVersion?: number;
|
|
277
|
+
customComponents?: Record<string, React.ComponentType<any>>;
|
|
278
|
+
codeBlockProps?: Record<string, any>;
|
|
279
|
+
mermaidProps?: Partial<Omit<MermaidBlockNodeProps, 'node' | 'loading' | 'isDark'>>;
|
|
280
|
+
d2Props?: Partial<Omit<D2BlockNodeProps, 'node' | 'loading' | 'isDark'>>;
|
|
281
|
+
infographicProps?: Partial<Omit<InfographicBlockNodeProps, 'node' | 'loading' | 'isDark'>>;
|
|
282
|
+
showTooltips?: boolean;
|
|
283
|
+
codeBlockStream?: boolean;
|
|
284
|
+
renderCodeBlocksAsPre?: boolean;
|
|
285
|
+
codeBlockThemes?: {
|
|
286
|
+
themes?: CodeBlockMonacoTheme[];
|
|
287
|
+
darkTheme?: CodeBlockMonacoTheme;
|
|
288
|
+
lightTheme?: CodeBlockMonacoTheme;
|
|
289
|
+
monacoOptions?: CodeBlockMonacoOptions;
|
|
290
|
+
minWidth?: string | number;
|
|
291
|
+
maxWidth?: string | number;
|
|
292
|
+
};
|
|
293
|
+
events: {
|
|
294
|
+
onCopy?: (code: string) => void;
|
|
295
|
+
onHandleArtifactClick?: (payload: any) => void;
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
type RenderNodeFn = (node: ParsedNode, key: React.Key, ctx: RenderContext) => React.ReactNode;
|
|
299
|
+
|
|
300
|
+
interface NodeComponentProps<TNode = unknown> {
|
|
301
|
+
node: TNode;
|
|
302
|
+
ctx?: RenderContext;
|
|
303
|
+
renderNode?: RenderNodeFn;
|
|
304
|
+
indexKey?: React.Key;
|
|
305
|
+
customId?: string;
|
|
306
|
+
isDark?: boolean;
|
|
307
|
+
typewriter?: boolean;
|
|
308
|
+
children?: React.ReactNode;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
interface LinkNodeStyleProps {
|
|
312
|
+
showTooltip?: boolean;
|
|
313
|
+
color?: string;
|
|
314
|
+
underlineHeight?: number;
|
|
315
|
+
underlineBottom?: number | string;
|
|
316
|
+
animationDuration?: number;
|
|
317
|
+
animationOpacity?: number;
|
|
318
|
+
animationTiming?: string;
|
|
319
|
+
animationIteration?: string | number;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
interface ListItemNodeData {
|
|
323
|
+
type: 'list_item';
|
|
324
|
+
children?: ParsedNode[];
|
|
325
|
+
raw?: string;
|
|
326
|
+
}
|
|
327
|
+
interface ListItemNodeProps extends NodeComponentProps<ListItemNodeData> {
|
|
328
|
+
value?: number;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
interface MarkdownCodeBlockNodeProps {
|
|
332
|
+
node: {
|
|
333
|
+
type: 'code_block';
|
|
334
|
+
language: string;
|
|
335
|
+
code: string;
|
|
336
|
+
raw: string;
|
|
337
|
+
diff?: boolean;
|
|
338
|
+
originalCode?: string;
|
|
339
|
+
updatedCode?: string;
|
|
340
|
+
};
|
|
341
|
+
loading?: boolean;
|
|
342
|
+
stream?: boolean;
|
|
343
|
+
darkTheme?: string;
|
|
344
|
+
lightTheme?: string;
|
|
345
|
+
isDark?: boolean;
|
|
346
|
+
isShowPreview?: boolean;
|
|
347
|
+
enableFontSizeControl?: boolean;
|
|
348
|
+
minWidth?: string | number;
|
|
349
|
+
maxWidth?: string | number;
|
|
350
|
+
themes?: string[];
|
|
351
|
+
showHeader?: boolean;
|
|
352
|
+
showCopyButton?: boolean;
|
|
353
|
+
showExpandButton?: boolean;
|
|
354
|
+
showPreviewButton?: boolean;
|
|
355
|
+
showCollapseButton?: boolean;
|
|
356
|
+
showFontSizeButtons?: boolean;
|
|
357
|
+
showTooltips?: boolean;
|
|
358
|
+
onCopy?: (code: string) => void;
|
|
359
|
+
onPreviewCode?: (payload: {
|
|
360
|
+
type: string;
|
|
361
|
+
content: string;
|
|
362
|
+
title: string;
|
|
363
|
+
}) => void;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
type TooltipPlacement = 'top' | 'bottom' | 'left' | 'right';
|
|
367
|
+
interface TooltipProps {
|
|
368
|
+
visible: boolean;
|
|
369
|
+
anchorEl: HTMLElement | null;
|
|
370
|
+
content: string;
|
|
371
|
+
placement?: TooltipPlacement;
|
|
372
|
+
offset?: number;
|
|
373
|
+
originX?: number | null;
|
|
374
|
+
originY?: number | null;
|
|
375
|
+
id?: string | null;
|
|
376
|
+
isDark?: boolean | null;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
type CustomComponentMap = Record<string, ComponentType<any>>;
|
|
380
|
+
declare function setCustomComponents(id: string, mapping: CustomComponentMap): void;
|
|
381
|
+
declare function setCustomComponents(mapping: CustomComponentMap): void;
|
|
382
|
+
declare function getCustomNodeComponents(customId?: string): CustomComponentMap;
|
|
383
|
+
declare function removeCustomComponents(id: string): void;
|
|
384
|
+
declare function clearGlobalCustomComponents(): void;
|
|
385
|
+
|
|
386
|
+
declare function TextNode(props: NodeComponentProps<{
|
|
387
|
+
type: 'text';
|
|
388
|
+
content: string;
|
|
389
|
+
center?: boolean;
|
|
390
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
391
|
+
declare function ParagraphNode(props: NodeComponentProps<{
|
|
392
|
+
type: 'paragraph';
|
|
393
|
+
children?: ParsedNode[];
|
|
394
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
395
|
+
declare function HeadingNode(props: NodeComponentProps<{
|
|
396
|
+
type: 'heading';
|
|
397
|
+
level?: number;
|
|
398
|
+
children?: ParsedNode[];
|
|
399
|
+
attrs?: Record<string, string | boolean>;
|
|
400
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
401
|
+
declare function BlockquoteNode(props: NodeComponentProps<{
|
|
402
|
+
type: 'blockquote';
|
|
403
|
+
children?: ParsedNode[];
|
|
404
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
405
|
+
declare function ListItemNode(props: NodeComponentProps<{
|
|
406
|
+
type: 'list_item';
|
|
407
|
+
children?: ParsedNode[];
|
|
408
|
+
}> & {
|
|
409
|
+
value?: number;
|
|
410
|
+
}): react_jsx_runtime.JSX.Element;
|
|
411
|
+
declare function ListNode(props: NodeComponentProps<{
|
|
412
|
+
type: 'list';
|
|
413
|
+
ordered?: boolean;
|
|
414
|
+
start?: number;
|
|
415
|
+
items?: any[];
|
|
416
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
417
|
+
declare function TableNode(props: NodeComponentProps<{
|
|
418
|
+
type: 'table';
|
|
419
|
+
header?: any;
|
|
420
|
+
rows?: any[];
|
|
421
|
+
loading?: boolean;
|
|
422
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
423
|
+
declare function DefinitionListNode(props: NodeComponentProps<{
|
|
424
|
+
type: 'definition_list';
|
|
425
|
+
items?: any[];
|
|
426
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
427
|
+
declare function FootnoteNode(props: NodeComponentProps<{
|
|
428
|
+
type: 'footnote';
|
|
429
|
+
id: string;
|
|
430
|
+
children?: ParsedNode[];
|
|
431
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
432
|
+
declare function FootnoteReferenceNode(props: NodeComponentProps<{
|
|
433
|
+
type: 'footnote_reference';
|
|
434
|
+
id: string;
|
|
435
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
436
|
+
declare function FootnoteAnchorNode(props: NodeComponentProps<{
|
|
437
|
+
type: 'footnote_anchor';
|
|
438
|
+
id: string;
|
|
439
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
440
|
+
declare function AdmonitionNode(props: NodeComponentProps<{
|
|
441
|
+
type: 'admonition';
|
|
442
|
+
kind?: string;
|
|
443
|
+
title?: string;
|
|
444
|
+
children?: ParsedNode[];
|
|
445
|
+
collapsible?: boolean;
|
|
446
|
+
open?: boolean;
|
|
447
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
448
|
+
declare function CheckboxNode(props: NodeComponentProps<{
|
|
449
|
+
type: 'checkbox' | 'checkbox_input';
|
|
450
|
+
checked?: boolean;
|
|
451
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
452
|
+
declare function EmojiNode(props: NodeComponentProps<{
|
|
453
|
+
type: 'emoji';
|
|
454
|
+
name: string;
|
|
455
|
+
markup?: string;
|
|
456
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
457
|
+
declare function StrongNode(props: NodeComponentProps<{
|
|
458
|
+
type: 'strong';
|
|
459
|
+
children?: ParsedNode[];
|
|
460
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
461
|
+
declare function EmphasisNode(props: NodeComponentProps<{
|
|
462
|
+
type: 'emphasis';
|
|
463
|
+
children?: ParsedNode[];
|
|
464
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
465
|
+
declare function StrikethroughNode(props: NodeComponentProps<{
|
|
466
|
+
type: 'strikethrough';
|
|
467
|
+
children?: ParsedNode[];
|
|
468
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
469
|
+
declare function HighlightNode(props: NodeComponentProps<{
|
|
470
|
+
type: 'highlight';
|
|
471
|
+
children?: ParsedNode[];
|
|
472
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
473
|
+
declare function InsertNode(props: NodeComponentProps<{
|
|
474
|
+
type: 'insert';
|
|
475
|
+
children?: ParsedNode[];
|
|
476
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
477
|
+
declare function SubscriptNode(props: NodeComponentProps<{
|
|
478
|
+
type: 'subscript';
|
|
479
|
+
children?: ParsedNode[];
|
|
480
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
481
|
+
declare function SuperscriptNode(props: NodeComponentProps<{
|
|
482
|
+
type: 'superscript';
|
|
483
|
+
children?: ParsedNode[];
|
|
484
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
485
|
+
declare function HardBreakNode(_props: NodeComponentProps<{
|
|
486
|
+
type: 'hardbreak';
|
|
487
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
488
|
+
declare function ThematicBreakNode(_props?: NodeComponentProps<{
|
|
489
|
+
type: 'thematic_break';
|
|
490
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
491
|
+
declare function InlineCodeNode(props: NodeComponentProps<{
|
|
492
|
+
type: 'inline_code';
|
|
493
|
+
code: string;
|
|
494
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
495
|
+
declare function LinkNode(props: NodeComponentProps<LinkNodeProps['node']> & {
|
|
496
|
+
showTooltip?: boolean;
|
|
497
|
+
color?: string;
|
|
498
|
+
underlineHeight?: number;
|
|
499
|
+
underlineBottom?: number | string;
|
|
500
|
+
animationDuration?: number;
|
|
501
|
+
animationOpacity?: number;
|
|
502
|
+
animationTiming?: string;
|
|
503
|
+
animationIteration?: string | number;
|
|
504
|
+
}): react_jsx_runtime.JSX.Element;
|
|
505
|
+
declare function ImageNode(rawProps: ImageNodeProps): react_jsx_runtime.JSX.Element;
|
|
506
|
+
declare function PreCodeNode({ node }: PreCodeNodeProps): react_jsx_runtime.JSX.Element;
|
|
507
|
+
declare function CodeBlockNode(props: CodeBlockNodeProps): react_jsx_runtime.JSX.Element;
|
|
508
|
+
declare function MarkdownCodeBlockNode(props: MarkdownCodeBlockNodeProps): react_jsx_runtime.JSX.Element;
|
|
509
|
+
declare function MermaidBlockNode(props: MermaidBlockNodeProps): react_jsx_runtime.JSX.Element;
|
|
510
|
+
declare function D2BlockNode(props: D2BlockNodeProps): react_jsx_runtime.JSX.Element;
|
|
511
|
+
declare function InfographicBlockNode(props: InfographicBlockNodeProps): react_jsx_runtime.JSX.Element;
|
|
512
|
+
declare function MathBlockNode({ node }: MathBlockNodeProps): react_jsx_runtime.JSX.Element;
|
|
513
|
+
declare function MathInlineNode({ node }: MathInlineNodeProps): react_jsx_runtime.JSX.Element;
|
|
514
|
+
declare function ReferenceNode(props: NodeComponentProps<{
|
|
515
|
+
type: 'reference';
|
|
516
|
+
id: string;
|
|
517
|
+
}> & {
|
|
518
|
+
messageId?: string;
|
|
519
|
+
threadId?: string;
|
|
520
|
+
}): react_jsx_runtime.JSX.Element;
|
|
521
|
+
declare function HtmlBlockNode(props: NodeComponentProps<{
|
|
522
|
+
type: 'html_block';
|
|
523
|
+
content?: string;
|
|
524
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
525
|
+
declare function HtmlInlineNode(props: NodeComponentProps<{
|
|
526
|
+
type: 'html_inline';
|
|
527
|
+
content?: string;
|
|
528
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
529
|
+
declare function VmrContainerNode(props: NodeComponentProps<{
|
|
530
|
+
type: 'vmr_container';
|
|
531
|
+
name: string;
|
|
532
|
+
attrs?: Record<string, string> | [string, string | null][] | null;
|
|
533
|
+
children?: ParsedNode[];
|
|
534
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
535
|
+
declare function Tooltip(_props: TooltipProps): any;
|
|
536
|
+
declare function HtmlPreviewFrame(_props: HtmlPreviewFrameProps): any;
|
|
537
|
+
declare function FallbackComponent(props: NodeComponentProps<{
|
|
538
|
+
type: string;
|
|
539
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
540
|
+
declare function renderNode(node: ParsedNode, key: React.Key, ctx: RenderContext): react_jsx_runtime.JSX.Element;
|
|
541
|
+
declare function NodeRenderer(props: NodeRendererProps): react_jsx_runtime.JSX.Element;
|
|
542
|
+
|
|
543
|
+
export { AdmonitionNode, BlockquoteNode, CheckboxNode, CodeBlockDiffAppearance, CodeBlockDiffHideUnchangedRegions, CodeBlockDiffHideUnchangedRegionsOptions, CodeBlockDiffHunkActionContext, CodeBlockDiffHunkActionKind, CodeBlockDiffHunkSide, CodeBlockDiffLineStyle, CodeBlockDiffUnchangedRegionStyle, CodeBlockMonacoLanguage, CodeBlockMonacoOptions, CodeBlockMonacoTheme, CodeBlockMonacoThemeObject, CodeBlockNode, CodeBlockNodeProps, D2BlockNode, D2BlockNodeProps, DefinitionListNode, EmojiNode, EmphasisNode, FallbackComponent, FootnoteAnchorNode, FootnoteNode, FootnoteReferenceNode, HardBreakNode, HeadingNode, HighlightNode, HtmlBlockNode, HtmlInlineNode, HtmlPreviewFrame, HtmlPreviewFrameProps, ImageNode, ImageNodeProps, InfographicBlockNode, InfographicBlockNodeProps, InlineCodeNode, InsertNode, LinkNode, LinkNodeProps, LinkNodeStyleProps, ListItemNode, ListItemNodeProps, ListNode, MarkdownCodeBlockNode, MarkdownCodeBlockNodeProps, MathBlockNode, MathBlockNodeProps, MathInlineNode, MathInlineNodeProps, MermaidBlockEvent, MermaidBlockNode, MermaidBlockNodeProps, NodeComponentProps, NodeRenderer, NodeRendererProps, ParagraphNode, PreCodeNode, PreCodeNodeProps, CodeBlockNode as ReactCodeBlockNode, ReferenceNode, StrikethroughNode, StrongNode, SubscriptNode, SuperscriptNode, TableNode, TextNode, ThematicBreakNode, Tooltip, TooltipPlacement, TooltipProps, VmrContainerNode, clearGlobalCustomComponents, NodeRenderer as default, getCustomNodeComponents, removeCustomComponents, renderNode, setCustomComponents };
|
package/dist/server.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as e,g as o,r as a,s}from"./languageIcon-BiAQ6aSb.js";import{A as d,B as t,C as N,a as n,D as r,b as i,E as m,c as l,F as c,d as k,e as C,f as p,H as g,g as h,h as B,i as u,j as I,k as f,I as H,l as b,m as F,n as x,L,o as M,p as R,M as S,q as T,r as j,s as P,N as v,P as w,t as A,a as D,R as E,S as q,u as G,v as V,w as y,T as z,x as J,y as K,z as O,V as Q,N as U,G as W}from"./index-BQw8Blc5.js";export{d as AdmonitionNode,t as BlockquoteNode,N as CheckboxNode,n as CodeBlockNode,r as D2BlockNode,i as DefinitionListNode,m as EmojiNode,l as EmphasisNode,c as FallbackComponent,k as FootnoteAnchorNode,C as FootnoteNode,p as FootnoteReferenceNode,g as HardBreakNode,h as HeadingNode,B as HighlightNode,u as HtmlBlockNode,I as HtmlInlineNode,f as HtmlPreviewFrame,H as ImageNode,b as InfographicBlockNode,F as InlineCodeNode,x as InsertNode,L as LinkNode,M as ListItemNode,R as ListNode,S as MarkdownCodeBlockNode,T as MathBlockNode,j as MathInlineNode,P as MermaidBlockNode,v as NodeRenderer,w as ParagraphNode,A as PreCodeNode,D as ReactCodeBlockNode,E as ReferenceNode,q as StrikethroughNode,G as StrongNode,V as SubscriptNode,y as SuperscriptNode,z as TableNode,J as TextNode,K as ThematicBreakNode,O as Tooltip,Q as VmrContainerNode,e as clearGlobalCustomComponents,U as default,o as getCustomNodeComponents,a as removeCustomComponents,W as renderNode,s as setCustomComponents};
|
package/dist/tailwind.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export const safeList = `string cannot delete global call clearGlobalCustomComponents
|
|
1
|
+
export const safeList = `use client react string cannot delete global call clearGlobalCustomComponents checkbox-node checkbox checkbox-input react-dom en utf-8 viewport content="width=device-width initial-scale=1 event.key keydown html-preview-frame__backdrop--dark html-preview-frame--dark html-preview-frame__header html-preview-frame__title html-preview-frame__dot html-preview-frame__label html-preview-frame__close--dark html-preview-frame__iframe allow-scripts allow-same-origin about:blank note is-dark data-index-key headerId admonition-header admonition-icon admonition-title admonition-toggle aria-expanded aria-controls collapsed admonition-content aria-labelledby blockquote-node auto dependency is not install it to enable stream-markdown-parser typeof window.requestIdleCallback [data-node-index] node-spacer dark virtualized data-custom-id code_block node-slot data-node-index data-node-type typewriter-node node-placeholder performance [markstream-react][perf] mermaid theme object name markdown-renderer boolean line-info diffUnchangedRegionStyle line-info-basic metadata legacy none off never background 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 plaintext number diff visible view.getModifiedEditor ?? explicit on same helpers.cleanupEditor canonicalLanguage window.requestAnimationFrame single window.cancelAnimationFrame clientX top navigator.clipboard navigator.clipboard.writeText 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-rendering is-diff is-plain-text code-block-header flex justify-between items-center px-4 py-2.5 border-b border-gray-400/5 space-x-2 flex-1 icon-slot h-4 w-4 flex-shrink-0 text-sm font-medium font-mono truncate code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)] aria-pressed w-3 h-3 currentColor round m9 copied m14 evenodd code-block-body--collapsed code-block-body--expanded code-editor-layer code-height-placeholder hidden aria-hidden code-editor-fallback-surface code-fallback-plain m-0 aria-busy aria-label no code-loading-placeholder loading-skeleton skeleton-line short sr-only polite status footnote-node mt-2 mb-2 leading-relaxed border-t border-[#eaecef] pt-2 dl definition-list indexKey mb-4 dt definition-term font-semibold ctx renderNode definition dd definition-desc ml-4 emoji-node emphasis-node smooth footnote-anchor text-[#0366d6] hover:underline cursor-pointer ↩︎ clsx href xlink:href markstream-d2-root-svg instance.render instance missing render returned empty d2-block text-gray-100 text-gray-900 d2-block-header gap-x-2 gap-x-1 p-0.5 bg-gray-700 bg-gray-100 mode-btn px-2 py-1 rounded !showSource is-active showSource d2-action-btn copying bodyRef d2-block-body bodyStyle !hasPreview d2-source py-4 d2-code d2-error d2-render d2-svg pb-3 mark highlight-node footnote-reference handleScroll footnote footnote-link heading-node hard-break onclick onerror onload onmouseover onmouseout onmousedown onmouseup onkeydown onkeyup onfocus onblur onsubmit onreset onchange onselect ondblclick src srcset formaction abbr address area article aside bdi bdo caption cite col colgroup data datalist details dfn dialog embed fieldset footer header hgroup kbd legend main map menu meter nav optgroup output param picture progress rp rt ruby samp section small source summary template tfoot time track var wbr class text tag_close self_closing tag_open setHostEl html-block-node shouldRender useDynamic reactNodes renderContent html-block-node__placeholder html-block-node__placeholder-bar w-4/5 w-2/3 setFigureEl image-node image-node__inner is-loaded contain lazy eager async image image-node__placeholder image-node__spinner image-node__placeholder-text image… placeholder image-node__error failed load image-node__caption inline-code inline text-[85%] px-1 py-0.5 bg-[hsl(var(--secondary))] whitespace-normal break-words max-w-full text-node-stream-delta text-node-stream-delta--a text-node-stream-delta--b list-item pl-1.5 my-2 valueAttr children insert-node ease-in-out infinite node.title link-loading inline-flex items-baseline gap-1.5 link-text-wrapper relative leading-[normal] link-text link-loading-indicator link-node noopener noreferrer library text-red-500 p-4">Failed instanceof error.message error transform ease center fullscreen touches text-gray-400 hover:bg-gray-700 hover:text-gray-200 text-gray-600 hover:bg-gray-200 hover:text-gray-700 bg-gray-800 bg-gray-50 px-2.5 bg-gray-600 text-gray-200 text-gray-700 text-gray-500 m16 isCollapsed opacity-50 cursor-not-allowed m7 whitespace-pre-wrap text-gray-300 baseCode absolute top-2 right-2 z-10 gap-2 backdrop-blur min-h-[360px] transition-all duration-100 block inset-0 cursor-grab isDragging containerRef w-full text-center justify-center min-h-full fixed z-50 bg-black/70 p-4 closeModal h-full max-h-full shadow-lg top-6 right-6 !isDragging cursor-grabbing vitesse-dark vitesse-light shiki shiki-fallback stream-markdown code-block-content rendererTargetRef code-block-render list-node my-5 pl-[calc(13/8*1em)] list-decimal list-disc max-lg:my-[calc(4/3*1em)] max-lg:pl-[calc(14/9*1em)] list unknown-node italic node paragraph-node paragraph strong-node strikethrough-node superscript-node subscript-node right text-right text-left table-node-wrapper my-8 table-node table-node--loading border-[var(--table-border,#cbd5e1)] p-[calc(4/7*1em)] table-node__loading table-node__spinner reference-node bg-[hsl(var(--muted))] px-1.5 mx-0.5 hover:bg-[hsl(var(--secondary))] hr-node thematic-break window.matchMedia ms-tooltip z-[9999] inline-block text-base py-2 px-3 shadow-md whitespace-nowrap pointer-events-none tooltip-element text-white border-gray-700 tooltip text-node text-node-center in out zoom containerClass vmr-container afterbegin loose strict viewBox open-modal [data-mermaid-wrapper] mermaid-action-btn toggle-mode preview common.zoomIn common.zoomOut common.resetZoom transition-[height] duration-150 ease-out data-mermaid-wrapper mermaid-loading mermaid-spinner diagram… mermaid-block-header space-x-1 common.preview common.source common.export mermaid-error mermaid-block modeContainerRef mermaid-modal-overlay mermaid-modal-panel mermaid-modal-header mermaid-modal-title mermaid-modal-close mermaid-modal-body modalContentRef mermaid-modal-content available default abort timed infographic d2 language d2lang html_block node.type html_inline text_special node.content heading list_item definition_list footnote_reference footnote_anchor admonition hardbreak inline_code emphasis strikethrough highlight insert subscript superscript checkbox_input emoji thematic_break math_inline math_block reference vmr_container label_open label_close javascript typescript python shell plain cpp markdown [mermaidWorkerClient] messageerror cleared worker inject via busy canParse findPrefix document thinking htmlFor className data-language role aria-describedby stream-monaco ontouchstart ontouchend ontouchmove ontouchcancel onwheel onscroll oncopy oncut onpaste oninput oninvalid onsearch checked disabled readonly required autofocus multiple value min max step width height size maxlength parse dynamic html-inline-node html-inline-node--loading data-ssr-fallback normalizedLanguage classAttr node.cite renderNodeProp void rowIdx bodyRows.length isOpen thematic-break-node cssVars image-node__img code-block-node code-block markdown-code-block-node markdown-code-block mermaid-block-node d2-block-node infographic-block-node math-block overflow-x-auto min-h-[40px] $$ math-inline-wrapper math-inline data-reference-id server-renderer node-content mathRef rendering math-rendering math-inline--hidden math-inline__loading math-inline__spinner globalThis.requestAnimationFrame globalThis.cancelAnimationFrame [katexWorkerClient] init cache-hit timeout waiting slot module did expected [markstream-react] existingEnv.getWorkerUrl katex process`
|
|
2
2
|
module.exports = safeList;
|
|
3
3
|
export default safeList;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ParsedNode } from 'stream-markdown-parser';
|
|
2
|
+
import { NodeComponentProps } from '../../types/node-component';
|
|
3
|
+
export declare function AdmonitionNode(props: NodeComponentProps<{
|
|
4
|
+
type: 'admonition';
|
|
5
|
+
kind?: string;
|
|
6
|
+
title?: string;
|
|
7
|
+
children?: ParsedNode[];
|
|
8
|
+
collapsible?: boolean;
|
|
9
|
+
open?: boolean;
|
|
10
|
+
}>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export default AdmonitionNode;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ParsedNode } from 'stream-markdown-parser';
|
|
2
|
+
import { NodeComponentProps } from '../../types/node-component';
|
|
3
|
+
export declare function BlockquoteNode(props: NodeComponentProps<{
|
|
4
|
+
type: 'blockquote';
|
|
5
|
+
children?: ParsedNode[];
|
|
6
|
+
}>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default BlockquoteNode;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { NodeComponentProps } from '../../types/node-component';
|
|
2
|
+
export declare function CheckboxNode(props: NodeComponentProps<{
|
|
3
|
+
type: 'checkbox' | 'checkbox_input';
|
|
4
|
+
checked?: boolean;
|
|
5
|
+
}>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export default CheckboxNode;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CodeBlockNodeProps } from '../../types/component-props';
|
|
2
|
+
export interface CodeBlockPreviewPayload {
|
|
3
|
+
node: CodeBlockNodeProps['node'];
|
|
4
|
+
artifactType: 'text/html' | 'image/svg+xml';
|
|
5
|
+
artifactTitle: string;
|
|
6
|
+
id: string;
|
|
7
|
+
}
|
|
8
|
+
export interface CodeBlockNodeReactEvents {
|
|
9
|
+
onCopy?: (code: string) => void;
|
|
10
|
+
onPreviewCode?: (payload: CodeBlockPreviewPayload) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare function CodeBlockNode(rawProps: CodeBlockNodeProps & CodeBlockNodeReactEvents): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export default CodeBlockNode;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface HtmlPreviewFrameProps {
|
|
3
|
+
code: string;
|
|
4
|
+
isDark?: boolean;
|
|
5
|
+
onClose?: () => void;
|
|
6
|
+
title?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function HtmlPreviewFrame(props: HtmlPreviewFrameProps): React.ReactPortal;
|
|
9
|
+
export default HtmlPreviewFrame;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getUseMonaco(): Promise<any>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
type MonacoTheme = any;
|
|
2
|
+
type SetThemeFn = (theme: MonacoTheme, force?: boolean) => Promise<void> | void;
|
|
3
|
+
export declare function subscribeMonacoThemeApplied(listener: () => void): () => void;
|
|
4
|
+
export declare function registerMonacoThemeSetter(setTheme: SetThemeFn | null | undefined): void;
|
|
5
|
+
export declare function setDesiredMonacoTheme(theme: MonacoTheme | null | undefined): void;
|
|
6
|
+
export declare function getDesiredMonacoTheme(): MonacoTheme | null;
|
|
7
|
+
export {};
|