v4.2.0
This month's release includes many bug fixes and small API additions, along with a major version bump of our TipTap rich text editor.
What's new
💥 TipTap v3 (#5717)
We've upgraded TipTap from v2 to v3. If you've done any customization to our standard TipTap kit, please refer to TipTap's guide How to upgrade Tiptap v2 to v3 for breaking changes you might experience.
Migration guide
Starting in v4.2, tldraw bundles TipTap v3 as a transitive dependency. If your project pins @tiptap/* v2 packages directly, upgrade them to v3 before trying to fix any code-level errors — leaving v2 in place produces a dual install that surfaces as confusing type errors.
Dual-install symptom. Deeply-nested errors like "Property 'getCharacterCount' is missing in type 'Editor' but required in type 'Editor'", with the two Editor types resolving to different paths (one under node_modules/@tiptap/core, the other under node_modules/@tldraw/editor/node_modules/@tiptap/core), are not API changes — they are the v2/v3 dual install. The Editor classes are structurally similar but nominally different. Finishing the v3 upgrade collapses the duplicate and these errors disappear without code changes.
Code-level changes that affect tldraw users:
-
Default → named exports. Several extensions changed from default to named exports:
// Before import StarterKit from '@tiptap/starter-kit' // After import { StarterKit } from '@tiptap/starter-kit' -
TextStyle→TextStyleKit, andFontFamilymoved. TheFontFamilyextension is no longer in@tiptap/extension-font-family; it's part ofTextStyleKitin@tiptap/extension-text-style. ThesetFontFamilyandsetFontSizechain commands only exist onTextStyleKit, not on bareTextStyle. -
Transaction handler types. Inline parameter type annotations on TipTap event handlers no longer work. Import the proper event-map type:
import { EditorEvents } from '@tiptap/core' // ... onTransaction: (props: EditorEvents['transaction']) => { /* ... */ } -
Custom chained commands still register via
declare module '@tiptap/core'augmentation in v3 — the augmentation target is the same.
API changes
- Add
Editor.setTool/Editor.removeToolfor dynamically altering the editor's tool state chart. (#6909) (#7134) - Allow using custom socket implementations with
useSyncvia a newconnectoption. (#6859) (contributed by @Digital39999) - Add support for nested property queries in the store. (#6981)
- Add
createBookmarkFromUrlhelper for easier bookmark shape creation. (#6894) - Add custom reference points for handle angle snapping. (#6987) (contributed by @naaa760)
- Add new "lined-fill" style, accessible via Option+Shift+F. (#7034)
- Add
onInteractionEndcallback option. (#6919) - Add
allowReferreroption for window opening functions. (#7004) - Remove defunct Excalidraw embed definition. (#6897)
Improvements
- Use window.prompt for renaming frames on mobile. (#6838)
- Optimize string append operations in sync protocol. (#7007) (contributed by @quasor)
Bug fixes
- Fix Replit embed URL handling. (#6892)
- Fix accessibility issue that caused a misleading warning in the console. (#6904)
- Fix convert-to-bookmark action. (#6894)
- Fix dropdown menu pointer handling. (#7021)
- Fix iOS Safari image uploads. (#7037)
- Fix Alt+Tab conflict on Windows. (#7005)
- Fix text focus issues. (#7043)
- Fix
TldrawEditorusability withoutTldrawUiContextProvider. (#7053) - Fix cross-realm clipboard functionality. (#7026)
- Fix iOS ink rendering via coalesced events. (#6917)
- Fix menu-open dragging behavior. (#6918)
Patch releases
v4.2.1
- Fix CommonJS/cjs builds that were broken in v4.2.0. (#7282)