tldraw/packages
Steve Ruiz 39dbbca90e
Camera APIs (#1786)
This PR updates camera APIs:
- removes animateCamera
- adds animation support to setCamera
- makes camera commands accept points rather than an x/y
  - `centerOnPoint`
  - `pageToScreen`
  - `screenToPoint`
  - `pan`
  - `setCamera`
- makes `zoomToBounds` accept a `Box2d` rather than x/y/w/h
- removes the `getBoundingClientRects` call from `getPointerInfo`
- removes the resize observer from `useScreenBounds`, uses an interval
instead when focused

A big (unexpected) improvement here is that `getBoundingClientRects` was
being called on every pointer move. This is a relatively expensive call
(it forces reflow) which could impact interactions. It's now called at
most once per second, and we could probably improve on that too if we
needed by only updating while in the select state.

### Change Type

- [x] `major` — Breaking change

### Test Plan

1. Try the multiple editors example after scrolling / resizing
2. Use the camera commands (zoom in, etc)

- [x] Unit Tests

### Release Notes

- (editor) improve camera commands
2023-08-02 15:56:33 +00:00
..
assets [feature] Add val town embed (#1777) 2023-07-31 15:44:33 +00:00
editor Camera APIs (#1786) 2023-08-02 15:56:33 +00:00
state Revert "Editor commands API / effects" (#1783) 2023-08-01 17:03:31 +00:00
store SideEffectManager (#1785) 2023-08-02 11:05:14 +00:00
tldraw Camera APIs (#1786) 2023-08-02 15:56:33 +00:00
tlschema Revert "Editor commands API / effects" (#1783) 2023-08-01 17:03:31 +00:00
utils move some utils into tldraw/utils (#1750) 2023-07-19 10:50:40 +00:00
validate Add shapes to exports (#1776) 2023-07-28 16:08:59 +00:00