16 Commits

Author SHA1 Message Date
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
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
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
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
Jed Fox
8e0206cc1e
Undo/Redo buttons, refactor menu toggles (#793)
* Make Undo & Redo and the menu buttons into actions; add undo/redo buttons

* Create variables for the ToolIcon colors

* Darken the menu buttons when they’re active

* Put the more intensive test in `perform`

* Fix & restyle hint viewer

* Add pinch zoom for macOS Safari

* Chrome/Firefox trackpad pinch zoom

* openedMenu → openMenu

* needsShapeEditor.ts → showSelectedShapeActions.ts

* Call showSelectedShapeActions
2020-03-01 20:39:03 +01:00
Oren Me
07336bb168
feat: add reset zoom button (#777)
* feat: add reset zoom button

Add zoom reset button.
Button is shown only when zoom scale is different from 1

* change reset zoom icon

* always show zoom reset

* fix typo
2020-02-22 20:24:34 +01:00
Jed Fox
0fd3fb4b5b
More mobile tweaks (#790)
* Disable text selection

* Set content-editable=plaintext-only to disable Touch Bar formatting buttons

* Enlarge resize handle tap targets for pen/touch

* Make the lock button a button in mobile mode

* Use icons instead of Unicode characters; add an alternate toolbar for creating multipoint lines

* Allow buttons to hide themselves

* Fix heuristic for showing shape actions

* Refactor icons

* Fix label for edit button

* Switch edit button icon

* Remove lock button on mobile

* Add language selector on mobile

* Fix showing edit button on mobile

* Fix showing edit button on mobile, part 2

* Fix handle touch regions

* Fix scroll-back button position

* Allow using the text tool on a text object to start editing it

* Fix deletion of last point in line
2020-02-21 11:34:18 -08:00
Jed Fox
ab176937e6
Add touch support (#788)
* Add touch support

* Mock media query

* Mock media query pt 2

* Fix tests

* Allow installing as an app on iOS

* Fix type error

* Math.hypot

* delete and finalize buttons, hint viewer

* skip failing tests

* skip the rest of the failing tests

* Hide the selected shape actions when nothing is selected

* Don’t go into mobile view on short-but-wide viewports

* lol
2020-02-21 08:17:20 -05:00
Jed Fox
7a7a73b78d
Initial support for mobile devices (#787)
* Initial support for mobile devices

No editing yet, but UI looks nice and you can open the canvas menu

* Add support for editing shape color, etc

* Allow the mobile menus to cover the shape selector

* Hopefully fix test error

* Fix touch on canvas

* Fix safe area handling & remove unused Island
2020-02-20 15:44:38 -08:00
Enzo Ferey
c7ff4c2ed6
Canvas zooming (#716)
* Zoom icons.

* Actions.

* Min zoom of 0 does not make sense.

* Zoom logic.

* Modify how zoom affects selection rendering.

* More precise scrollbar dimensions.

* Adjust elements visibility and scrollbars.

* Normalized canvas width and height.

* Apply zoom to resize test.

* [WIP] Zoom using canvas center as an origin.

* Undo zoom on `getScrollBars`.

* WIP: center zoom origin via scroll

* This was wrong for sure.

* Finish scaling using center as origin.

* Almost there.

* Scroll offset should be not part of zoom transforms.

* Better naming.

* Wheel movement should be the same no matter the zoom level.

* Panning movement should be the same no matter the zoom level.

* Fix elements pasting.

* Fix text WYSIWGT.

* Fix scrollbars and visibility.
2020-02-15 21:03:32 +01:00
wboucher
471ea4a747
Add zindex to panel (#736)
* Add z-index options back to panel

* Add formatting for z-index panel buttons

* make z-index buttons all the same width

* make z-index button spacing even

* use svg icons & translations

* add ui legend

Co-authored-by: David Luzar <luzar.david@gmail.com>
2020-02-09 15:07:34 +01:00
Christopher Chedeau
935a7f58a7
Remove previously loaded scenes (#734)
As mentioned in #724, the current implementation is suboptimal. Let's remove it until we come back with a better design.

Fixes #724
2020-02-08 15:05:38 -08:00
Christopher Chedeau
e6d03aeeea
End to end encryption description (#731)
* End to end encryption description

This PR updates the url upload description to mention that it is end to end encrypted. I used a very similar message as whatsapp so that it is familar to people.

I also removed the automatic copying and turned the alert into prompt. This should be less awkward than the current implementation.

* capitalize excalidraw

Co-authored-by: David Luzar <luzar.david@gmail.com>
2020-02-08 10:43:59 +01:00
Gasim Gasimzada
f70bd0081c
Feature: Hint viewer (#666)
* Add Hint viewer

- Add hints for arrows and lines
- Add hints for resizing elements

* Swap priority of multi mode and resize mode in Hint Viewer

* Remove dangling locales from public

* Add shortcut to hide hints

* Change hint texts and show resize hint ONLY during resizing

* Remove hints toggling
2020-02-03 09:52:21 -08:00
Christopher Chedeau
be97bd980e
Add button when scrolled outside of visible area (#643)
With the infinite scroll behavior, it's easy to scroll super far away from where the content is and have a hard time getting back. This PR adds a button to refocus on the center of the scene when no elements are visible anymore.
2020-02-01 17:52:10 +01:00
Christopher Chedeau
e4919e2e6c
Replace i18n by a custom implementation (#638)
There are two problems with the current localization strategy:
- We download the translations on-demand, which means that it does a serial roundtrip for nothing.
- withTranslation helper actually renders the app 3 times on startup, instead of once (I haven't tried to debug it)
2020-01-31 21:06:06 +00:00