Commit Graph

390 Commits

Author SHA1 Message Date
9c89504b6f fix: start dragging grouped elements (#1818)
Co-authored-by: dwelle <luzar.david@gmail.com>
2020-06-24 13:38:42 +02:00
baa8fb6c14 grid support (1st iteration) (#1788)
Co-authored-by: dwelle <luzar.david@gmail.com>
2020-06-23 17:24:52 +02:00
60973f6dc5 rename container class to excalidraw and move css from index.html to app.css (#1729)
Moved the css from index.html to app.css so it can be included in upstream app as well
2020-06-08 13:36:35 +03:00
53ab46126d support resizing multiple elements including texts (#1726)
Co-authored-by: David Luzar <luzar.david@gmail.com>
2020-06-08 11:25:20 +02:00
f7c4efbd35 Excalicharts MVP (#1723)
Co-authored-by: David Luzar <luzar.david@gmail.com>
2020-06-06 22:09:04 +02:00
fd75b88bd3 Double finger zoom should not select things (#1333) 2020-06-02 19:41:40 +03:00
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
f413bab3de Fix group element removing (#1676) 2020-05-30 13:48:57 -07:00
17e9cc4506 Some cleanup in App.tsx (#1681) 2020-05-30 15:26:17 +02:00
fa359034c5 scroll the closest element to center (#1670)
Co-authored-by: Sanghyeon Lee <yongdamsh@gmail.com>
2020-05-30 14:02:32 +02:00
44a88d2d58 Rewrite restore to guard against missing migrations (#1664) 2020-05-28 02:41:34 -07:00
5327e8a3dc fix language change not rerendering ui (#1638) 2020-05-27 16:46:11 +02:00
63c10743fb split font into fontSize and fontFamily (#1635) 2020-05-27 15:14:50 +02:00
61e5b66dac Group/ungroup (#1648)
Co-authored-by: dwelle <luzar.david@gmail.com>
2020-05-26 13:07:46 -07:00
5252726307 dynamically import socket.io-client when needed (#1631) 2020-05-26 20:51:03 +02:00
d2ae18995c add history.shouldCreateEntry resolver (#1622) 2020-05-22 22:26:59 -07:00
c427aa3cce Prefer arrow functions and callbacks (#1210) 2020-05-20 15:21:37 +02:00
39c56a4c01 implement stroke style (#1571) 2020-05-14 17:04:33 +02:00
828c9c4d65 use commitToHistory prop for handling draw history (#1595) 2020-05-14 14:51:33 +02:00
c32640d174 Fix free draw to allow undo (#1594) 2020-05-14 13:32:10 +01:00
9ec43d2626 Add free draw mode (#1570) 2020-05-12 21:10:11 +02:00
394237728f Refactor: resize two-point lines/arrows (#1568) 2020-05-10 17:41:36 +02:00
3b1d6910aa fix resizing: dynamic pointer offset for better UX (#1560) 2020-05-09 10:57:00 +02:00
8c8458ceb0 fix incorrect font rendered on late load (#1555) 2020-05-08 10:42:51 +02:00
4696c9ee0e Syncing optimizations (#1554)
* Syncing optimizations

* Add comment
2020-05-07 14:13:18 -07:00
4aa1784ba3 fix horizontal scroll via shift+wheel on mac (#1528) 2020-05-02 13:15:28 -07:00
b7a37c157b scroll horizontally on shift-scroll (#1519) 2020-04-30 13:34:38 -07:00
dd1dfc5950 One more socket listener moved to Portal (#1507)
* room-user-change listener moved to Portal

* Eliminate useless checks

* Update src/components/App.tsx

Co-Authored-By: Lipis <lipiridis@gmail.com>

Co-authored-by: Lipis <lipiridis@gmail.com>
2020-04-28 09:49:00 -07:00
0baabff41b Begin moving socket listeners to Portal (#1504) 2020-04-27 10:56:08 -07:00
1866074c07 Add Zen mode for distraction free drawing (#1450) 2020-04-25 15:13:02 +02:00
ed6fb60337 resize elements from center point (#1225)
* 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>
2020-04-22 17:57:17 +02:00
9b7a743e8b Fix bug: Undo multi element (#1461)
* Add failing test

* Fix multi element undo

* Update snapshots
2020-04-20 15:05:39 +02:00
a18342b5b5 Refactor LayerUI (#1434)
* 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
2020-04-17 22:24:19 +02:00
83199164ae don't prevent select-element devTools action (#1446) 2020-04-17 01:18:45 +03:00
d998a190df persist pointerDown event (#1426) 2020-04-14 12:33:57 +02:00
7df16c1b1d Bump prettier from 2.0.3 to 2.0.4 (#1412)
* Bump prettier from 2.0.3 to 2.0.4

Bumps [prettier](https://github.com/prettier/prettier) from 2.0.3 to 2.0.4.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.0.3...2.0.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* format

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Panayiotis Lipiridis <lipiridis@gmail.com>
2020-04-14 12:30:58 +03:00
4228c2e094 [POC] use serviceWorker from create-react-app (#1286)
* Service worker with toast notifications

* Update CSP to allow fetches from now.sh

* Fixed clearing timers

* rounded icon for pwa (#1301)

* rounded icon for pwa

* cirle pwa app icon

* fix fonts caching

* fix app

* fix css import

* Updated csp tp inlcude worker-src: self

* add worker CSP rule

* use square icon

Co-authored-by: Timur Khazamov <t1mmaas@skbkontur.ru>
Co-authored-by: Faustino Kialungila <Faustino.kialungila@gmail.com>
Co-authored-by: kbariotis <konmpar@gmail.com>
2020-04-13 16:08:39 +02:00
e158dbc45a Prevent next paste on middle clic with linux (#1402) 2020-04-13 16:10:26 +03:00
6771b505ad rewrite wysiwyg property updating (#1387)
* 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
2020-04-12 15:57:57 +02:00
227ff60909 refactor(app.tsx): move Portal to new file and some refactoring (#1398) 2020-04-12 12:54:52 +02:00
e98fba38be refactor(app.tsx): use constants instead of hard coded strings for better readablility (#1391)
don't use inline function as it will create a new refrence everytime
2020-04-11 17:42:02 -07:00
d902bbd618 Fix flickering mouse tracking when using two touches on mobile (#1390) 2020-04-11 15:26:27 -07:00
2adae4132b Global username instead of per room (#1382)
* global username

* remove string interpolation

Co-Authored-By: Lipis <lipiridis@gmail.com>

* remove string interpolation

Co-Authored-By: Lipis <lipiridis@gmail.com>

* remove backwards compat

Co-authored-by: Lipis <lipiridis@gmail.com>
2020-04-11 21:23:12 +01:00
7b3816d0d3 Store username for every room (#1381)
* store username for every room

* add missing fun
2020-04-11 19:13:10 +03:00
5e2f164026 PoC: Expose wysiwyg element to manipulate from outside (#1356)
* expose wysiwyg element to manipulate from outside

* keep focus after changing style

* update editingElement correctly

* remove mistake

* update text only

* proper check for element

* udpate snapshots

* add error log

* remove try catch handler

* remove blur event

* add proper types

* merge if condition

* simplify if condition

Co-Authored-By: Lipis <lipiridis@gmail.com>

Co-authored-by: dwelle <luzar.david@gmail.com>
Co-authored-by: Lipis <lipiridis@gmail.com>
Co-authored-by: Fausto95 <faustino.kialungila@gmail.com>
2020-04-11 18:10:56 +02:00
f3ef93e9ce Allow to drag THEN press alt to duplicate (#1373)
* fix typo

* duplicate elements when alt is pressed on pointer move

* document use case

Co-authored-by: dwelle <luzar.david@gmail.com>
2020-04-11 13:37:43 +02:00
0a284adc18 Allow opening empty excalidraw file (#1348)
* allow openning empty file

* correctly throw error

* fix error handling

* switch back to error objects

Co-authored-by: dwelle <luzar.david@gmail.com>
2020-04-10 11:58:09 +02:00
9761d7ea50 Refactor ResizeArrowFnType to resolve Codesandbox parsing error (#1338) 2020-04-09 19:10:35 +03:00
d5899f6ca0 Make the mouse location broadcast volatile (#1331) 2020-04-09 02:13:32 -07:00
57bbc9fe55 Fill a looped curve with the selected background color (#1315) 2020-04-09 11:46:47 +03:00