kopia lustrzana https://github.com/Tldraw/Tldraw
f2d8fae6ea
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] |
||
---|---|---|
.. | ||
__snapshots__ | ||
alignShapes.test.tsx | ||
allShapesCommonBounds.test.ts | ||
animateShapes.test.ts | ||
animateToShape.test.ts | ||
animationSpeed.test.ts | ||
blur.test.ts | ||
cancel.test.ts | ||
centerOnPoint.test.ts | ||
clipboard.test.ts | ||
complete.test.ts | ||
createPage.test.ts | ||
createShapes.test.ts | ||
deletePage.test.ts | ||
deleteShapes.test.ts | ||
distributeShapes.test.ts | ||
duplicatePage.test.ts | ||
flipShapes.test.ts | ||
getContent.test.ts | ||
getSvg.test.ts | ||
groupShapes.test.ts | ||
guide.md | ||
interrupt.test.ts | ||
lockShapes.test.ts | ||
moveShapesToPage.test.ts | ||
nudge.test.ts | ||
packShapes.test.ts | ||
pageToScreen.test.ts | ||
pan.test.ts | ||
paste.test.ts | ||
pinch.test.ts | ||
putContent.test.ts | ||
renderingShapes.test.tsx | ||
reorderShapes.test.ts | ||
reparentShapesById.test.ts | ||
resetZoom.test.ts | ||
resizeShape.test.ts | ||
rotateShapes.test.ts | ||
screenToPage.test.ts | ||
setAppState.test.ts | ||
setBrush.test.ts | ||
setCurrentPage.test.ts | ||
setPageState.test.ts | ||
setSelectedIds.test.ts | ||
setSelectedTool.test.ts | ||
setSettings.test.ts | ||
setStyle.test.ts | ||
stackShapes.test.ts | ||
stretch.test.tsx | ||
ungroup.test.ts | ||
updateShapes.test.ts | ||
updateViewportPageBounds.test.ts | ||
zoomIn.test.ts | ||
zoomOut.test.ts | ||
zoomToBounds.test.ts | ||
zoomToFit.test.ts | ||
zoomToSelection.test.ts |