Commit Graph

639 Commits

Author SHA1 Message Date
dc618ab122 Encapsulate SceneHistory. A little. (#1016) 2020-03-20 18:45:30 +01:00
edd54d93b3 revert #1017 (#1025)
This reverts commit 1546c00c0c.
2020-03-20 16:46:06 +01:00
1546c00c0c Fix adding incorrect dragging element when handleCanvasPointerD… (#1017) 2020-03-20 11:00:50 +01:00
fda06e4fc3 Fix history - the 2nd installment (#1014)
* don't regenerate versionNonce on pushEntry

* fix history handling around multi-point arrows

* remove filtering from getElementMap helper
2020-03-19 11:41:32 -07:00
f14aaccc38 Fix SpaceBar pan (#1013) 2020-03-19 08:59:20 -07:00
82ce068972 fix history (#1009)
* fix history

* tweak withBatchedUpdates typing
2020-03-19 14:51:05 +01:00
ff033640e4 expose a few state props for debugging (#1008)
* expose a few state props for debugging

* rename h.appState & add h.setState

* support setting elements
2020-03-18 20:44:05 +01:00
cb66adc716 Add a Shortcut for Toggling Shape Lock (#1005)
* Update shortcuts.md for Lock

* Add 'Q' as a shortcut for toggling shape lock

* Add shortcut to LockIcon title

* use event.key instead

Co-authored-by: Faustino Kialungila <Faustino.kialungila@gmail.com>
2020-03-18 19:29:59 +01:00
b7da524538 confirm arrow on doubleclick (#949)
* confirm arrow on double click

* change hint

* fix cursor not updating on click
2020-03-18 16:43:06 +01:00
254a0753ff fix negative resize for non-multipoint elements (#1000) 2020-03-18 08:34:04 -07:00
d8bbe536a7 Restyle the mobile UI a bit (#1002)
* Restyle the bottom bar on mobile as an Island

* Shorter label for collaboration button, truncate too-long button labels

* Refactor safe area things to global vars

* Fix scroll bar positioning, don’t block scrollbars with menu island

* Update text
2020-03-18 11:31:40 -04:00
793e0e4aa0 Remove redundant text (#918) 2020-03-18 13:27:10 +01:00
6fe40516bf deselect all elements when inserting text with double click (#996) 2020-03-17 23:11:27 -07:00
7d57d124bd Fix alt drag (#995) 2020-03-17 15:21:35 -07:00
373d16abe6 improve & granularize ExcalidrawElement types (#991)
* improve & granularize ExcalidrawElement types

* fix incorrectly passing type

* fix tests

* fix more tests

* fix unnecessary spreads & refactor

* add comments
2020-03-17 20:55:40 +01:00
b603337c3f Fix multielements (#987) 2020-03-17 11:01:11 -07:00
0dc07135b7 Fix three rendering when loading (#986)
The problem is that syncActionResult wasn't using batching.
2020-03-16 19:21:01 -07:00
e9f5175f51 Fix performance bug (#984) 2020-03-16 19:07:47 -07:00
db1f97f59e Revert "[RFC] Randomized names next to mouse pointers. (#971)" (#972)
This reverts commit dcb93f75e6.
2020-03-16 00:38:37 -07:00
dcb93f75e6 [RFC] Randomized names next to mouse pointers. (#971)
* [WIP] Add names next to pointers

This implements the rendering and messaging across. Still need to do the UI to set the name.

Also, not really sure what's the best place to send the name and store it.

* Add randomized names

Co-authored-by: Christopher Chedeau <vjeux@fb.com>
2020-03-15 18:56:38 -07:00
d58216f5ec [RFC] show confirmation dialog before the user closes the page (#957) 2020-03-15 14:00:33 -07:00
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
e44801123a Restyle the color picker a touch (#920) 2020-03-15 19:26:52 +02:00
35ce1729cc remove most setState({}) (#959) 2020-03-15 10:06:41 -07:00
e1e2249f57 Abstract away or eliminate most of the mutation of the Elements array (#955) 2020-03-14 21:48:51 -07:00
3f8144ef85 Fix many syncing issues (#952) 2020-03-14 20:46:57 -07:00
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
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
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
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
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
450a024f5c remove object.fromEntries (#933) 2020-03-13 15:10:24 +01:00
642e47bd03 Merge remote-tracking branch 'origin/master' into fix_multiplayer_concurrency 2020-03-12 21:49:54 +01:00
c04fe403fc don't sync editing elements & prefer local versions 2020-03-12 21:28:58 +01:00
37284c9174 Merge pull request #915 from excalidraw/fix_remote_pointers
remove remote pointers on client disconnect
2020-03-12 12:18:27 -07:00
95e726bd6f cancel text via doubleclick when in multiElement mode (#926) 2020-03-12 18:31:53 +01:00
5706dd7ae2 consolidate & align collaboration socket eventing with server 2020-03-12 12:19:56 +01:00
96320478e6 remove remote pointers on client disconnect 2020-03-12 10:41:36 +01:00
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
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
83a2f5de28 remove closures from mutateElement, get rid of the element spreading (#902) 2020-03-10 20:11:02 -07:00
a0669f874e add comments 2020-03-09 23:37:42 -07:00
1419f17175 enable version bumping for collaboration 2020-03-09 22:34:50 -07:00
5dadbcdcd5 don't set pointer on pointerMove if not already present (#889) 2020-03-09 09:17:26 -07:00
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
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
463854e42a fix pinch zoom (#885) 2020-03-09 07:19:38 -07:00
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
8d8f9f23bd Make gesture.pointers a Map instead of an array of pointers (#877) 2020-03-08 19:25:16 -07:00
92ba401da8 Pull onPointerDown, onDoubleClick, onPointerMove into instance methods (#876)
* Pull onPointerDown, onDoubleClick, onPointerMove into instance methods

* Use bound instance methods
2020-03-08 18:09:45 -07:00