Tldraw/packages/editor/src/lib/utils
alex 674a829d1f
[1/3] initial highlighter shape/tool (#1401)
This diff adds an initial version of the highlighter shape. At this
stage, it's a complete copy of the draw tool minus the following
features:
* Fills
* Stroke types
* Closed shapes

I've created a new shape util (a copy-paste of the draw one with stuff
renamed/deleted) but reused the state chart nodes for the draw shape.
Currently this new tool looks exactly like the draw tool, but that'll be
changing soon!

![Kapture 2023-05-17 at 15 37
33](https://github.com/tldraw/tldraw/assets/1489520/982e78f4-6495-4a68-aa51-c8f7b5bcdd01)

The UI here is extremely WIP. The highlighter tool is behind a feature
flag, but once enabled is accessible through the tool bar. There's a
first-draft highlighter icon (i didn't spend much time on this, it's not
super legible on non-retina displays yet imo), and the tool is bound to
the `i` key (any better suggestions? `h` is taken by the hand tool)

### The plan
1. initial highlighter shape/tool #1401 **>you are here<**
2. sandwich rendering for highlighter shapes #1418  
3. shape styling - new colours and sizes, lightweight perfect freehand
changes

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

### Test Plan
(not yet)

### Release Notes

[internal only change layout ground work for highlighter]
2023-06-01 12:46:13 +00:00
..
WeakMapCache.ts transfer-out: transfer out 2023-04-25 12:01:25 +01:00
assets.test.ts transfer-out: transfer out 2023-04-25 12:01:25 +01:00
assets.ts [refactor] update record names (#1473) 2023-05-26 13:37:59 +00:00
buildFromV1Document.ts [refactor] update record names (#1473) 2023-05-26 13:37:59 +00:00
data.ts transfer-out: transfer out 2023-04-25 12:01:25 +01:00
debug-flags.ts [1/3] initial highlighter shape/tool (#1401) 2023-06-01 12:46:13 +00:00
dom.ts transfer-out: transfer out 2023-04-25 12:01:25 +01:00
embeds.test.ts transfer-out: transfer out 2023-04-25 12:01:25 +01:00
embeds.ts transfer-out: transfer out 2023-04-25 12:01:25 +01:00
export.ts Added `pHYs` to import/export of png images (#1200) 2023-04-29 22:10:01 +00:00
hard-reset.ts transfer-out: transfer out 2023-04-25 12:01:25 +01:00
is-gif-animated.ts transfer-out: transfer out 2023-04-25 12:01:25 +01:00
legacy.ts Add migration for horizontal alignment (#1443) 2023-05-24 11:34:13 +00:00
png.ts Added `pHYs` to import/export of png images (#1200) 2023-04-29 22:10:01 +00:00
props-for-next-shape.ts transfer-out: transfer out 2023-04-25 12:01:25 +01:00
refresh-page.ts transfer-out: transfer out 2023-04-25 12:01:25 +01:00
rotation.ts transfer-out: transfer out 2023-04-25 12:01:25 +01:00
runtime.ts transfer-out: transfer out 2023-04-25 12:01:25 +01:00
string.ts [fix] tabs in text exports (#1323) 2023-05-11 09:20:48 +00:00
svg.ts transfer-out: transfer out 2023-04-25 12:01:25 +01:00
window-open.ts transfer-out: transfer out 2023-04-25 12:01:25 +01:00