markstream-react 0.0.32 → 0.0.34
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-CgreNSxF.js +211 -0
- package/dist/index-DzmDCKan.js +89 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +66 -622
- package/dist/index.js +1 -211
- package/dist/index.px.css +1 -1
- package/dist/index.tailwind.css +1 -1
- package/dist/languageIcon-CEJktwcf.js +3 -0
- package/dist/markstream-react.css +1 -0
- package/dist/next.d.ts +739 -0
- package/dist/next.js +2 -0
- package/dist/server.d.ts +545 -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/SoftBreakNode/SoftBreakNode.d.ts +5 -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 +66 -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 +169 -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 +209 -0
- package/dist/types/types/node-component.d.ts +12 -0
- package/dist/types/types.d.ts +83 -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 h,N as x,P as A,u as B,R as N,v as S,w as v,x as j,y as O,T as P,z as w,G as z,J as F,V as Y}from"./Tooltip-CgreNSxF.js";import{M as q,W as G,K as H,O as U,Q as V,U as J,X as $,Y as Q,Z,ah as aa,_ as sa,$ as ea,a0 as ra,a1 as oa,a2 as ta,a3 as na,a4 as ia,a5 as ma,a6 as la,a7 as ua,a8 as ca,a9 as da,aa as ga,ab as fa,ac as pa,ad as Ca,ae as Ta,af as ka,ag as Da}from"./Tooltip-CgreNSxF.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-CEJktwcf.js";import{A as ha,B as xa,C as Aa,a as Ba,D as Na,b as Sa,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 Ja,m as $a,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-DzmDCKan.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,ha),Ks=Ds(o,xa),Ms=Ds(t,Aa),Is=Ds(n,Ba),Ws=Is,_s=Ds(E,Ua),Ls=Ds(i,Na),Rs=Ds(m,Sa),Xs=Ds(l,va),bs=Ds(u,ja),ys=Ds(d,Pa),hs=Ds(g,wa),xs=Ds(f,za),As=Ds(p,Fa),Bs=Ds(C,Ya),Ns=Ds(T,qa),Ss=Ds(k,Ga),vs=Ds(D,Ha),js=Ds(K,Va),Os=Ds(M,Ja),Ps=Ds(I,$a),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(h,ts),Vs=Ds(x,ns),Js=Ds(c,Oa),$s=Ds(A,is),Qs=Ds(B,ms),Zs=Ds(N,ls),ae=Ds(S,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,Js as FallbackComponent,ys as FootnoteAnchorNode,hs as FootnoteNode,xs as FootnoteReferenceNode,As as HardBreakNode,Bs as HeadingNode,Ns as HighlightNode,Ss 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,$s 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,J as clearMermaidWorker,Vs as default,$ 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,545 @@
|
|
|
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
|
+
inline?: boolean;
|
|
113
|
+
}
|
|
114
|
+
interface LinkNodeProps {
|
|
115
|
+
node: {
|
|
116
|
+
type: 'link';
|
|
117
|
+
href: string;
|
|
118
|
+
title: string | null;
|
|
119
|
+
text: string;
|
|
120
|
+
attrs?: [string, string][];
|
|
121
|
+
children: {
|
|
122
|
+
type: string;
|
|
123
|
+
raw: string;
|
|
124
|
+
}[];
|
|
125
|
+
raw: string;
|
|
126
|
+
loading?: boolean;
|
|
127
|
+
};
|
|
128
|
+
indexKey: number | string;
|
|
129
|
+
customId?: string;
|
|
130
|
+
showTooltip?: boolean;
|
|
131
|
+
color?: string;
|
|
132
|
+
underlineHeight?: number;
|
|
133
|
+
underlineBottom?: number | string;
|
|
134
|
+
animationDuration?: number;
|
|
135
|
+
animationOpacity?: number;
|
|
136
|
+
animationTiming?: string;
|
|
137
|
+
animationIteration?: string | number;
|
|
138
|
+
}
|
|
139
|
+
interface PreCodeNodeProps {
|
|
140
|
+
node: CodeBlockNode$1;
|
|
141
|
+
}
|
|
142
|
+
interface MermaidBlockNodeProps {
|
|
143
|
+
node: CodeBlockNode$1;
|
|
144
|
+
maxHeight?: string | null;
|
|
145
|
+
loading?: boolean;
|
|
146
|
+
isDark?: boolean;
|
|
147
|
+
workerTimeoutMs?: number;
|
|
148
|
+
parseTimeoutMs?: number;
|
|
149
|
+
renderTimeoutMs?: number;
|
|
150
|
+
fullRenderTimeoutMs?: number;
|
|
151
|
+
renderDebounceMs?: number;
|
|
152
|
+
contentStableDelayMs?: number;
|
|
153
|
+
previewPollDelayMs?: number;
|
|
154
|
+
previewPollMaxDelayMs?: number;
|
|
155
|
+
previewPollMaxAttempts?: number;
|
|
156
|
+
showHeader?: boolean;
|
|
157
|
+
showModeToggle?: boolean;
|
|
158
|
+
showCopyButton?: boolean;
|
|
159
|
+
showExportButton?: boolean;
|
|
160
|
+
showFullscreenButton?: boolean;
|
|
161
|
+
showCollapseButton?: boolean;
|
|
162
|
+
showZoomControls?: boolean;
|
|
163
|
+
enableWheelZoom?: boolean;
|
|
164
|
+
isStrict?: boolean;
|
|
165
|
+
showTooltips?: boolean;
|
|
166
|
+
onRenderError?: (error: unknown, code: string, container: HTMLElement) => boolean | void;
|
|
167
|
+
}
|
|
168
|
+
interface MermaidBlockEvent<TPayload = any> {
|
|
169
|
+
payload?: TPayload;
|
|
170
|
+
defaultPrevented: boolean;
|
|
171
|
+
preventDefault: () => void;
|
|
172
|
+
svgElement?: SVGElement | null;
|
|
173
|
+
svgString?: string | null;
|
|
174
|
+
}
|
|
175
|
+
interface D2BlockNodeProps {
|
|
176
|
+
node: CodeBlockNode$1;
|
|
177
|
+
maxHeight?: string | null;
|
|
178
|
+
loading?: boolean;
|
|
179
|
+
isDark?: boolean;
|
|
180
|
+
progressiveRender?: boolean;
|
|
181
|
+
progressiveIntervalMs?: number;
|
|
182
|
+
themeId?: number | null;
|
|
183
|
+
darkThemeId?: number | null;
|
|
184
|
+
showHeader?: boolean;
|
|
185
|
+
showModeToggle?: boolean;
|
|
186
|
+
showCopyButton?: boolean;
|
|
187
|
+
showExportButton?: boolean;
|
|
188
|
+
showCollapseButton?: boolean;
|
|
189
|
+
}
|
|
190
|
+
interface MathBlockNodeProps {
|
|
191
|
+
node: {
|
|
192
|
+
type: 'math_block';
|
|
193
|
+
content: string;
|
|
194
|
+
raw: string;
|
|
195
|
+
loading?: boolean;
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
interface MathInlineNodeProps {
|
|
199
|
+
node: {
|
|
200
|
+
type: 'math_inline';
|
|
201
|
+
content: string;
|
|
202
|
+
raw: string;
|
|
203
|
+
loading?: boolean;
|
|
204
|
+
markup?: string;
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
interface InfographicBlockNodeProps {
|
|
208
|
+
node: CodeBlockNode$1;
|
|
209
|
+
maxHeight?: string | null;
|
|
210
|
+
loading?: boolean;
|
|
211
|
+
isDark?: boolean;
|
|
212
|
+
showHeader?: boolean;
|
|
213
|
+
showModeToggle?: boolean;
|
|
214
|
+
showCopyButton?: boolean;
|
|
215
|
+
showCollapseButton?: boolean;
|
|
216
|
+
showExportButton?: boolean;
|
|
217
|
+
showFullscreenButton?: boolean;
|
|
218
|
+
showZoomControls?: boolean;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
interface NodeRendererProps {
|
|
222
|
+
content?: string;
|
|
223
|
+
nodes?: readonly BaseNode[] | null;
|
|
224
|
+
/**
|
|
225
|
+
* Whether the input stream is complete (end-of-stream). When true, the parser
|
|
226
|
+
* can stop emitting streaming "loading" nodes for unfinished constructs.
|
|
227
|
+
*/
|
|
228
|
+
final?: boolean;
|
|
229
|
+
parseOptions?: ParseOptions;
|
|
230
|
+
customMarkdownIt?: (md: MarkdownIt) => MarkdownIt;
|
|
231
|
+
/** Log parse/render timing stats (dev only). */
|
|
232
|
+
debugPerformance?: boolean;
|
|
233
|
+
/**
|
|
234
|
+
* Custom HTML-like tags that should be emitted as custom nodes (e.g. ['thinking']).
|
|
235
|
+
* Forwarded to `getMarkdown()` and merged into parseOptions.
|
|
236
|
+
*/
|
|
237
|
+
customHtmlTags?: readonly string[];
|
|
238
|
+
viewportPriority?: boolean;
|
|
239
|
+
codeBlockStream?: boolean;
|
|
240
|
+
codeBlockDarkTheme?: CodeBlockMonacoTheme;
|
|
241
|
+
codeBlockLightTheme?: CodeBlockMonacoTheme;
|
|
242
|
+
codeBlockMonacoOptions?: CodeBlockMonacoOptions;
|
|
243
|
+
renderCodeBlocksAsPre?: boolean;
|
|
244
|
+
codeBlockMinWidth?: string | number;
|
|
245
|
+
codeBlockMaxWidth?: string | number;
|
|
246
|
+
codeBlockProps?: Record<string, any>;
|
|
247
|
+
mermaidProps?: Partial<Omit<MermaidBlockNodeProps, 'node' | 'loading' | 'isDark'>>;
|
|
248
|
+
d2Props?: Partial<Omit<D2BlockNodeProps, 'node' | 'loading' | 'isDark'>>;
|
|
249
|
+
infographicProps?: Partial<Omit<InfographicBlockNodeProps, 'node' | 'loading' | 'isDark'>>;
|
|
250
|
+
showTooltips?: boolean;
|
|
251
|
+
themes?: CodeBlockMonacoTheme[];
|
|
252
|
+
isDark?: boolean;
|
|
253
|
+
customId?: string;
|
|
254
|
+
indexKey?: number | string;
|
|
255
|
+
typewriter?: boolean;
|
|
256
|
+
batchRendering?: boolean;
|
|
257
|
+
initialRenderBatchSize?: number;
|
|
258
|
+
renderBatchSize?: number;
|
|
259
|
+
renderBatchDelay?: number;
|
|
260
|
+
renderBatchBudgetMs?: number;
|
|
261
|
+
renderBatchIdleTimeoutMs?: number;
|
|
262
|
+
deferNodesUntilVisible?: boolean;
|
|
263
|
+
maxLiveNodes?: number;
|
|
264
|
+
liveNodeBuffer?: number;
|
|
265
|
+
onCopy?: (code: string) => void;
|
|
266
|
+
onHandleArtifactClick?: (payload: any) => void;
|
|
267
|
+
onClick?: (event: React.MouseEvent<HTMLDivElement>) => void;
|
|
268
|
+
onMouseOver?: (event: React.MouseEvent<HTMLElement>) => void;
|
|
269
|
+
onMouseOut?: (event: React.MouseEvent<HTMLElement>) => void;
|
|
270
|
+
}
|
|
271
|
+
interface RenderContext {
|
|
272
|
+
customId?: string;
|
|
273
|
+
isDark?: boolean;
|
|
274
|
+
indexKey?: string;
|
|
275
|
+
typewriter?: boolean;
|
|
276
|
+
textStreamState?: Map<string, string>;
|
|
277
|
+
streamRenderVersion?: number;
|
|
278
|
+
customComponents?: Record<string, React.ComponentType<any>>;
|
|
279
|
+
codeBlockProps?: Record<string, any>;
|
|
280
|
+
mermaidProps?: Partial<Omit<MermaidBlockNodeProps, 'node' | 'loading' | 'isDark'>>;
|
|
281
|
+
d2Props?: Partial<Omit<D2BlockNodeProps, 'node' | 'loading' | 'isDark'>>;
|
|
282
|
+
infographicProps?: Partial<Omit<InfographicBlockNodeProps, 'node' | 'loading' | 'isDark'>>;
|
|
283
|
+
showTooltips?: boolean;
|
|
284
|
+
inlineImages?: boolean;
|
|
285
|
+
codeBlockStream?: boolean;
|
|
286
|
+
renderCodeBlocksAsPre?: boolean;
|
|
287
|
+
codeBlockThemes?: {
|
|
288
|
+
themes?: CodeBlockMonacoTheme[];
|
|
289
|
+
darkTheme?: CodeBlockMonacoTheme;
|
|
290
|
+
lightTheme?: CodeBlockMonacoTheme;
|
|
291
|
+
monacoOptions?: CodeBlockMonacoOptions;
|
|
292
|
+
minWidth?: string | number;
|
|
293
|
+
maxWidth?: string | number;
|
|
294
|
+
};
|
|
295
|
+
events: {
|
|
296
|
+
onCopy?: (code: string) => void;
|
|
297
|
+
onHandleArtifactClick?: (payload: any) => void;
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
type RenderNodeFn = (node: ParsedNode, key: React.Key, ctx: RenderContext) => React.ReactNode;
|
|
301
|
+
|
|
302
|
+
interface NodeComponentProps<TNode = unknown> {
|
|
303
|
+
node: TNode;
|
|
304
|
+
ctx?: RenderContext;
|
|
305
|
+
renderNode?: RenderNodeFn;
|
|
306
|
+
indexKey?: React.Key;
|
|
307
|
+
customId?: string;
|
|
308
|
+
isDark?: boolean;
|
|
309
|
+
typewriter?: boolean;
|
|
310
|
+
children?: React.ReactNode;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
interface LinkNodeStyleProps {
|
|
314
|
+
showTooltip?: boolean;
|
|
315
|
+
color?: string;
|
|
316
|
+
underlineHeight?: number;
|
|
317
|
+
underlineBottom?: number | string;
|
|
318
|
+
animationDuration?: number;
|
|
319
|
+
animationOpacity?: number;
|
|
320
|
+
animationTiming?: string;
|
|
321
|
+
animationIteration?: string | number;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
interface ListItemNodeData {
|
|
325
|
+
type: 'list_item';
|
|
326
|
+
children?: ParsedNode[];
|
|
327
|
+
raw?: string;
|
|
328
|
+
}
|
|
329
|
+
interface ListItemNodeProps extends NodeComponentProps<ListItemNodeData> {
|
|
330
|
+
value?: number;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
interface MarkdownCodeBlockNodeProps {
|
|
334
|
+
node: {
|
|
335
|
+
type: 'code_block';
|
|
336
|
+
language: string;
|
|
337
|
+
code: string;
|
|
338
|
+
raw: string;
|
|
339
|
+
diff?: boolean;
|
|
340
|
+
originalCode?: string;
|
|
341
|
+
updatedCode?: string;
|
|
342
|
+
};
|
|
343
|
+
loading?: boolean;
|
|
344
|
+
stream?: boolean;
|
|
345
|
+
darkTheme?: string;
|
|
346
|
+
lightTheme?: string;
|
|
347
|
+
isDark?: boolean;
|
|
348
|
+
isShowPreview?: boolean;
|
|
349
|
+
enableFontSizeControl?: boolean;
|
|
350
|
+
minWidth?: string | number;
|
|
351
|
+
maxWidth?: string | number;
|
|
352
|
+
themes?: string[];
|
|
353
|
+
showHeader?: boolean;
|
|
354
|
+
showCopyButton?: boolean;
|
|
355
|
+
showExpandButton?: boolean;
|
|
356
|
+
showPreviewButton?: boolean;
|
|
357
|
+
showCollapseButton?: boolean;
|
|
358
|
+
showFontSizeButtons?: boolean;
|
|
359
|
+
showTooltips?: boolean;
|
|
360
|
+
onCopy?: (code: string) => void;
|
|
361
|
+
onPreviewCode?: (payload: {
|
|
362
|
+
type: string;
|
|
363
|
+
content: string;
|
|
364
|
+
title: string;
|
|
365
|
+
}) => void;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
type TooltipPlacement = 'top' | 'bottom' | 'left' | 'right';
|
|
369
|
+
interface TooltipProps {
|
|
370
|
+
visible: boolean;
|
|
371
|
+
anchorEl: HTMLElement | null;
|
|
372
|
+
content: string;
|
|
373
|
+
placement?: TooltipPlacement;
|
|
374
|
+
offset?: number;
|
|
375
|
+
originX?: number | null;
|
|
376
|
+
originY?: number | null;
|
|
377
|
+
id?: string | null;
|
|
378
|
+
isDark?: boolean | null;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
type CustomComponentMap = Record<string, ComponentType<any>>;
|
|
382
|
+
declare function setCustomComponents(id: string, mapping: CustomComponentMap): void;
|
|
383
|
+
declare function setCustomComponents(mapping: CustomComponentMap): void;
|
|
384
|
+
declare function getCustomNodeComponents(customId?: string): CustomComponentMap;
|
|
385
|
+
declare function removeCustomComponents(id: string): void;
|
|
386
|
+
declare function clearGlobalCustomComponents(): void;
|
|
387
|
+
|
|
388
|
+
declare function TextNode(props: NodeComponentProps<{
|
|
389
|
+
type: 'text';
|
|
390
|
+
content: string;
|
|
391
|
+
center?: boolean;
|
|
392
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
393
|
+
declare function ParagraphNode(props: NodeComponentProps<{
|
|
394
|
+
type: 'paragraph';
|
|
395
|
+
children?: ParsedNode[];
|
|
396
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
397
|
+
declare function HeadingNode(props: NodeComponentProps<{
|
|
398
|
+
type: 'heading';
|
|
399
|
+
level?: number;
|
|
400
|
+
children?: ParsedNode[];
|
|
401
|
+
attrs?: Record<string, string | boolean>;
|
|
402
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
403
|
+
declare function BlockquoteNode(props: NodeComponentProps<{
|
|
404
|
+
type: 'blockquote';
|
|
405
|
+
children?: ParsedNode[];
|
|
406
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
407
|
+
declare function ListItemNode(props: NodeComponentProps<{
|
|
408
|
+
type: 'list_item';
|
|
409
|
+
children?: ParsedNode[];
|
|
410
|
+
}> & {
|
|
411
|
+
value?: number;
|
|
412
|
+
}): react_jsx_runtime.JSX.Element;
|
|
413
|
+
declare function ListNode(props: NodeComponentProps<{
|
|
414
|
+
type: 'list';
|
|
415
|
+
ordered?: boolean;
|
|
416
|
+
start?: number;
|
|
417
|
+
items?: any[];
|
|
418
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
419
|
+
declare function TableNode(props: NodeComponentProps<{
|
|
420
|
+
type: 'table';
|
|
421
|
+
header?: any;
|
|
422
|
+
rows?: any[];
|
|
423
|
+
loading?: boolean;
|
|
424
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
425
|
+
declare function DefinitionListNode(props: NodeComponentProps<{
|
|
426
|
+
type: 'definition_list';
|
|
427
|
+
items?: any[];
|
|
428
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
429
|
+
declare function FootnoteNode(props: NodeComponentProps<{
|
|
430
|
+
type: 'footnote';
|
|
431
|
+
id: string;
|
|
432
|
+
children?: ParsedNode[];
|
|
433
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
434
|
+
declare function FootnoteReferenceNode(props: NodeComponentProps<{
|
|
435
|
+
type: 'footnote_reference';
|
|
436
|
+
id: string;
|
|
437
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
438
|
+
declare function FootnoteAnchorNode(props: NodeComponentProps<{
|
|
439
|
+
type: 'footnote_anchor';
|
|
440
|
+
id: string;
|
|
441
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
442
|
+
declare function AdmonitionNode(props: NodeComponentProps<{
|
|
443
|
+
type: 'admonition';
|
|
444
|
+
kind?: string;
|
|
445
|
+
title?: string;
|
|
446
|
+
children?: ParsedNode[];
|
|
447
|
+
collapsible?: boolean;
|
|
448
|
+
open?: boolean;
|
|
449
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
450
|
+
declare function CheckboxNode(props: NodeComponentProps<{
|
|
451
|
+
type: 'checkbox' | 'checkbox_input';
|
|
452
|
+
checked?: boolean;
|
|
453
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
454
|
+
declare function EmojiNode(props: NodeComponentProps<{
|
|
455
|
+
type: 'emoji';
|
|
456
|
+
name: string;
|
|
457
|
+
markup?: string;
|
|
458
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
459
|
+
declare function StrongNode(props: NodeComponentProps<{
|
|
460
|
+
type: 'strong';
|
|
461
|
+
children?: ParsedNode[];
|
|
462
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
463
|
+
declare function EmphasisNode(props: NodeComponentProps<{
|
|
464
|
+
type: 'emphasis';
|
|
465
|
+
children?: ParsedNode[];
|
|
466
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
467
|
+
declare function StrikethroughNode(props: NodeComponentProps<{
|
|
468
|
+
type: 'strikethrough';
|
|
469
|
+
children?: ParsedNode[];
|
|
470
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
471
|
+
declare function HighlightNode(props: NodeComponentProps<{
|
|
472
|
+
type: 'highlight';
|
|
473
|
+
children?: ParsedNode[];
|
|
474
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
475
|
+
declare function InsertNode(props: NodeComponentProps<{
|
|
476
|
+
type: 'insert';
|
|
477
|
+
children?: ParsedNode[];
|
|
478
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
479
|
+
declare function SubscriptNode(props: NodeComponentProps<{
|
|
480
|
+
type: 'subscript';
|
|
481
|
+
children?: ParsedNode[];
|
|
482
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
483
|
+
declare function SuperscriptNode(props: NodeComponentProps<{
|
|
484
|
+
type: 'superscript';
|
|
485
|
+
children?: ParsedNode[];
|
|
486
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
487
|
+
declare function HardBreakNode(_props: NodeComponentProps<{
|
|
488
|
+
type: 'hardbreak';
|
|
489
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
490
|
+
declare function ThematicBreakNode(_props?: NodeComponentProps<{
|
|
491
|
+
type: 'thematic_break';
|
|
492
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
493
|
+
declare function InlineCodeNode(props: NodeComponentProps<{
|
|
494
|
+
type: 'inline_code';
|
|
495
|
+
code: string;
|
|
496
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
497
|
+
declare function LinkNode(props: NodeComponentProps<LinkNodeProps['node']> & {
|
|
498
|
+
showTooltip?: boolean;
|
|
499
|
+
color?: string;
|
|
500
|
+
underlineHeight?: number;
|
|
501
|
+
underlineBottom?: number | string;
|
|
502
|
+
animationDuration?: number;
|
|
503
|
+
animationOpacity?: number;
|
|
504
|
+
animationTiming?: string;
|
|
505
|
+
animationIteration?: string | number;
|
|
506
|
+
}): react_jsx_runtime.JSX.Element;
|
|
507
|
+
declare function ImageNode(rawProps: ImageNodeProps): react_jsx_runtime.JSX.Element;
|
|
508
|
+
declare function PreCodeNode({ node }: PreCodeNodeProps): react_jsx_runtime.JSX.Element;
|
|
509
|
+
declare function CodeBlockNode(props: CodeBlockNodeProps): react_jsx_runtime.JSX.Element;
|
|
510
|
+
declare function MarkdownCodeBlockNode(props: MarkdownCodeBlockNodeProps): react_jsx_runtime.JSX.Element;
|
|
511
|
+
declare function MermaidBlockNode(props: MermaidBlockNodeProps): react_jsx_runtime.JSX.Element;
|
|
512
|
+
declare function D2BlockNode(props: D2BlockNodeProps): react_jsx_runtime.JSX.Element;
|
|
513
|
+
declare function InfographicBlockNode(props: InfographicBlockNodeProps): react_jsx_runtime.JSX.Element;
|
|
514
|
+
declare function MathBlockNode({ node }: MathBlockNodeProps): react_jsx_runtime.JSX.Element;
|
|
515
|
+
declare function MathInlineNode({ node }: MathInlineNodeProps): react_jsx_runtime.JSX.Element;
|
|
516
|
+
declare function ReferenceNode(props: NodeComponentProps<{
|
|
517
|
+
type: 'reference';
|
|
518
|
+
id: string;
|
|
519
|
+
}> & {
|
|
520
|
+
messageId?: string;
|
|
521
|
+
threadId?: string;
|
|
522
|
+
}): react_jsx_runtime.JSX.Element;
|
|
523
|
+
declare function HtmlBlockNode(props: NodeComponentProps<{
|
|
524
|
+
type: 'html_block';
|
|
525
|
+
content?: string;
|
|
526
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
527
|
+
declare function HtmlInlineNode(props: NodeComponentProps<{
|
|
528
|
+
type: 'html_inline';
|
|
529
|
+
content?: string;
|
|
530
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
531
|
+
declare function VmrContainerNode(props: NodeComponentProps<{
|
|
532
|
+
type: 'vmr_container';
|
|
533
|
+
name: string;
|
|
534
|
+
attrs?: Record<string, string> | [string, string | null][] | null;
|
|
535
|
+
children?: ParsedNode[];
|
|
536
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
537
|
+
declare function Tooltip(_props: TooltipProps): any;
|
|
538
|
+
declare function HtmlPreviewFrame(_props: HtmlPreviewFrameProps): any;
|
|
539
|
+
declare function FallbackComponent(props: NodeComponentProps<{
|
|
540
|
+
type: string;
|
|
541
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
542
|
+
declare function renderNode(node: ParsedNode, key: React.Key, ctx: RenderContext): react_jsx_runtime.JSX.Element;
|
|
543
|
+
declare function NodeRenderer(props: NodeRendererProps): react_jsx_runtime.JSX.Element;
|
|
544
|
+
|
|
545
|
+
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-CEJktwcf.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-DzmDCKan.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 blockquote-node auto
|
|
1
|
+
export const safeList = `use client react string cannot delete global call clearGlobalCustomComponents blockquote-node auto 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 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 dependency is not install it to enable note is-dark data-index-key headerId admonition-header admonition-icon admonition-title admonition-toggle aria-expanded aria-controls collapsed admonition-content aria-labelledby 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 emoji-node emphasis-node 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 mt-2 d2-render d2-svg pb-3 smooth footnote-reference handleScroll footnote footnote-link cursor-pointer footnote-node 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 footnote-anchor text-[#0366d6] hover:underline ↩︎ hard-break mark highlight-node heading-node 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 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 void isSvg image-node image-node--inline image-node--block image-node__inner image-node__inner--inline image-node__img--inline is-loaded contain lazy eager async image image-node__placeholder image-node__placeholder--inline image-node__spinner image-node__placeholder-text image… placeholder image-node__error image-node__error--inline failed load image-node__caption insert-node 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 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 dialog 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 unknown-node italic node strong-node reference-node bg-[hsl(var(--muted))] px-1.5 mx-0.5 hover:bg-[hsl(var(--secondary))] superscript-node strikethrough-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 subscript-node paragraph-node child.type softbreak childCtx paragraph 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 source 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 out containerClass vmr-container text-node text-node-center 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 hr-node thematic-break in zoom 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 [mermaidWorkerClient] messageerror cleared worker inject via busy canParse findPrefix javascript typescript python ruby shell plain cpp markdown stream-monaco document thinking htmlFor className data-language role aria-describedby $$ math-inline-wrapper mathRef math-inline--hidden math-inline__loading math-inline__spinner math-block overflow-x-auto min-h-[40px] rendering math-rendering data-ssr-fallback normalizedLanguage classAttr node.cite renderNodeProp value rowIdx bodyRows.length isOpen thematic-break-node cssVars code-block-node code-block markdown-code-block-node markdown-code-block mermaid-block-node d2-block-node infographic-block-node math-inline data-reference-id server-renderer node-content checked disabled readonly required autofocus multiple min max step width height size maxlength parse dynamic template html-inline-node html-inline-node--loading globalThis.requestAnimationFrame globalThis.cancelAnimationFrame module did expected [markstream-react] [katexWorkerClient] init cache-hit timeout waiting slot 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 {};
|