tldraw/packages
alex e8bc114bf3
Styles API follow-ups (#1636)
tldraw-zero themed follow-ups to the styles API added in #1580.

- Removed style related helpers from `ShapeUtil`
- `editor.css` no longer includes the tldraw default color palette.
Instead, a global `DefaultColorPalette` is defined as part of the color
style. If developers wish to cusomise the colors, they can mutate that
global.
- `ShapeUtil.toSvg` no longer takes font/color. Instead, it takes an
"svg export context" that can be used to add `<defs>` to the exported
SVG element. Converting e.g. fonts to inlined data urls is now the
responsibility of the shapes that use them rather than the Editor.
- `usePattern` is not longer a core part of the editor. Instead,
`ShapeUtil` has a `getCanvasSvgDefs` method for returning react
components representing anything a shape needs included in `<defs>` for
the canvas.
- The shape-specific cleanup logic in `setStyle` has been deleted. It
turned out that none of that logic has been running anyway, and instead
the relevant logic lives in shape `onBeforeChange` callbacks already.

### Change Type
- [x] `minor` — New feature

### Test Plan


- [x] Unit Tests
- [x] End to end tests

### Release Notes
 --

---------

Co-authored-by: Steve Ruiz <steveruizok@gmail.com>
2023-06-24 13:46:04 +00:00
..
assets Revert "Update dependencies (#1613)" (#1617) 2023-06-19 09:49:44 +00:00
editor Styles API follow-ups (#1636) 2023-06-24 13:46:04 +00:00
file-format ShapeUtil refactor, Editor cleanup (#1611) 2023-06-19 14:01:18 +00:00
indices update lazyrepo 2023-06-05 18:32:32 +01:00
polyfills Revert "Update dependencies (#1613)" (#1617) 2023-06-19 09:49:44 +00:00
primitives [refactor] snapping (#1589) 2023-06-15 14:36:46 +00:00
state Incorporate signia as @tldraw/state (#1620) 2023-06-20 13:31:26 +00:00
store Incorporate signia as @tldraw/state (#1620) 2023-06-20 13:31:26 +00:00
tldraw ShapeUtil refactor, Editor cleanup (#1611) 2023-06-19 14:01:18 +00:00
tlschema Styles API follow-ups (#1636) 2023-06-24 13:46:04 +00:00
ui Styles API follow-ups (#1636) 2023-06-24 13:46:04 +00:00
utils Styles API (#1580) 2023-06-16 10:33:47 +00:00
validate Styles API (#1580) 2023-06-16 10:33:47 +00:00