markstream-angular 0.0.3 → 0.0.6

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 (86) hide show
  1. package/README.md +14 -5
  2. package/dist/README.md +117 -0
  3. package/dist/fesm2022/markstream-angular.mjs +10490 -0
  4. package/dist/fesm2022/markstream-angular.mjs.map +1 -0
  5. package/dist/index.css +1363 -1
  6. package/dist/index.d.ts +1490 -0
  7. package/package.json +47 -16
  8. package/dist/index.js +0 -8620
  9. package/dist/types/index.d.ts +0 -6
  10. package/dist/types/markstream-angular/src/components/AdmonitionNode/AdmonitionNode.component.d.ts +0 -11
  11. package/dist/types/markstream-angular/src/components/BlockquoteNode/BlockquoteNode.component.d.ts +0 -9
  12. package/dist/types/markstream-angular/src/components/CheckboxNode/CheckboxNode.component.d.ts +0 -5
  13. package/dist/types/markstream-angular/src/components/CodeBlockNode/CodeBlockNode.component.d.ts +0 -143
  14. package/dist/types/markstream-angular/src/components/CodeBlockNode/HtmlPreviewFrame.component.d.ts +0 -12
  15. package/dist/types/markstream-angular/src/components/D2BlockNode/D2BlockNode.component.d.ts +0 -52
  16. package/dist/types/markstream-angular/src/components/DefinitionListNode/DefinitionListNode.component.d.ts +0 -11
  17. package/dist/types/markstream-angular/src/components/DynamicNodeHost/DynamicNodeHost.component.d.ts +0 -16
  18. package/dist/types/markstream-angular/src/components/EmojiNode/EmojiNode.component.d.ts +0 -5
  19. package/dist/types/markstream-angular/src/components/EmphasisNode/EmphasisNode.component.d.ts +0 -8
  20. package/dist/types/markstream-angular/src/components/FallbackComponent/FallbackComponent.component.d.ts +0 -14
  21. package/dist/types/markstream-angular/src/components/FootnoteAnchorNode/FootnoteAnchorNode.component.d.ts +0 -7
  22. package/dist/types/markstream-angular/src/components/FootnoteNode/FootnoteNode.component.d.ts +0 -9
  23. package/dist/types/markstream-angular/src/components/FootnoteReferenceNode/FootnoteReferenceNode.component.d.ts +0 -7
  24. package/dist/types/markstream-angular/src/components/HardBreakNode/HardBreakNode.component.d.ts +0 -2
  25. package/dist/types/markstream-angular/src/components/HeadingNode/HeadingNode.component.d.ts +0 -10
  26. package/dist/types/markstream-angular/src/components/HighlightNode/HighlightNode.component.d.ts +0 -8
  27. package/dist/types/markstream-angular/src/components/HtmlBlockNode/HtmlBlockNode.component.d.ts +0 -10
  28. package/dist/types/markstream-angular/src/components/HtmlInlineNode/HtmlInlineNode.component.d.ts +0 -10
  29. package/dist/types/markstream-angular/src/components/ImageNode/ImageNode.component.d.ts +0 -7
  30. package/dist/types/markstream-angular/src/components/InfographicBlockNode/InfographicBlockNode.component.d.ts +0 -71
  31. package/dist/types/markstream-angular/src/components/InlineCodeNode/InlineCodeNode.component.d.ts +0 -17
  32. package/dist/types/markstream-angular/src/components/InsertNode/InsertNode.component.d.ts +0 -8
  33. package/dist/types/markstream-angular/src/components/LinkNode/LinkNode.component.d.ts +0 -25
  34. package/dist/types/markstream-angular/src/components/ListItemNode/ListItemNode.component.d.ts +0 -9
  35. package/dist/types/markstream-angular/src/components/ListNode/ListNode.component.d.ts +0 -11
  36. package/dist/types/markstream-angular/src/components/MathBlockNode/MathBlockNode.component.d.ts +0 -17
  37. package/dist/types/markstream-angular/src/components/MathInlineNode/MathInlineNode.component.d.ts +0 -18
  38. package/dist/types/markstream-angular/src/components/MermaidBlockNode/MermaidBlockNode.component.d.ts +0 -91
  39. package/dist/types/markstream-angular/src/components/NestedRenderer/NestedRenderer.component.d.ts +0 -33
  40. package/dist/types/markstream-angular/src/components/NodeOutlet/NodeOutlet.component.d.ts +0 -31
  41. package/dist/types/markstream-angular/src/components/NodeRenderer/NodeRenderer.component.d.ts +0 -161
  42. package/dist/types/markstream-angular/src/components/ParagraphNode/ParagraphNode.component.d.ts +0 -25
  43. package/dist/types/markstream-angular/src/components/PreCodeNode/PreCodeNode.component.d.ts +0 -9
  44. package/dist/types/markstream-angular/src/components/ReferenceNode/ReferenceNode.component.d.ts +0 -5
  45. package/dist/types/markstream-angular/src/components/StrikethroughNode/StrikethroughNode.component.d.ts +0 -8
  46. package/dist/types/markstream-angular/src/components/StrongNode/StrongNode.component.d.ts +0 -8
  47. package/dist/types/markstream-angular/src/components/SubscriptNode/SubscriptNode.component.d.ts +0 -8
  48. package/dist/types/markstream-angular/src/components/SuperscriptNode/SuperscriptNode.component.d.ts +0 -8
  49. package/dist/types/markstream-angular/src/components/TableNode/TableNode.component.d.ts +0 -29
  50. package/dist/types/markstream-angular/src/components/TextNode/TextNode.component.d.ts +0 -19
  51. package/dist/types/markstream-angular/src/components/TextNode/streamingTextState.d.ts +0 -2
  52. package/dist/types/markstream-angular/src/components/ThematicBreakNode/ThematicBreakNode.component.d.ts +0 -2
  53. package/dist/types/markstream-angular/src/components/VmrContainerNode/VmrContainerNode.component.d.ts +0 -8
  54. package/dist/types/markstream-angular/src/components/shared/diagram-height.d.ts +0 -9
  55. package/dist/types/markstream-angular/src/components/shared/node-helpers.d.ts +0 -176
  56. package/dist/types/markstream-angular/src/components/shared/node-outlet-helpers.d.ts +0 -10
  57. package/dist/types/markstream-angular/src/components/shared/render-window.d.ts +0 -18
  58. package/dist/types/markstream-angular/src/components/shared/rich-block-helpers.d.ts +0 -6
  59. package/dist/types/markstream-angular/src/components/shared/safe-attrs.directive.d.ts +0 -11
  60. package/dist/types/markstream-angular/src/components/shared/smooth-streaming-scope.d.ts +0 -5
  61. package/dist/types/markstream-angular/src/customComponents.d.ts +0 -9
  62. package/dist/types/markstream-angular/src/enhanceRenderedHtml.d.ts +0 -22
  63. package/dist/types/markstream-angular/src/hydrateCustomTagContent.d.ts +0 -2
  64. package/dist/types/markstream-angular/src/i18n/useSafeI18n.d.ts +0 -4
  65. package/dist/types/markstream-angular/src/index.d.ts +0 -77
  66. package/dist/types/markstream-angular/src/markstream-angular.component.d.ts +0 -2
  67. package/dist/types/markstream-angular/src/optional/d2.d.ts +0 -17
  68. package/dist/types/markstream-angular/src/optional/infographic.d.ts +0 -13
  69. package/dist/types/markstream-angular/src/optional/katex.d.ts +0 -9
  70. package/dist/types/markstream-angular/src/optional/mermaid.d.ts +0 -27
  71. package/dist/types/markstream-angular/src/optional/monaco.d.ts +0 -18
  72. package/dist/types/markstream-angular/src/parseNestedMarkdownToNodes.d.ts +0 -19
  73. package/dist/types/markstream-angular/src/renderMarkdownHtml.d.ts +0 -30
  74. package/dist/types/markstream-angular/src/sanitizeHtmlContent.d.ts +0 -2
  75. package/dist/types/markstream-angular/src/sanitizeSvg.d.ts +0 -2
  76. package/dist/types/markstream-angular/src/services/smooth-markdown-stream.service.d.ts +0 -33
  77. package/dist/types/markstream-angular/src/tooltip/singletonTooltip.d.ts +0 -3
  78. package/dist/types/markstream-angular/src/types/monaco.d.ts +0 -65
  79. package/dist/types/markstream-angular/src/utils/languageIcon.d.ts +0 -6
  80. package/dist/types/markstream-angular/src/utils/normalizeKaTeXRenderInput.d.ts +0 -1
  81. package/dist/types/markstream-angular/src/workers/katexCdnWorker.d.ts +0 -20
  82. package/dist/types/markstream-angular/src/workers/katexRenderer.worker.d.ts +0 -0
  83. package/dist/types/markstream-angular/src/workers/katexWorkerClient.d.ts +0 -35
  84. package/dist/types/markstream-angular/src/workers/mermaidCdnWorker.d.ts +0 -15
  85. package/dist/types/markstream-angular/src/workers/mermaidParser.worker.d.ts +0 -1
  86. package/dist/types/markstream-angular/src/workers/mermaidWorkerClient.d.ts +0 -15
