Sidharth VinodandClaude Opus 4.8 e6333e9d7f refactor: Convert history state to Svelte 5 runes + add svelte-check
Migrate the Timeline/Saved history state module to idiomatic Svelte 5
runes and wire up type-checking.

- Rename history.ts -> historyState.svelte.ts and replace the Svelte
  stores with $state-backed reactive values, removing the get() calls
  (the only remaining one reads the external inputStateStore). A small
  localStorage-backed `persisted()` helper keeps the same keys, so user
  data is preserved. Consumers read via the reactive `historyState`
  getter object instead of store auto-subscriptions.
- The gist loader now replaces the in-memory revisions in one call
  (setLoaderEntries) instead of appending, so loading a new gist no
  longer accumulates stale revisions.
- Add svelte-check: new `check` script, a "Type check" step in the
  unit-tests CI workflow, and skipLibCheck so the check passes on the
  dependency .d.ts files. svelte-check reports 0 errors / 0 warnings.
- Add accessible labels to the History toggle and the per-item
  Restore/Delete buttons (a11y + testability).
- Unskip tests/history.spec.ts and rewrite it against the new UI:
  load-from-localStorage + restore, tab-highlight follows the mode,
  save/dedupe, auto-vs-manual isolation, and delete/clear. All pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 19:28:38 +05:30
2025-03-16 19:19:10 -07:00
2026-04-22 21:04:00 +05:30
2025-03-16 19:19:10 -07:00
2026-02-16 19:36:20 +05:30
2023-11-30 18:06:19 +00:00
2022-11-03 14:20:55 +05:30
2025-03-17 21:27:33 -07:00
2021-05-31 13:52:28 +05:30
2025-03-16 19:19:10 -07:00
2026-01-28 00:32:44 +05:30
2025-03-15 20:09:21 -07:00
2025-09-03 16:38:03 +05:30
2025-09-03 16:38:03 +05:30
2023-05-16 23:52:33 +05:30
2025-03-18 13:00:08 -07:00
2025-03-16 19:47:10 -07:00
2022-07-07 00:22:37 +05:30
2025-09-03 16:36:09 +05:30

Join our Discord! Netlify Status

Mermaid Live Editor

Edit, preview and share mermaid charts/diagrams.

Features

  • Edit and preview flowcharts, sequence diagrams, gantt diagrams in real time.
  • Save the result as a svg
  • Get a link to a viewer of the diagram so that you can share it with others.
  • Get a link to edit the diagram so that someone else can tweak it and send a new link back

Live demo

You can try out a live version.

Contributors are welcome!

If you want to speed up the progress for mermaid-live-editor, join the Discord channel and contact knsv.

Docker

Run published image

docker run --platform linux/amd64 --publish 8000:8080 ghcr.io/mermaid-js/mermaid-live-editor

The published docker image is built using our default environment variables. You cannot override them when running the image. If you need to customize them, you will need to build the image yourself.

To configure renderer URL

When building set the MERMAID_RENDERER_URL build argument to the rendering service. Example: Default ishttps://mermaid.ink. Set to empty string to disable PNG and SVG links under Actions

To configure Kroki Instance URL

When building set the MERMAID_KROKI_RENDERER_URL build argument to your Kroki instance. Default is https://kroki.io Set to empty string to disable Kroki link under Actions

To configure Analytics

When building set the MERMAID_ANALYTICS_URL build argument to your plausible instance, and MERMAID_DOMAIN to your domain.

Default is empty, disabling analytics.

When building set the MERMAID_IS_ENABLED_MERMAID_CHART_LINKS build argument to true

Default is empty, disabling button to save to Mermaid Chart and promotional banner.

To update the Security modal

The modal shown on clicking the security link assumes analytics, renderer, Kroki and Mermaid chart are enabled. You can update it by modifying Privacy.svelte if you wish.

Development

docker compose up --build

Then open http://localhost:3000

Building and running images locally

Build

docker build -t mermaid-js/mermaid-live-editor .

Run

docker run --detach --name mermaid-live-editor --publish 8080:8080 mermaid-js/mermaid-live-editor

Visit: http://localhost:8080

Stop

docker stop mermaid-live-editor

Setup

Below link will help you making a copy of the repository in your local system.

https://docs.github.com/en/get-started/quickstart/fork-a-repo

Requirements

  • Node.js current LTS version
  • pnpm package manager. Install with corepack enable pnpm

Development

pnpm install
pnpm dev -- --open

This app is created with Svelte Kit.

Release

When a PR is created targeting master, it will be built and deployed by Netlify. The URL will be indicated in a Comment in the PR.

Once the PR is merged, it will automatically be released.

S
Description
Edit, preview and share mermaid charts/diagrams.
Readme MIT
146 MiB
Languages
TypeScript 50%
Svelte 45.1%
JavaScript 2.3%
CSS 1.5%
HTML 0.4%
Other 0.7%