1100 Commits

Author SHA1 Message Date
Christopher Chedeau
fed7054114
Fix hit testing threshold (#969)
* Fix hit testing threshold

- The bounding box was not correctly extended to take into account the threshold. It was only for y axis but not x.
- The bezier threshold was using 20 instead of 10 and not taking into account zoom level.

Both those issues are fixed and now the behavior looks good on all the shapes I can test.

* fix_tests
2020-03-15 13:42:18 -07:00
Christopher Chedeau
2937efacde
Remove last get/setTransform (#964)
My original hack to put the scale when we create the canvas element doesn't make much sense. It should be done when we are rendering the scene. I moved it there in this PR.

The rest was all about forwarding the scale to where it's needed.
2020-03-15 12:25:18 -07:00
Lipis
79ea76b48b
Different color for the stroke of the collaborator's arrow (#963)
* Different color for the stroke of the arrow

* Sort
2020-03-15 11:05:12 -07:00
Jed Fox
e44801123a
Restyle the color picker a touch (#920) 2020-03-15 19:26:52 +02:00
Lipis
d834ff4d89
New Crowdin translations (#912) 2020-03-15 19:12:35 +02:00
Pete Hunt
35ce1729cc
remove most setState({}) (#959) 2020-03-15 10:06:41 -07:00
Pete Hunt
e1e2249f57
Abstract away or eliminate most of the mutation of the Elements array (#955) 2020-03-14 21:48:51 -07:00
Keyan Zhang
05af9f04ed
[easy] run typechecking on CI (#954) 2020-03-14 21:12:39 -07:00
Pete Hunt
3f8144ef85
Fix many syncing issues (#952) 2020-03-14 20:46:57 -07:00
Christopher Chedeau
b20d4539c0
Stop using getTransform (#950)
* Stop using getTransform

Fixes #861

The original motivation behind this is to make it work with Firefox. But it also helped make the code more intentional.

Test Plan:
- Create one square, select it, zoom in repeatedly, make sure that it zooms centered in the screen and everything looks good
- Scroll at various zoom levels, things look good
- Export a small scene at 1x and 3x, make sure the background is properly set and look good

* fix selection element
2020-03-14 17:24:28 -07:00
Christian Alfoni
dbfc8bee57
Add copy to PNG option on context menu (#941)
* Add copy to PNG option on context menu

* lint & refactor & fixes

* add keybinding

* swap keybinding

* fix docs

Co-authored-by: dwelle <luzar.david@gmail.com>
2020-03-14 22:53:18 +01:00
Christopher Chedeau
e19088f214
Make selection handle resolution independent (#948)
They shouldn't really change when zooming in or out.
2020-03-14 22:29:48 +01:00
Christopher Chedeau
809d7ba9f5
Remove text trim (#947)
This was added when we were computing the width without adding "pre" behavior. Now it is no longer an issue
2020-03-14 14:00:20 -07:00
Christopher Chedeau
b49f9b29e5
Render pointers out of screen (#945)
I opted to use transparency to indicate that the pointer is out of screen. It seems to be working relatively well.

Fixes #935
2020-03-14 13:52:42 -07:00
David Luzar
b9c75b5bc4
use deletedIds map to sync deletions (#936)
* use deletedIds map for sync deletions

* refactor how we create data for syncing

* fix comments

* streamline broadcast API

* split broadcast methods
2020-03-14 21:25:07 +01:00
Christopher Chedeau
ead6a083d4
Assign a colors to each pointers (#944)
I'm using the client id as a random number to index on the color array. So far it's been working better than using a sequential increment as the colors in the array are sorted by proximity. Also, it has the advantage that everyone in the room will see the same color for the same person.
2020-03-14 12:18:57 -07:00
Christopher Chedeau
a6244e7602
Better looking pointer (#943)
Instead of a crude circle, this makes it look more like a pointer. I manually tweaked the numbers until it looked like a pointer :)
2020-03-14 12:08:45 -07:00
Jed Fox
668f8ec4a6
Make dialogs look better on mobile (#908)
* Standardize mobile media query

* Refactor & add mobile support to dialogs

* back & close icons
2020-03-13 20:32:47 +01:00
David Luzar
c85315650f
fix calculating text width for indented text (#930) 2020-03-13 15:10:44 +01:00
David Luzar
450a024f5c
remove object.fromEntries (#933) 2020-03-13 15:10:24 +01:00
Pete Hunt
f393486eed
Merge pull request #928 from excalidraw/fix_multiplayer_concurrency
Fix multiplayer concurrency
2020-03-12 21:32:33 -07:00
dwelle
642e47bd03 Merge remote-tracking branch 'origin/master' into fix_multiplayer_concurrency 2020-03-12 21:49:54 +01:00
dwelle
c04fe403fc don't sync editing elements & prefer local versions 2020-03-12 21:28:58 +01:00
Edwin Lin
37284c9174
Merge pull request #915 from excalidraw/fix_remote_pointers
remove remote pointers on client disconnect
2020-03-12 12:18:27 -07:00
dwelle
f1ac8cac32 remove unused selectedId 2020-03-12 20:02:10 +01:00
David Luzar
95e726bd6f
cancel text via doubleclick when in multiElement mode (#926) 2020-03-12 18:31:53 +01:00
David Luzar
f0e6f4dbb8
Text esc fixes (#925)
* fix incorrectly resetting state on esc

* confirm text on esc
2020-03-12 18:04:56 +01:00
David Luzar
3a5ca27600
fix zero-coalescing roughness (#924) 2020-03-12 17:49:11 +01:00
dwelle
5706dd7ae2 consolidate & align collaboration socket eventing with server 2020-03-12 12:19:56 +01:00
dwelle
96320478e6 remove remote pointers on client disconnect 2020-03-12 10:41:36 +01:00
David Luzar
2db2f3f5e4
Collab ui tweaks (#913)
* decrease gap between menu icons

* reduce margin of copy button

* add collaboratorsCount to roomDialog toggle button
2020-03-11 14:48:27 -07:00
David Luzar
b82b0754ac
Room dialog (#905)
* support ToolIcon className and fix label padding

* factor some ExportDialog classes out to Modal

* initial RoomDialog prototype

* change label for another-session button

* remove unused css

* add color comments

* Move the collaboration button to the main menu, add support for mobile

* remove button for creating another session

* add locks

* Fix alignment issue

* Reorder button

* reuse current scene for collab session

* keep collaboration state on restore

Co-authored-by: Jed Fox <git@twopointzero.us>
2020-03-11 19:42:18 +01:00
Lipis
aa9a6b0909
New Crowdin translations (#893) 2020-03-11 11:55:07 +02:00
Pete Hunt
83a2f5de28
remove closures from mutateElement, get rid of the element spreading (#902) 2020-03-10 20:11:02 -07:00
David Luzar
13b838117c
filter out selection elements on restore (#901)
* filter out selection elements on restore

* add comment
2020-03-10 19:41:41 +01:00
Edwin Lin
c95dcf2682
Merge pull request #898 from idlewinn/master
enable version bumping for collaboration
2020-03-09 23:41:46 -07:00
idlewinn
a0669f874e add comments 2020-03-09 23:37:42 -07:00
idlewinn
1419f17175 enable version bumping for collaboration 2020-03-09 22:34:50 -07:00
Jed Fox
30903fbe04
Fill the resize handles with white so they are visible on dark b… (#894)
* Fill the resize handles with white so they are visible on dark backgrounds

* revert package-lock.json

Co-authored-by: dwelle <luzar.david@gmail.com>
2020-03-09 21:01:29 +01:00
David Luzar
5dadbcdcd5
don't set pointer on pointerMove if not already present (#889) 2020-03-09 09:17:26 -07:00
David Luzar
3bf3d96d9f
make error message more user-friendly (#812)
* make error message more user-friendly

* tweak aria

* override user-select for error splash screen

* localize messages

* fix naming

* log error

* include spaces in i18n
2020-03-09 17:09:45 +01:00
Lipis
56a2f8f15f
Add a doc with all the current shortcuts (#785) 2020-03-09 18:03:44 +02:00
Lipis
c261f089fc
New Crowdin translations (#888) 2020-03-09 18:03:12 +02:00
Edwin Lin
0e5c29b3f3
basic Socket.io implementation of collaborative editing (#879)
* Enable collaborative syncing for elements

* Don't fall back to local storage if using a room, as that is confusing

* Use remote socket server

* Send updates to new users when they join

* ~

* add mouse tracking

* enable collaboration, rooms, and mouse tracking

* fix syncing bugs and add a button to start syncing mid session

* enable collaboration, rooms, and mouse tracking

* fix syncing bugs and add a button to start syncing mid session

* Add Live button and app state to support tracking collaborator counts

* Enable collaborative syncing for elements

* add mouse tracking

* enable collaboration, rooms, and mouse tracking

* fix syncing bugs and add a button to start syncing mid session

* fix syncing bugs and add a button to start syncing mid session

* Add Live button and app state to support tracking collaborator counts

* prettier

* Fix bug with remote pointers not changing on scroll

* Enable collaborative syncing for elements

* add mouse tracking

* enable collaboration, rooms, and mouse tracking

* fix syncing bugs and add a button to start syncing mid session

* enable collaboration, rooms, and mouse tracking

* fix syncing bugs and add a button to start syncing mid session

* Add Live button and app state to support tracking collaborator counts

* enable collaboration, rooms, and mouse tracking

* fix syncing bugs and add a button to start syncing mid session

* fix syncing bugs and add a button to start syncing mid session

* Fix bug with remote pointers not changing on scroll

* remove UI for collaboration

* remove link

* clean up lingering unused UI

* set random IV passed per encrypted message, reduce room id length, refactored socket broadcasting API, rename room_id to room, removed throttling of pointer movement

* fix package.json conflict
2020-03-09 08:48:25 -07:00
David Luzar
463854e42a
fix pinch zoom (#885) 2020-03-09 07:19:38 -07:00
Lipis
9de3716324
Update send/bring shortcuts and show them properly per operating… (#784)
* Show proper shortcuts

* sort

* Add shortcuts to bring/send

* fix hotkeys matching greedily

* Space

* align zindex shortcuts with figma

* switch to event.code & change Darwin shortcuts

Co-authored-by: dwelle <luzar.david@gmail.com>
2020-03-09 14:06:35 +01:00
Lipis
f9edb1b4ac
Remove www from open graph images (#884)
* Remove www from open graph images

* Lint
2020-03-09 12:42:48 +02:00
dependabot-preview[bot]
d3771b7e0b
Bump @testing-library/react from 9.4.1 to 9.5.0 (#883)
Bumps [@testing-library/react](https://github.com/testing-library/react-testing-library) from 9.4.1 to 9.5.0.
- [Release notes](https://github.com/testing-library/react-testing-library/releases)
- [Changelog](https://github.com/testing-library/react-testing-library/blob/master/CHANGELOG.md)
- [Commits](https://github.com/testing-library/react-testing-library/compare/v9.4.1...v9.5.0)

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

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-03-09 10:51:38 +01:00
dependabot-preview[bot]
165a2a17d8
Bump @types/jest from 25.1.3 to 25.1.4 (#882)
Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 25.1.3 to 25.1.4.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest)

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

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-03-09 10:47:09 +01:00
Pete Hunt
05ebf3434b
Fix a bug introduced by #880 (#881) 2020-03-08 23:35:30 -07:00