Tldraw/packages/editor/src/lib/test/tools
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
..
__snapshots__ hoist opacity out of props (#1526) 2023-06-06 16:15:12 +00:00
TLArrowTool.test.ts tlschema cleanup (#1509) 2023-06-03 20:46:53 +00:00
TLBookmarkUtil.test.ts rename app folder to editor (#1528) 2023-06-06 16:01:54 +00:00
TLDrawTool.test.ts rename app folder to editor (#1528) 2023-06-06 16:01:54 +00:00
TLEraserTool.test.ts tlschema cleanup (#1509) 2023-06-03 20:46:53 +00:00
TLFrameTool.test.ts rename app folder to editor (#1528) 2023-06-06 16:01:54 +00:00
TLGeoTool.test.ts rename app folder to editor (#1528) 2023-06-06 16:01:54 +00:00
TLHandTool.test.ts rename app folder to editor (#1528) 2023-06-06 16:01:54 +00:00
TLLineTool.test.ts rename app folder to editor (#1528) 2023-06-06 16:01:54 +00:00
TLNoteTool.test.ts rename app folder to editor (#1528) 2023-06-06 16:01:54 +00:00
TLSelectTool.test.ts hoist opacity out of props (#1526) 2023-06-06 16:15:12 +00:00
TLTextTool.test.ts rename app folder to editor (#1528) 2023-06-06 16:01:54 +00:00
TLZoomTool.test.ts tlschema cleanup (#1509) 2023-06-03 20:46:53 +00:00
cropping.test.ts hoist opacity out of props (#1526) 2023-06-06 16:15:12 +00:00
drawing.test.ts rename app to editor (#1503) 2023-06-02 15:21:45 +00:00
frames.test.ts rename app folder to editor (#1528) 2023-06-06 16:01:54 +00:00
groups.test.ts hoist opacity out of props (#1526) 2023-06-06 16:15:12 +00:00
panning.test.ts rename app to editor (#1503) 2023-06-02 15:21:45 +00:00
resizing.test.ts rename app folder to editor (#1528) 2023-06-06 16:01:54 +00:00
rotating.test.ts tlschema cleanup (#1509) 2023-06-03 20:46:53 +00:00
select.test.tsx rename app folder to editor (#1528) 2023-06-06 16:01:54 +00:00
styles.test.ts tlschema cleanup (#1509) 2023-06-03 20:46:53 +00:00
text.test.ts tlschema cleanup (#1509) 2023-06-03 20:46:53 +00:00
translating.test.ts rename app folder to editor (#1528) 2023-06-06 16:01:54 +00:00