v3.3.0
Welcome to the 3.3.0 release of the tldraw sdk. This release includes a number of new features and bug fixes.
Special thanks to new contributors @nayounsang and @vladh!
Whats's new
tldraw sync updates
We've been working on tldraw sync to improve the developer experience and enable common use cases.
New 'readonly' mode
When adding a socket to a room, you can now specify whether the client should be in readonly mode.
room.handleNewSession({
sessionId,
socket,
isReadonly: !(await canUserEdit(userId, roomId)),
});
Users in readonly mode:
- Will see a reduced UI, to hide tools and actions they can't make use of.
- Will not be able to make changes to the document. This is now enforced by the server.
- Will still send presence updates (cursor position, name, etc) to the server which will be broadcast to other users.
New methods on TLSocketRoom
We've added a few new methods to the TLSocketRoom class:
closeSession
- for terminating or restarting a client's socket connection.getRecord
- for getting an individual record.getSessions
- for getting a list of the active sessions.
Breaking Changes
No breaking changes in this release 🎉
Improvements
- Allow wheel events to pass through certain user interface elements like toolbars, to enable scrolling and zooming even when your cursor is not directly over the canvas. (#4662)
- Allow holding
cmd
/ctrl
modifier keys to add multiple shapes to the selection. Previously onlyshift
worked. (#4570) - Allow the text tool to be locked (#4569) (#4632) (#4644)
- Improve draw shape rendering performance during zoom interactions. (#4647)
- Disable debug mode in development by default. (#4629)
Api Changes
- Adds an editor option to control the placement of quick action shortcuts (undo, redo, delete, etc). (#4666)
- Adds an
editor.getIsReadonly()
helper method. (#4673)
Bug fixes
- Fix icon button width (#4663)
- Fixed a bug where dropping images or other things on user interface elements would navigate away from the canvas (#4651)
- Work around a Safari performance bug affecting arrows at certain zoom levels. (#4636)
- Fix a bug that affected some geometry calculations for lines that start and end at the same point (#4650).
- Fix layer ordering issue with the watermark. (#4656)
- Fixed a signals transaction bug that was manifesting as
Error('cannot change atoms during reaction cycle')
(#4645) - Fix a bug where the watermark link would open twice (#4622)
- Fixed a bug where camera constraints were not upheld after switching pages or setting new camera constraints. (#4628)
- Fixes a bug where arrow labels could be edited in readonly mode. (#4673)
Authors
- @nayounsang
- David Sheldrick (@ds300)
- Mime Čuvalo (@mimecuvalo)
- Mitja Bezenšek (@MitjaBezensek)
- Steve Ruiz (@steveruizok)
- Vlad-Stefan Harbuz (@vladh)
Prev
v3.4.0Next
v3.2.0