* implement line editing
* line editing with rotation
* ensure adding new points is disabled on point dragging
* fix hotkey replacement
* don't paint bounding box when creating new multipoint
* tweak points style, account for zoom and z-index
* don't persist editingLinearElement to localStorage
* don't mutate on noop points updates
* account for rotation when adding new point
* ensure clicking on points doesn't deselect element
* tweak history handling around editingline element
* update snapshots
* refactor pointerMove handling
* factor out point dragging
* factor out pointerDown
* improve positioning with rotation
* revert to use roughjs for calculating points bounds
* migrate from storing editingLinearElement.element to id
* make GlobalScene.getElement into O(1)
* use Alt for adding new points
* fix adding and deleting a point with rotation
* disable resize handlers & bounding box on line edit
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>
* 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>
* Add a icon for dulplication
* Add PanelComponent for duplication
* Add duplicate button for mobile
* Add styles for layout action buttons
* Add a translation for 'Actions'
* Show left action buttons only for desktop
* Add duplicate button at the bottom of mobile
It is provided depending on whether or not it is `multiElement` to maintain space between buttons.
* cmd+d to duplicate selection
* use duplicateElement instead
* use duplicateElement instead
* Update actionDuplicateSelection.ts
* select the new duplicated element
* add locale
* use event.key instead of event.code
Co-authored-by: David Luzar <luzar.david@gmail.com>
* Get rid of isSelected, canvas, canvasZoom, canvasOffsetX and canvasOffsetY on ExcalidrawElement.
* Fix most unit tests. Fix cmd a. Fix alt drag
* Focus on paste
* shift select should include previously selected items
* Fix last test
* Move this.shape out of ExcalidrawElement and into a WeakMap
* Initial factoring out of parts of the LayerUI component
2360 → 2224 LOC
* Create a Section component
* Break up src/index.tsx
* Refactor actions to reduce duplication, fix CSS
Also consolidate icons
* Move scene/data.ts to its own directory
* Fix accidental reverts, banish further single-character variables
* ACTIVE_ELEM_COLOR → ACTIVE_ELEMENT_COLOR
* Further refactoring the icons file
* Log all errors
* Pointer Event polyfill to make the tests work
* add test hooks & fix tests
Co-authored-by: dwelle <luzar.david@gmail.com>