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 CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![npm version](https://badge.fury.io/js/svelte-streamdown.svg)](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
@@ -33,7 +33,7 @@
33
33
  import { highlighter } from './hightlighter.svelte.js';
34
34
 
35
35
  let {
36
- content,
36
+ content = '',
37
37
  class: className,
38
38
  shikiTheme,
39
39
  shikiPreloadThemes,
@@ -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 api === 'function') {
362
- api(run).finished.finally(() => {
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 api === 'function') {
387
- api(run).finished.finally(() => {
384
+ if (typeof document.startViewTransition === 'function') {
385
+ document.startViewTransition(run).finished.finally(() => {
388
386
  if (eventTarget)
389
387
  eventTarget.style.viewTransitionName = '';
390
388
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svelte-streamdown",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run prepack",