Tldraw/apps/examples/src
alex f2d8fae6ea
hoist opacity out of props (#1526)
This change hoists opacity out of props and changes it to a number
instead of an enum.

The change to a number is to make tldraw more flexible for library
consumers who might want more expressivity with opacity than our 5
possible values allow. the tldraw editor will now happily respect any
opacity between 0 and 1. The limit to our supported values is enforced
only in the UI. I think this is limited enough that it's a reasonable
tradeoff between in-app simplicity and giving external developers the
flexibility they need.

There's a new `opacityForNextShape` property on the instance. This works
exactly the same way as propsForNextShape does, except... it's just for
opacity. With this, there should be no user-facing changes to how
opacity works in tldraw. There are also new `opacity`/`setOpacity` APIs
in the editor that work with it/selections similar to how props do.

@ds300 do you mind reviewing the migrations here?

### Change Type

- [x] `major` — Breaking Change

### Test Plan

- [x] Unit Tests
- [ ] Webdriver tests

### Release Notes

[internal only for now]
2023-06-06 16:15:12 +00:00
..
1-basic Independent instance state persistence (#1493) 2023-06-05 14:11:07 +00:00
2-api tlschema cleanup (#1509) 2023-06-03 20:46:53 +00:00
3-custom-config hoist opacity out of props (#1526) 2023-06-06 16:15:12 +00:00
4-custom-ui rename app to editor (#1503) 2023-06-02 15:21:45 +00:00
5-exploded [refactor] User-facing APIs (#1478) 2023-06-01 15:47:34 +00:00
6-scroll remove svg layer, html all the things, rs to tl (#1227) 2023-05-05 14:14:42 +00:00
7-multiple [refactor] User-facing APIs (#1478) 2023-06-01 15:47:34 +00:00
8-error-boundary Renaming types, shape utils, tools (#1513) 2023-06-04 10:38:53 +00:00
9-hide-ui remove svg layer, html all the things, rs to tl (#1227) 2023-05-05 14:14:42 +00:00
10-custom-components remove svg layer, html all the things, rs to tl (#1227) 2023-05-05 14:14:42 +00:00
11-user-presence Independent instance state persistence (#1493) 2023-06-05 14:11:07 +00:00
12-ui-events [improvement] rename onEvent to onUiEvent (#1358) 2023-05-12 09:05:56 +00:00
13-store-events rename app to editor (#1503) 2023-06-02 15:21:45 +00:00
14-persistence Independent instance state persistence (#1493) 2023-06-05 14:11:07 +00:00
15-custom-zones Add support for project names (#1340) 2023-06-01 18:46:26 +00:00
end-to-end rename app to editor (#1503) 2023-06-02 15:21:45 +00:00
icons New vite-based examples app (#1226) 2023-05-05 13:10:36 +00:00
index.html New vite-based examples app (#1226) 2023-05-05 13:10:36 +00:00
index.tsx Add support for project names (#1340) 2023-06-01 18:46:26 +00:00
styles.css New vite-based examples app (#1226) 2023-05-05 13:10:36 +00:00