Skip to content
This repository was archived by the owner on Nov 13, 2026. It is now read-only.

Releases

v4.0.1

Choose a tag to compare

@craftzdog craftzdog released this 10 Nov 02:51
aa2997e

Features

  • New Center Diagrams setting in Preferences → Plugins → mermaid places diagrams in the middle of their code block instead of on the left. It's off by default and applies to diagrams already on screen.

Fixes

  • The dot grid behind a diagram now fills its code block up to the border, and a zoomed diagram pans right up to the edge. The full-screen view does the same.

Notes

  • Bundles @inkdropapp/mermaid 1.0.1.
  • Theme authors who pad code blocks differently set --mermaid-card-padding (default 16px) rather than the pre's padding, which diagrams replace.

@inkdropapp/mermaid@1.0.1

Choose a tag to compare

@craftzdog craftzdog released this 10 Nov 02:51
90cb786

Features

  • New center prop: places the drawing in the middle of its canvas instead of at the left edge. A fill diagram is always centred.
  • New --mermaid-diagram-inset custom property: the room between the canvas edge and the drawing. The dot grid and a zoomed drawing reach the canvas edge, and the toolbar moves in by the same amount. Full-screen shells set it instead of padding themselves.
  • Themes can set --mermaid-card-padding (default 16px, one to four lengths) to change the inset inside a preview code block.

Fixes

  • In a preview code block, the card's padding moves onto the canvas, so the dot grid fills the card up to its border instead of stopping 16px short. Print keeps the card's own padding.
  • A fill diagram fits inside the canvas padding, and a detached container is left alone.

Docs

  • The README documents Pele, math, the zoom behaviour, center, --mermaid-diagram-inset and --mermaid-card-padding.

Other

  • check:styles also checks the canvas layout: card and theme padding, print, center, zoom and pan, the toolbar position and full-screen fit.

Notes

  • The diagram SVG is now display: block, so each inline diagram is a few pixels shorter: the line gap under an inline SVG is gone.

v4.0.0

Choose a tag to compare

@craftzdog craftzdog released this 23 Oct 06:54

Features

  • Diagrams are drawn by Pele instead of Mermaid: faster, and the plugin's diagram code shrinks from 5.16 MB (1.43 MB gzipped) to 705 kB (254 kB gzipped).
  • $$...$$ math in labels is typeset with KaTeX, loaded only when a diagram contains math.
  • Zoom with Ctrl/Cmd + scroll or pinch, and drag to pan while zoomed. Inline, only diagrams shrunk to fit are zoomable; full screen zooms any diagram.
  • Full screen fits the diagram in both axes, keeps your zoom when the window resizes, and the dot grid follows the diagram.
  • Errors show in place, over the last good drawing while you edit.
  • inkdrop:// note links work in diagrams.

Notes

  • Bundles @inkdropapp/mermaid 1.0.0 and Pele 1.9.0.
  • Layout and styling differ somewhat from Mermaid's.
  • Text can't be selected while zoomed in, and the cursor shows an arrow while dragging. Both come from Pele.

@inkdrop/mermaid@1.0.0

Choose a tag to compare

@craftzdog craftzdog released this 23 Oct 06:54

Breaking changes

  • Diagrams are drawn by Pele instead of Mermaid and panzoom. mermaid and panzoom are no longer peer dependencies; pele 1.9.0 is a dependency.
  • usePanZoom and PanZoomControls are replaced by useZoomControls and ZoomControls.
  • buildInkdropThemeVariables is removed. The --mermaid-* tokens are mapped onto Pele's --pele-* variables in styles/mermaid.css and stay live across theme switches.

Features

  • Typeset $$...$$ math in labels with the new math option. createKatexMath(katex) builds a resolver from the host's KaTeX, rendering MathML in each platform's math font.
  • Inline, only diagrams shrunk to fit are zoomable, so diagrams that fit aren't tab stops and don't block page pinch-zoom on mobile.
  • In fill mode, the diagram fits both axes, keeps the user's zoom across resizes, and the dot grid pans and zooms with it.
  • Diagram errors show in place, over the last good drawing while editing.
  • inkdrop:// links work in diagrams.

Other

  • Add check:styles, which renders every diagram type in Chromium or WebKit and checks the themed styles.

Notes

  • Text can't be selected while zoomed in, and the cursor shows an arrow while dragging. Both come from Pele.

v3.1.0

Choose a tag to compare

@craftzdog craftzdog released this 16 Oct 06:39

