markstream-react 0.0.50 → 0.0.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/README.md +134 -104
  2. package/dist/{Tooltip-D786qxIk.js → Tooltip-Ux2h3oiV.js} +125 -125
  3. package/dist/{codeBlockExtraProps-7n9FWJXk.js → codeBlockExtraProps-NhTjbA1T.js} +1 -1
  4. package/dist/{index-o_DISWz2.js → index-DdaK6qko.js} +14 -14
  5. package/dist/index.css +1 -1
  6. package/dist/index.js +1 -1
  7. package/dist/index.px.css +1 -1
  8. package/dist/index.tailwind.css +1 -1
  9. package/dist/markstream-react.css +1 -1
  10. package/dist/next.d.ts +1 -2
  11. package/dist/next.js +1 -1
  12. package/dist/server.d.ts +41 -42
  13. package/dist/server.js +1 -1
  14. package/dist/tailwind.cjs +4 -0
  15. package/dist/tailwind.d.ts +2 -0
  16. package/dist/tailwind.js +2 -0
  17. package/dist/types/components/AdmonitionNode/AdmonitionNode.d.ts +2 -1
  18. package/dist/types/components/BlockquoteNode/BlockquoteNode.d.ts +2 -1
  19. package/dist/types/components/CheckboxNode/CheckboxNode.d.ts +2 -1
  20. package/dist/types/components/CodeBlockNode/CodeBlockNode.d.ts +2 -1
  21. package/dist/types/components/CodeBlockNode/PreCodeNode.d.ts +2 -1
  22. package/dist/types/components/D2BlockNode/D2BlockNode.d.ts +2 -1
  23. package/dist/types/components/DefinitionListNode/DefinitionListNode.d.ts +2 -1
  24. package/dist/types/components/EmojiNode/EmojiNode.d.ts +2 -1
  25. package/dist/types/components/EmphasisNode/EmphasisNode.d.ts +2 -1
  26. package/dist/types/components/FootnoteAnchorNode/FootnoteAnchorNode.d.ts +2 -1
  27. package/dist/types/components/FootnoteNode/FootnoteNode.d.ts +2 -1
  28. package/dist/types/components/FootnoteReferenceNode/FootnoteReferenceNode.d.ts +2 -1
  29. package/dist/types/components/HardBreakNode/HardBreakNode.d.ts +2 -1
  30. package/dist/types/components/HeadingNode/HeadingNode.d.ts +2 -1
  31. package/dist/types/components/HighlightNode/HighlightNode.d.ts +2 -1
  32. package/dist/types/components/HtmlBlockNode/HtmlBlockNode.d.ts +1 -1
  33. package/dist/types/components/HtmlInlineNode/HtmlInlineNode.d.ts +2 -1
  34. package/dist/types/components/ImageNode/ImageNode.d.ts +1 -1
  35. package/dist/types/components/InfographicBlockNode/InfographicBlockNode.d.ts +2 -1
  36. package/dist/types/components/InlineCodeNode/InlineCodeNode.d.ts +2 -1
  37. package/dist/types/components/InsertNode/InsertNode.d.ts +2 -1
  38. package/dist/types/components/LinkNode/LinkNode.d.ts +2 -1
  39. package/dist/types/components/ListItemNode/ListItemNode.d.ts +2 -1
  40. package/dist/types/components/ListNode/ListNode.d.ts +2 -1
  41. package/dist/types/components/MarkdownCodeBlockNode/MarkdownCodeBlockNode.d.ts +2 -1
  42. package/dist/types/components/Math/MathBlockNode.d.ts +1 -1
  43. package/dist/types/components/Math/MathInlineNode.d.ts +1 -1
  44. package/dist/types/components/MermaidBlockNode/MermaidBlockNode.d.ts +2 -1
  45. package/dist/types/components/NodeRenderer/FallbackComponent.d.ts +2 -1
  46. package/dist/types/components/ParagraphNode/ParagraphNode.d.ts +2 -1
  47. package/dist/types/components/ReferenceNode/ReferenceNode.d.ts +1 -1
  48. package/dist/types/components/StrikethroughNode/StrikethroughNode.d.ts +2 -1
  49. package/dist/types/components/StrongNode/StrongNode.d.ts +2 -1
  50. package/dist/types/components/SubscriptNode/SubscriptNode.d.ts +2 -1
  51. package/dist/types/components/SuperscriptNode/SuperscriptNode.d.ts +2 -1
  52. package/dist/types/components/TableNode/TableNode.d.ts +2 -1
  53. package/dist/types/components/TextNode/TextNode.d.ts +2 -1
  54. package/dist/types/components/ThematicBreakNode/ThematicBreakNode.d.ts +2 -1
  55. package/dist/types/components/VmrContainerNode/VmrContainerNode.d.ts +2 -1
  56. package/dist/types/context/viewportPriority.d.ts +1 -1
  57. package/dist/types/renderers/renderChildren.d.ts +1 -1
  58. package/dist/types/renderers/renderNode.d.ts +1 -1
  59. package/dist/types/server-renderer/index.d.ts +41 -41
  60. package/dist/types/styles.d.ts +1 -0
  61. package/package.json +39 -40
  62. package/dist/tailwind.ts +0 -3
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "markstream-react",
3
3
  "type": "module",
