Commit Graph

137 Commits

Author SHA1 Message Date
ee68af0fd3 Set Trailing Cmma to () 2020-01-24 12:04:54 +02:00
d24b9c4d78 Update to browser-nativefs v0.1.0 () 2020-01-23 18:15:44 +02:00
a436e70764 Internationalization followup ()
* add translations in data.ts

* add language list
add spanish version

* fixes pr review

* add more translations

* remove unused label

Co-authored-by: David Luzar <luzar.david@gmail.com>
2020-01-22 16:25:04 +02:00
d1fb824369 Move file system operations to separate module () 2020-01-22 13:55:13 +01:00
dc0a4f4cb8 fix: Preview image is being stretched when the proportions are w… ()
Fixes . Preserves the ratio of the preview image when width / height reaches max-width/max-height
2020-01-22 12:09:49 +02:00
2340dddaad Sync panel props to editing element ()
* ensure panel props are sync to editing elem

* ensure we don't create empty-text elements (fixes )

* remove dead code

Co-authored-by: Christopher Chedeau <vjeuxx@gmail.com>
2020-01-20 15:16:22 -08:00
183a62627c id 2020-01-20 21:38:51 +02:00
a210f442f4 Store background color in backend ()
* Store background color in backend

* Background
2020-01-20 19:47:27 +01:00
4487e9af8a Switch hashes to smaller IDs for the backend ()
* Update backend

* log
2020-01-20 20:11:03 +02:00
6ad596e9f1 Share excalidrawings as links! ()
* shareable links

* fix

* review comments

* json-excaliber ()

* draw

* Boom

* backend

* Remove local

Co-authored-by: Lipis <lipiridis@gmail.com>
2020-01-19 21:56:19 -08:00
7f6e1f420e Pure node rendering () 2020-01-19 13:21:33 -08:00
5ce5e5ac1e Adjust type of data URI when saving ()
Previously the type used for the data URI when saving was text/plain.
On iPad, this caused the file to automatically have a .txt extension
added (so files ended up with names like "drawing-xyz.json.txt"). This
meant that the files couldn't be loaded by the tool, which expects only
files with a .json extension.

Now, the type used is application/json, which means that the files get
saved with the correct extension and can be successfully loaded on iPad.
2020-01-19 23:15:40 +02:00
6892348c3d Revert 400 and 420 ()
* revert  font file

* Revert "Revert "Set scale for export images ()" ()"

This reverts commit d603921234.
2020-01-17 16:43:24 +02:00
d603921234 Revert "Set scale for export images ()" ()
This reverts commit 82f559f826.
2020-01-17 15:55:17 +03:00
82f559f826 Set scale for export images () 2020-01-17 15:19:56 +03:00
7ddc206b8c Add Native File System API saving/exporting and opening ()
* Add Native File System API saving/exporting

* Add Native File System API opening

* Add origin trial token placeholder

* Reuse an opened file handle for better saving experience

* Fix file handle reuse to only kick in for Excalidraw files

* Remove reference
2020-01-17 11:25:05 +01:00
a3aa57d98b Add AppState to export json to fix various import bugs ()
* export background, app state

* review comments
2020-01-15 21:08:52 -05:00
8db8827c6f feat: add line shape ()
* feat: add line shape

* fix: align line tool

* fix: hitbox bug sw to ne

* fix: add stroke width n sloppiness  for line

* fix: center line inside a panel box

* fix: use color as a unique key
2020-01-16 00:07:19 +05:00
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
bc2bae2a9a Shift drag to add to selection ()
* Shift drag to add to selection

* Inlined variable
2020-01-12 15:32:25 -08:00
f91b708abb Revert "Shift drag to add to selection ()" ()
This reverts commit ce467f7b65.
2020-01-12 12:08:18 -08:00
ce467f7b65 Shift drag to add to selection () 2020-01-12 11:56:10 -08:00
ba8bc10431 Remove element shape object from local storage save () 2020-01-12 15:08:47 +05: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
deee57314d support export canvas to clipboard () 2020-01-09 17:37:08 +01: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
1ea72e9134 Center element on paste ()
* Center element on paste

* paste on cursor position

* correctly center elements

* rename vars
2020-01-09 12:34:46 +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
a16cd3a34f Add font size and font familly option for selection ()
* Add font size and font familly option for selection

* Allow copy font style

* More clearner method name

* Update options size and font-familly
2020-01-08 17:29:41 -08:00
1739540f00 Creating a text near the center of a shape should put it in the center ()
* Snap to element center

* Fixed typo

* Added comment

* Reduced threshold to 30

* Skip snapping if alt key is pressed

* Fixed creating text with shape tool
2020-01-09 01:09:09 +05: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
ae982e9298 Revert "Save scene in URL ()" ()
This reverts commit db973c61e8.
2020-01-07 07:18:20 -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
db973c61e8 Save scene in URL ()
Co-authored-by: Christopher Chedeau <vjeuxx@gmail.com>
2020-01-06 19:08:23 -08:00
86a1c29eec Extract scene functions to their respective modules ()
- Also, extract utilities into utils module -- capitalizeString, getDateTime, isInputLike
2020-01-06 20:24:54 +04:00
01805f734d Extract element functions into modules () 2020-01-06 19:34:22 +04:00