1
0
mirror of https://github.com/excalidraw/excalidraw.git synced 2024-11-10 11:35:52 +01:00
Commit Graph

922 Commits

Author SHA1 Message Date
David Luzar
0db7ac78c4
fix fontFamily state updating (#1679) 2020-05-29 21:59:39 +02:00
David Luzar
44a88d2d58
Rewrite restore to guard against missing migrations (#1664) 2020-05-28 02:41:34 -07:00
Pete Hunt
56f8bc092d
Tests for groups, more test utils (#1669) 2020-05-28 10:56:18 +02:00
David Luzar
4f3bf79708
skip element mutation on noop updates (#1667) 2020-05-28 00:50:56 -07:00
Daishi Kato
7edcea9a93
feat: resize text element (#1650)
* feat: resize text element

* ignore small font size change that leads jankiness

Co-authored-by: dwelle <luzar.david@gmail.com>
2020-05-28 07:17:15 +09:00
David Luzar
5327e8a3dc
fix language change not rerendering ui (#1638) 2020-05-27 16:46:11 +02:00
David Luzar
63c10743fb
split font into fontSize and fontFamily (#1635) 2020-05-27 15:14:50 +02:00
Pete Hunt
46b574283f
Fix zindex in groups (#1660) 2020-05-26 22:56:22 +02:00
Pete Hunt
61e5b66dac
Group/ungroup (#1648)
Co-authored-by: dwelle <luzar.david@gmail.com>
2020-05-26 13:07:46 -07:00
Aakansha Doshi
5252726307
dynamically import socket.io-client when needed (#1631) 2020-05-26 20:51:03 +02:00
Lipis
1a1cbb345b
New Crowdin translations (#1617) 2020-05-26 17:24:01 +03:00
David Luzar
35049e3de7
History tweaks (#1641)
Co-authored-by: Pete Hunt <phunt@twitter.com>
2020-05-24 15:17:14 -07:00
Timur Khazamov
d315e3dc4d
Update TypeScript to 3.9.3 (#1640)
Co-authored-by: tk338g <tkhazamov@wayfair.com>
2020-05-24 21:17:25 +02:00
Pete Hunt
6512ede9ca
Optimize undo history (#1632)
Co-authored-by: dwelle <luzar.david@gmail.com>
2020-05-23 12:07:11 -07:00
Daishi Kato
51608c07b0
15-degree rotation locking (#1627) 2020-05-23 10:45:05 +02:00
David Luzar
d2ae18995c
add history.shouldCreateEntry resolver (#1622) 2020-05-22 22:26:59 -07:00
David Luzar
ce6f2ff88c
cache nonDeleted elements (#1626) 2020-05-22 10:15:16 -07:00
Preet
584e4182a7
Ensure arrows are not draggable from inside (#1620) 2020-05-21 21:57:54 +02:00
Lipis
c427aa3cce
Prefer arrow functions and callbacks (#1210) 2020-05-20 15:21:37 +02:00
Richard Keenan
33fe223b5d
Typo fix in desc_exitSession en.json (#1619) 2020-05-19 19:33:37 +02:00
Daishi Kato
4d2e8f9ad1
feat: resize multiple elements including two-point lines (#1607) 2020-05-18 10:36:30 +02:00
Daishi Kato
6b628bb1a6
fix: resize non solid lines/arrows/draws (#1608) 2020-05-17 16:01:35 +02:00
Kostas Bariotis
7f35b805d1
Add Catalan translation (#1566) 2020-05-16 18:45:56 +03:00
Lipis
755cd9c320
New Crowdin translations (#1567)
* New translations en.json (Greek)

* New translations en.json (Norwegian)

* New translations en.json (Russian)

* New translations en.json (Russian)

* New translations en.json (Russian)

* New translations en.json (Catalan)

* New translations en.json (French)

* New translations en.json (French)

* New translations en.json (French)

* New translations en.json (Norwegian)

* New translations en.json (Hebrew)

* New translations en.json (Hindi)

* New translations en.json (Indonesian)

* New translations en.json (Chinese Traditional)

* New translations en.json (Chinese Simplified)

* New translations en.json (Turkish)

* New translations en.json (Russian)

* New translations en.json (Portuguese)

* New translations en.json (Polish)

* New translations en.json (Dutch)

* New translations en.json (Spanish)

* New translations en.json (Korean)

* New translations en.json (Japanese)

* New translations en.json (Italian)

* New translations en.json (Hungarian)

* New translations en.json (Finnish)

* New translations en.json (Greek)

* New translations en.json (German)

* New translations en.json (Bulgarian)

* New translations en.json (Arabic)

* New translations en.json (Catalan)

* New translations en.json (Spanish)

* New translations en.json (Portuguese)

* New translations en.json (Norwegian)

* New translations en.json (Finnish)

* New translations en.json (German)

* New translations en.json (German)

* New translations en.json (German)

* New translations en.json (French)

* New translations en.json (French)

* New translations en.json (French)

* New translations en.json (Norwegian)

* New translations en.json (Hebrew)

* New translations en.json (Hindi)

* New translations en.json (Indonesian)

* New translations en.json (Chinese Traditional)

* New translations en.json (Chinese Simplified)

* New translations en.json (Turkish)

* New translations en.json (Russian)

* New translations en.json (Portuguese)

* New translations en.json (Polish)

* New translations en.json (Dutch)

* New translations en.json (Spanish)

* New translations en.json (Korean)

* New translations en.json (Japanese)

* New translations en.json (Italian)

* New translations en.json (Hungarian)

* New translations en.json (Finnish)

* New translations en.json (Greek)

* New translations en.json (German)

* New translations en.json (Bulgarian)

* New translations en.json (Arabic)

* New translations en.json (Catalan)

* New translations en.json (French)

* New translations en.json (Spanish)

* New translations en.json (Greek)

* New translations en.json (French)

* New translations en.json (Norwegian)

* New translations en.json (Hebrew)

* New translations en.json (Chinese Traditional)

* New translations en.json (Chinese Simplified)

* New translations en.json (Turkish)

* New translations en.json (Russian)

* New translations en.json (Portuguese)

* New translations en.json (Polish)

* New translations en.json (Dutch)

* New translations en.json (Spanish)

* New translations en.json (Korean)

* New translations en.json (Japanese)

* New translations en.json (Italian)

* New translations en.json (Hungarian)

* New translations en.json (Finnish)

* New translations en.json (Greek)

* New translations en.json (German)

* New translations en.json (Bulgarian)

* New translations en.json (Arabic)

* New translations en.json (Spanish)

* New translations en.json (Finnish)

* New translations en.json (German)

* New translations en.json (German)

* New translations en.json (Catalan)

* New translations en.json (Catalan)

* New translations en.json (Spanish)

* New translations en.json (Catalan)

* New translations en.json (Catalan)

* New translations en.json (Catalan)

* New translations en.json (Catalan)

* New translations en.json (French)

* New translations en.json (Italian)

* New translations en.json (Portuguese)

* New translations en.json (Italian)
2020-05-16 18:45:09 +03:00
fujimoto kyosuke
afbfe2b8b1
Alt should be labeled as Option on Mac (#1602) 2020-05-14 16:51:52 -07:00
Yuval Ashkenazi
9bd72f91fc
fixed typo: loose ==> lose (#1601) 2020-05-14 21:16:39 +02:00
David Luzar
876170ee27
fix snapshots (#1598) 2020-05-14 17:21:37 +02:00
David Luzar
39c56a4c01
implement stroke style (#1571) 2020-05-14 17:04:33 +02:00
Daishi Kato
f6be200388
feat: resize multiple curved lines (#1596) 2020-05-14 16:56:14 +02:00
David Luzar
828c9c4d65
use commitToHistory prop for handling draw history (#1595) 2020-05-14 14:51:33 +02:00
fujimoto kyosuke
c32640d174
Fix free draw to allow undo (#1594) 2020-05-14 13:32:10 +01:00
Thomas Steiner
ad81033a78
Prompt for reload when new service worker is available (#1588) 2020-05-13 19:19:49 +02:00
Simonboeuf1
ece631b430
preserve spaces in text blocks in svg export (#1587) 2020-05-13 14:30:53 +02:00
Kostas Bariotis
9ec43d2626
Add free draw mode (#1570) 2020-05-12 21:10:11 +02:00
David Luzar
a90ca5eb84
don't use unicode characters for shortcut help (#1565)
* don't use unicode characters for shortcut help

* use option instead of alt

* make shortcut replacement case-insensitive

* improve shortcut dialog layout
2020-05-11 01:29:35 +03:00
Daishi Kato
394237728f
Refactor: resize two-point lines/arrows (#1568) 2020-05-10 17:41:36 +02:00
Lipis
cdb483b895
New Crowdin translations (#1551)
* New translations en.json (Spanish)

* New translations en.json (Japanese)

* New translations en.json (Spanish)

* New translations en.json (French)

* New translations en.json (Norwegian)

* New translations en.json (Hindi)

* New translations en.json (Indonesian)

* New translations en.json (Chinese Traditional)

* New translations en.json (Chinese Simplified)

* New translations en.json (Turkish)

* New translations en.json (Russian)

* New translations en.json (Portuguese)

* New translations en.json (Polish)

* New translations en.json (Dutch)

* New translations en.json (Spanish)

* New translations en.json (Korean)

* New translations en.json (Japanese)

* New translations en.json (Italian)

* New translations en.json (Hungarian)

* New translations en.json (Finnish)

* New translations en.json (Greek)

* New translations en.json (German)

* New translations en.json (Bulgarian)

* New translations en.json (Arabic)

* New translations en.json (Hebrew)

* New translations en.json (Finnish)

* New translations en.json (Spanish)

* New translations en.json (Portuguese)

* New translations en.json (German)

* New translations en.json (Dutch)
2020-05-09 14:35:59 -04:00
Herb Caudill
48264d1be0
Room dialog: Change 'Name' to 'Your name' (#1562)
* Change label 'Name' to 'Your name'

* add yourName as duplicate of Name in all locales
2020-05-09 16:27:42 +03:00
Aakansha Doshi
5b80ad045b
show reset icon with zoom percentage during zen mode (#1540) 2020-05-09 14:47:22 +02:00
Daishi Kato
3b1d6910aa
fix resizing: dynamic pointer offset for better UX (#1560) 2020-05-09 10:57:00 +02:00
David Luzar
8c8458ceb0
fix incorrect font rendered on late load (#1555) 2020-05-08 10:42:51 +02:00
Pete Hunt
4696c9ee0e
Syncing optimizations (#1554)
* Syncing optimizations

* Add comment
2020-05-07 14:13:18 -07:00
Justin Greenberg
e27f3f9ad2
fix(data): removes unnecessary await (#1549) 2020-05-06 21:18:49 +02:00
Lipis
028f9b4b88
New Crowdin translations (#1508) 2020-05-05 17:56:29 +03:00
Daishi Kato
73d8c5b7c1
fix resizing lines with abs coords bigger than element w/h (#1427) 2020-05-04 17:25:40 +02:00
Ion Rosgrim
686af31d9d
on rtl languages the language dropdown is not visible (#1526) 2020-05-03 10:23:04 +02:00
Esteban
7522c48453
Make tools shortcuts case insensitive (#1532) (#1533) 2020-05-02 19:55:59 -07:00
Ion Rosgrim
dd7aa29297
#1529 Rtl ui broken in zen mode (#1530) 2020-05-03 03:30:58 +03:00
David Luzar
4aa1784ba3
fix horizontal scroll via shift+wheel on mac (#1528) 2020-05-02 13:15:28 -07:00
David Luzar
b7a37c157b
scroll horizontally on shift-scroll (#1519) 2020-04-30 13:34:38 -07:00
David Luzar
51f8146357
disable pointer events on hidden menus in zen mode (#1511) 2020-04-29 22:49:36 +02:00
Aakansha Doshi
0c2aa951d6
refactor toolbutton.tsx - add default props (#1492) 2020-04-29 17:13:29 +02:00
Kent Beck
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
Lipis
77f76a263b
New Crowdin translations (#1494)
* New translations en.json (German)

* New translations en.json (Finnish)

* New translations en.json (Indonesian)

* New translations en.json (Hebrew)

* New translations en.json (Japanese)
2020-04-28 11:31:58 -04:00
Kent Beck
0baabff41b
Begin moving socket listeners to Portal (#1504) 2020-04-27 10:56:08 -07:00
Daishi Kato
da1031aeb4
Fix resize logic (partly) (#1475) 2020-04-27 10:30:19 +02:00
Lipis
4824f9e1d4
New Crowdin translations (#1491) 2020-04-27 11:22:14 +03:00
Lipis
5855fcf946
New Crowdin translations (#1490)
* New translations en.json (French)

* New translations en.json (Hebrew)

* New translations en.json (Hebrew)

* New translations en.json (Hebrew)

* New translations en.json (Hebrew)

* New translations en.json (Hebrew)
2020-04-26 09:34:18 -04:00
Lipis
9cd2b78d79
New Crowdin translations (#1471)
* New translations en.json (Norwegian)

* New translations en.json (French)

* New translations en.json (Dutch)

* New translations en.json (Chinese Simplified)

* New translations en.json (Turkish)

* New translations en.json (Russian)

* New translations en.json (Portuguese)

* New translations en.json (Polish)

* New translations en.json (Norwegian)

* New translations en.json (Korean)

* New translations en.json (Spanish)

* New translations en.json (Italian)

* New translations en.json (Hungarian)

* New translations en.json (Finnish)

* New translations en.json (Greek)

* New translations en.json (German)

* New translations en.json (Bulgarian)

* New translations en.json (Arabic)

* New translations en.json (Dutch)

* New translations en.json (Portuguese)

* New translations en.json (Polish)

* New translations en.json (Norwegian)

* New translations en.json (Italian)

* New translations en.json (Finnish)

* New translations en.json (German)

* New translations en.json (Finnish)

* New translations en.json (Norwegian)

* New translations en.json (Polish)

* New translations en.json (Portuguese)

* New translations en.json (German)

* New translations en.json (French)

* New translations en.json (Dutch)

* New translations en.json (Indonesian)

* New translations en.json (Chinese Traditional)

* New translations en.json (Chinese Simplified)

* New translations en.json (Turkish)

* New translations en.json (Russian)

* New translations en.json (Portuguese)

* New translations en.json (Polish)

* New translations en.json (Norwegian)

* New translations en.json (Korean)

* New translations en.json (Spanish)

* New translations en.json (Japanese)

* New translations en.json (Italian)

* New translations en.json (Hungarian)

* New translations en.json (Finnish)

* New translations en.json (Greek)

* New translations en.json (German)

* New translations en.json (Bulgarian)

* New translations en.json (Arabic)

* New translations en.json (Hindi)

* New translations en.json (Greek)

* New translations en.json (Norwegian)

* New translations en.json (Hebrew)

* New translations en.json (Hebrew)

* New translations en.json (Hebrew)

* Add Hebrew to dropdown

Co-authored-by: Jed Fox <git@twopointzero.us>
2020-04-26 08:24:39 -04:00
Faustino Kialungila
582d26e858
fix tool icon button on mobile (#1489) 2020-04-26 11:45:35 +02:00
David Luzar
2c5c770e78
rewrite picker color handling (#1487) 2020-04-25 23:06:16 +02:00
David Luzar
a4b49ea350
ignore fileOpen error when user cancels (#1486) 2020-04-25 09:02:31 -07:00
Aakansha Doshi
1866074c07
Add Zen mode for distraction free drawing (#1450) 2020-04-25 15:13:02 +02:00
Warren Seine
71e7f130bc
Generalize color normalization (#1479) (#1483)
Following #1478, a bug was found related to transparent backgrounds. As Excalidraw only supports `transparent` as a valid transparent color, this commits generalizes the use of canvas to normalize color values.

It changes a few details:
- `rgba()` or `hsla()` syntaxes are not accepted anymore
- pasting values goes through the same normalization step, avoiding invalid values
- color validation is not regex-based anymore
- any CSS-valid black color is now accepted (e.g. previously, `rgb(0,0,0)` was rejected)
2020-04-24 11:06:54 -07:00
Warren Seine
fa8354e306
Support different color inputs (#1478) (#1479) 2020-04-23 09:18:28 -07:00
Lipis
fc802c758f
Update shield's tooltip (#1466) 2020-04-22 21:52:14 +03:00
José Quinto
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
Daishi Kato
8c49770e3b
Better resize cursors on rotated elements (#1470)
* better resize cursor on rotated elements

* refactor with Math.round
2020-04-22 15:11:01 +02:00
Jed Fox
d7729d295a
RTL for the security badge, add an arrow to the tooltip (#1469)
* FIx RTL on the encryption shield

* Add an arrow to the tooltip
2020-04-21 14:50:08 -07:00
Lipis
d1086f3624
New Crowdin translations (#1452) 2020-04-21 17:42:59 +03:00
Preet
9ac79061fa
Bump roughjs and resolve breaking change in roughjs refactoring… (#1463)
* Fix for roughjs refactoring curve-estinmation code into a separate package

* Update jest transformIgnorePatterns
2020-04-20 19:43:06 +02:00
Ed Bentley
9b7a743e8b
Fix bug: Undo multi element (#1461)
* Add failing test

* Fix multi element undo

* Update snapshots
2020-04-20 15:05:39 +02:00
Ed Bentley
5822117e23
Add optional watermark on export (#1365)
* Add optional watermark on export

* Address init PR feedback

* Add SVG export with refactoring

* Update export.ts

* Move addWatermark to appState

* Update snapshots

* Fit watermark in small scene

* Rename watermark things

Co-authored-by: Lipis <lipiridis@gmail.com>
2020-04-19 12:50:23 -07:00
Lipis
13cea081f3
New Crowdin translations (#1449)
* New translations en.json (Arabic)

* New translations en.json (Korean)

* New translations en.json (Bulgarian)

* New translations en.json (Turkish)

* New translations en.json (Spanish)

* New translations en.json (Russian)

* New translations en.json (Portuguese)

* New translations en.json (Polish)

* New translations en.json (Norwegian)

* New translations en.json (Italian)

* New translations en.json (Chinese Simplified)

* New translations en.json (Indonesian)

* New translations en.json (Hungarian)

* New translations en.json (Hindi)

* New translations en.json (Greek)

* New translations en.json (German)

* New translations en.json (French)

* New translations en.json (Dutch)

* New translations en.json (Chinese Traditional)

* New translations en.json (Japanese)

* New translations en.json (Dutch)

* New translations en.json (Polish)

* New translations en.json (Norwegian)

* New translations en.json (Arabic)

* New translations en.json (Korean)

* New translations en.json (Bulgarian)

* New translations en.json (Turkish)

* New translations en.json (Spanish)

* New translations en.json (Russian)

* New translations en.json (Portuguese)

* New translations en.json (Polish)

* New translations en.json (Norwegian)

* New translations en.json (Italian)

* New translations en.json (Chinese Simplified)

* New translations en.json (Indonesian)

* New translations en.json (Hungarian)

* New translations en.json (Hindi)

* New translations en.json (Greek)

* New translations en.json (German)

* New translations en.json (French)

* New translations en.json (Dutch)

* New translations en.json (Chinese Traditional)

* New translations en.json (Japanese)

* New translations en.json (Norwegian)

* New translations en.json (Italian)

* New translations en.json (Italian)

* New translations en.json (German)
2020-04-18 17:40:40 -04:00
fujimoto kyosuke
38c7d5a7bf
Reflect textAlign when pasting a style (#1378)
* Reflect `textAlign` when pasting a style

* Re-run Actions
2020-04-18 15:43:21 +01:00
Steven Nguyen
2bfb0c20c3
Add a button to show all content, if the zoom allows it. (#1406)
* add zoom center action button

* enhance zoom calculation and scroll to center

* add zoom out and center button

* filter deleted elements

* improve complexity

* add key shortcut

* calculate zoom value

* don't render zoomCenter action

* offset from top to account for shape menu

* change shortcut & add to shortcut dialog

* decrease offset

* revert offset

* change hotkey & description

* rename to zoomToFit

* change shortcut label & position

Co-authored-by: dwelle <luzar.david@gmail.com>
2020-04-18 15:50:30 +02:00
Aakansha Doshi
ff0ecb5e33
add always visible lock icon on top right to show info about e… (#1403)
* improvement(layerui.js): add lock icon on top right to show encrypted info about excalidraw

fixes https://github.com/excalidraw/excalidraw/issues/1313

* swap lock with shield

* fix dimensions

* make link open in new tab

* add newline between toolip text and link

* increase tooltip line-height

* remove unused GitHubCorner compo

* reposition; reintroduce GH icon

* make shield into link

* make tooltip not show when drawing

* Review fix

* remove link from tooltip

Co-authored-by: dwelle <luzar.david@gmail.com>
2020-04-17 22:39:15 +02:00
Aakansha Doshi
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
Lipis
9131813661
New Crowdin translations (#1430)
* New translations en.json (German)

* New translations en.json (French)

* New translations en.json (German)

* New translations en.json (Chinese Simplified)

* New translations en.json (Chinese Traditional)

* New translations en.json (Dutch)
2020-04-17 14:21:44 +03:00
David Luzar
83199164ae
don't prevent select-element devTools action (#1446) 2020-04-17 01:18:45 +03:00
Mohit kumar Bajoria
519a9ca493
Close sharing dialog on Enter when changing the username (#1437) 2020-04-16 22:02:59 +02:00
David Luzar
8cfc64a3ab
fix bg color picker rendered behind shape menu (#1445)
* fix bg color picker rendered behind shape menu

* add comment
2020-04-16 21:31:20 +02:00
Thomas Steiner
c35d76cb4c
Use application/vnd.excalidraw+json and .excalidraw (#1440)
* Use application/vnd.excalidraw+json and .excalidraw

* UA sniff and use appication/json on mobile Safari
2020-04-16 17:55:49 +02:00
Thomas Steiner
9a59b7496e
Only load PWACompat when we really need it (#1439) 2020-04-16 17:27:23 +02:00
Thomas Steiner
fe5e71a4e5
Add PWACompat (#1433)
* Add PWACompat (attempt)
Fixes #1425

* Fix CSS, use custom splash screen font

* Respect bottom safe area
2020-04-16 14:23:39 +02:00
David Luzar
75e0163dd1
tweak blurry bg for legibility & remove from modals (#1436) 2020-04-15 21:20:35 +02:00
Tom Hicks
3b357d8332
Improve UI continuity behind panels (#1435)
* Add variable for island color

* Make islands semi-transparent

This preserves the notion of the infinite canvas and helps
maintain context, especially on smaller screens.
2020-04-15 10:42:07 -07:00
Lipis
08e467f1a1
New Crowdin translations (#1416)
* New translations en.json (Portuguese)

* New translations en.json (Korean)

* New translations en.json (Russian)

* New translations en.json (German)
2020-04-14 11:19:41 -04:00
David Luzar
d998a190df
persist pointerDown event (#1426) 2020-04-14 12:33:57 +02:00
dependabot-preview[bot]
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
Daishi Kato
e77e2255bd
Add test for getElementBounds (#1395)
* fix calc diamond bounds

* Add test for getElementBounds

* use toEqual
2020-04-13 17:47:09 -07:00
Faustino Kialungila
51ccf61cc6
Bring root fonts back (#1422)
* redirect font loading

* bring preloading back

* change paths

* add css type

* move fonts to root

* correct paths

* remove redirects

* correct ext

* remove fonts from main CSS

* remove unneeded fonts

Co-authored-by: kbariotis <konmpar@gmail.com>
2020-04-13 20:53:07 +01:00
Faustino Kialungila
cca15b0640
Disable notifications (#1421)
* Remove notifications

* remove dead component
2020-04-13 18:53:33 +02:00
David Luzar
692ceece65
fix not using className when querying container (#1420) 2020-04-13 17:29:11 +02:00
Kostas Bariotis
0e94303791
Ignore `undefined is not an object (evaluating 'window.__pad.pe… (#1417) 2020-04-13 16:34:39 +02:00
Timur Khazamov
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
Jérémie Pardou-Piquemal
e158dbc45a
Prevent next paste on middle clic with linux (#1402) 2020-04-13 16:10:26 +03:00
Lipis
0ffbde77ac
New Crowdin translations Bulgarian (#1388) 2020-04-13 13:35:29 +03:00
David Luzar
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
Aakansha Doshi
227ff60909
refactor(app.tsx): move Portal to new file and some refactoring (#1398) 2020-04-12 12:54:52 +02:00
fujimoto kyosuke
6abcb2d87f
Suppresses unnecessary fill-rule attribute in SVG (#1397) 2020-04-12 00:03:49 -07:00
fujimoto kyosuke
8b805d436f
Fix fill of looping lines in exported SVG (#1396) 2020-04-11 19:46:46 -07:00
Daishi Kato
038cff8793
fix calc diamond bounds (#1394) 2020-04-11 18:19:01 -07:00
Aakansha Doshi
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
Roxana Chiorean
d902bbd618
Fix flickering mouse tracking when using two touches on mobile (#1390) 2020-04-11 15:26:27 -07:00
Lipis
2b9ae38946
Alt drag to shortcuts for duplicate (#1389) 2020-04-11 23:04:53 +02:00
Kostas Bariotis
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
fujimoto kyosuke
166ad0412c
Fix to reflect textAlign property to SVG export (#1375) 2020-04-11 19:17:20 +03:00
Kostas Bariotis
7b3816d0d3
Store username for every room (#1381)
* store username for every room

* add missing fun
2020-04-11 19:13:10 +03:00
Kostas Bariotis
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
Lipis
d2246bfb30
New Crowdin translations (#1380) 2020-04-11 18:26:39 +03:00
Lipis
a3fd464702
New Crowdin translations (#1344)
* New translations en.json (Spanish)

* New translations en.json (Russian)

* New translations en.json (Portuguese)

* New translations en.json (Portuguese)

* New translations en.json (Italian)

* New translations en.json (Arabic)

* New translations en.json (Italian)

* New translations en.json (Turkish)

* New translations en.json (Spanish)

* New translations en.json (Russian)

* New translations en.json (Portuguese)

* New translations en.json (Polish)

* New translations en.json (Norwegian)

* New translations en.json (Korean)

* New translations en.json (Indonesian)

* New translations en.json (Chinese Simplified)

* New translations en.json (Hungarian)

* New translations en.json (Hindi)

* New translations en.json (Greek)

* New translations en.json (German)

* New translations en.json (French)

* New translations en.json (Dutch)

* New translations en.json (Chinese Traditional)

* New translations en.json (Bulgarian)

* New translations en.json (German)

* New translations en.json (Chinese Simplified)

* New translations en.json (Norwegian)

* New translations en.json (Spanish)

* New translations en.json (Greek)

* New translations en.json (Bulgarian)

* New translations en.json (Polish)

* New translations en.json (French)

* New translations en.json (Arabic)

* New translations en.json (Italian)

* New translations en.json (Turkish)

* New translations en.json (Spanish)

* New translations en.json (Russian)

* New translations en.json (Portuguese)

* New translations en.json (Polish)

* New translations en.json (Norwegian)

* New translations en.json (Korean)

* New translations en.json (Indonesian)

* New translations en.json (Chinese Simplified)

* New translations en.json (Hungarian)

* New translations en.json (Hindi)

* New translations en.json (Greek)

* New translations en.json (German)

* New translations en.json (French)

* New translations en.json (Dutch)

* New translations en.json (Chinese Traditional)

* New translations en.json (Bulgarian)

* New translations en.json (Greek)

* New translations en.json (German)

* New translations en.json (French)

* New translations en.json (Norwegian)

* New translations en.json (Spanish)

* New translations en.json (Chinese Simplified)

* New translations en.json (German)

* New translations en.json (Indonesian)

* New translations en.json (Polish)
2020-04-11 08:37:26 -04:00
Tom Dohnal
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
Daishi Kato
5ca763cdbb
Calculate rotated element bounds properly (#1354)
* Calculate rotated element bounds properly, fixes #1303

* prefer isLinearElement

* empty commit
2020-04-11 13:10:47 +02:00
fujimoto kyosuke
b971737d32
Restore textAlign property (#1374) 2020-04-11 10:59:22 +02:00
Jed Fox
f7e3ee2064
Use open-color directly (#1371) 2020-04-11 01:09:29 +03:00
Jed Fox
8ce595e5d6
Add rule banning literal text in JSX (#1367) 2020-04-10 12:58:46 -04:00
Jed Fox
16a3aa7561
Fix mobile dialog styling (#1363) 2020-04-10 18:13:31 +03:00
Lipis
f134211bf9
Ask for name instead of username (#1362) 2020-04-10 18:12:51 +03:00
Jed Fox
136b14cef5
Update shortcut display for enter on Mac (#1358) 2020-04-10 17:13:06 +03:00
Kostas Bariotis
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
Lipis
70e7dd6e3b
Add more shortcuts and minor refactor (#1347) 2020-04-09 22:58:29 +03:00
Lipis
d04eaf7040
New Crowdin translations (#1323) 2020-04-09 19:11:01 +03:00
Sanghyeon Lee
9761d7ea50
Refactor ResizeArrowFnType to resolve Codesandbox parsing error (#1338) 2020-04-09 19:10:35 +03:00
José Quinto
8efe0b7d05
Shift loses pointer fixing #1296 (#1330)
* change resize math to absolute instead of delta

* typings

* small change for width on rotation

* apply absolute resize to other sides

* revert&change math.ts

* polish, polish, polish

* refactor with offset

* eliminate nextX

* rename to offsetPointer

* fix curved lines

* prefer arrow function

* remove unused variables/comments for now

Co-authored-by: daishi <daishi@axlight.com>
2020-04-10 00:14:32 +09:00
Sanghyeon Lee
bd32a26653
Move GitHub corner and visually-hidden class (#1336)
* Move visually-hidden class to index.html

* Replace github corner with component

* Momoize GitHubCorner

* Simplify component return
2020-04-09 16:48:41 +03:00
fujimoto kyosuke
b1ed5b4cdc
Support negative resize for multiple points line/arrow (#1237)
* Support negative resize for multiple points line

* prettier

* Fix an issue with width or height becoming zero
2020-04-09 11:53:12 +02:00
Edwin Lin
d5899f6ca0
Make the mouse location broadcast volatile (#1331) 2020-04-09 02:13:32 -07:00
Preet
57bbc9fe55
Fill a looped curve with the selected background color (#1315) 2020-04-09 11:46:47 +03:00
Dreace
fe6f482e96
Optimize ShortcutsDialog style (#1329)
* Optimize ShortcutsDialog style

* Add word-break only to ShortcutKey
2020-04-09 11:23:10 +03:00
Youness Fkhach
ff82d1cfa3
feat/ability to change the alignment of the text (#1213)
* feat: add the ability to change the alignement of the text

* test: update the snapshots to included the newely textAlign state

* style: use explicit key assignment to object

* test: add missing new key textAlign to newElement.test.ts

* style: make the text on the buttons start with uppercase

* Update src/locales/en.json

* add types

* add migration

* remove incorrect update

Co-authored-by: Youness Fkhach <younessfkhach@porotonmail.com>
Co-authored-by: Lipis <lipiridis@gmail.com>
Co-authored-by: dwelle <luzar.david@gmail.com>
2020-04-08 22:00:27 +02:00
David Luzar
3fd6f3023f
support newline on shift+enter (#1324) 2020-04-08 20:56:27 +02:00
Kent Beck
fdebb38bf6
Move more stuff to Portal (#1309) 2020-04-08 10:18:56 -07:00
Pete Hunt
df0613d8ac
Add NonDeleted<ExcalidrawElement> (#1068)
* add NonDeleted

* make test:all script run tests without prompt

* rename helper

* replace with helper

* make element contructors return nonDeleted elements

* cache filtered elements where appliacable for better perf

* rename manager element getter

* remove unnecessary assertion

* fix test

* make element types in resizeElement into nonDeleted

Co-authored-by: dwelle <luzar.david@gmail.com>
2020-04-08 18:49:52 +02:00
Lipis
c714c778ab
New Crowdin translations (#1319)
* New translations en.json (German)

* New translations en.json (Turkish)
2020-04-08 18:12:28 +03:00
Sanghyeon Lee
26facfa710
Fix 'Dialog' keydown event and prop type warning (#1305) 2020-04-08 15:31:40 +03:00
Lipis
020eebb663
New Crowdin translations (#1277) 2020-04-08 13:14:30 +03:00
Lipis
26fd2fe165
Better name for app state (#1300)
* Better name for app state

* Snapshot
2020-04-07 15:31:28 -07:00
Kent Beck
9a1af38c97
Begin extracting collaboration code to Portal (#1306) 2020-04-07 15:29:43 -07:00
Timur Khazamov
ed378170b7
Use woff2 instead ttf (#1307)
* Use woff2 instead ttf

* Update font in svg-exported files to use woff2

Co-authored-by: Timur Khazamov <t1mmaas@skbkontur.ru>
2020-04-07 15:28:44 -07:00
Daishi Kato
c3b83fba38
fix detecting rotated elements with selection (#1273)
* fix #1232

* Update src/element/bounds.ts

* prefer arrow functions

* fix merging

Co-authored-by: Lipis <lipiridis@gmail.com>
2020-04-07 16:04:20 +02:00
Lipis
03c22c1255
Switch to Sentence case instead of Title Case (#1279) 2020-04-07 16:57:27 +03:00
David Luzar
88cec2df5e
log console.error to sentry (#1243)
* log console.error to sentry

* fix
2020-04-07 15:54:49 +02:00
Lipis
5b684495ef
Translate click and change label (#1299) 2020-04-07 16:40:37 +03:00
Kostas Bariotis
67805bc7a7
Add collaborators names (#1223)
* add random usernames

* add username state

* add username input

* ability to set names

* fix tests

* set username oon mobile

* remove auto generated names

* remove commented code

* always string

* updaate snapshots

* maintain username when clearing canvas

* Update src/renderer/renderScene.ts

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

* add border

* fix styles

Co-authored-by: Pete Hunt <petehunt@users.noreply.github.com>
Co-authored-by: Faustino Kialungila <faustino.kialungila@gmail.com>
Co-authored-by: Lipis <lipiridis@gmail.com>
2020-04-07 14:02:42 +01:00
Lipis
0c3d34261e
Fixes in Shortcuts dialog and minor refactor (#1297) 2020-04-07 14:39:06 +03:00
Mohit kumar Bajoria
e4c154f43e
Button for shortcuts (#1253) 2020-04-07 13:42:10 +03:00
Shriram Balaji
22160f50d3
Wrap localStorage API Access in try-catch (#1241) 2020-04-07 13:09:37 +03:00
Daishi Kato
2cc1105ff5
Resize multiple elements (rectangles, diamonds and ellipses onl… (#1193)
* experiment resizing multiple elements

* hack common component

* calculate scale properly (still se only)fg

* prioritize multi selection

* take handle offset into calculation

* fix master merge

* refactor resizeElements out from App

* wip: handlerRectanglesFromCoords

* fix test with type assertion

* properly show handles wip

* revert previous one and do a tweak

* remove unnecessary assignments

* replace hack code with good one

* refactor coords in arg

* resize NW

* resize from sw,ne

* fix with setResizeHandle

* do not show hint while resizing multiple elements

* empty commit

* fix format
2020-04-07 10:49:59 +02:00
Kostas Bariotis
b60f5fcf06
Save on CTRL/CMD + S (#1287)
* save on shortcut

* revert keys files

* remove constant
2020-04-06 23:24:50 +01:00
David Luzar
729aeacc47
prevent pasting svg copied from excalidraw (#1288)
* prevent pasting svg copied from excalidraw

* remove unnecessary template
2020-04-06 23:02:17 +02:00
David Luzar
e9b4700bba
edit text when clicked on with text tool (#1283) 2020-04-06 22:26:54 +02:00
David Luzar
d3ed5a42fc
fix font being reset to current state font on edit (#1282) 2020-04-06 22:26:00 +02:00
Lipis
0c41f3e7aa
Add curved lines/arrows shortcuts (#1274) 2020-04-06 17:26:05 +03:00
Lipis
854af8aed2
New Crowdin translations (#1228)
* New translations en.json (Portuguese)

* New translations en.json (Chinese Simplified)

* New translations en.json (Chinese Simplified)

* New translations en.json (Chinese Simplified)

* New translations en.json (Chinese Simplified)

* New translations en.json (Arabic)

* New translations en.json (Italian)

* New translations en.json (Spanish)

* New translations en.json (Russian)

* New translations en.json (Portuguese)

* New translations en.json (Polish)

* New translations en.json (Norwegian)

* New translations en.json (Korean)

* New translations en.json (Indonesian)

* New translations en.json (Chinese Simplified)

* New translations en.json (Hungarian)

* New translations en.json (Hindi)

* New translations en.json (Greek)

* New translations en.json (German)

* New translations en.json (French)

* New translations en.json (Dutch)

* New translations en.json (Chinese Traditional)

* New translations en.json (Turkish)

* New translations en.json (Polish)

* New translations en.json (German)

* New translations en.json (Dutch)

* New translations en.json (French)

* New translations en.json (Korean)

* New translations en.json (Greek)

* New translations en.json (Polish)

* New translations en.json (Arabic)

* New translations en.json (Italian)

* New translations en.json (Spanish)

* New translations en.json (Russian)

* New translations en.json (Portuguese)

* New translations en.json (Polish)

* New translations en.json (Norwegian)

* New translations en.json (Korean)

* New translations en.json (Indonesian)

* New translations en.json (Chinese Simplified)

* New translations en.json (Hungarian)

* New translations en.json (Hindi)

* New translations en.json (Greek)

* New translations en.json (German)

* New translations en.json (French)

* New translations en.json (Dutch)

* New translations en.json (Chinese Traditional)

* New translations en.json (Turkish)

* New translations en.json (Arabic)

* New translations en.json (Italian)

* New translations en.json (Spanish)

* New translations en.json (Russian)

* New translations en.json (Portuguese)

* New translations en.json (Polish)

* New translations en.json (Norwegian)

* New translations en.json (Korean)

* New translations en.json (Indonesian)

* New translations en.json (Chinese Simplified)

* New translations en.json (Hungarian)

* New translations en.json (Hindi)

* New translations en.json (Greek)

* New translations en.json (German)

* New translations en.json (French)

* New translations en.json (Dutch)

* New translations en.json (Chinese Traditional)

* New translations en.json (Turkish)

* New translations en.json (Portuguese)

* New translations en.json (Chinese Simplified)

* New translations en.json (Chinese Simplified)

* New translations en.json (Norwegian)

* New translations en.json (Dutch)

* New translations en.json (Greek)

* New translations en.json (French)

* New translations en.json (Portuguese)
2020-04-06 08:14:31 -04:00
Lipis
60d9567e2d
Add Select All shortcut (#1270) 2020-04-06 15:07:28 +03:00
dependabot-preview[bot]
18f0b76231
Bump prettier from 2.0.2 to 2.0.3 (#1263)
* Bump prettier from 2.0.2 to 2.0.3

Bumps [prettier](https://github.com/prettier/prettier) from 2.0.2 to 2.0.3.
- [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.2...2.0.3)

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-06 14:21:07 +03:00
Daishi Kato
4003fa24b2
fix #1254 (#1255) 2020-04-05 20:54:27 -07:00
Roxana Chiorean
d5366db341
Adding ability to copy to clipboard as SVG (#1250) 2020-04-06 02:13:17 +03:00
Mohit kumar Bajoria
2de4fe29ad
Full Screen mode (#1212) 2020-04-06 00:47:13 +03:00
David Luzar
81b38d8808
fix wysiwyg event cleanup (#1248) 2020-04-05 22:31:59 +02:00
Shriram Balaji
290244660b
Restore selectedElements on undelete (#1242)
* Restore selectedElements on undelete

* Update regressionTest snapshots
2020-04-05 21:19:54 +02:00
Lipis
9a0889c698
Show shortcuts dialog when pressing ? (#1224) 2020-04-05 15:58:00 +03:00
Lipis
f6bf093fdd
New Crowdin translations (#1194)
* New translations en.json (Greek)

* New translations en.json (German)

* New translations en.json (Russian)

* New translations en.json (Norwegian)

* New translations en.json (Portuguese)

* New translations en.json (Spanish)

* New translations en.json (German)

* New translations en.json (Spanish)

* New translations en.json (Polish)
2020-04-04 17:39:13 -04:00
David Luzar
4dd947b261
fix scrollToCenter when no elements supplied (#1222)
* fix scrollToCenter when no elements supplied

* make getCommonBounds return default values on empty elements
2020-04-04 18:45:14 +02:00
Kostas Bariotis
b97520400a
Broadcast mouse activity (#1175)
* broadcast mouse activity

* move to same MOUSE_LOCATION event

* remove key up handler

* update tests

* Fix border

* refactor

* rename activity to button

Co-authored-by: Panayiotis Lipiridis <lipiridis@gmail.com>
2020-04-04 17:12:19 +02:00
David Luzar
23540eba4c
sync remote selection (#1207)
* sync remote selection

* skip deleted elements

* remove unnecessary condition & change naming
2020-04-04 16:02:16 +02:00
Faustino Kialungila
adc099ed15
Refactor dnd event handler (#1221) 2020-04-04 15:27:53 +02:00
Faustino Kialungila
d243f3901c
Insert text on double tap (#1217)
* Insert text on double tap(mobile)

* handleCanvasRef
2020-04-04 14:55:36 +02:00
José Quinto
030954badb
shift locking 22.5 degree and move to constants (#1216)
* shift locking 22.5 degree and move to constants #1171

* review SHIFT_LOCKING_ANGLE
2020-04-04 14:55:22 +03:00
Daishi Kato
44f871de71
do not select deleted elements (#1215) 2020-04-04 12:27:34 +02:00
Lipis
ae1eee15cc
Replace ev -> event (#1209) 2020-04-04 10:41:54 +02:00
Lipis
31f76d59a2
Skip transparent background for cursor (#1208)
* Skip transparent background for cursor

* slice
2020-04-04 00:54:04 +03:00
David Luzar
3afb4515b6
scroll to content on collab scene init (#1201) 2020-04-03 22:22:26 +03:00
David Luzar
036978b837
fix font not rendered on init in FF (#1197) 2020-04-03 22:21:40 +03:00
Sanghyeon Lee
96cea9b84b
Make left panel height flexible to avoid overflow (#1169)
* Make overall left menu scrollable

* Make only mid-left panel scrollable

* Update src/styles.scss

* Update src/styles.scss

* Update src/components/LayerUI.tsx

* Remove unused class

* Move the scrolling role to Island

Co-authored-by: Lipis <lipiridis@gmail.com>
2020-04-03 13:58:50 -04:00
Adil HADDAOUI
ae655cd7d3
Align ToolButton Label in RTL mode (#1186) 2020-04-03 17:24:25 +03:00
David Luzar
8030a167c6
make text committing cross-platform (#1188) 2020-04-03 15:56:23 +02:00
Lipis
cd3083e8e6
New translations en.json (French) (#1190) 2020-04-03 09:45:37 -04:00
Lipis
c1b067a8b9
New Crowdin translations (Dutch) (#1187)
* New translations en.json (Dutch)

* Update i18n.ts
2020-04-03 16:06:30 +03:00
alaoui abdellah
980d08ce56
Add support for committing a text entry on cmd/shift click (#1185) 2020-04-03 15:41:32 +03:00
Adil HADDAOUI
b9b58d4464
Change arabic language name (#1184) 2020-04-03 15:40:01 +03:00
Lipis
c240fff0c5
New Crowdin translations (mostly Arabic updates) (#1181) 2020-04-03 15:32:00 +03:00
David Luzar
4912a29e75
sync intermediate text updates (#1174)
* sync intermediate text updates

* fix initial render text position

* batch updates

* tweak onChange subscription
2020-04-03 14:16:14 +02:00
Kostas Bariotis
0c9459e9e5
Warn on invalid JSON file (#1159)
* add error dialog

* show error modal on file dnd

* add locales

* Update src/locales/en.json

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

* Update src/data/blob.ts

* Update src/data/blob.ts

* fix titles, update snapshots

* make modal smaller

* fix dnd wrong file type

* reset errorMessage

Co-authored-by: Faustino Kialungila <faustino.kialungila@gmail.com>
Co-authored-by: Lipis <lipiridis@gmail.com>
2020-04-03 13:50:51 +02:00
Lipis
2be34effd4
New Crowdin translations (#1178)
* New translations en.json (Norwegian)

* New translations en.json (Norwegian)
2020-04-03 12:59:26 +03:00
Christopher Chedeau
27075b028c
Update zoom refresh (#1180)
One second feels way too long. Let's try 300ms
2020-04-02 23:56:14 -07:00
Christopher Chedeau
79557676c2
Revert "simulate a db tap on mobile to insert text (#1155)" (#1179)
This reverts commit 56034eacb049c3b157728f82cd1124f9de1a2c59.
2020-04-02 23:47:39 -07:00
José Quinto
efa8b95c52
fix scrollbar and toolbar grid-gap #1170 (#1173) 2020-04-03 09:11:42 +03:00
Lipis
a488555f30
New Crowdin translations (#1165)
* New translations en.json (Chinese Simplified)

* New translations en.json (Turkish)

* New translations en.json (Hindi)

* New translations en.json (Greek)

* New translations en.json (Italian)

* New translations en.json (Hungarian)

* New translations en.json (Chinese Traditional)

* New translations en.json (Korean)

* New translations en.json (Spanish)

* New translations en.json (French)

* New translations en.json (Russian)

* New translations en.json (Portuguese)

* New translations en.json (Polish)

* New translations en.json (Norwegian)

* New translations en.json (Indonesian)

* New translations en.json (German)

* New translations en.json (Arabic)

* New translations en.json (Greek)

* New translations en.json (Hungarian)

* New translations en.json (French)

* New translations en.json (Hungarian)

* New translations en.json (German)

* New translations en.json (Korean)

* New translations en.json (Polish)

* New translations en.json (Polish)

* New translations en.json (Polish)

* New translations en.json (Polish)

* New translations en.json (Polish)
2020-04-02 22:53:17 -04:00
Jed Fox
663526129a
Proper RTL support (#1154)
* Add RTL styles. Most of the work is done by the browser 💖

* Refactor getLanguage

* Additional fixes

* Mirror the mouse pointer icon

* Move the vertical scrollbar to the left on RTL

* Revert "Mirror the mouse pointer icon"

This reverts commit f69b132538038d231b1b1acc0d6f4a28c91130bb.
2020-04-02 12:21:19 -04:00
José Quinto
8fea75b84f
fix for #1106 - Weird behavior when resize + shift a 2-point li… (#1152)
Co-authored-by: dwelle <luzar.david@gmail.com>
2020-04-02 11:46:05 +02:00
Daishi Kato
65be7973be
Rotation support (#1099)
* rotate rectanble with fixed angle

* rotate dashed rectangle with fixed angle

* fix rotate handler rect

* fix canvas size with rotation

* angle in element base

* fix bug in calculating canvas size

* trial only for rectangle

* hitTest for rectangle rotation

* properly resize rotated rectangle

* fix canvas size calculation

* giving up... workaround for now

* **experimental** handler to rotate rectangle

* remove rotation on copy for debugging

* update snapshots

* better rotation handler with atan2

* rotate when drawImage

* add rotation handler

* hitTest for any shapes

* fix hitTest for curved lines

* rotate text element

* rotation locking

* hint messaage for rotating

* show proper handlers on mobile (a workaround, there should be a better way)

* refactor hitTest

* support exporting png

* support exporting svg

* fix rotating curved line

* refactor drawElementFromCanvas with getElementAbsoluteCoords

* fix export png and svg

* adjust resize positions for lines (N, E, S, W)

* do not make handlers big on mobile

* Update src/locales/en.json

Alright!

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

* do not show rotation/resizing hints on mobile

* proper calculation for N and W positions

* simplify calculation

* use "rotation" as property name for clarification (may increase bundle size)

* update snapshots excluding rotation handle

* refactor with adjustPositionWithRotation

* refactor with adjustXYWithRotation

* forgot to rename rotation

* rename internal function

* initialize element angle on restore

* rotate wysiwyg editor

* fix shift-rotate around 270deg

* improve rotation locking

* refactor adjustXYWithRotation

* avoid rotation degree becomes >=360

* refactor with generateHandler

Co-authored-by: Lipis <lipiridis@gmail.com>
Co-authored-by: dwelle <luzar.david@gmail.com>
2020-04-02 10:40:26 +02:00
Lipis
3e3ce18755
New translations en.json (Greek) (#1163) 2020-04-02 09:56:59 +02:00
Sanghyeon Lee
634410ad48
Modify action buttons visibility for desktop (#1156) 2020-04-02 09:52:24 +02:00
Lipis
ffec3af635
New Crowdin translations (#1160)
* New translations en.json (French)

* New translations en.json (Russian)

* New translations en.json (French)
2020-04-02 09:49:02 +02:00
Mohit kumar Bajoria
9b6700755a
Add new line on Enter (#1161)
* Add new line on Enter

Fixes #1158

* Fix lint
2020-04-02 01:41:42 +02:00
Faustino Kialungila
56034eacb0
simulate a db tap on mobile to insert text (#1155) 2020-04-01 21:44:09 +02:00
Lipis
0e90996715
New Crowdin translations (#1151)
* New translations en.json (Arabic)

* New translations en.json (Chinese Simplified)

* New translations en.json (Turkish)

* New translations en.json (Hindi)

* New translations en.json (Greek)

* New translations en.json (Italian)

* New translations en.json (Hungarian)

* New translations en.json (Chinese Traditional)

* New translations en.json (Korean)

* New translations en.json (Spanish)

* New translations en.json (French)

* New translations en.json (Russian)

* New translations en.json (Portuguese)

* New translations en.json (Polish)

* New translations en.json (Norwegian)

* New translations en.json (Indonesian)

* New translations en.json (German)

* New translations en.json (Arabic)

* New translations en.json (Portuguese)

* New translations en.json (Polish)

* New translations en.json (Arabic)

* New translations en.json (Polish)

* New translations en.json (Arabic)

* New translations en.json (French)

* New translations en.json (German)

* Update i18n.ts

* New translations en.json (German)
2020-04-01 13:49:49 -04:00
Sanghyeon Lee
86d0da5204
Add duplicate button for mobile view (#1146)
* Add a icon for dulplication

* Add PanelComponent for duplication

* Add duplicate button for mobile

* Add styles for layout action buttons

* Add a translation for 'Actions'

* Show left action buttons only for desktop

* Add duplicate button at the bottom of mobile

It is provided depending on whether or not it is `multiElement` to maintain space between buttons.
2020-04-01 18:13:53 +03:00
Lipis
1a47ff5c52
New Crowdin translations (#1145) 2020-03-31 18:14:50 +03:00
Lipis
e2e4f3c805
New Crowdin translations (Greek) (#1118) 2020-03-31 14:44:29 +03:00
Brock Balducci
81d4f611a3
add action ui for deleting an element - #1125 (#1140) 2020-03-31 11:54:42 +03:00
Kostas Bariotis
4ecbbab7da
Add sentry integration (#1141) 2020-03-31 11:37:51 +03:00
Christopher Chedeau
a7bd21ccf2
Avoid broadcasting what was just received (#1116)
Fixes #1115

The issue is that replaceAllElements calls a render synchronously, preventing lastBroadcastedOrReceivedSceneVersion from being set correctly.

I tried using batchUpdate but it only takes a single argument ( c5d2fc7127/packages/react-reconciler/src/ReactFiberWorkLoop.js (L1088) ) whereas the callback takes two.

Test Plan:
- Add a console.log before `this.broadcastScene("SCENE_UPDATE");` in App.tsx
- Connect a bunch of clients
- Have one move a shape
- Make sure that this client has the console logged
- Make sure the other clients don't have it
2020-03-28 21:25:40 -07:00
Sanghyeon Lee
763735ac84
Add SCENE_INIT broadcast type for new user (#1095) 2020-03-28 19:35:56 -07:00
Christopher Chedeau
8e6d55cf75
Fix corner resize for multi-point arrows (#1105)
The logic to support it was not implemented. This is not the prettiest way to solve it in the world but it does work. Some more refactoring here is probably warranted.

Fixes #1039
2020-03-28 18:08:21 -07:00
Christopher Chedeau
24fa657093
Don't reset cache while zooming using a gesture (#1103)
* Don't reset cache while zooming using a gesture

This reuses the cached canvas while the gesture is happening. Once it has stop updating, then recompute the cache with the proper zoom.

This should massively improve performance when panning on big scenes on mobile

Fixes #1056

* update snapshot tests
2020-03-28 16:59:36 -07:00
Kent Beck
95eaadeb85
Refactor paste code (#1102) 2020-03-28 15:43:09 -07:00
Christopher Chedeau
6056170d4b
Fix wysiwyg center (#1101)
This wasn't taking into account zoom properly.

The logic should probably get refactored a bit, it's not ideal that we're passing canvas, state and scale as different arguments. Also it's weird that the function that returns the center is computing the viewport translation. But I'm not motivated enough to fix it right now...

Fixes #1100
2020-03-28 14:30:41 -07:00
Kent Beck
aa54364bd6
Use existing helper to copy all state (#1098) 2020-03-27 15:18:14 -07:00
Lipis
2a373571f8
Change order of the fill options (#1097) 2020-03-27 19:38:03 +02:00
Lipis
90c83927ad
New Crowdin translations (#1089) 2020-03-27 14:12:27 +02:00
David Luzar
cac2dda5ac
Add loading state (#1027)
* add loading state

* update snapshots

* add border radius

* fix comment breaking build jsx
2020-03-26 18:28:26 +01:00
Sanghyeon Lee
d8708cb14f
Apply scroll-back-to-content's z-index only for mobile (#1086)
ref: https://github.com/excalidraw/excalidraw/pull/1002/files#diff-6a2256f44598ec970b4bd034962e011eR376
2020-03-26 13:22:15 +02:00
David Luzar
6fd2a3b2e5
fix z-index action to account for deleted elems and add tests (#1077) 2020-03-26 00:28:50 -07:00
Lipis
fb82715ef7
New Crowdin translations (#1085)
* New translations en.json (Chinese Traditional)

* New translations en.json (Chinese Traditional)
2020-03-25 22:50:53 +01:00
Sanghyeon Lee
051a946438
Add Enter key handler that can start text editing (#1084)
* Add handler that can start text editing with Enter key

* Refine `startTextEditing` parameters

* Apply prettier fixes
2020-03-25 17:12:51 +01:00
Marcel Kloubert
12d7550958
fixed generateCollaborationLink() (#1081) 2020-03-25 17:18:22 +02:00
Faustino Kialungila
4442addc02
Type action names (#1079)
* Type action names

* improve typing

Co-authored-by: dwelle <luzar.david@gmail.com>
2020-03-25 14:13:59 +01:00
Lipis
9cc1037e7b
New Crowdin translations (#1076) 2020-03-25 12:35:29 +02:00
David Luzar
42df058223
load from localStorage only if not in multiplayer (#1074) 2020-03-24 09:57:59 -07:00
Sanghyeon Lee
104e48b6cb
Add the shape lock button for mobile (#1054) 2020-03-24 12:51:49 +02:00
Lipis
e38045ccad
New Crowdin translations (#1055)
* New translations en.json (Norwegian)

* New translations en.json (Norwegian)

* New translations en.json (Chinese Simplified)

* New translations en.json (Chinese Simplified)

* New translations en.json (Chinese Simplified)

* New translations en.json (French)

* New translations en.json (German)

* New translations en.json (Indonesian)

* New translations en.json (Norwegian)

* New translations en.json (Polish)

* New translations en.json (Portuguese)

* New translations en.json (Russian)

* New translations en.json (Spanish)

* New translations en.json (Turkish)

* New translations en.json (Korean)

* New translations en.json (Chinese Traditional)

* New translations en.json (Hungarian)

* New translations en.json (Norwegian)

* New translations en.json (French)
2020-03-24 09:55:29 +01:00
Pete Hunt
bd7856adf3
Much more thorough tests! (#1053) 2020-03-23 16:38:41 -07:00
David Luzar
cf4fa30a57
tweak png copy button label (#1062)
* tweak png copy button label

* fix lint
2020-03-23 16:15:22 +01:00
dependabot-preview[bot]
722c498abe
Bump prettier from 1.19.1 to 2.0.1 (#1060)
* Bump prettier from 1.19.1 to 2.0.1

Bumps [prettier](https://github.com/prettier/prettier) from 1.19.1 to 2.0.1.
- [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/1.19.1...2.0.1)

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

* Update formatting

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Panayiotis Lipiridis <lipiridis@gmail.com>
2020-03-23 13:05:07 +02:00
Lipis
c7f10c5de2
New Crowdin translations (#1049)
* New translations en.json (German)

* New translations en.json (German)

* New translations en.json (German)
2020-03-22 23:01:38 +02:00
Jed Fox
8a6e2bf9cf
Use system fonts where possible. (#1050)
Also put Arial after Helvetica. I hate Arial.
2020-03-22 16:11:21 -04:00
Edwin Lin
f1160a1534
load scene from localStorage in collaboration if user is first… (#1036)
* load scene from localStorage in collaboration if user is first in room

* load scene from localStorage in collaboration prior to syncing with server

* fix merge

Co-authored-by: dwelle <luzar.david@gmail.com>
2020-03-22 18:41:05 +01:00
Kent Beck
ba3cec8d0d
App mitosis begins (#1047) 2020-03-22 18:24:50 +01:00
Lipis
125d1294a0
New Crowdin translations (#1043) 2020-03-22 16:14:45 +02:00
Jed Fox
daa121e909
Add a warning to encourage people to update translations direct… (#1045) 2020-03-22 14:43:06 +01:00
Lipis
5b6723b514
New Crowdin translations (#1037) 2020-03-22 06:24:38 +02:00
Kent Beck
d3d25a128c
Extract helper for App context menu handling (#1033)
* Encapsulate SceneHistory. A little.

* Clean up TopErrorBoundary

* Extract helper for App context menu handling
2020-03-21 17:03:17 +01:00
Kent Beck
1e8cd2bd1c
Separated specification and implementation in TopErrorBoundary (#1031)
* Encapsulate SceneHistory. A little.

* Clean up TopErrorBoundary
2020-03-21 10:26:01 +01:00
David Luzar
f6b36519f1
don't pass deleted elements to UI (#1029) 2020-03-20 21:46:09 +01:00
Kent Beck
dc618ab122
Encapsulate SceneHistory. A little. (#1016) 2020-03-20 18:45:30 +01:00
Lipis
46e619d800
New Crowdin translations (#1020) 2020-03-20 18:32:46 +02:00
David Luzar
edd54d93b3
revert #1017 (#1025)
This reverts commit 1546c00c0cea1a814f1c59a35d40610a86e953e7.
2020-03-20 16:46:06 +01:00
Faustino Kialungila
0ad6f4ec6b
Remove deleted elements from svg export (#1021)
* Remove deleted elements from svg export

* skip deleted elements

* remove old comment

Co-authored-by: dwelle <luzar.david@gmail.com>
2020-03-20 15:19:20 +01:00
Chang Yan
1546c00c0c
Fix adding incorrect dragging element when handleCanvasPointerD… (#1017) 2020-03-20 11:00:50 +01:00
Lipis
6b3dee6777
New Crowdin translations (#1011) 2020-03-19 22:12:47 +02:00
David Luzar
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
Faustino Kialungila
f14aaccc38
Fix SpaceBar pan (#1013) 2020-03-19 08:59:20 -07:00
David Luzar
82ce068972
fix history (#1009)
* fix history

* tweak withBatchedUpdates typing
2020-03-19 14:51:05 +01:00
Lipis
59fa371367
New translations en.json (Chinese Simplified) (#1006) 2020-03-19 07:56:57 +01:00
David Luzar
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
Sanghyeon Lee
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
Lipis
cb68153a81
New Crowdin translations (#998) 2020-03-18 19:59:48 +02:00