Following #1478, a bug was found related to transparent backgrounds. As Excalidraw only supports `transparent` as a valid transparent color, this commits generalizes the use of canvas to normalize color values.
It changes a few details:
- `rgba()` or `hsla()` syntaxes are not accepted anymore
- pasting values goes through the same normalization step, avoiding invalid values
- color validation is not regex-based anymore
- any CSS-valid black color is now accepted (e.g. previously, `rgb(0,0,0)` was rejected)
* add hint & support multi-line hints
* resize from center point using the new resize maths
* resize with origin element when lifting alt key
* add readonly to elementOriginPosition
* add setResizeWithCenterKeyLifted
* isResizeFromCenter logic
* offsetX and offsetY
* simplify equations
* creating element from center point
* lint
* lint
* lint
* remove revert on key up logic
Co-authored-by: dwelle <luzar.david@gmail.com>
Co-authored-by: daishi <daishi@axlight.com>
* add zoom center action button
* enhance zoom calculation and scroll to center
* add zoom out and center button
* filter deleted elements
* improve complexity
* add key shortcut
* calculate zoom value
* don't render zoomCenter action
* offset from top to account for shape menu
* change shortcut & add to shortcut dialog
* decrease offset
* revert offset
* change hotkey & description
* rename to zoomToFit
* change shortcut label & position
Co-authored-by: dwelle <luzar.david@gmail.com>
* improvement(layerui.js): add lock icon on top right to show encrypted info about excalidraw
fixes https://github.com/excalidraw/excalidraw/issues/1313
* swap lock with shield
* fix dimensions
* make link open in new tab
* add newline between toolip text and link
* increase tooltip line-height
* remove unused GitHubCorner compo
* reposition; reintroduce GH icon
* make shield into link
* make tooltip not show when drawing
* Review fix
* remove link from tooltip
Co-authored-by: dwelle <luzar.david@gmail.com>
* chore(gitignore): add .idea to gitignore
* refactor(layerui): pass named function to react.memo so that in dev tools the name shows up
This makes debugging easier as well
* refactor(layerui): break the functional component into multiple render methods
* Add variable for island color
* Make islands semi-transparent
This preserves the notion of the infinite canvas and helps
maintain context, especially on smaller screens.
* rewrite wysiwyg property updating
* reuse existing class
* fix case of focus being stolen by other UIs
* revert mistake csp removal
* ensure we don't run cleanup twice
* fix opacity updating
* add shape actions menu class to constants
* feat: add the ability to change the alignement of the text
* test: update the snapshots to included the newely textAlign state
* style: use explicit key assignment to object
* test: add missing new key textAlign to newElement.test.ts
* style: make the text on the buttons start with uppercase
* Update src/locales/en.json
* add types
* add migration
* remove incorrect update
Co-authored-by: Youness Fkhach <younessfkhach@porotonmail.com>
Co-authored-by: Lipis <lipiridis@gmail.com>
Co-authored-by: dwelle <luzar.david@gmail.com>
* add NonDeleted
* make test:all script run tests without prompt
* rename helper
* replace with helper
* make element contructors return nonDeleted elements
* cache filtered elements where appliacable for better perf
* rename manager element getter
* remove unnecessary assertion
* fix test
* make element types in resizeElement into nonDeleted
Co-authored-by: dwelle <luzar.david@gmail.com>