Features

  • Upgrade to Mermaid 12. Flowchart, state, class, sequence, ER and other diagrams now use Mermaid's new neo look, and ELK is bundled as the default layout.
  • Node shadows follow the Inkdrop theme through the new --mermaid-node-shadow variable, in light, dark and print.
  • Sequence diagram actors use the themed shadow too, so it no longer disappears on light themes.
  • Theme the new use case (usecase-beta) and agentflow (agentflow-beta) diagrams.

Fixes

  • Stop diagrams from rendering twice on mount.
  • Keep the diagram on screen while its source is edited.
  • Give each render a fresh id so the diagram never blanks.
  • Resolve theme variables against the diagram's own theme scope.

Refactoring

  • Split the rendering core out into @inkdropapp/mermaid (now 0.2.0).

Docs

  • Add a package README and fix the plugin manifest.

Other

  • Bump dev dependencies and tidy lint errors.
  • Point repository URLs at inkdropapp/mermaid.

Notes

  • The shadow and use case colours need the new variables from @inkdropapp/css 0.10.1 or later. Without them, nodes show no shadow.
  • Mermaid 12 requires ES2024 (Safari 17.4 / iOS 17.4).
  • The plugin's Mermaid bundle grows from about 3.4 MB to 5.2 MB because ELK is now included.

@inkdrop/mermaid@0.1.5

Choose a tag to compare

@craftzdog craftzdog released this 11 Sep 02:38

Other

  • Fix lint errors surfaced by the updated oxlint (impure Math.random call during render, and host components re-created on every render)
  • Upgrade typescript to v7, mermaid, @inkdropapp/types, @types/node, @types/react, playwright, tsdown, oxfmt, and oxlint

@inkdrop/mermaid@0.1.4

Choose a tag to compare

@craftzdog craftzdog released this 02 Aug 02:17

Fixes

  • Resolve --mermaid-* theme variables against the diagram's own theme scope instead of always falling back to :root. A host can scope a theme's variables to a class partway down the tree (e.g. a themed section); the diagram now follows that scope.

@inkdrop/mermaid@0.1.1

Choose a tag to compare

@craftzdog craftzdog released this 26 Jul 06:17

First tagged release of @inkdropapp/mermaid, the host-agnostic rendering package split out of the Inkdrop plugin. Covers everything since v3.0.1.

Fixes

  • Diagrams no longer render twice on mount. The theme effect guarded its first run with a one-shot ref, which assumed the effect body runs exactly once per mount. React makes no such guarantee — it re-runs effects without remounting under StrictMode, and whenever a Suspense subtree is hidden and revealed, which is what happens when a host loads the component through React.lazy. The second run scheduled a real timer and forced a spurious re-render roughly 400ms after the diagram appeared. This affected every consumer, including those that never pass themeRevision.
  • Fixed an invalid styleSheets entry that left the plugin's package.json unparseable.

Refactoring

  • Split the rendering core into @inkdropapp/mermaid and converted the repository into a pnpm workspace (packages/mermaid + packages/plugin). The package imports no Inkdrop API — the button component, print mode and theme signal all arrive as props — so the website demo and the mobile web editor can share one implementation instead of each carrying its own port.
  • The full-screen viewer's stage collapsed into the shared <MermaidDiagram fill />, with the lazy boundary kept in the host so Mermaid stays out of the eager entry chunk.
  • Pan/zoom now initialises via ResizeObserver, which fires on any real size change (for example a pane leaving display: none).

Docs

  • Added a README for @inkdropapp/mermaid covering the API, the two required stylesheets and the peer dependencies.
  • Added a repository-root README describing the workspace layout, development and publishing.

Other

  • Repository URLs now point at inkdropapp/mermaid.

v3.0.1

Choose a tag to compare

@craftzdog craftzdog released this 06 Jul 01:31

Fixes

  • Allow text selection (modal)
  • Fix wrong background (modal)

v3.0.0

Choose a tag to compare

@craftzdog craftzdog released this 02 Jul 08:00

Features

  • Add full-screen diagram viewer
  • Theme diagrams via Inkdrop CSS variables (#34)
  • Add dot-grid background behind diagrams
  • Add pan/zoom toolbar for rendered diagrams

Fixes

  • Use useLocalConfigValue for core.theme observation
  • Use hand cursor and support ctrl/cmd zoom-out on double-click (pan/zoom)
  • Re-render diagrams when the app theme changes
  • Normalize color(srgb) probe output for khroma (theme)
  • Hide scrollbar (style)
  • Allow selecting text when holding ctrl/cmd (pan/zoom)
  • Use CSS variables (style)

Docs

  • Update README

Other

  • Narrow inkdrop engine range to ^6.0.0