4
- "version": "0.0.50",
5
- "description": "React Markdown renderer optimized for large documents with progressive Mermaid rendering, streaming diff code blocks, and fast real-time preview. Built on stream-markdown AST for consistent rendering across frameworks. Perfect for documentation sites, AI chat interfaces, and content management systems.",
4
+ "version": "0.0.52",
5
+ "description": "React/Next.js streaming Markdown renderer for AI chat, LLM token streams, SSE/WebSocket output, incomplete Markdown, long documents, Mermaid, KaTeX, Shiki, Monaco, and custom React components.",
6
6
  "author": "Simon He",
7
7
  "license": "MIT",
8
- "homepage": "https://github.com/Simon-He95/markstream-vue#readme",
8
+ "homepage": "https://markstream.simonhe.me/frameworks/react",
9
9
  "repository": {
10
10
  "type": "git",
11
11
  "url": "git+https://github.com/Simon-He95/markstream-vue.git",
@@ -16,43 +16,37 @@
16
16
  },
17
17
  "keywords": [
18
18
  "react",
19
- "reactjs",
20
- "markdown",
21
- "markdown-to-html",
22
- "markdown-renderer",
23
- "react-markdown",
24
- "react-markdown-renderer",
25
- "react-markdown-component",
26
- "markdown-preview",
27
- "markdown-viewer",
28
- "react-component",
29
19
  "nextjs",
30
20
  "next.js",
31
21
  "remix",
32
- "vite",
33
- "webpack",
34
- "sse",
35
- "ai-chat",
22
+ "markdown",
23
+ "markdown-renderer",
24
+ "streaming-markdown-renderer",
25
+ "react-markdown",
26
+ "react-markdown-alternative",
27
+ "streamdown-alternative",
36
28
  "streaming-markdown",
37
- "html",
38
- "renderer",
39
- "custom-component",
29
+ "ai-markdown-renderer",
30
+ "ai-chat",
31
+ "llm",
32
+ "llm-markdown",
33
+ "llm-streaming",
34
+ "sse",
35
+ "sse-markdown",
36
+ "websocket",
37
+ "websocket-markdown",
40
38
  "mermaid",
41
- "progressive-mermaid",
42
- "streaming-diff",
43
- "diff-codeblock",
39
+ "streaming-mermaid",
40
+ "katex",
41
+ "streaming-katex",
42
+ "shiki",
43
+ "monaco",
44
+ "monaco-editor",
45
+ "streaming-code-blocks",
44
46
  "large-documents",
45
- "performance",
46
- "real-time-preview",
47
+ "safe-html",
47
48
  "markstream-react",
48
- "markstream",
49
- "documentation",
50
- "docs",
51
- "content-management",
52
- "cms",
53
- "markdown-parser",
54
- "md-to-html",
55
- "react-markdown-component"
49
+ "markstream"
56
50
  ],
57
51
  "sideEffects": [
58
52
  "**/*.css"
@@ -73,7 +67,11 @@
73
67
  "./index.css": "./dist/index.css",
74
68
  "./index.px.css": "./dist/index.px.css",
75
69
  "./index.tailwind.css": "./dist/index.tailwind.css",
76
- "./tailwind": "./dist/tailwind.ts",
70
+ "./tailwind": {
71
+ "types": "./dist/tailwind.d.ts",
72
+ "import": "./dist/tailwind.js",
73
+ "require": "./dist/tailwind.cjs"
74
+ },
77
75
  "./workers/katexRenderer.worker": "./dist/workers/katexRenderer.worker.js",
78
76
  "./workers/mermaidParser.worker": "./dist/workers/mermaidParser.worker.js"
79
77
  },
@@ -91,7 +89,7 @@
91
89
  "react": ">=18",
92
90
  "react-dom": ">=18",
93
91
  "stream-markdown": ">=0.0.16",
94
- "stream-monaco": ">=0.0.41"
92
+ "stream-monaco": ">=0.0.45"
95
93
  },
