Back to Tldraw

Next release

apps/docs/content/releases/next.mdx

5.3.13.6 KB
Original Source

This release adds a center operation to Editor.alignShapes, iterateGraphemes to @tldraw/utils, and two new reactive methods on AtomMap. It also deprecates useViewportHeight and fixes a batch of crashes and interaction bugs across dialogs, sync reconnection, undo, and keyboard shortcut tooltips.

API changes

  • 🔜 useViewportHeight() is deprecated. Read window.visualViewport directly instead. The hook returns only the visible viewport's bottom edge, and keeping a panel clear of the software keyboard generally needs the whole visible rectangle. (#9826)
  • Add 'center' as an Editor.alignShapes operation. It applies the existing 'center-horizontal' and 'center-vertical' operations together, so shapes center on both axes in one command. (#9074)
  • Add getOrInsert(key, defaultValue) and getOrInsertComputed(key, callback) to AtomMap, matching the Map methods added in newer JavaScript runtimes. Both are reactive, and the callback only runs when the key is absent. (#9752)
  • Add iterateGraphemes(str) to @tldraw/utils. It iterates a string's grapheme clusters, using Intl.Segmenter when it's available and falling back to code-point iteration when it isn't. (#9896)

Improvements

  • Reduce per-pointer-event allocations in Group2d and Editor hit-testing. (#8600)

Bug fixes

  • Fix the editor failing to load on older browsers that lack Intl.Segmenter, such as Firefox before 125. (#9896)
  • Fix a crash when computing a frame's geometry if its heading text couldn't be measured yet. (#9496)
  • Fix undo after a cut also reverting the change made before it. (#9920)
  • Fix modifier keys (Shift, Alt, Ctrl, Cmd) briefly being treated as held at the start of a new click or drag right after being released, which could momentarily affect snapping and other modifier-dependent behavior. (#9523)
  • Fix Flatten to image producing different groupings depending on selection order, and not merging clusters that were only connected through a bridging shape. (#8661)
  • Fix pasted links showing a broken preview image when the linked page has no Open Graph image. (#9909)
  • Fix closing a stacked dialog by touch also closing the dialog beneath it. (#10002)
  • Fix wheel event normalization passing through non-finite delta values. (#9586)
  • Fix the counterclockwise rotation tooltip not showing its comma key. (#9772)
  • Fix the spacing around the cursor chat item in the context menu. (#9921)
  • Fix the people menu's collaborator rows not lining up with your own row above them: the follow icon sat too close to the right edge, and collaborator names sat slightly left of your own. (#9900)
  • Fix the comment thread popover briefly rendering with a doubled shadow the first time a thread is opened. (#9886)
  • Fix background tabs repeatedly dropping and re-establishing their sync connection when the browser throttles timers. (#9964)