Commit Graph

323 Commits

Author SHA1 Message Date
79aee53ff6 Redesign idea ()
* Redisign idea

* Code cleanup

* Fixed to right container

* Reoredered layout

* Reordering panels

* Export dialog

* Removed redunant code

* Fixed not removing temp canvas

* Fixed preview not using only selected elements

* Returned file name on export

* Toggle export selected/all elements

* Hide copy to clipboard button if no support of clipboard

* Added border to swatches

* Fixed modal flickering
2020-01-15 07:42:02 -08:00
8dbd1b80df Update to rough.js 4.0.1 ()
* upgrade to latest rough.js

* remove random.ts because roughjs now supports seeding.
2020-01-13 11:04:28 -08:00
5887be6eda select filled elements by clicking inside () 2020-01-12 11:16:48 -08:00
407f00bbd5 Fix alt-duplicate ()
We need to unselect all the previous elements and select all the new ones. Also made sure that the shape is regenerated when the element is duplicated
2020-01-11 19:35:06 -08:00
74764b06eb Regenerate roughjs shape only when the item is updated ()
* Regenerate roughjs shape only when the item is updated

* Remove shape object during export and history undo/redo

* Remove shape element during copying

* Fix shape generation during creation
2020-01-11 16:00:00 -08:00
81f23a8ccb fix text shape contenteditable & paste handling (fixes ) 2020-01-10 15:51:22 +01:00
f2346275ef Extract Side Panel from App component ()
* Extract Side Panel from App component

* Refactor SidePanel component

- Remove unnecessary props (we are already passing appState as a prop)
- Remove unnecessary allback (we are already passing setState)
2020-01-10 18:00:19 +04:00
862231da4f Make all operations on elements array immutable ()
* Make scene functions return array instead of mutate array

- Not all functions were changes; so the given argument was a new array to some

* Make data restoration functions immutable

- Make mutations in App component

* Make history actions immutable

* Fix an issue in change property that was causing elements to be removed

* mark elements params as readonly & remove unnecessary copying

* Make `clearSelection` return a new array

* Perform Id comparisons instead of reference comparisons in onDoubleClick

* Allow deselecting items with SHIFT key

- Refactor hit detection code

* Fix a bug in element selection and revert drag functionality

Co-authored-by: David Luzar <luzar.david@gmail.com>
2020-01-09 16:22:04 +01:00
4a044d3ace Show move and resize cursors on hover ()
* Change to move cursor on hover

* Show resize handlers on hover
2020-01-08 18:56:35 -08:00
299e7e9099 Extract app and keys ()
* Extract app component from entrypoint (index)

- Use refs to refer to canvas and rough context
- Remove ReactDOM double rendering

* Extract keys and key related utils into their own module

* Move everything back to entrypoint
2020-01-09 02:00:59 +04:00
e38f65dea7 Contenteditable wysiwyg ()
* Contenteditable wysiwyg

* Added comment about pasting multiline text
2020-01-09 02:04:53 +05:00
37934c0f8b Fixes text jumping on creation ()
* Fixes text jumping on creation

* Do not remove node on ESC

* Fixed typo
2020-01-09 00:06:25 +05:00
2122a9cf9f fix for duplicating elements () 2020-01-08 19:54:42 +01:00
08b804ac63 ensure only selected elems can be resized (fixes ) 2020-01-08 18:06:04 +01:00
009412a093 improve typing for handlerRectangles 2020-01-08 17:05:00 +01:00
4b7eb2f04a Add IDs to elements ()
* Add IDs to elements

- Move round rect function within the renderer

* Generate IDs using nanoid

* If element ID does not exist, add the ID during restoration
2020-01-07 23:49:39 +04:00
846f427732 adding comments about diamond dimensions () 2020-01-07 18:59:10 +01:00
10955f8bb0 Wysiwyg text 2.0 ()
* Fixed cleaning handlers after cleanup

* Double click to edit text

* Preserve text styles on change
2020-01-07 09:21:05 -08:00
829a65b8cb Refactor Element Functions ()
* Remove `generatedraw` from element object

- Create a function that renders a single element
- Refactor rendering selected elements

* Replace getElementAbsoluteXY with getElementAbsoluteCoords
2020-01-07 19:04:52 +04:00
f2665408fc Revert "Wysiwyg text ()" ()
This reverts commit abbc04df0e.
2020-01-06 19:50:37 -08:00
abbc04df0e Wysiwyg text () 2020-01-06 19:03:05 -08:00
7bf0184499 Fixed ellipse hit test if sizes are negative () 2020-01-06 23:06:54 +05:00
01805f734d Extract element functions into modules () 2020-01-06 19:34:22 +04:00