tldraw/packages
Steve Ruiz f4ceb581dd
ShapeUtil.getInterpolatedProps (#4162)
This PR adds a `getInterpolatedProps` method to the `ShapeUtil` class.
It is used in `Editor.animateShapes` to allow shapes to lerp values that
the editor doesn't specifically know about.

![Kapture 2024-07-13 at 09 12
48](https://github.com/user-attachments/assets/f9711aa0-278b-4a26-84d3-4b6bbe610b81)

### Change type

- [x] `feature`
- [x] `api`

### Test plan

1. Animate a shape's props.

```ts

const shape = editor.getOnlySelectedShape()

setInterval(() => {
	editor.animateShape(
		{
			...shape,
			x: Math.random() * 500,
			y: Math.random() * 200,
			props: { w: 200 + Math.random() * 200, h: 200 + Math.random() * 200 },
		},
		{ animation: { duration: 500 } }
	)
}, 1000)
```

- [ ] Unit tests (Could be done!)

### Release notes

- SDK: adds `ShapeUtil.getInterpolatedProps` so that shapes can better
participate in animations.

---------

Co-authored-by: alex <alex@dytry.ch>
2024-07-15 14:04:22 +00:00
..
assets serve icons via a single merged .svg file (#4150) 2024-07-15 11:03:11 +00:00
dotcom-shared license: show on dotcom dev mode (#4158) 2024-07-12 16:53:31 +00:00
editor ShapeUtil.getInterpolatedProps (#4162) 2024-07-15 14:04:22 +00:00
namespaced-tldraw Update CHANGELOG.md [skip ci] 2024-06-25 13:27:57 +00:00
state Split @tldraw/state into @tldraw/state and @tldraw/state-react (#4170) 2024-07-15 11:18:59 +00:00
state-react Split @tldraw/state into @tldraw/state and @tldraw/state-react (#4170) 2024-07-15 11:18:59 +00:00
store Update CHANGELOG.md [skip ci] 2024-06-25 13:27:57 +00:00
sync [bemo] allow special chars in roomId (#4153) 2024-07-12 14:01:34 +00:00
sync-core [5/5] Move bemo from dotcom to examples (#4135) 2024-07-12 10:36:31 +00:00
tldraw sdk: wires up tldraw to have licensing mechanisms (#4021) 2024-07-11 11:49:18 +00:00
tlschema [3/5] Automatically enable multiplayer UI when using demo sync (#4119) 2024-07-10 15:46:09 +00:00
utils Initial bemo worker setup (#4017) 2024-07-01 11:35:23 +00:00
validate Demo server bookmark unfurl endpoint (#4062) 2024-07-03 10:48:34 +00:00
worker-shared introduce images.tldraw.xyz image optimisation worker (#4069) 2024-07-08 16:25:53 +00:00