@svadmin/ai-elements 0.7.4 → 0.9.0

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 (218) hide show
  1. package/README.md +31 -4
  2. package/THIRD_PARTY_NOTICES.md +67 -6
  3. package/dist/ai-workspace-contract.d.ts +14 -0
  4. package/dist/ai-workspace-contract.js +14 -0
  5. package/dist/ai.css +2 -5
  6. package/dist/ai.theme.css +1 -0
  7. package/dist/class-properties.generated.d.ts +1 -0
  8. package/dist/class-properties.generated.js +2 -0
  9. package/dist/classnames.d.ts +8 -0
  10. package/dist/classnames.js +26 -0
  11. package/dist/components/Response.svelte +2 -2
  12. package/dist/components/Response.svelte.d.ts +1 -1
  13. package/dist/components/code/index.d.ts +9 -18
  14. package/dist/components/code/index.js +8 -11
  15. package/dist/components/code-block/highlight.js +1 -1
  16. package/dist/index.d.ts +2 -0
  17. package/dist/index.js +1 -0
  18. package/dist/utilities.css +3172 -0
  19. package/dist/utils.d.ts +1 -1
  20. package/dist/utils.js +1 -1
  21. package/package.json +36 -11
  22. package/vendor/streamdown/AnimatedText.svelte +93 -0
  23. package/vendor/streamdown/AnimatedText.svelte.d.ts +6 -0
  24. package/vendor/streamdown/Block.svelte +96 -0
  25. package/vendor/streamdown/Block.svelte.d.ts +11 -0
  26. package/vendor/streamdown/Elements/Alert.svelte +69 -0
  27. package/vendor/streamdown/Elements/Alert.svelte.d.ts +10 -0
  28. package/vendor/streamdown/Elements/Citation.svelte +260 -0
  29. package/vendor/streamdown/Elements/Citation.svelte.d.ts +7 -0
  30. package/vendor/streamdown/Elements/Code.svelte +226 -0
  31. package/vendor/streamdown/Elements/Code.svelte.d.ts +9 -0
  32. package/vendor/streamdown/Elements/Element.svelte +574 -0
  33. package/vendor/streamdown/Elements/Element.svelte.d.ts +10 -0
  34. package/vendor/streamdown/Elements/FootnoteRef.svelte +30 -0
  35. package/vendor/streamdown/Elements/FootnoteRef.svelte.d.ts +7 -0
  36. package/vendor/streamdown/Elements/Footnotes.svelte +54 -0
  37. package/vendor/streamdown/Elements/Footnotes.svelte.d.ts +7 -0
  38. package/vendor/streamdown/Elements/Image.svelte +200 -0
  39. package/vendor/streamdown/Elements/Image.svelte.d.ts +10 -0
  40. package/vendor/streamdown/Elements/Link.svelte +220 -0
  41. package/vendor/streamdown/Elements/Link.svelte.d.ts +10 -0
  42. package/vendor/streamdown/Elements/LinkSafetyModal.svelte +121 -0
  43. package/vendor/streamdown/Elements/LinkSafetyModal.svelte.d.ts +4 -0
  44. package/vendor/streamdown/Elements/Math.svelte +100 -0
  45. package/vendor/streamdown/Elements/Math.svelte.d.ts +9 -0
  46. package/vendor/streamdown/Elements/Mermaid.svelte +455 -0
  47. package/vendor/streamdown/Elements/Mermaid.svelte.d.ts +9 -0
  48. package/vendor/streamdown/Elements/MermaidDownload.svelte +145 -0
  49. package/vendor/streamdown/Elements/MermaidDownload.svelte.d.ts +8 -0
  50. package/vendor/streamdown/Elements/Slot.svelte +23 -0
  51. package/vendor/streamdown/Elements/Slot.svelte.d.ts +10 -0
  52. package/vendor/streamdown/Elements/Table.svelte +195 -0
  53. package/vendor/streamdown/Elements/Table.svelte.d.ts +9 -0
  54. package/vendor/streamdown/Elements/TableDownload.svelte +221 -0
  55. package/vendor/streamdown/Elements/TableDownload.svelte.d.ts +8 -0
  56. package/vendor/streamdown/Elements/fallbacks/CodeFallback.svelte +41 -0
  57. package/vendor/streamdown/Elements/fallbacks/CodeFallback.svelte.d.ts +9 -0
  58. package/vendor/streamdown/Elements/fallbacks/MathFallback.svelte +35 -0
  59. package/vendor/streamdown/Elements/fallbacks/MathFallback.svelte.d.ts +8 -0
  60. package/vendor/streamdown/Elements/fallbacks/MermaidFallback.svelte +36 -0
  61. package/vendor/streamdown/Elements/fallbacks/MermaidFallback.svelte.d.ts +9 -0
  62. package/vendor/streamdown/Elements/fallbacks/index.d.ts +3 -0
  63. package/vendor/streamdown/Elements/fallbacks/index.js +3 -0
  64. package/vendor/streamdown/Elements/icons.d.ts +31 -0
  65. package/vendor/streamdown/Elements/icons.js +200 -0
  66. package/vendor/streamdown/Elements/index.d.ts +8 -0
  67. package/vendor/streamdown/Elements/index.js +8 -0
  68. package/vendor/streamdown/Elements/popover.svelte.d.ts +8 -0
  69. package/vendor/streamdown/Elements/popover.svelte.js +45 -0
  70. package/vendor/streamdown/Elements/stepperState.svelte.d.ts +36 -0
  71. package/vendor/streamdown/Elements/stepperState.svelte.js +92 -0
  72. package/vendor/streamdown/IconProvider.svelte +11 -0
  73. package/vendor/streamdown/IconProvider.svelte.d.ts +30 -0
  74. package/vendor/streamdown/LICENSE +202 -0
  75. package/vendor/streamdown/PluginProvider.svelte +11 -0
  76. package/vendor/streamdown/PluginProvider.svelte.d.ts +30 -0
  77. package/vendor/streamdown/README.svadmin.md +5 -0
  78. package/vendor/streamdown/Streamdown.svelte +447 -0
  79. package/vendor/streamdown/Streamdown.svelte.d.ts +25 -0
  80. package/vendor/streamdown/block/BlockTokens.svelte +45 -0
  81. package/vendor/streamdown/block/BlockTokens.svelte.d.ts +9 -0
  82. package/vendor/streamdown/block/html.d.ts +14 -0
  83. package/vendor/streamdown/block/html.js +27 -0
  84. package/vendor/streamdown/block/text.d.ts +10 -0
  85. package/vendor/streamdown/block/text.js +31 -0
  86. package/vendor/streamdown/context-key.d.ts +1 -0
  87. package/vendor/streamdown/context-key.js +1 -0
  88. package/vendor/streamdown/context.svelte.d.ts +24 -0
  89. package/vendor/streamdown/context.svelte.js +75 -0
  90. package/vendor/streamdown/contracts/plugins.d.ts +26 -0
  91. package/vendor/streamdown/contracts/plugins.js +1 -0
  92. package/vendor/streamdown/contracts/streamdown.d.ts +374 -0
  93. package/vendor/streamdown/contracts/streamdown.js +29 -0
  94. package/vendor/streamdown/detect-direction.d.ts +1 -0
  95. package/vendor/streamdown/detect-direction.js +1 -0
  96. package/vendor/streamdown/icon-context.d.ts +36 -0
  97. package/vendor/streamdown/icon-context.js +52 -0
  98. package/vendor/streamdown/incomplete-code.d.ts +6 -0
  99. package/vendor/streamdown/incomplete-code.js +23 -0
  100. package/vendor/streamdown/index.d.ts +22 -0
  101. package/vendor/streamdown/index.js +20 -0
  102. package/vendor/streamdown/markdown-parse-cache.d.ts +37 -0
  103. package/vendor/streamdown/markdown-parse-cache.js +109 -0
  104. package/vendor/streamdown/markdown.d.ts +21 -0
  105. package/vendor/streamdown/markdown.js +214 -0
  106. package/vendor/streamdown/marked/index.d.ts +44 -0
  107. package/vendor/streamdown/marked/index.js +228 -0
  108. package/vendor/streamdown/marked/marked-alert.d.ts +13 -0
  109. package/vendor/streamdown/marked/marked-alert.js +47 -0
  110. package/vendor/streamdown/marked/marked-align.d.ts +10 -0
  111. package/vendor/streamdown/marked/marked-align.js +45 -0
  112. package/vendor/streamdown/marked/marked-br.d.ts +6 -0
  113. package/vendor/streamdown/marked/marked-br.js +15 -0
  114. package/vendor/streamdown/marked/marked-citations.d.ts +8 -0
  115. package/vendor/streamdown/marked/marked-citations.js +53 -0
  116. package/vendor/streamdown/marked/marked-cjk.d.ts +2 -0
  117. package/vendor/streamdown/marked/marked-cjk.js +165 -0
  118. package/vendor/streamdown/marked/marked-dl.d.ts +23 -0
  119. package/vendor/streamdown/marked/marked-dl.js +44 -0
  120. package/vendor/streamdown/marked/marked-footnotes.d.ts +26 -0
  121. package/vendor/streamdown/marked/marked-footnotes.js +101 -0
  122. package/vendor/streamdown/marked/marked-hr.d.ts +6 -0
  123. package/vendor/streamdown/marked/marked-hr.js +18 -0
  124. package/vendor/streamdown/marked/marked-list.d.ts +31 -0
  125. package/vendor/streamdown/marked/marked-list.js +330 -0
  126. package/vendor/streamdown/marked/marked-math.d.ts +13 -0
  127. package/vendor/streamdown/marked/marked-math.js +129 -0
  128. package/vendor/streamdown/marked/marked-mdx.d.ts +12 -0
  129. package/vendor/streamdown/marked/marked-mdx.js +124 -0
  130. package/vendor/streamdown/marked/marked-subsup.d.ts +22 -0
  131. package/vendor/streamdown/marked/marked-subsup.js +40 -0
  132. package/vendor/streamdown/marked/marked-table.d.ts +80 -0
  133. package/vendor/streamdown/marked/marked-table.js +527 -0
  134. package/vendor/streamdown/plugin-context.d.ts +19 -0
  135. package/vendor/streamdown/plugin-context.js +40 -0
  136. package/vendor/streamdown/plugins/cjk-shared.d.ts +1 -0
  137. package/vendor/streamdown/plugins/cjk-shared.js +1 -0
  138. package/vendor/streamdown/plugins.d.ts +19 -0
  139. package/vendor/streamdown/plugins.js +107 -0
  140. package/vendor/streamdown/provenance.json +229 -0
  141. package/vendor/streamdown/remend.d.ts +2 -0
  142. package/vendor/streamdown/remend.js +1 -0
  143. package/vendor/streamdown/security/html.d.ts +19 -0
  144. package/vendor/streamdown/security/html.js +329 -0
  145. package/vendor/streamdown/security/preprocess-custom-tags.d.ts +1 -0
  146. package/vendor/streamdown/security/preprocess-custom-tags.js +20 -0
  147. package/vendor/streamdown/security/preprocess-literal-tag-content.d.ts +1 -0
  148. package/vendor/streamdown/security/preprocess-literal-tag-content.js +16 -0
  149. package/vendor/streamdown/security/types.d.ts +1 -0
  150. package/vendor/streamdown/security/types.js +1 -0
  151. package/vendor/streamdown/site/SiteHeader.svelte +94 -0
  152. package/vendor/streamdown/site/SiteHeader.svelte.d.ts +6 -0
  153. package/vendor/streamdown/site/home/HomeDemo.svelte +122 -0
  154. package/vendor/streamdown/site/home/HomeDemo.svelte.d.ts +3 -0
  155. package/vendor/streamdown/site/home/HomePage.svelte +293 -0
  156. package/vendor/streamdown/site/home/HomePage.svelte.d.ts +3 -0
  157. package/vendor/streamdown/site/home/content.d.ts +69 -0
  158. package/vendor/streamdown/site/home/content.js +144 -0
  159. package/vendor/streamdown/site/metadata.d.ts +4 -0
  160. package/vendor/streamdown/site/metadata.js +4 -0
  161. package/vendor/streamdown/site/navigation.d.ts +6 -0
  162. package/vendor/streamdown/site/navigation.js +22 -0
  163. package/vendor/streamdown/streamdown/config.d.ts +41 -0
  164. package/vendor/streamdown/streamdown/config.js +125 -0
  165. package/vendor/streamdown/streamdown/context.d.ts +12 -0
  166. package/vendor/streamdown/streamdown/context.js +2 -0
  167. package/vendor/streamdown/streamdown/incomplete-markdown.d.ts +5 -0
  168. package/vendor/streamdown/streamdown/incomplete-markdown.js +79 -0
  169. package/vendor/streamdown/streamdown/pipeline.d.ts +95 -0
  170. package/vendor/streamdown/streamdown/pipeline.js +138 -0
  171. package/vendor/streamdown/streamdown/runtime.d.ts +59 -0
  172. package/vendor/streamdown/streamdown/runtime.js +112 -0
  173. package/vendor/streamdown/streaming.d.ts +5 -0
  174. package/vendor/streamdown/streaming.js +5 -0
  175. package/vendor/streamdown/theme.d.ts +486 -0
  176. package/vendor/streamdown/theme.js +370 -0
  177. package/vendor/streamdown/translations.d.ts +43 -0
  178. package/vendor/streamdown/translations.js +54 -0
  179. package/vendor/streamdown/url-policy.d.ts +1 -0
  180. package/vendor/streamdown/url-policy.js +1 -0
  181. package/vendor/streamdown/utils/bind.d.ts +8 -0
  182. package/vendor/streamdown/utils/bind.js +26 -0
  183. package/vendor/streamdown/utils/bundledLanguages.d.ts +1 -0
  184. package/vendor/streamdown/utils/bundledLanguages.js +1 -0
  185. package/vendor/streamdown/utils/code-block.d.ts +8 -0
  186. package/vendor/streamdown/utils/code-block.js +38 -0
  187. package/vendor/streamdown/utils/copy.svelte.d.ts +7 -0
  188. package/vendor/streamdown/utils/copy.svelte.js +38 -0
  189. package/vendor/streamdown/utils/darkMode.svelte.d.ts +3 -0
  190. package/vendor/streamdown/utils/darkMode.svelte.js +49 -0
  191. package/vendor/streamdown/utils/detectDirection.d.ts +1 -0
  192. package/vendor/streamdown/utils/detectDirection.js +19 -0
  193. package/vendor/streamdown/utils/get.d.ts +1 -0
  194. package/vendor/streamdown/utils/get.js +25 -0
  195. package/vendor/streamdown/utils/hightlighter.svelte.d.ts +30 -0
  196. package/vendor/streamdown/utils/hightlighter.svelte.js +524 -0
  197. package/vendor/streamdown/utils/index.d.ts +3 -0
  198. package/vendor/streamdown/utils/index.js +3 -0
  199. package/vendor/streamdown/utils/mermaid.d.ts +13 -0
  200. package/vendor/streamdown/utils/mermaid.js +49 -0
  201. package/vendor/streamdown/utils/panzoom.svelte.d.ts +35 -0
  202. package/vendor/streamdown/utils/panzoom.svelte.js +556 -0
  203. package/vendor/streamdown/utils/parse-incomplete-markdown.d.ts +2 -0
  204. package/vendor/streamdown/utils/parse-incomplete-markdown.js +2 -0
  205. package/vendor/streamdown/utils/runtime-env.d.ts +1 -0
  206. package/vendor/streamdown/utils/runtime-env.js +13 -0
  207. package/vendor/streamdown/utils/save.d.ts +1 -0
  208. package/vendor/streamdown/utils/save.js +14 -0
  209. package/vendor/streamdown/utils/scroll-lock.d.ts +2 -0
  210. package/vendor/streamdown/utils/scroll-lock.js +35 -0
  211. package/vendor/streamdown/utils/table.d.ts +8 -0
  212. package/vendor/streamdown/utils/table.js +176 -0
  213. package/vendor/streamdown/utils/url.d.ts +22 -0
  214. package/vendor/streamdown/utils/url.js +98 -0
  215. package/vendor/streamdown/utils/useClickOutside.svelte.d.ts +8 -0
  216. package/vendor/streamdown/utils/useClickOutside.svelte.js +41 -0
  217. package/vendor/streamdown/utils/useKeyDown.svelte.d.ts +5 -0
  218. package/vendor/streamdown/utils/useKeyDown.svelte.js +23 -0
