Host-integrated Mermaid download and fullscreen hooks
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 65/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Tranquilo
- Stack tecnológico
- typescript
- Área
- frontend
Línea de trabajo
Comienza localizando la Mermaid controls configuration y los handlers existentes de download y fullscreen. Rastrea sus payloads y su comportamiento predeterminado; después, añade los callbacks opcionales para que un resultado gestionado omita la acción predeterminada correspondiente, mientras que la ausencia de un callback conserve el comportamiento actual; verifica los payloads de los callbacks y los defaults sin cambios con las pruebas relevantes de Mermaid.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem Statement
When Streamdown is embedded inside a desktop webview or an iframe sidebar panel, the Mermaid download and fullscreen actions are confined to the web context:
- Download is sandboxed to the browser/webview and cannot invoke host-native save dialogs or write files to user-selected locations.
- Fullscreen is limited to the iframe/panel container, not a true host-level expanded view.
This blocks good UX for desktop integrations where the host application needs to handle these actions natively.
Proposed Solution
Add optional callback hooks to the Mermaid controls configuration:
onMermaidDownload(payload)— called before the default download. Receives the generatedBlob, suggested filename, mimeType, chart source, and config. If the callback returns{ handled: true }, the default browser download is skipped.onMermaidFullscreen(payload)— called before the default fullscreen. Receives chart source and config. If the callback returns{ handled: true }, the default fullscreen behavior is skipped.
If no callbacks are provided, existing behavior is unchanged.
Alternatives Considered
- Custom renderer plugin: Using the existing
customRendererAPI to replace the entire Mermaid block. This is too heavy-handed — it requires reimplementing the full Mermaid UI just to intercept two actions.
Use Case
import { Streamdown } from "streamdown";
<Streamdown
mermaid={{
config: { theme: "dark" },
onDownload: async ({ blob, filename, mimeType, chart, config }) => {
// Forward blob to desktop host via postMessage / bridge API
window.parent.postMessage(
{ type: "save-file", blob, filename, mimeType },
"*"
);
return { handled: true }; // skip default browser download
},
onFullscreen: ({ chart, config }) => {
// Ask host to open chart in a dedicated large window
window.parent.postMessage(
{ type: "open-fullscreen", chart, config },
"*"
);
return { handled: true }; // skip default in-panel fullscreen
},
}}
>
{markdown}
</Streamdown>;
Priority
Important
Contribution
- I am willing to help implement this feature
Additional Context
No response
- Lenguaje dominante
- TypeScript
- Estrellas
- 5.7k
- Forks
- 307
- Merge medio
- 1 d 22 h
- PR fusionados (30 d)
- 22
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de vercel/streamdown
-
`mode="static"` parses the whole document twice on mount (since the caret host in 2.7)Posiblemente ocupada @akhil9tiet la tomó hace 1 día. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
vercel/streamdown#673 · 3 comentarios · 2 reacciones ·
Los mantenedores suelen responder en 1 día
-
remend: unclosed `$$` in a table cell is closed on a new line when an earlier line has mathPosiblemente ocupada @orinnz la tomó hace 13 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
vercel/streamdown#652 ·
Los mantenedores suelen responder en 1 día
-
`data-*` and `aria-*` props passed to `<Streamdown>` are never set on its root elementPosiblemente ocupada @xyrolle la tomó hoy. Abierto
Dificultad 3/5 Medio día Aptitud para principiantes 55/100
vercel/streamdown#675 ·
Los mantenedores suelen responder en 1 día
-
CJK autolink boundary handling keeps `**` in the URL when a bold URL is followed by CJK punctuationPosiblemente ocupada @mikemikimike la tomó hace 1 día. Abiertobug
Dificultad 3/5 Medio día Aptitud para principiantes 50/100
vercel/streamdown#672 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
vercel/streamdown#669 ·
Los mantenedores suelen responder en 1 día
Todos los issues de vercel/streamdown
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
melgarafael/DeskcommCRM#3000 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
callstackincubator/simlock#639 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
aws/agentcore-cli#2606 ·
Los mantenedores suelen responder en 1 día
-
🐛 [BUG] - FeatureComparisonTable text-only cells are top-aligned while icon cells are centeredAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 7 días
-
ai-driven-qa bug Cosmetic
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 1 día