153 Commits

Author SHA1 Message Date
Lipis
abde1daba4
Add basic event actions to analytics (#2375)
Co-authored-by: dwelle <luzar.david@gmail.com>
2020-12-02 23:57:51 +02:00
Lipis
014097a97e
refactor: Stop using the deprecated keyCode (#2426)
Co-authored-by: Lipis <lipiridis@gmail.com>
Co-authored-by: David Luzar <luzar.david@gmail.com>
2020-12-01 22:36:06 +01:00
David Luzar
36980160ae
Revert "Remove unused project name from export dialog (#2427)" (#2436) 2020-12-01 14:00:13 +01:00
Lipis
bdb1fb2dae
Add border to the Avatars (#2428) 2020-11-29 20:19:06 +02:00
Lipis
b21fd49412
chore: Minor refactoring for consistency (#2425) 2020-11-29 17:32:51 +01:00
Lipis
204c8370a0
Remove unused project name from export dialog (#2427)
* Remove unused project name from export dialog

* snaps
2020-11-29 15:42:44 +02:00
Steve Ruiz
198106e297
Add distribute actions. (#2395) 2020-11-23 19:16:23 +01:00
Lipis
dad9ad9bf4
don't reset specific appState props on canvas clear (#2359)
Co-authored-by: David Luzar <luzar.david@gmail.com>
2020-11-08 16:10:20 +01:00
Lipis
a20f3240fd
Prefer arrow functions (#2344) 2020-11-06 21:06:39 +01:00
Lipis
e05acd6fd9
Update ESLint rules (#2342) 2020-11-06 21:06:30 +01:00
Lipis
5d295415db
Keep errors, elements and comments consistent (#2340)
Co-authored-by: David Luzar <luzar.david@gmail.com>
2020-11-05 18:06:18 +01:00
João Forja
566e6a5ede
Zoom on cursor | Issue #940 (#2319) 2020-11-04 19:49:15 +02:00
Noel Schnierer
7491fcc3f3
use icons for toggle labels (#2315) 2020-11-01 20:08:48 +01:00
Sven Kube
856ab50090
Feature: Align elements (#2267)
Co-authored-by: Maximilian Massing <maximilian.massing@googlemail.com>
Co-authored-by: Sven Kube <github@sven-kube.de>
Co-authored-by: Maximilian Massing <massing@sipgate.de>
2020-10-31 11:40:06 +01:00
David Luzar
ba3f548b91
Fix library dnd (#2314) 2020-10-30 21:01:41 +01:00
David Luzar
1484c5a63b
fileHandle refactor & fixes (#2252) 2020-10-19 10:53:37 +02:00
David Luzar
5950fa9a40
support embedding scene data to PNG/SVG (#2219)
Co-authored-by: Lipis <lipiridis@gmail.com>
2020-10-13 14:47:07 +02:00
Thomas Steiner
b2822f3538
Make File Handling actually work (#2181)
Follow-up from #1736
2020-09-22 15:21:22 +02:00
David Luzar
d07099aadd
fix zindex to account for group boundaries (#2065) 2020-09-11 17:06:07 +02:00
David Luzar
aaddde5dd9
Fix history initialization (#2115) 2020-09-09 21:08:06 +02:00
Daishi Kato
41cb1fbeba
feat: sharpness (#1931)
* feat: sharpness

* feat: fill sharp lines, et al.

* fix: rotated positioning

* chore: simplify path with Q

* fix: hit test inside sharp elements

* make sharp / round buttons work properly

* fix tsc tests

* update snapshots

* update snapshots

* fix: sharp arrow creation error

* fix merge and test

* avoid type assertion

* remove duplicate helper

Co-authored-by: dwelle <luzar.david@gmail.com>
2020-08-14 17:59:43 +02:00
David Luzar
3f2b0fdd0a
don't reset dark mode on canvas clear (#2032) 2020-08-13 17:22:39 +02:00
Michal Srb
c0dd870c6e
Dark mode (#2006)
Co-authored-by: dwelle <luzar.david@gmail.com>
2020-08-13 13:35:31 +02:00
Michal Srb
26f67d27ec
Allow binding linear elements to other elements (#1899)
* Refactor: simplify linear element type

* Refactor: dedupe scrollbar handling

* First step towards binding - establish relationship and basic test for dragged lines

* Refactor: use zoom from appstate

* Refactor: generalize getElementAtPosition

* Only consider bindable elements in hit test

* Refactor: pull out pieces of hit test for reuse later

* Refactor: pull out diamond from hit test for reuse later

* Refactor: pull out text from hit test for reuse later

* Suggest binding when hovering

* Give shapes in regression test real size

* Give shapes in undo/redo test real size

* Keep bound element highlighted

* Show binding suggestion for multi-point elements

* Move binding to its on module with functions so that I can use it from actions, add support for binding end of multi-point elements

* Use Id instead of ID

* Improve boundary offset for non-squarish elements

* Fix localStorage for binding on linear elements

* Simplify dragging code and fix elements bound twice to the same shape

* Fix binding for rectangles

* Bind both ends at the end of the linear element creation, needed for focus points

* wip

* Refactor: Renames and reshapes for next commit

* Calculate and store focus points and gaps, but dont use them yet

* Focus points for rectangles

* Dont blow up when canceling linear element

* Stop suggesting binding when a non-compatible tool is selected

* Clean up collision code

* Using Geometric Algebra for hit tests

* Correct binding for all shapes

* Constant gap around polygon corners

* Fix rotation handling

* Generalize update and fix hit test for rotated elements

* Handle rotation realtime

* Handle scaling

* Remove vibration when moving bound and binding element together

* Handle simultenous scaling

* Allow binding and unbinding when editing linear elements

* Dont delete binding when the end point wasnt touched

* Bind on enter/escape when editing

* Support multiple suggested bindable elements in preparation for supporting linear elements dragging

* Update binding when moving linear elements

* Update binding when resizing linear elements

* Dont re-render UI on binding hints

* Update both ends when one is moved

* Use distance instead of focus point for binding

* Complicated approach for posterity, ignore this commit

* Revert the complicated approach

* Better focus point strategy, working for all shapes

* Update snapshots

* Dont break binding gap when mirroring shape

* Dont break binding gap when grid mode pushes it inside

* Dont bind draw elements

* Support alt duplication

* Fix alt duplication to

* Support cmd+D duplication

* All copy mechanisms are supported

* Allow binding shapes to arrows, having arrows created first

* Prevent arrows from disappearing for ellipses

* Better binding suggestion highlight for shapes

* Dont suggest second binding for simple elements when editing or moving them

* Dont steal already bound linear elements when moving shapes

* Fix highlighting diamonds and more precisely highlight other shapes

* Highlight linear element edges for binding

* Highlight text binding too

* Handle deletion

* Dont suggest second binding for simple linear elements when creating them

* Dont highlight bound element during creation

* Fix binding for rotated linear elements

* Fix collision check for ellipses

* Dont show suggested bindings for selected pairs

* Bind multi-point linear elements when the tool is switched - important for mobile

* Handle unbinding one of two bound edges correctly

* Rename boundElement in state to startBoundElement

* Dont double account for zoom when rendering binding highlight

* Fix rendering of edited linear element point handles

* Suggest binding when adding new point to a linear element

* Bind when adding a new point to a linear element and dont unbind when moving middle elements

* Handle deleting points

* Add cmd modifier key to disable binding

* Use state for enabling binding, fix not binding for linear elements during creation

* Drop support for binding lines, only arrows are bindable

* Reset binding mode on blur

* Fix not binding lines
2020-08-08 21:04:15 -07:00
Rene
403e8bd307
clear selection from copied/duplicatated group (#1973)
Co-authored-by: rene_mbp <harryloveslearning@googlemail.com>
Co-authored-by: dwelle <luzar.david@gmail.com>
2020-08-08 22:35:34 +02:00
David Luzar
fea257765d
regenerate seed on change of sloppiness (#1986) 2020-07-30 20:14:38 +02:00
Aakansha Doshi
20500b7822
remove shared global scene and attach it to every instance (#1706)
Co-authored-by: dwelle <luzar.david@gmail.com>
2020-07-30 11:20:59 +02:00
Mohammed Salman
ee8fa6aaad
Import and export library from/to a file (#1940)
Co-authored-by: dwelle <luzar.david@gmail.com>
2020-07-27 14:29:19 +02:00
Aakansha Doshi
7eff6893c5
calculate coords based on container viewport position (#1955)
* feat: calculate coords based on parent left and top so it renders correctly in host App

* fix text

* move offsets to state & fix bugs

* fix text jumping

* account for zoom in textWysiwyg & undo incorrect offsetting

Co-authored-by: dwelle <luzar.david@gmail.com>
2020-07-27 13:48:49 +02:00
Farooq AR
df4e903bd6
Add regression tests for context-menu actions (#1959) 2020-07-26 13:29:44 +02:00
Rene
ebf2923c5e
Issues/1827 group-ungroup icons (#1956)
* show group and ungroup action-icon

* change group-icon visiblilty

don't show group if selected is only a single element or a single group of elements

Co-authored-by: rene_mbp <harryloveslearning@googlemail.com>
2020-07-26 01:42:06 +03:00
Thomas Steiner
880cac2359
Update browser-nativefs (#1963)
Incorporates the latest changes in the Native File System API
2020-07-25 15:34:51 +02:00
David Luzar
494b7d08c5
mute FS abort errors (#1929) 2020-07-17 11:34:21 +02:00
Pete Hunt
6428b59ccb
Library MVP (#1787)
Co-authored-by: dwelle <luzar.david@gmail.com>
2020-07-10 11:20:23 +02:00
David Luzar
6e357c0291
fix deleting multi-point elem during edit (#1892) 2020-07-09 22:33:27 +02:00
Rene
51a8ab65f3
Group / ungroup should not always be present in the context menu (#1890)
Co-authored-by: rene_mbp <harryloveslearning@googlemail.com>
Co-authored-by: dwelle <luzar.david@gmail.com>
2020-07-09 22:32:27 +02:00
fujimoto kyosuke
6f13b5ac75
Fix status when do selectAll while editing lines (#1828) 2020-07-08 10:29:47 +02:00
David Luzar
df5eb3f0d9
change copy/paste styles shortcuts (#1881)
* change copy/paste styles shortcuts

* use keyCode
2020-07-07 20:22:23 +02:00
Aakansha Doshi
9351b2821c
feat: add width, height as props to App.tsx (#1871) 2020-07-07 17:10:39 +02:00
David Luzar
b1261eea70
duplicate point on cmd+d (#1831) 2020-07-07 13:53:44 +02:00
David Luzar
cd87bd6901
do not center text when not applicable (#1783) 2020-06-25 21:21:27 +02:00
Kostas Bariotis
bda8415714
Include stroke style when copy/paste styles (#1785) 2020-06-19 21:33:37 +02:00
Oliver Benns
ca87ca6fe9
Add user list component + snap to user functionality (#1749) 2020-06-19 12:36:49 +02:00
Thomas Steiner
5d3867d8ac
Implement Save without re-prompt and Save as (#1709)
* Implement Save without re-prompt and Save as
Fixes #1668

* Add save-as icon

* Make .excalidraw the default extension

* Only show save as button on supporting browsers
2020-06-12 18:35:04 +02:00
Thomas Steiner
6b87278a0f
Add file handling (#1736)
* Add file handling
https://github.com/WICG/file-handling/blob/master/explainer.md#example

* Only trigger on `.excalidraw` for now
2020-06-08 13:02:06 +02:00
David Luzar
14a66956d7
Implement line editing (#1616)
* 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>
2020-06-01 11:35:44 +02:00
David Luzar
f413bab3de
Fix group element removing (#1676) 2020-05-30 13:48:57 -07:00
Aakansha Doshi
fa359034c5
scroll the closest element to center (#1670)
Co-authored-by: Sanghyeon Lee <yongdamsh@gmail.com>
2020-05-30 14:02:32 +02:00
David Luzar
0db7ac78c4
fix fontFamily state updating (#1679) 2020-05-29 21:59:39 +02:00
Pete Hunt
56f8bc092d
Tests for groups, more test utils (#1669) 2020-05-28 10:56:18 +02:00