package/README.md CHANGED
@@ -1,6 +1,15 @@
1
- # markstream-angular
1
+ # markstream-angular — Angular streaming Markdown renderer for AI chat
2
2
 
3
- Angular version of Markstream: a streaming-friendly Markdown renderer with KaTeX, Mermaid, Monaco code blocks, D2, infographic blocks, custom HTML tags, and cross-framework playground parity.
3
+ Angular 20+ standalone component for streaming Markdown: AI chat, LLM token streams, SSE/WebSocket output, incomplete Markdown states, long documents, Mermaid, KaTeX, Monaco code blocks, D2, infographic blocks, custom HTML tags, and cross-framework playground parity.
4
+
5
+ ## When to use it
6
+
7
+ Use `markstream-angular` when Markdown streams from an LLM, SSE, or WebSocket into an Angular 20+ standalone app.
8
+ For short static Markdown, a completed-document Markdown renderer or a simpler parser is usually enough.
9
+
10
+ ## Status
11
+
12
+ This package is currently alpha. Treat it as a streaming Markdown integration surface to evaluate in your Angular app, not as the most stable package in the Markstream family. Check npm and the [Angular guide](https://markstream.simonhe.me/guide/angular-quick-start) for the latest API maturity.
4
13
 
5
14
  ## Install
6
15
 
@@ -16,6 +25,8 @@ Optional peer dependencies:
16
25
  - `@terrastruct/d2` for D2 diagrams
17
26
  - `@antv/infographic` for infographic blocks
18
27
 
28
+ Install only the peers your output actually needs. Plain Markdown does not require Mermaid, KaTeX, Monaco, D2, or Infographic.
29
+
19
30
  Example:
20
31
 
21
32
  ```bash
@@ -96,9 +107,7 @@ In this monorepo:
96
107
  - Angular regression lab: `http://127.0.0.1:4175/test`
97
108
  - Angular version sandbox: `http://127.0.0.1:4175/test-sandbox`
98
109
 
99
- ## Status
100
-
101
- This package is still tagged `alpha`, but the current direction is already aligned with `markstream-react` / `markstream-vue2` for:
110
+ Current development is aligned with `markstream-react` / `markstream-vue2` for:
102
111
 
103
112
  - node-component renderer structure
104
113
  - streaming code block behavior
package/dist/README.md ADDED
@@ -0,0 +1,117 @@
1
+ # markstream-angular — Angular streaming Markdown renderer for AI chat
2
+
3
+ Angular 20+ standalone component for streaming Markdown: AI chat, LLM token streams, SSE/WebSocket output, incomplete Markdown states, long documents, Mermaid, KaTeX, Monaco code blocks, D2, infographic blocks, custom HTML tags, and cross-framework playground parity.
4
+
5
+ ## When to use it
6
+
7
+ Use `markstream-angular` when Markdown streams from an LLM, SSE, or WebSocket into an Angular 20+ standalone app.
8
+ For short static Markdown, a completed-document Markdown renderer or a simpler parser is usually enough.
9
+
10
+ ## Status
11
+
12
+ This package is currently alpha. Treat it as a streaming Markdown integration surface to evaluate in your Angular app, not as the most stable package in the Markstream family. Check npm and the [Angular guide](https://markstream.simonhe.me/guide/angular-quick-start) for the latest API maturity.
13
+
14
+ ## Install
15
+
16
+ ```bash
17
+ pnpm add markstream-angular @angular/core @angular/common
18
+ ```
19
+
20
+ Optional peer dependencies:
21
+
22
+ - `stream-monaco` for Monaco-powered code blocks
23
+ - `mermaid` for Mermaid diagrams
24
+ - `katex` for math rendering
25
+ - `@terrastruct/d2` for D2 diagrams
26
+ - `@antv/infographic` for infographic blocks
27
+
28
+ Install only the peers your output actually needs. Plain Markdown does not require Mermaid, KaTeX, Monaco, D2, or Infographic.
29
+
30
+ Example:
31
+
32
+ ```bash
33
+ pnpm add stream-monaco mermaid katex @terrastruct/d2 @antv/infographic
34
+ ```
35
+
36
+ ## Quick Start
37
+
38
+ Import the stylesheet once in your Angular app entry:
39
+
40
+ ```ts
41
+ import 'markstream-angular/index.css'
42
+ import 'katex/dist/katex.min.css'
43
+ ```
44
+
45
+ Use the standalone component directly:
46
+
47
+ ```ts
48
+ import { Component, signal } from '@angular/core'
49
+ import { bootstrapApplication } from '@angular/platform-browser'
50
+ import { MarkstreamAngularComponent } from 'markstream-angular'
51
+
52
+ @Component({
53
+ selector: 'app-root',
54
+ standalone: true,
55
+ imports: [MarkstreamAngularComponent],
56
+ template: `
57
+ <markstream-angular
58
+ [content]="markdown()"
59
+ [final]="true"
60
+ [codeBlockStream]="true"
61
+ />
62
+ `,
63
+ })
64
+ class AppComponent {
65
+ readonly markdown = signal(`# Hello Angular
66
+
67
+ - streaming markdown
68
+ - code blocks
69
+ - Mermaid / KaTeX / D2`)
70
+ }
71
+
72
+ bootstrapApplication(AppComponent)
73
+ ```
74
+
75
+ ## TypeScript
76
+
77
+ `markstream-angular` exports the same public props/context helpers you use at runtime:
78
+
79
+ ```ts
80
+ import type {
81
+ AngularRenderContext,
82
+ CodeBlockMonacoOptions,
83
+ CustomComponentMap,
84
+ MarkstreamAngularComponentProps,
85
+ NodeRendererProps,
86
+ } from 'markstream-angular'
87
+ ```
88
+
89
+ ## Workers
90
+
91
+ KaTeX and Mermaid can use the same off-thread worker path as the React/Vue packages:
92
+
93
+ ```ts
94
+ import { setKaTeXWorker, setMermaidWorker } from 'markstream-angular'
95
+ import KatexWorker from 'markstream-angular/workers/katexRenderer.worker?worker'
96
+ import MermaidWorker from 'markstream-angular/workers/mermaidParser.worker?worker'
97
+
98
+ setKaTeXWorker(new KatexWorker())
99
+ setMermaidWorker(new MermaidWorker())
100
+ ```
101
+
102
+ ## Playground
103
+
104
+ In this monorepo:
105
+
106
+ - Angular playground: `pnpm play:angular`
107
+ - Angular regression lab: `http://127.0.0.1:4175/test`
108
+ - Angular version sandbox: `http://127.0.0.1:4175/test-sandbox`
109
+
110
+ Current development is aligned with `markstream-react` / `markstream-vue2` for:
111
+
112
+ - node-component renderer structure
113
+ - streaming code block behavior
114
+ - shared `/test` fixtures and cross-framework comparison
115
+ - KaTeX / Mermaid worker integration
116
+
117
+ Issue tracker and source: [Simon-He95/markstream-vue](https://github.com/Simon-He95/markstream-vue)