96
94
  "peerDependenciesMeta": {
97
95
  "@antv/infographic": {
@@ -116,11 +114,11 @@
116
114
  "dependencies": {
117
115
  "@floating-ui/dom": "^1.7.6",
118
116
  "clsx": "^2.1.1",
119
- "markstream-core": "1.0.3",
120
- "stream-markdown-parser": "1.0.5"
117
+ "stream-markdown-parser": "1.0.5",
118
+ "markstream-core": "1.0.3"
121
119
  },
122
120
  "devDependencies": {
123
- "@types/react": "^18.3.28",
121
+ "@types/react": "^18.3.31",
124
122
  "@types/react-dom": "^18.3.7",
125
123
  "@vitejs/plugin-react-swc": "^3.11.0",
126
124
  "autoprefixer": "^10.5.0",
@@ -129,14 +127,15 @@
129
127
  "rollup-plugin-visualizer": "^6.0.11",
130
128
  "tailwindcss": "^3.4.19",
131
129
  "typescript": "^5.9.3",
132
- "vite": "^7.3.3",
130
+ "vite": "^7.3.5",
133
131
  "vite-plugin-dts": "^4.5.4"
134
132
  },
135
133
  "scripts": {
136
134
  "dev": "vite dev",
137
- "build": "pnpm --dir ../markstream-core build && vite build --mode npm && vite build -c vite.config.tailwind.ts --mode npm && node ./scripts/copy-tailwind-css.mjs && node ../../scripts/generate-px-css.mjs && pnpm run build:dts && node ./scripts/ensure-next-client-directive.mjs",
135
+ "build": "pnpm --dir ../markstream-core build && vite build --mode npm && node ../../scripts/cleanup-style-entry.mjs && node ./scripts/finalize-tailwind-export.mjs && vite build -c vite.config.tailwind.ts --mode npm && node ./scripts/copy-tailwind-css.mjs && node ../../scripts/generate-px-css.mjs && pnpm run build:dts && node ./scripts/ensure-next-client-directive.mjs",
138
136
  "build:analyze": "ANALYZE=true pnpm build",
139
137
  "build:dts": "rollup -c ./scripts/rollup.dts.config.mjs && node ./scripts/clean-dts.cjs",
138
+ "check:exports": "node ../../scripts/check-react-package-exports.mjs",
140
139
  "preview": "vite preview",
141
140
  "typecheck": "tsc --noEmit",
142
141
  "size:check": "node ../../scripts/check-package-size.mjs",
package/dist/tailwind.ts DELETED
@@ -1,3 +0,0 @@
1
- export const safeList = `use client react string cannot delete global call clearGlobalCustomComponents blockquote-node auto note is-dark data-index-key headerId admonition-header admonition-icon admonition-title admonition-toggle aria-expanded aria-controls collapsed admonition-content aria-labelledby markstream-core stream-markdown-parser plaintext ?? data-ssr-fallback aria-busy normalizedLanguage block data-language no safe html-block-node boolean none mermaid infographic d2 language d2lang langs whitespace-pre-wrap text-node-center text image paragraph-node renderNodeProp ctx paragraph heading-node font-semibold classAttr object node.cite children list-item pl-1.5 my-2 value void 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 right text-right center text-center text-left table-node-wrapper text-sm table-node--loading border-[var(--table-border,#cbd5e1)] border-b p-[calc(4/7*1em)] rowIdx bodyRows.length table-node__loading status polite table-node__spinner sr-only dl definition-list indexKey mb-4 dt definition-term definition dd definition-desc ml-4 footnote-node flex leading-relaxed border-t border-[var(--footnote-border,#eaecef)] pt-2 flex-1 footnote-reference href footnote-link cursor-pointer footnote-anchor hover:underline ↩︎ isOpen checkbox-node checkbox checkbox-input emoji-node strong-node emphasis-node emphasis strikethrough-node strikethrough mark highlight-node highlight insert-node insert subscript-node subscript superscript-node superscript thematic-break-node inline-code inline text-[85%] px-1 py-0.5 rounded font-mono bg-[hsl(var(--secondary))] whitespace-normal break-words max-w-full number ease-in-out typeof infinite node.title link-loading inline-flex items-baseline gap-1.5 cssVars link-text-wrapper relative leading-[normal] link-text link-loading-indicator link-node aria-label noopener noreferrer image-node__img is-loaded eager lazy async 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] node.content $$ math-inline-wrapper math-inline reference-node bg-[hsl(var(--muted))] text-xs rounded-md px-1.5 mx-0.5 hover:bg-[hsl(var(--secondary))] data-reference-id html-block customComponents vmr-container unknown-node text-gray-500 italic node code_block html_block node.type html_inline text_special heading list_item definition_list footnote footnote_reference footnote_anchor admonition hardbreak inline_code checkbox_input emoji thematic_break math_inline math_block reference vmr_container label_open label_close server-renderer markdown-renderer dark data-custom-id node-slot data-node-index data-node-type node-content next.type window.requestIdleCallback [data-node-index] node-spacer virtualized fade-node typewriter-node node-placeholder typewriterCursorRef typewriter-cursor [data-node-type="code_block"] [data-node-type="admonition"] [data-node-type="table"] [data-node-type="math_block"] [data-node-type="html_block"] [data-node-type="image"] performance [markstream-react][perf] theme name dependency is not install it to enable smooth renderNode handleScroll clsx hard-break text-node-stream-delta text-node-stream-delta--a text-node-stream-delta--b valueAttr primary fallback failed image-node__placeholder image-node__spinner image-node__placeholder-text image… placeholder image-node__error currentColor load xlink:href markstream-d2-root-svg window.requestAnimationFrame instance.render instance missing render returned empty top d2-block my-4 rounded-lg border overflow-hidden shadow-sm border-gray-700/30 bg-gray-900 text-gray-100 border-gray-200 bg-white text-gray-900 d2-block-header justify-between items-center px-4 py-2.5 border-gray-400/5 gap-x-2 font-medium gap-x-1 p-0.5 bg-gray-700 bg-gray-100 mode-btn px-2 py-1 !showSource is-active showSource d2-action-btn p-2 transition-colors hover:bg-[var(--vscode-editor-selectionBackground)] copying w-3 h-3 round aria-pressed m9 bodyRef d2-block-body bodyStyle !hasPreview d2-source py-4 d2-code d2-error mt-2 d2-render d2-svg pb-3 style.visibility hidden line-info legacy 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 diff important max-height visible height onDidUpdateDiff onDidContentSizeChange onDidLayoutChange window.MutationObserver childList record.type attributes class explicit fontSize lineHeight paddingBottom paddingTop tabSize on same helpers.cleanupEditor canonicalLanguage single window.cancelAnimationFrame clientX navigator.clipboard navigator.clipboard.writeText code-fallback-plain m-0 code-block-container is-rendering is-diff is-plain-text code-block-header space-x-2 icon-slot h-4 w-4 flex-shrink-0 truncate code-action-btn copied m14 evenodd code-block-body--collapsed code-block-body--expanded code-editor-layer code-height-placeholder aria-hidden code-editor-fallback-surface code-loading-placeholder loading-skeleton skeleton-line short react-dom library text-red-500 p-4">Failed instanceof error.message error keydown transform ease fullscreen touches text-gray-400 hover:bg-gray-700 hover:text-gray-200 text-gray-600 hover:bg-gray-200 hover:text-gray-700 source hasPreview preview pending bg-gray-800 bg-gray-50 px-2.5 bg-gray-600 text-gray-200 text-gray-700 m16 isCollapsed opacity-50 cursor-not-allowed m7 text-gray-300 baseCode absolute top-2 right-2 z-10 gap-2 backdrop-blur infographic-preview min-h-[360px] transition-all duration-100 inset-0 cursor-grab isDragging containerRef w-full 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 escape html-block-node__placeholder html-block-node__placeholder-bar w-4/5 w-2/3 setHostEl shouldRender useDynamic reactNodes vitesse-dark vitesse-light shiki shiki-fallback [MarkdownCodeBlockNode] dispose stream-markdown stream-markdown.createShikiStreamRenderer available stale ready requires with ignoring and using default register configured retrying without code-block-content rendererTargetRef code-block-render event.key loose strict viewBox gantt open-modal [data-mermaid-wrapper] mermaid-action-btn toggle-mode 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 hasRenderedOnce 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 abort timed out text-node 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 in zoom hr-node thematic-break containerClass javascript typescript go python ruby shell powershell plain cpp csharp objectivec objectivecpp yaml markdown rust kotlin [mermaidWorkerClient] messageerror cleared worker inject via busy canParse findPrefix pointermove pointerup pointercancel my-8 table-node colgroup table-node__resize-handle key ref prototype constructor normalizedType sequencediagram classdiagram kind statediagram erdiagram flowchart graph thinking htmlFor className self_closing tag_open stream-monaco process katex document [markstream-react] htmlPreviewSandbox contains both allow-scripts this only fully trusted content served an isolated en utf-8 viewport content="width=device-width initial-scale=1 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 no-referrer about:blank role aria-describedby tag_close parse dynamic template html-inline-node html-inline-node--loading hunk context removed added markstream-pre__diff-pane--inline original markstream-pre__diff-pane--original modified markstream-pre__diff-pane--modified markstream-pre--line-numbers markstream-pre--diff-preview markstream-pre--diff-inline showLineNumbers markstream-pre__diff-code markstream-pre__diff-rail markstream-pre__diff-number markstream-pre__diff-content markstream-pre__diff-content-inner mathRef rendering math-rendering math-inline--hidden math-inline__loading math-inline__spinner globalThis.requestAnimationFrame globalThis.cancelAnimationFrame module did expected [katexWorkerClient] init cache-hit timeout waiting slot npm development existingEnv.getWorkerUrl °C`
2
- module.exports = safeList;
3
- export default safeList;