svelte-streamdown 1.0.0 → 1.0.2
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 +1 -3
- package/dist/Streamdown.svelte +1 -1
- package/dist/utils/panzoom.svelte.js +4 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://badge.fury.io/js/svelte-streamdown)
|
|
4
4
|
|
|
5
|
-
A **Svelte port** of [Streamdown](https://streamdown.ai/) by Vercel - an all markdown renderer, designed specifically for AI-powered streaming applications.
|
|
5
|
+
A **Svelte port** of [Streamdown](https://streamdown.ai/) by Vercel - an all in one markdown renderer, designed specifically for AI-powered streaming applications.
|
|
6
6
|
|
|
7
7
|
## 📦 Installation
|
|
8
8
|
|
|
@@ -16,8 +16,6 @@ yarn add svelte-streamdown
|
|
|
16
16
|
|
|
17
17
|
## 🚀 Overview
|
|
18
18
|
|
|
19
|
-
Streamdown makes formatting Markdown easy, but when you tokenize and stream it from AI models, new challenges arise. This Svelte port brings all the power of the original React Streamdown component to the Svelte ecosystem.
|
|
20
|
-
|
|
21
19
|
Perfect for AI-powered applications that need to stream and render markdown content safely and beautifully, with support for incomplete markdown blocks, security hardening, and rich features like code highlighting, math expressions, and interactive diagrams.
|
|
22
20
|
|
|
23
21
|
## ✨ Main Features
|
package/dist/Streamdown.svelte
CHANGED
|
@@ -351,15 +351,14 @@ export const usePanzoom = (opts = {}) => {
|
|
|
351
351
|
// Add view transition name for CSS targeting
|
|
352
352
|
eventTarget.style.viewTransitionName = 'panzoom-element';
|
|
353
353
|
isExpanded = false;
|
|
354
|
-
const api = document.startViewTransition;
|
|
355
354
|
const run = () => {
|
|
356
355
|
if (!eventTarget)
|
|
357
356
|
return;
|
|
358
357
|
eventTarget.dataset.expanded = 'false';
|
|
359
358
|
zoomToFit();
|
|
360
359
|
};
|
|
361
|
-
if (typeof
|
|
362
|
-
|
|
360
|
+
if (typeof document.startViewTransition === 'function') {
|
|
361
|
+
document.startViewTransition(run).finished.finally(() => {
|
|
363
362
|
if (eventTarget)
|
|
364
363
|
eventTarget.style.viewTransitionName = '';
|
|
365
364
|
});
|
|
@@ -376,15 +375,14 @@ export const usePanzoom = (opts = {}) => {
|
|
|
376
375
|
// Add view transition name for CSS targeting
|
|
377
376
|
eventTarget.style.viewTransitionName = 'panzoom-element';
|
|
378
377
|
isExpanded = true;
|
|
379
|
-
const api = document.startViewTransition;
|
|
380
378
|
const run = () => {
|
|
381
379
|
if (!eventTarget)
|
|
382
380
|
return;
|
|
383
381
|
eventTarget.dataset.expanded = 'true';
|
|
384
382
|
zoomToFit();
|
|
385
383
|
};
|
|
386
|
-
if (typeof
|
|
387
|
-
|
|
384
|
+
if (typeof document.startViewTransition === 'function') {
|
|
385
|
+
document.startViewTransition(run).finished.finally(() => {
|
|
388
386
|
if (eventTarget)
|
|
389
387
|
eventTarget.style.viewTransitionName = '';
|
|
390
388
|
});
|