@@ -0,0 +1,293 @@
1
+ <script lang="ts">
2
+ import { onDestroy } from 'svelte';
3
+ import Streamdown from '../../Streamdown.svelte';
4
+ import { code } from '../../plugins.js';
5
+ import { PLAYGROUND_URL, REPO_URL, SITE_URL } from '../metadata.js';
6
+ import HomeDemo from './HomeDemo.svelte';
7
+ import SiteHeader from '../SiteHeader.svelte';
8
+ import {
9
+ benchmarkSummary,
10
+ featureCards,
11
+ heroDescription,
12
+ heroTitle,
13
+ installCommand,
14
+ usageFilePath,
15
+ usageCode,
16
+ usageMarkdown
17
+ } from './content.js';
18
+
19
+ type CopyTarget = 'install' | 'usage';
20
+
21
+ let copiedTarget = $state<CopyTarget | null>(null);
22
+ let copyTimer: ReturnType<typeof setTimeout> | null = null;
23
+
24
+ function resetTimer(timer: ReturnType<typeof setTimeout> | null) {
25
+ if (timer) {
26
+ clearTimeout(timer);
27
+ }
28
+ }
29
+
30
+ async function copyText(text: string, target: CopyTarget) {
31
+ await navigator.clipboard.writeText(text);
32
+ copiedTarget = target;
33
+ resetTimer(copyTimer);
34
+ copyTimer = setTimeout(() => {
35
+ copiedTarget = null;
36
+ }, 2000);
37
+ }
38
+
39
+ onDestroy(() => {
40
+ resetTimer(copyTimer);
41
+ });
42
+ </script>
43
+
44
+ <svelte:head>
45
+ <title>Streamdown-Svelte</title>
46
+ <meta
47
+ name="description"
48
+ content="Streamdown-Svelte is a markdown renderer designed for streaming content from AI models. Highly interactive, customizable, and easy to use."
49
+ />
50
+ <link rel="canonical" href={SITE_URL} />
51
+ <meta property="og:title" content="Streamdown-Svelte" />
52
+ <meta
53
+ property="og:description"
54
+ content="Streaming-first markdown rendering for Svelte with code, math, Mermaid, and hardened HTML support."
55
+ />
56
+ <meta property="og:type" content="website" />
57
+ <meta property="og:url" content={SITE_URL} />
58
+ <meta name="twitter:card" content="summary" />
59
+ <meta name="twitter:title" content="Streamdown-Svelte" />
60
+ <meta
61
+ name="twitter:description"
62
+ content="Streaming-first markdown rendering for Svelte with code, math, Mermaid, and hardened HTML support."
63
+ />
64
+ </svelte:head>
65
+
66
+ <div class="min-h-dvh bg-sidebar pb-32 dark:bg-background">
67
+ <SiteHeader />
68
+
69
+ <div class="mx-auto w-full max-w-5xl">
70
+ <section class="space-y-6 px-4 pt-16 pb-16 text-center sm:pt-24">
71
+ <div class="mx-auto w-full max-w-4xl space-y-5">
72
+ <h1
73
+ class="text-center text-4xl font-semibold tracking-tight text-balance sm:text-5xl xl:text-6xl"
74
+ >
75
+ {heroTitle}
76
+ </h1>
77
+ <p
78
+ class="mx-auto max-w-xl text-lg leading-relaxed text-balance text-muted-foreground sm:text-xl"
79
+ >
80
+ {heroDescription}
81
+ </p>
82
+ </div>
83
+
84
+ <div class="mx-auto flex w-full max-w-3xl flex-col gap-3 sm:flex-row sm:justify-center">
85
+ <div
86
+ class="inline-flex min-w-0 items-center overflow-hidden rounded-md border border-border bg-background text-left shadow-sm sm:flex-[0_1_24rem]"
87
+ >
88
+ <span class="border-r border-border px-3 py-3 font-mono text-sm text-muted-foreground"
89
+ >$</span
90
+ >
91
+ <input
92
+ class="min-w-0 flex-1 bg-transparent px-3 py-3 font-mono text-sm outline-none sm:min-w-[12rem] md:min-w-[12rem]"
93
+ readonly
94
+ value={installCommand}
95
+ />
96
+ <button
97
+ class="border-l border-border px-3 py-3 text-sm font-medium transition-colors hover:bg-accent"
98
+ type="button"
99
+ onclick={() => copyText(installCommand, 'install')}
100
+ >
101
+ {copiedTarget === 'install' ? 'Copied' : 'Copy'}
102
+ </button>
103
+ </div>
104
+
105
+ <a
106
+ class="inline-flex items-center justify-center rounded-md border border-border bg-background px-4 py-3 text-sm font-medium shadow-sm transition-colors hover:bg-accent"
107
+ href={PLAYGROUND_URL}
108
+ >
109
+ Open playground
110
+ </a>
111
+ </div>
112
+ </section>
113
+
114
+ <div class="grid divide-y border-y border-border bg-background sm:border-x">
115
+ <section
116
+ id="demo"
117
+ class="grid items-center gap-10 overflow-hidden px-4 py-8 sm:px-12 sm:py-12"
118
+ >
119
+ <div class="mx-auto grid max-w-2xl gap-4 text-center">
120
+ <h2 class="text-xl font-semibold tracking-tight sm:text-2xl md:text-3xl lg:text-[40px]">
121
+ A fully-loaded Markdown renderer
122
+ </h2>
123
+ <p class="text-lg text-balance text-muted-foreground">
124
+ Built-in typography, streaming carets, animations, plugins, and more.
125
+ </p>
126
+ </div>
127
+
128
+ <HomeDemo />
129
+ </section>
130
+
131
+ <section
132
+ id="features"
133
+ class="grid scroll-mt-24 gap-8 px-4 py-8 sm:grid-cols-2 sm:px-12 sm:py-12 md:grid-cols-3"
134
+ >
135
+ {#each featureCards as card}
136
+ <div>
137
+ <h3 class="mb-2 text-lg font-semibold tracking-tight">{card.title}</h3>
138
+ <p
139
+ class="text-muted-foreground [&_a]:font-medium [&_a]:text-foreground [&_a]:underline [&_a]:decoration-border [&_a]:underline-offset-4 [&_a]:transition-colors [&_a:hover]:decoration-foreground/60"
140
+ >
141
+ {@html card.description}
142
+ </p>
143
+ </div>
144
+ {/each}
145
+ </section>
146
+
147
+ <section
148
+ id="plugins"
149
+ class="grid scroll-mt-24 gap-12 p-8 sm:grid-cols-3 sm:gap-0 sm:divide-x sm:p-0"
150
+ >
151
+ <div class="flex flex-col gap-2 text-balance sm:p-12">
152
+ <h2 class="text-xl font-semibold tracking-tight sm:text-2xl md:text-3xl">
153
+ Get started in seconds
154
+ </h2>
155
+ <p class="mt-2 text-lg text-balance text-muted-foreground">
156
+ Install only what you need. Plugins are optional and tree-shakeable for minimal bundle
157
+ size.
158
+ </p>
159
+ </div>
160
+
161
+ <div class="sm:col-span-2 sm:p-12">
162
+ <div
163
+ class="overflow-hidden rounded-2xl border border-border bg-background shadow-[0_20px_70px_-40px_rgba(15,23,42,0.45)]"
164
+ >
165
+ <div
166
+ class="flex items-center gap-3 border-b border-border bg-sidebar/80 px-4 py-3 text-muted-foreground supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur"
167
+ >
168
+ <img alt="Svelte" class="size-5 shrink-0" src="/svelte-favicon.png" />
169
+ <span
170
+ class="min-w-0 flex-1 truncate font-mono text-sm tracking-tight text-foreground"
171
+ >
172
+ {usageFilePath}
173
+ </span>
174
+ <button
175
+ class="inline-flex shrink-0 items-center gap-2 rounded-lg border border-border bg-background px-3 py-1.5 text-sm font-medium text-foreground transition-colors hover:bg-accent"
176
+ type="button"
177
+ onclick={() => copyText(usageCode, 'usage')}
178
+ >
179
+ {copiedTarget === 'usage' ? 'Copied' : 'Copy'}
180
+ </button>
181
+ </div>
182
+ <div class="usage-preview bg-background">
183
+ <Streamdown
184
+ content={usageMarkdown}
185
+ baseTheme="shadcn"
186
+ plugins={{ code }}
187
+ controls={{ code: false }}
188
+ />
189
+ </div>
190
+ </div>
191
+ </div>
192
+ </section>
193
+
194
+ <section class="grid gap-8 px-4 py-8 sm:px-12 sm:py-12">
195
+ <div class="grid gap-3 text-balance">
196
+ <h2 class="text-xl font-semibold tracking-tight sm:text-2xl md:text-3xl lg:text-[40px]">
197
+ {benchmarkSummary.title}
198
+ </h2>
199
+ <p class="max-w-3xl text-lg text-balance text-muted-foreground">
200
+ {benchmarkSummary.description}
201
+ </p>
202
+ <p class="text-sm text-muted-foreground">
203
+ Snapshot from {benchmarkSummary.reportDate} on {benchmarkSummary.platform}.
204
+ </p>
205
+ </div>
206
+
207
+ <div class="grid gap-4 md:grid-cols-3">
208
+ {#each benchmarkSummary.highlights as item}
209
+ <div class="rounded-2xl border border-border bg-background p-5 shadow-sm">
210
+ <p class="text-sm font-medium text-muted-foreground">{item.label}</p>
211
+ <p class="mt-2 text-3xl font-semibold tracking-tight">{item.value}</p>
212
+ <p class="mt-2 text-sm text-muted-foreground">{item.detail}</p>
213
+ </div>
214
+ {/each}
215
+ </div>
216
+
217
+ <div class="flex items-center justify-center rounded-2xl bg-sidebar/20 px-4 py-6">
218
+ <img
219
+ alt="Benchmark comparison by scenario"
220
+ class="mx-auto block w-full max-w-6xl"
221
+ src={benchmarkSummary.chart}
222
+ />
223
+ </div>
224
+
225
+ <div class="grid gap-4 md:grid-cols-2 xl:grid-cols-4">
226
+ {#each benchmarkSummary.suites as suite}
227
+ <div class="rounded-xl border border-border bg-background p-4">
228
+ <p class="text-sm font-medium text-muted-foreground">{suite.name}</p>
229
+ <p class="mt-2 text-2xl font-semibold tracking-tight">{suite.delta}</p>
230
+ <p class="mt-2 text-sm text-muted-foreground">{suite.record}</p>
231
+ </div>
232
+ {/each}
233
+ </div>
234
+ </section>
235
+
236
+ <section
237
+ class="flex flex-col gap-4 px-8 py-10 md:flex-row md:items-center md:justify-between"
238
+ >
239
+ <h2 class="text-xl font-semibold tracking-tight sm:text-2xl md:text-3xl lg:text-[40px]">
240
+ Upgrade your AI experiences
241
+ </h2>
242
+ <div class="flex flex-wrap gap-3">
243
+ <a
244
+ class="inline-flex items-center justify-center rounded-md bg-[#ff3e00] px-4 py-3 text-sm font-medium text-white shadow-sm transition-colors hover:bg-[#e43700]"
245
+ href={PLAYGROUND_URL}
246
+ >
247
+ Open playground
248
+ </a>
249
+ <a
250
+ class="inline-flex items-center justify-center rounded-md border border-[#ff3e00]/30 bg-[#ff3e00]/8 px-4 py-3 text-sm font-medium text-[#ff3e00] transition-colors hover:bg-[#ff3e00]/14 dark:border-[#ff6b3d]/30 dark:bg-[#ff6b3d]/10 dark:text-[#ff8a66] dark:hover:bg-[#ff6b3d]/16"
251
+ href={REPO_URL}
252
+ target="_blank"
253
+ rel="noreferrer"
254
+ >
255
+ Browse the repo
256
+ </a>
257
+ </div>
258
+ </section>
259
+ </div>
260
+ </div>
261
+ </div>
262
+
263
+ <style>
264
+ .usage-preview :global(.streamdown) {
265
+ max-width: none;
266
+ }
267
+
268
+ .usage-preview :global([data-streamdown='code-block']) {
269
+ margin: 0;
270
+ gap: 0;
271
+ border: 0;
272
+ border-radius: 0;
273
+ background: transparent;
274
+ padding: 0;
275
+ }
276
+
277
+ .usage-preview :global([data-streamdown='code-block-header']) {
278
+ display: none;
279
+ }
280
+
281
+ .usage-preview :global([data-streamdown='code-block-body']) {
282
+ border: 0;
283
+ border-radius: 0;
284
+ background: transparent;
285
+ padding: 1.25rem;
286
+ }
287
+
288
+ .usage-preview :global(pre) {
289
+ margin: 0;
290
+ border-radius: 0;
291
+ background: transparent;
292
+ }
293
+ </style>
@@ -0,0 +1,3 @@
1
+ declare const HomePage: import("svelte").Component<Record<string, never>, {}, "">;
2
+ type HomePage = ReturnType<typeof HomePage>;
3
+ export default HomePage;
@@ -0,0 +1,69 @@
1
+ export declare const heroTitle = "Streamdown-Svelte";
2
+ export declare const heroDescription = "Streamdown-Svelte is a markdown renderer designed for streaming content from AI models. Highly interactive, customizable, and easy to use.";
3
+ export declare const installCommand = "npm i streamdown-svelte";
4
+ export declare const usageFilePath = "src/lib/ChatMessage.svelte";
5
+ export declare const demoMarkdown = "# Streamdown-Svelte\n\nStreamdown-Svelte is a **streaming-optimized** Markdown renderer for Svelte. It was designed for AI chat interfaces where content arrives token-by-token, but it works just as well for static content.\n\nMost Markdown renderers re-parse the entire document on every update. Streamdown-Svelte takes a different approach \u2014 it splits content into discrete blocks and only re-renders the block that changed. This means your UI stays fast, even when the response is hundreds of lines long.\n\n## Getting started\n\nInstall the package from npm, then drop it into your component tree. Pass markdown through the `content` prop and Streamdown-Svelte handles the rest.\n\n```svelte\nimport { Streamdown } from \"streamdown-svelte\";\n\n<Streamdown content={content} animated caret=\"block\" />\n```\n\nThe `animated` prop enables a smooth fade-in on new blocks, and `caret` renders a blinking cursor at the end of the stream \u2014 just like the one you're watching right now.\n\n## Plugin ecosystem\n\nStreamdown-Svelte ships with optional plugins for common use cases. Each one is a separate package, so you only bundle what you need.\n\n| Plugin | Package | Purpose |\n| --- | --- | --- |\n| Syntax highlighting | `@streamdown-svelte/code` | Shiki-powered code blocks |\n| Diagrams | `@streamdown-svelte/mermaid` | Mermaid diagram rendering |\n| Math | `@streamdown-svelte/math` | KaTeX math expressions |\n| CJK | `@streamdown-svelte/cjk` | CJK line-breaking rules |\n\nFor example, the quadratic formula renders beautifully: $$x = \\frac{-b \\pm \\sqrt{b^2 - 4ac}}{2a}$$\n\n## Why Streamdown-Svelte?\n\nThere are plenty of Markdown renderers out there, but most of them weren't built for streaming. Here's what makes Streamdown-Svelte different:\n\n- [x] Block-level diffing for *incremental* re-renders\n- [x] First-class support for ~~incomplete~~ partial Markdown\n- [x] Configurable caret styles and animations\n- [ ] World domination\n\n> Streamdown-Svelte is open-source and Apache-2.0 licensed. Contributions are welcome.\n";
6
+ export declare const usageCode = "<script lang=\"ts\">\nimport { Streamdown } from \"streamdown-svelte\";\nimport { code } from \"@streamdown-svelte/code\";\nimport { mermaid } from \"@streamdown-svelte/mermaid\";\nimport { math } from \"@streamdown-svelte/math\";\nimport { cjk } from \"@streamdown-svelte/cjk\";\nimport \"katex/dist/katex.min.css\";\n\nexport let content = \"\";\nexport let isStreaming = false;\n</script>\n\n<Streamdown\n {content}\n plugins={{ code, mermaid, math, cjk }}\n isAnimating={isStreaming}\n/>\n";
7
+ export declare const usageMarkdown = "```svelte\n<script lang=\"ts\">\nimport { Streamdown } from \"streamdown-svelte\";\nimport { code } from \"@streamdown-svelte/code\";\nimport { mermaid } from \"@streamdown-svelte/mermaid\";\nimport { math } from \"@streamdown-svelte/math\";\nimport { cjk } from \"@streamdown-svelte/cjk\";\nimport \"katex/dist/katex.min.css\";\n\nexport let content = \"\";\nexport let isStreaming = false;\n</script>\n\n<Streamdown\n {content}\n plugins={{ code, mermaid, math, cjk }}\n isAnimating={isStreaming}\n/>\n\n```";
8
+ export declare const featureCards: readonly [{
9
+ readonly id: "typography";
10
+ readonly title: "Typography & GFM";
11
+ readonly description: "Built-in <a href=\"/playground\">typography</a> for headings, lists, and code blocks. <a href=\"/playground\">GitHub Flavored Markdown</a> adds tables, task lists, strikethrough, and autolinks.";
12
+ }, {
13
+ readonly id: "streaming";
14
+ readonly title: "Streaming experience";
15
+ readonly description: "Built-in <a href=\"#demo\">caret indicators</a> show users content is generating. Unterminated block styling and <a href=\"#demo\">animations</a> make partial Markdown look polished while tokens are still arriving.";
16
+ }, {
17
+ readonly id: "code";
18
+ readonly title: "Interactive code blocks";
19
+ readonly description: "<a href=\"/playground\">Shiki-powered</a> syntax highlighting with copy and download controls. Streamdown-Svelte supports language detection, line numbers, and custom renderers for rich fenced blocks.";
20
+ }, {
21
+ readonly id: "plugins";
22
+ readonly title: "Math, diagrams & CJK";
23
+ readonly description: "LaTeX math through KaTeX, interactive Mermaid diagrams with fullscreen viewing, and <a href=\"/playground?fixture=15-composite-playground.md\">CJK support</a> for correct ideographic punctuation.";
24
+ }, {
25
+ readonly id: "security";
26
+ readonly title: "Security & link safety";
27
+ readonly description: "Security hardening blocks images and links from unexpected origins. URL policy, safe HTML handling, and controlled embeds keep streamed content predictable.";
28
+ }, {
29
+ readonly id: "customization";
30
+ readonly title: "Fully customizable";
31
+ readonly description: "Override any element with custom Svelte components, apply your own styles, and fine-tune behavior through plugins and configuration without forking the renderer.";
32
+ }];
33
+ export declare const benchmarkSummary: {
34
+ readonly title: "Performance";
35
+ readonly description: "Current workspace benchmark snapshot against the upstream Streamdown reference. These figures come from the same compare report previewed in the README.";
36
+ readonly chart: "/benchmarks/compare-by-scenario.svg";
37
+ readonly reportDate: "April 7, 2026";
38
+ readonly platform: "Linux x64, Intel Core Ultra 9 285K, Node 22.22.1";
39
+ readonly highlights: readonly [{
40
+ readonly label: "Overall throughput";
41
+ readonly value: "+31.8%";
42
+ readonly detail: "Geometric mean across 31 benchmark pairs";
43
+ }, {
44
+ readonly label: "Head-to-head wins";
45
+ readonly value: "19 / 31";
46
+ readonly detail: "Local Streamdown-Svelte wins over upstream reference";
47
+ }, {
48
+ readonly label: "Stream render suite";
49
+ readonly value: "+273.3%";
50
+ readonly detail: "Fastest area, with 5 out of 5 wins";
51
+ }];
52
+ readonly suites: readonly [{
53
+ readonly name: "Stream Render";
54
+ readonly delta: "+273.3%";
55
+ readonly record: "5 wins / 0 losses";
56
+ }, {
57
+ readonly name: "Table Utilities";
58
+ readonly delta: "+34.9%";
59
+ readonly record: "9 wins / 0 losses";
60
+ }, {
61
+ readonly name: "Remend Parser";
62
+ readonly delta: "-3.3%";
63
+ readonly record: "4 wins / 5 losses";
64
+ }, {
65
+ readonly name: "Parse Blocks";
66
+ readonly delta: "-5.1%";
67
+ readonly record: "1 win / 7 losses";
68
+ }];
69
+ };
@@ -0,0 +1,144 @@
1
+ export const heroTitle = 'Streamdown-Svelte';
2
+ export const heroDescription = 'Streamdown-Svelte is a markdown renderer designed for streaming content from AI models. Highly interactive, customizable, and easy to use.';
3
+ export const installCommand = 'npm i streamdown-svelte';
4
+ export const usageFilePath = 'src/lib/ChatMessage.svelte';
5
+ export const demoMarkdown = `# Streamdown-Svelte
6
+
7
+ Streamdown-Svelte is a **streaming-optimized** Markdown renderer for Svelte. It was designed for AI chat interfaces where content arrives token-by-token, but it works just as well for static content.
8
+
9
+ Most Markdown renderers re-parse the entire document on every update. Streamdown-Svelte takes a different approach — it splits content into discrete blocks and only re-renders the block that changed. This means your UI stays fast, even when the response is hundreds of lines long.
10
+
11
+ ## Getting started
12
+
13
+ Install the package from npm, then drop it into your component tree. Pass markdown through the \`content\` prop and Streamdown-Svelte handles the rest.
14
+
15
+ \`\`\`svelte
16
+ import { Streamdown } from "streamdown-svelte";
17
+
18
+ <Streamdown content={content} animated caret="block" />
19
+ \`\`\`
20
+
21
+ The \`animated\` prop enables a smooth fade-in on new blocks, and \`caret\` renders a blinking cursor at the end of the stream — just like the one you're watching right now.
22
+
23
+ ## Plugin ecosystem
24
+
25
+ Streamdown-Svelte ships with optional plugins for common use cases. Each one is a separate package, so you only bundle what you need.
26
+
27
+ | Plugin | Package | Purpose |
28
+ | --- | --- | --- |
29
+ | Syntax highlighting | \`@streamdown-svelte/code\` | Shiki-powered code blocks |
30
+ | Diagrams | \`@streamdown-svelte/mermaid\` | Mermaid diagram rendering |
31
+ | Math | \`@streamdown-svelte/math\` | KaTeX math expressions |
32
+ | CJK | \`@streamdown-svelte/cjk\` | CJK line-breaking rules |
33
+
34
+ For example, the quadratic formula renders beautifully: $$x = \\frac{-b \\pm \\sqrt{b^2 - 4ac}}{2a}$$
35
+
36
+ ## Why Streamdown-Svelte?
37
+
38
+ There are plenty of Markdown renderers out there, but most of them weren't built for streaming. Here's what makes Streamdown-Svelte different:
39
+
40
+ - [x] Block-level diffing for *incremental* re-renders
41
+ - [x] First-class support for ~~incomplete~~ partial Markdown
42
+ - [x] Configurable caret styles and animations
43
+ - [ ] World domination
44
+
45
+ > Streamdown-Svelte is open-source and Apache-2.0 licensed. Contributions are welcome.
46
+ `;
47
+ export const usageCode = `<script lang="ts">
48
+ import { Streamdown } from "streamdown-svelte";
49
+ import { code } from "@streamdown-svelte/code";
50
+ import { mermaid } from "@streamdown-svelte/mermaid";
51
+ import { math } from "@streamdown-svelte/math";
52
+ import { cjk } from "@streamdown-svelte/cjk";
53
+ import "katex/dist/katex.min.css";
54
+
55
+ export let content = "";
56
+ export let isStreaming = false;
57
+ </script>
58
+
59
+ <Streamdown
60
+ {content}
61
+ plugins={{ code, mermaid, math, cjk }}
62
+ isAnimating={isStreaming}
63
+ />\n`;
64
+ export const usageMarkdown = `\`\`\`svelte
65
+ ${usageCode}
66
+ \`\`\``;
67
+ export const featureCards = [
68
+ {
69
+ id: 'typography',
70
+ title: 'Typography & GFM',
71
+ description: 'Built-in <a href="/playground">typography</a> for headings, lists, and code blocks. <a href="/playground">GitHub Flavored Markdown</a> adds tables, task lists, strikethrough, and autolinks.'
72
+ },
73
+ {
74
+ id: 'streaming',
75
+ title: 'Streaming experience',
76
+ description: 'Built-in <a href="#demo">caret indicators</a> show users content is generating. Unterminated block styling and <a href="#demo">animations</a> make partial Markdown look polished while tokens are still arriving.'
77
+ },
78
+ {
79
+ id: 'code',
80
+ title: 'Interactive code blocks',
81
+ description: '<a href="/playground">Shiki-powered</a> syntax highlighting with copy and download controls. Streamdown-Svelte supports language detection, line numbers, and custom renderers for rich fenced blocks.'
82
+ },
83
+ {
84
+ id: 'plugins',
85
+ title: 'Math, diagrams & CJK',
86
+ description: 'LaTeX math through KaTeX, interactive Mermaid diagrams with fullscreen viewing, and <a href="/playground?fixture=15-composite-playground.md">CJK support</a> for correct ideographic punctuation.'
87
+ },
88
+ {
89
+ id: 'security',
90
+ title: 'Security & link safety',
91
+ description: 'Security hardening blocks images and links from unexpected origins. URL policy, safe HTML handling, and controlled embeds keep streamed content predictable.'
92
+ },
93
+ {
94
+ id: 'customization',
95
+ title: 'Fully customizable',
96
+ description: 'Override any element with custom Svelte components, apply your own styles, and fine-tune behavior through plugins and configuration without forking the renderer.'
97
+ }
98
+ ];
99
+ export const benchmarkSummary = {
100
+ title: 'Performance',
101
+ description: 'Current workspace benchmark snapshot against the upstream Streamdown reference. These figures come from the same compare report previewed in the README.',
102
+ chart: '/benchmarks/compare-by-scenario.svg',
103
+ reportDate: 'April 7, 2026',
104
+ platform: 'Linux x64, Intel Core Ultra 9 285K, Node 22.22.1',
105
+ highlights: [
106
+ {
107
+ label: 'Overall throughput',
108
+ value: '+31.8%',
109
+ detail: 'Geometric mean across 31 benchmark pairs'
110
+ },
111
+ {
112
+ label: 'Head-to-head wins',
113
+ value: '19 / 31',
114
+ detail: 'Local Streamdown-Svelte wins over upstream reference'
115
+ },
116
+ {
117
+ label: 'Stream render suite',
118
+ value: '+273.3%',
119
+ detail: 'Fastest area, with 5 out of 5 wins'
120
+ }
121
+ ],
122
+ suites: [
123
+ {
124
+ name: 'Stream Render',
125
+ delta: '+273.3%',
126
+ record: '5 wins / 0 losses'
127
+ },
128
+ {
129
+ name: 'Table Utilities',
130
+ delta: '+34.9%',
131
+ record: '9 wins / 0 losses'
132
+ },
133
+ {
134
+ name: 'Remend Parser',
135
+ delta: '-3.3%',
136
+ record: '4 wins / 5 losses'
137
+ },
138
+ {
139
+ name: 'Parse Blocks',
140
+ delta: '-5.1%',
141
+ record: '1 win / 7 losses'
142
+ }
143
+ ]
144
+ };
@@ -0,0 +1,4 @@
1
+ export declare const SITE_URL = "https://streamdown-svelte.pacificstudio.ai";
2
+ export declare const PLAYGROUND_URL = "https://streamdown-svelte.pacificstudio.ai/playground";
3
+ export declare const DOCS_URL = "https://streamdown-svelte.pacificstudio.ai/docs";
4
+ export declare const REPO_URL = "https://github.com/PacificStudio/streamdown-svelte";
@@ -0,0 +1,4 @@
1
+ export const SITE_URL = 'https://streamdown-svelte.pacificstudio.ai';
2
+ export const PLAYGROUND_URL = `${SITE_URL}/playground`;
3
+ export const DOCS_URL = `${SITE_URL}/docs`;
4
+ export const REPO_URL = 'https://github.com/PacificStudio/streamdown-svelte';
@@ -0,0 +1,6 @@
1
+ export type SiteNavItem = {
2
+ label: string;
3
+ href: string;
4
+ match: (pathname: string, hash: string) => boolean;
5
+ };
6
+ export declare const siteNavItems: readonly SiteNavItem[];
@@ -0,0 +1,22 @@
1
+ export const siteNavItems = [
2
+ {
3
+ label: 'Docs',
4
+ href: '/docs',
5
+ match: (pathname) => pathname === '/docs' || pathname === '/prompting'
6
+ },
7
+ {
8
+ label: 'Features',
9
+ href: '/#features',
10
+ match: (pathname, hash) => pathname === '/' && (hash === '' || hash === '#features')
11
+ },
12
+ {
13
+ label: 'Plugins',
14
+ href: '/#plugins',
15
+ match: (pathname, hash) => pathname === '/' && hash === '#plugins'
16
+ },
17
+ {
18
+ label: 'Playground',
19
+ href: '/playground',
20
+ match: (pathname) => pathname === '/playground'
21
+ }
22
+ ];
@@ -0,0 +1,41 @@
1
+ import { type ResolvedAnimationConfig, type StreamdownProps } from '../context.svelte.js';
2
+ import { type ThemeInput } from '../plugins.js';
3
+ import { type Theme } from '../theme.js';
4
+ export declare const defaultLinkSafetyConfig: {
5
+ readonly enabled: true;
6
+ };
7
+ export declare const defaultShikiTheme: [ThemeInput, ThemeInput];
8
+ export declare const footnoteDefinitionPattern: RegExp;
9
+ export declare const resolveShikiThemePair: <Source extends Record<string, any>>(theme: StreamdownProps<Source>["shikiTheme"] | undefined) => [ThemeInput, ThemeInput];
10
+ export declare const collectThemeRegistrations: (themes: [ThemeInput, ThemeInput]) => Record<string, import("shiki").ThemeRegistration>;
11
+ export declare const resolveCompatAnimation: <Source extends Record<string, any>>(animated: StreamdownProps<Source>["animated"], isAnimating: boolean, mode: "static" | "streaming") => ResolvedAnimationConfig;
12
+ export declare const resolveControls: <Source extends Record<string, any>>(controls: StreamdownProps<Source>["controls"]) => {
13
+ controls: {
14
+ code: boolean;
15
+ mermaid: import("../context.svelte.js").NormalizedMermaidControls;
16
+ table: import("../context.svelte.js").TableControlsConfig;
17
+ };
18
+ codeControls: {
19
+ copy: boolean;
20
+ download: boolean;
21
+ };
22
+ };
23
+ export declare const resolveAnimationConfig: <Source extends Record<string, any>>({ animation, animated, isAnimating, mode }: {
24
+ animation: StreamdownProps<Source>["animation"];
25
+ animated: StreamdownProps<Source>["animated"];
26
+ isAnimating: boolean;
27
+ mode: "static" | "streaming";
28
+ }) => ResolvedAnimationConfig;
29
+ export declare const resolveThemeClassMap: <Source extends Record<string, any>>({ theme, baseTheme, shouldMergeTheme, prefix }: {
30
+ theme: StreamdownProps<Source>["theme"];
31
+ baseTheme: StreamdownProps<Source>["baseTheme"];
32
+ shouldMergeTheme: boolean;
33
+ prefix: string | undefined;
34
+ }) => Theme;
35
+ export declare const resolveRootClassName: ({ className, futureClassName, prefix, shouldShowCaret, shouldHideCaret }: {
36
+ className: string | undefined;
37
+ futureClassName: string | undefined;
38
+ prefix: string | undefined;
39
+ shouldShowCaret: boolean;
40
+ shouldHideCaret: boolean;
41
+ }) => string;