tldraw/packages
Mitja Bezenšek d738c28c19
Add support for locking shapes (#1447)
Add support for locking shapes. 

How it works right now:
- You can lock / unlock shapes from the context menu.
- You can also lock shapes with `⇧⌘L` keyboard shortcut.
- You cannot select locked shapes: clicking on the shape, double click
to edit, select all, brush select,... should not work.
- You cannot change props of locked shapes.
- You cannot delete locked shapes.
- If a shape is grouped or within the frame the same rules apply.
- If you delete a group, that contains locked shape it will also delete
those shapes. This seems to be what other apps use as well.

Solves #1445 

### Change Type

- [x] `minor` — New Feature

### Test Plan

1. Insert a shape
2. Right click on it and lock it.
3. Test that you cannot select it, change its properties, delete it.
4. Do the same with locked groups.
5. Do the same with locked frames.

- [x] Unit Tests
- [ ] Webdriver tests

### Release Notes

- Add support for locking shapes.

---------

Co-authored-by: Steve Ruiz <steveruizok@gmail.com>
2023-06-01 18:13:38 +00:00
..
assets [3/3] Highlighter styling (#1490) 2023-06-01 15:34:59 +00:00
editor Add support for locking shapes (#1447) 2023-06-01 18:13:38 +00:00
file-format [refactor] User-facing APIs (#1478) 2023-06-01 15:47:34 +00:00
indices [chore] remove benchmark (#1489) 2023-05-30 15:43:28 +00:00
polyfills avoid lazy race conditions (#1364) 2023-05-12 15:41:40 +00:00
primitives replace console.log with nicelog (#1496) 2023-06-01 18:01:49 +00:00
tldraw [refactor] User-facing APIs (#1478) 2023-06-01 15:47:34 +00:00
tlschema [refactor] User-facing APIs (#1478) 2023-06-01 15:47:34 +00:00
tlstore [feature] Easier store persistence API + persistence example (#1480) 2023-05-30 15:22:49 +00:00
tlvalidate avoid lazy race conditions (#1364) 2023-05-12 15:41:40 +00:00
ui Add support for locking shapes (#1447) 2023-06-01 18:13:38 +00:00
utils Stricter ID types (#1439) 2023-05-24 11:25:41 +00:00