Unmounting with a text editor open left its listeners on the window,
holding on to the app and its scene until one of them next fired.
The editor is now torn down with the app. Nothing is written: what was
typed is in the last change the app reported.
Co-authored-by: Márk Tolmács <14922478+mtolmacs@users.noreply.github.com>
Co-authored-by: sahargavriely <63425950+sahargavriely@users.noreply.github.com>
Co-authored-by: Márk Tolmács <14922478+mtolmacs@users.noreply.github.com>
Co-authored-by: sahargavriely <63425950+sahargavriely@users.noreply.github.com>
* feat(editor): keep editing text when the window loses focus
The text editor submitted on any blur, the window's included: switching
to another tab or app and back ended the edit.
- submit only when the focus moves elsewhere in the document
- until the user types, and while the window is away, the editor shows
the scene's text, so a change made in another tab or by a collaborator
is there to go on from
- the editor closes when its element is deleted or removed from outside
- collab: a text being edited takes newer remote copies. Its editor holds
the draft and writes it on top, so the clients end up on the same text
- excalidraw-app: the tab sync no longer ends a text edit
* fix(editor): keep the text editor open when the update that removed its element brings it back
The editor closes when its element is gone from the scene, deferred to
after the update. A reset followed by a load of the same scene removes
and restores the element in one go, and the deferred close then wrote the
draft over the restored text.
* Revert "feat(editor): show the side of an edited text that can be dragged to wrap it"
This reverts commit baf95e5ce (part of #12634): drawing the hovered
side of an auto-resizing text while it's edited adds too much visual
noise. The resize cursor on the side handle stays.
* fix(editor): keep editing a text unwrapped from its auto-resize toggle
Clicking the auto-resize toggle on the box of the text being edited
landed on the canvas, which the editor took for a press outside it and
submitted. The editor now handles the press, keeping the text edited.
* fix(editor): keep a rotated text's anchor in place when toggling auto-resize
The point a text's alignment pins was kept in the text's unrotated frame,
but a rotated text turns about the center of its box, which (un)wrapping
moves: on the canvas, the text shifted. Keep the anchor where it's drawn.
Pick one of several promos (presentations, MCP, comments, teams, voice chat, CLI) at random on load, each with its own icon and utm_content. The CLI promo links to its GitHub repo in a blue variant.
* feat(app): return 404 for unknown paths
- vercel: drop the framework preset's catch-all to index.html, keep a rewrite for /excalidraw-plus-export
- add a static 404 page (excluded from the SW precache and the sitemap)
- service worker: serve the cached app shell only for / and APP_ROUTES
- APP_ROUTES list + test that it matches the vercel.json rewrites
- remove the dead web share target (nothing handled POST /web-share-target)
- robots.txt: simplify to what it already meant (allow all)
* fix(app): let the 404 page scroll and shrink on short screens
* feat(app): add Excalidraw+, docs and CLI links to the 404 page
* feat(app): add MCP link to the 404 page
* feat(app): track 404 page views on excalidraw.com
* fix(editor): Enter/Esc only close the shape switch popup
Esc no longer also deselects, and Enter no longer enters text/line editing.
* feat(editor): pick the flowchart Alt+arrow target by a single distance score
Replace the in-line/linked/cone/past-edge tiers with one score per node
(forward + (k * sideways)² / forward), so the nearest node that looks next in
the pressed direction wins; links only break near-ties.
* fix(editor): keep restored z-indices on undo/redo unless taken
Undo/redo generated a new fractional index for every element it moved in
the z-order, even when the restored index was still valid. Later history
entries refer to the original indices, so undoing several z-order changes
in a row could restore a different stacking order.
* fix(editor): frame deselected elements within the selection on `w`
Wrapping the selection in a frame now also takes in deselected elements
that are inside the selection's bounds, or overlap them while reaching out
by no more than the frame's padding (the frame grows to fit them; a frame
around an image keeps the image's size). Groups go in whole.
The frame takes the place of its lowest child in the z-order instead of
going on top, so that it stays below the elements overlapping it.
* feat(editor): `w` keeps the containers it unbinds texts from
Unwrapping a labeled container with `w` now unbinds its text and keeps
both selected, as the "unbind text" action does. Only a container that
`w` itself wrapped a text in is removed, while the selection stands.
The next `w` puts the unbound texts back into their containers as they
sat in them.
* fix(editor): keep the text auto-resize toggle on the box while typing
The toggle was positioned from `appState.editingTextElement`, the element
as it was when editing started, so it stayed put as lines were added or
removed. Resolve the current element instead, for the hit test too.
* feat(editor): resize a text from its sides while editing it
Dragging the left or right side of the free text being edited sets the
width it wraps at, without leaving the editor (a mere click there still
submits). The edited text isn't reliably the selection, so the drag is
handled by the editor rather than the selection's transform handles —
with grid and object snapping, as when resizing on the canvas.
* feat(editor): let a typed or pasted text grow wider when zoomed out
Below 100% zoom, the width a text wraps at is TEXT_MAX_WRAP_WIDTH on
screen rather than in scene units, up to TEXT_MAX_WRAP_WIDTH_ZOOMED_OUT.
* feat(editor): toggle text auto-resizing with Alt+W
On the selected free texts (on if any of them wraps, else off) and on the
text being edited. Turning it off keeps the text's width, wrapping at it —
at the width a typed text stops growing at, if wider.
Zen mode (Alt+Z) now goes by the key's letter too where the layout gives
one, as on AZERTY both would otherwise claim the key labelled W.
* feat(editor): hint at Alt+W for a wrapped text and while editing a text
The hint for editing now also takes precedence over the one for a selected
text: a text just created is selected while it's edited.
* feat(editor): show the side of an edited text that can be dragged to wrap it
A text that doesn't wrap yet has no box showing its sides while it's
edited: the side under the pointer is now drawn (dashed, as the box of a
wrapped text), along with the resize cursor.
* fix(editor): no stale cursor or hidden transform handles around a text being edited
- the canvas kept the cursor of what was hovered before editing (the
selected text's move cursor, a resize handle's), which flashed once the
pointer left the editor: it's reset as editing starts
- a text just created is selected while it's edited, so its transform
handles, which aren't drawn then, still resized it (ending the edit)
* fix(editor): no gap or cursor flash between a text's editor and its side handles
- the side handles of the text being edited get a hit test of their own:
the selection's left the pixel at the text's right edge to neither the
editor nor the handle
- the canvas is given, from over the editor, the cursor of what the pointer
would leave the editor onto: the browser shows the canvas' cursor as it is
when the pointer gets there, and what the canvas then sets a frame later
* fix(editor): give a text made to keep its width a pixel to spare
A text exactly as wide as its longest line is on the verge of wrapping:
Chrome lays the editor's text out in 1/64px steps, rounding each run of it
up (a line being split into more runs as it's edited), so the line could
wrap in the editor alone.
* fix(editor): stop centered text lines jittering while typing
The text editor was placed by `left`/`top` and zoomed by a scale
transform. Browsers round a scaled element's layout offset to whole
pixels, so as a center- or right-aligned text grows (moving the editor
by fractions of a pixel) its other lines shifted by up to 1px per
keystroke at any zoom other than 100%. Place the editor by the
transform's translate instead, which is kept exact.
* fix(editor): stop the other lines' glyphs shimmering while typing
- Anchor the editor's transform at the text's alignment point (origin
0 0), so it doesn't move while typing; only the box's own anchor
(a whole or half px) changes.
- Give non-wrapping editors a whole-px width, so the browser's rounding
of each line's centering offset stays constant. Wrapping editors keep
their exact width, where the canvas wraps the text too.
- Grow the editor's box to its text when a font's glyphs overflow it,
so the browser doesn't scroll the text to reveal the caret on each
keystroke (which shifted the other lines).
* test(editor): update the text editor style snapshot for its new placement
* feat(editor): ui.disabled.minimap; zoom buttons without the minimap toggle
- `ui={{ disabled: { minimap: true } }}`: a new opt-out form of the `ui`
prop, the full default UI minus the controls listed. Removes the minimap
and every way to toggle it (footer button, Preferences item, command
palette and context menu entries), through the minimap action's predicate
- without the minimap toggle (removed by `ui.disabled.minimap`, or the
reduced UI of `ui.enabled`), the zoom controls are the zoom out / zoom
level / zoom in buttons again instead of the zoom menu: their
PanelComponents, styles and zen-mode rules are restored from before #12605
- `isUIControlEnabled` handles both forms and is on AppClassProperties; the
props comparator compares either form generically
Claude Opus 5.5 (xhigh)
* docs(editor): changelog for the minimap, zoom menu and ui.disabled
Claude Opus 5.5 (xhigh)
* fix(editor): hide the zen-mode zoom buttons from keyboard focus
The −/+ buttons' own `visibility: visible` (.ToolIcon_type_button--show)
overrode their wrappers' `visibility: hidden` in zen mode, so Tab still
focused the invisible buttons. Hide the buttons too, at the end of the
wrappers' fade.
Claude Opus 5.5 (xhigh)
* feat(editor): add a toggleable minimap
- bottom-left above the canvas actions; toggled via the footer button,
Alt+M, the context menu, command palette and Preferences
(`appState.minimapEnabled`, browser-persisted)
- elements drawn as single-color blocks (polylines for lines/arrows/
freedraw, outlines for frames), rendered in a web worker on an
OffscreenCanvas with a main-thread fallback; the controller, renderer and
worker are lazy-loaded chunks
- drag the viewport (or press outside of it to center it), limited to one
viewport size past the content, with edge auto-pan; wheel zooms around
the viewport center
- locked viewports keep the minimap scale frozen while rubberbanding and
snapping back; `viewport.beginGesture()` holds the overscroll during the
drag
- the viewport rect turns opaque when small; the styles panel stays clear
of the minimap (and the tablet pen-mode button); unavailable in editors
shorter than 500px
- theme class is now applied before state-change listeners run
- `Scene.onUpdate` unsubscribe no longer throws after the scene is destroyed
Claude Fable 5.2 + Claude Opus 5.5 (xhigh)
* feat(editor): zoom menu in place of the zoom buttons
- the zoom island holds the zoom level and the minimap toggle (sharp where
they meet); the -/+ buttons are gone
- clicking the zoom level opens a menu: zoom in/out, reset zoom, and the
three zoom-to-fit actions, each with its shortcut
- zoom level's pressed/focus rings are inset, so the toggle can't cover them
- smaller gap between the styles panel and the minimap
- zoom in/out/reset actions no longer render their own buttons
Claude Fable 5.2 + Claude Opus 5.5 (xhigh)
* feat(editor): zoom menu fit items, no minimap shortcut, announcement dot
- zoom menu: zoom in/out, then "Zoom to fit" (Shift+1), "Zoom to
selection" (Shift+2) and "Reset zoom" (Shift+0, which it already
accepted); "Zoom to fit selection" (Shift+3) is no longer listed
- minimap: drop the Alt+M shortcut (action, help dialog, tooltip, menus)
- TEMPORARY pulsing dot on the minimap toggle announcing the minimap,
until 2026-11-19, for editors that loaded with content; dismissed for
good once the minimap is opened
- "Show hints" preference renamed "Toolbar hints"
Claude Opus 5.5 (xhigh)
* chore(repo): remove the minimap scroll-lock demo button
The dev-only "Scroll lock demo" button and the commented-out initialState
in excalidraw-app were for testing the minimap against a locked viewport
and aren't meant to ship.
Claude Opus 5.5 (xhigh)
Vercel compiles redirect sources with strict path-to-regexp, so "/:path*"
matches "/foo" but not "/". The root kept serving the old Docusaurus page.
"/(.*)" matches the root as well.
Opus 5.5 (xhigh)
* docs(repo): redirect docs.excalidraw.com to plus.excalidraw.com/docs/sdk
The developer docs moved to the Excalidraw+ docs. Every old page redirects to its new location, and anything else redirects to the docs home.
* docs(repo): redirect the mermaid-to-excalidraw docs to their own section
The package's docs moved to plus.excalidraw.com/docs/mermaid-to-excalidraw, rewritten for v3.
* feat(editor): bump mermaid-to-excalidraw to 3.3.0 (Pele 1.13, stepped edges)
- mermaid-to-excalidraw 3.1.0 -> 3.3.0 (Pele 1.8.0 -> 1.13.0): flowchart
edges and state transitions are elbow arrows when the definition asks for
a stepped curve (`curve: "step"`, `linkStyle … interpolate step`); class
namespaces are drawn as boxes like subgraphs (3.2.0)
- Pele 1.13 reports syntax errors on the source line (counting front matter,
directives, comments and blank lines) and errors past the end on the last
line, so the TTD dialog no longer converts them: the conversion would shift
them twice
Claude Opus 5.5 (low)
* docs: link #12535 in the changelog
Claude Opus 5.5 (low)
* feat(editor): draw Mermaid flowchart and state edges as elbow arrows
Convert Mermaid diagrams (TTD dialog and paste) with `flowchart.curve:
"step"` (`MERMAID_TO_EXCALIDRAW_CONFIG`), which m2e 3.3 turns into elbow
arrows for flowchart edges and state transitions. A curve the definition
sets itself (front matter, `%%{init}%%`, `linkStyle … interpolate`) still
wins; class and ER diagrams are unaffected.
Claude Opus 5.5 (low)
* feat(editor): elbow arrows for Mermaid flowcharts only (mermaid-to-excalidraw 3.4.0)
mermaid-to-excalidraw 3.4.0 replaces `flowchart.curve` with `elbow`, per
diagram type. Use `elbow: { flowchart: true }`: state diagrams' elbow
transitions need more work in m2e, so they stay as before.
Claude Opus 5.5 (low)
* feat(editor): bump mermaid-to-excalidraw to 3.5.0 (Gantt, quadrant charts, timelines)
mermaid-to-excalidraw 3.5.0 converts Gantt charts, quadrant charts and
timelines to Excalidraw elements instead of an image. The Mermaid dialog's
description lists them (and State diagrams, missing before), its syntax
links built by one helper.
Claude Opus 5.5 (low)
* fix(editor): detect pasted Mermaid after comments and front matter
Pasted text was only taken for Mermaid when its diagram type came first,
or after a single one-line `%%{...}%%` directive. Skip everything Mermaid
allows before it: blank lines, `%%` comments, directives (also over
several lines) and front matter.
A directive doesn't run past the next `%%{`, so text with many unclosed
directives is checked in linear time (searching each to the end of the text
would be quadratic: ReDoS).
Claude Opus 5.5 (low)
* feat(editor): bump mermaid-to-excalidraw to 3.6.0 (diagram types loaded on first use)
mermaid-to-excalidraw 3.6.0 loads each diagram type's parser and converter
on first use: its main chunk is 20.3 KiB (brotli) instead of 35.8, plus
1.5–5.1 KiB for the type converted (a first flowchart: 28.5 KiB).
Claude Opus 5.5 (low)
* fix(editor): don't clip arrows to their frames
Arrows (and their labels) are no longer clipped to the frame they belong
to, so they can connect elements across and out of frames. They stay
members of their frame, so they're still moved, copied, deleted and
exported with it.
- Not clipped on the canvas or in SVG, and hit (click, hover, box and
lasso selection) outside their frame too.
- Exporting a frame includes other frames' arrows reaching into it, as it
does other non-children overlapping it.
- Moving a frame (dragging it, with the arrow keys or from the stats
panel) keeps its arrows bound to the elements that don't move with it,
instead of unbinding them. Their free points move with the frame, elbow
arrows are routed once per move and keep their fixed segments.
- mutateElement no longer ignores an elbow arrow's x/y update to 0.
Fixes#6749Fixes#7827
Claude Opus 5.5 (xhigh reasoning)
* docs(changelog): arrows aren't clipped to frames
Claude Opus 5.5 (xhigh reasoning)
* fix(editor): take arrows out of frames once neither of their ends is in them
An arrow belongs to its frame only while one of its ends is in it: bound to
an element in the frame, or, unbound, inside it. Checked when an arrow is
finished (drawn, or an end dragged), when a drag ends (the dragged arrows and
those bound to the dragged elements), and when a frame's children are
recomputed (resize, grouping). An arrow bound only to elements outside its
frame thus no longer gets cut, duplicated or exported with it.
Claude Opus 5.5 (xhigh reasoning)
* fix(editor): take arrows out of frames when nudged or moved from the stats panel
The arrow keys and the stats panel move arrows too, so check there as well
whether a moved arrow still has an end in its frame.
Claude Opus 5.5 (xhigh reasoning)