Commit Graph

876 Commits (242ccac29094e94d74eca1a6d7ed027145a2ccce)

Author SHA1 Message Date
Esteban 7522c48453
Make tools shortcuts case insensitive (#1532) (#1533) 5 years ago
Ion Rosgrim dd7aa29297
#1529 Rtl ui broken in zen mode (#1530) 5 years ago
David Luzar 4aa1784ba3
fix horizontal scroll via shift+wheel on mac (#1528) 5 years ago
David Luzar b7a37c157b
scroll horizontally on shift-scroll (#1519) 5 years ago
David Luzar 51f8146357
disable pointer events on hidden menus in zen mode (#1511) 5 years ago
Aakansha Doshi 0c2aa951d6
refactor toolbutton.tsx - add default props (#1492) 5 years ago
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>
5 years ago
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)
5 years ago
Kent Beck 0baabff41b
Begin moving socket listeners to Portal (#1504) 5 years ago
Daishi Kato da1031aeb4
Fix resize logic (partly) (#1475) 5 years ago
Lipis 4824f9e1d4
New Crowdin translations (#1491) 5 years ago
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)
5 years ago
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>
5 years ago
Faustino Kialungila 582d26e858
fix tool icon button on mobile (#1489) 5 years ago
David Luzar 2c5c770e78
rewrite picker color handling (#1487) 5 years ago
David Luzar a4b49ea350
ignore fileOpen error when user cancels (#1486) 5 years ago
Aakansha Doshi 1866074c07
Add Zen mode for distraction free drawing (#1450) 5 years ago
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)
5 years ago
Warren Seine fa8354e306
Support different color inputs (#1478) (#1479) 5 years ago
Lipis fc802c758f
Update shield's tooltip (#1466) 5 years ago
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>
5 years ago
Daishi Kato 8c49770e3b
Better resize cursors on rotated elements (#1470)
* better resize cursor on rotated elements

* refactor with Math.round
5 years ago
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
5 years ago
Lipis d1086f3624
New Crowdin translations (#1452) 5 years ago
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
5 years ago
Ed Bentley 9b7a743e8b
Fix bug: Undo multi element (#1461)
* Add failing test

* Fix multi element undo

* Update snapshots
5 years ago
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>
5 years ago
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)
5 years ago
fujimoto kyosuke 38c7d5a7bf
Reflect `textAlign` when pasting a style (#1378)
* Reflect `textAlign` when pasting a style

* Re-run Actions
5 years ago
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>
5 years ago
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>
5 years ago
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
5 years ago
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)
5 years ago
David Luzar 83199164ae
don't prevent select-element devTools action (#1446) 5 years ago
Mohit kumar Bajoria 519a9ca493
Close sharing dialog on Enter when changing the username (#1437) 5 years ago
David Luzar 8cfc64a3ab
fix bg color picker rendered behind shape menu (#1445)
* fix bg color picker rendered behind shape menu

* add comment
5 years ago
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
5 years ago
Thomas Steiner 9a59b7496e
Only load PWACompat when we really need it (#1439) 5 years ago
Thomas Steiner fe5e71a4e5
Add PWACompat (#1433)
* Add PWACompat (attempt)
Fixes #1425

* Fix CSS, use custom splash screen font

* Respect bottom safe area
5 years ago
David Luzar 75e0163dd1
tweak blurry bg for legibility & remove from modals (#1436) 5 years ago
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.
5 years ago
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)
5 years ago
David Luzar d998a190df
persist pointerDown event (#1426) 5 years ago
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>
5 years ago
Daishi Kato e77e2255bd
Add test for getElementBounds (#1395)
* fix calc diamond bounds

* Add test for getElementBounds

* use toEqual
5 years ago
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>
5 years ago
Faustino Kialungila cca15b0640
Disable notifications (#1421)
* Remove notifications

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

* add missing fun
5 years ago
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>
5 years ago
Lipis d2246bfb30
New Crowdin translations (#1380) 5 years ago
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)
5 years ago
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>
5 years ago
Daishi Kato 5ca763cdbb
Calculate rotated element bounds properly (#1354)
* Calculate rotated element bounds properly, fixes #1303

* prefer isLinearElement

* empty commit
5 years ago
fujimoto kyosuke b971737d32
Restore textAlign property (#1374) 5 years ago
Jed Fox f7e3ee2064
Use open-color directly (#1371) 5 years ago
Jed Fox 8ce595e5d6
Add rule banning literal text in JSX (#1367) 5 years ago
Jed Fox 16a3aa7561
Fix mobile dialog styling (#1363) 5 years ago
Lipis f134211bf9
Ask for name instead of username (#1362) 5 years ago
Jed Fox 136b14cef5
Update shortcut display for enter on Mac (#1358) 5 years ago
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>
5 years ago
Lipis 70e7dd6e3b
Add more shortcuts and minor refactor (#1347) 5 years ago
Lipis d04eaf7040
New Crowdin translations (#1323) 5 years ago
Sanghyeon Lee 9761d7ea50
Refactor ResizeArrowFnType to resolve Codesandbox parsing error (#1338) 5 years ago
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>
5 years ago
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
5 years ago
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
5 years ago
Edwin Lin d5899f6ca0
Make the mouse location broadcast volatile (#1331) 5 years ago
Preet 57bbc9fe55
Fill a looped curve with the selected background color (#1315) 5 years ago
Dreace fe6f482e96
Optimize ShortcutsDialog style (#1329)
* Optimize ShortcutsDialog style

* Add word-break only to ShortcutKey
5 years ago
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>
5 years ago
David Luzar 3fd6f3023f
support newline on shift+enter (#1324) 5 years ago
Kent Beck fdebb38bf6
Move more stuff to Portal (#1309) 5 years ago
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>
5 years ago
Lipis c714c778ab
New Crowdin translations (#1319)
* New translations en.json (German)

* New translations en.json (Turkish)
5 years ago
Sanghyeon Lee 26facfa710
Fix 'Dialog' keydown event and prop type warning (#1305) 5 years ago
Lipis 020eebb663
New Crowdin translations (#1277) 5 years ago
Lipis 26fd2fe165
Better name for app state (#1300)
* Better name for app state

* Snapshot
5 years ago
Kent Beck 9a1af38c97
Begin extracting collaboration code to Portal (#1306) 5 years ago
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>
5 years ago
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>
5 years ago
Lipis 03c22c1255
Switch to `Sentence case` instead of `Title Case` (#1279) 5 years ago
David Luzar 88cec2df5e
log console.error to sentry (#1243)
* log console.error to sentry

* fix
5 years ago
Lipis 5b684495ef
Translate click and change label (#1299) 5 years ago
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>
5 years ago
Lipis 0c3d34261e
Fixes in Shortcuts dialog and minor refactor (#1297) 5 years ago
Mohit kumar Bajoria e4c154f43e
Button for shortcuts (#1253) 5 years ago
Shriram Balaji 22160f50d3
Wrap localStorage API Access in try-catch (#1241) 5 years ago
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
5 years ago
Kostas Bariotis b60f5fcf06
Save on CTRL/CMD + S (#1287)
* save on shortcut

* revert keys files

* remove constant
5 years ago
David Luzar 729aeacc47
prevent pasting svg copied from excalidraw (#1288)
* prevent pasting svg copied from excalidraw

* remove unnecessary template
5 years ago
David Luzar e9b4700bba
edit text when clicked on with text tool (#1283) 5 years ago
David Luzar d3ed5a42fc
fix font being reset to current state font on edit (#1282) 5 years ago
Lipis 0c41f3e7aa
Add curved lines/arrows shortcuts (#1274) 5 years ago
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)
5 years ago
Lipis 60d9567e2d
Add Select All shortcut (#1270) 5 years ago
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>
5 years ago
Daishi Kato 4003fa24b2
fix #1254 (#1255) 5 years ago
Roxana Chiorean d5366db341
Adding ability to copy to clipboard as SVG (#1250) 5 years ago
Mohit kumar Bajoria 2de4fe29ad
Full Screen mode (#1212) 5 years ago
David Luzar 81b38d8808
fix wysiwyg event cleanup (#1248) 5 years ago
Shriram Balaji 290244660b
Restore selectedElements on undelete (#1242)
* Restore selectedElements on undelete

* Update regressionTest snapshots
5 years ago
Lipis 9a0889c698
Show shortcuts dialog when pressing `?` (#1224) 5 years ago
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)
5 years ago
David Luzar 4dd947b261
fix scrollToCenter when no elements supplied (#1222)
* fix scrollToCenter when no elements supplied

* make getCommonBounds return default values on empty elements
5 years ago
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>
5 years ago
David Luzar 23540eba4c
sync remote selection (#1207)
* sync remote selection

* skip deleted elements

* remove unnecessary condition & change naming
5 years ago
Faustino Kialungila adc099ed15
Refactor dnd event handler (#1221) 5 years ago
Faustino Kialungila d243f3901c
Insert text on double tap (#1217)
* Insert text on double tap(mobile)

* handleCanvasRef
5 years ago
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
5 years ago
Daishi Kato 44f871de71
do not select deleted elements (#1215) 5 years ago
Lipis ae1eee15cc
Replace ev -> event (#1209) 5 years ago
Lipis 31f76d59a2
Skip transparent background for cursor (#1208)
* Skip transparent background for cursor

* slice
5 years ago
David Luzar 3afb4515b6
scroll to content on collab scene init (#1201) 5 years ago
David Luzar 036978b837
fix font not rendered on init in FF (#1197) 5 years ago
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>
5 years ago
Adil HADDAOUI ae655cd7d3
Align ToolButton Label in RTL mode (#1186) 5 years ago
David Luzar 8030a167c6
make text committing cross-platform (#1188) 5 years ago
Lipis cd3083e8e6
New translations en.json (French) (#1190) 5 years ago
Lipis c1b067a8b9
New Crowdin translations (Dutch) (#1187)
* New translations en.json (Dutch)

* Update i18n.ts
5 years ago
alaoui abdellah 980d08ce56
Add support for committing a text entry on cmd/shift click (#1185) 5 years ago
Adil HADDAOUI b9b58d4464
Change arabic language name (#1184) 5 years ago
Lipis c240fff0c5
New Crowdin translations (mostly Arabic updates) (#1181) 5 years ago
David Luzar 4912a29e75
sync intermediate text updates (#1174)
* sync intermediate text updates

* fix initial render text position

* batch updates

* tweak onChange subscription
5 years ago
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>
5 years ago
Lipis 2be34effd4
New Crowdin translations (#1178)
* New translations en.json (Norwegian)

* New translations en.json (Norwegian)
5 years ago
Christopher Chedeau 27075b028c
Update zoom refresh (#1180)
One second feels way too long. Let's try 300ms
5 years ago
Christopher Chedeau 79557676c2
Revert "simulate a db tap on mobile to insert text (#1155)" (#1179)
This reverts commit 56034eacb0.
5 years ago
José Quinto efa8b95c52
fix scrollbar and toolbar grid-gap #1170 (#1173) 5 years ago
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)
5 years ago
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 f69b132538.
5 years ago
José Quinto 8fea75b84f
fix for #1106 - Weird behavior when resize + shift a 2-point li… (#1152)
Co-authored-by: dwelle <luzar.david@gmail.com>
5 years ago
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>
5 years ago
Lipis 3e3ce18755
New translations en.json (Greek) (#1163) 5 years ago
Sanghyeon Lee 634410ad48
Modify action buttons visibility for desktop (#1156) 5 years ago
Lipis ffec3af635
New Crowdin translations (#1160)
* New translations en.json (French)

* New translations en.json (Russian)

* New translations en.json (French)
5 years ago
Mohit kumar Bajoria 9b6700755a
Add new line on Enter (#1161)
* Add new line on Enter

Fixes #1158

* Fix lint
5 years ago
Faustino Kialungila 56034eacb0
simulate a db tap on mobile to insert text (#1155) 5 years ago
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)
5 years ago
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.
5 years ago
Lipis 1a47ff5c52
New Crowdin translations (#1145) 5 years ago
Lipis e2e4f3c805
New Crowdin translations (Greek) (#1118) 5 years ago
Brock Balducci 81d4f611a3
add action ui for deleting an element - #1125 (#1140) 5 years ago
Kostas Bariotis 4ecbbab7da
Add sentry integration (#1141) 5 years ago
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
5 years ago
Sanghyeon Lee 763735ac84
Add `SCENE_INIT` broadcast type for new user (#1095) 5 years ago
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
5 years ago
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
5 years ago
Kent Beck 95eaadeb85
Refactor paste code (#1102) 5 years ago
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
5 years ago
Kent Beck aa54364bd6
Use existing helper to copy all state (#1098) 5 years ago
Lipis 2a373571f8
Change order of the fill options (#1097) 5 years ago
Lipis 90c83927ad
New Crowdin translations (#1089) 5 years ago
David Luzar cac2dda5ac
Add loading state (#1027)
* add loading state

* update snapshots

* add border radius

* fix comment breaking build jsx
5 years ago
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
5 years ago
David Luzar 6fd2a3b2e5
fix z-index action to account for deleted elems and add tests (#1077) 5 years ago
Lipis fb82715ef7
New Crowdin translations (#1085)
* New translations en.json (Chinese Traditional)

* New translations en.json (Chinese Traditional)
5 years ago
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
5 years ago
Marcel Kloubert 12d7550958
fixed generateCollaborationLink() (#1081) 5 years ago
Faustino Kialungila 4442addc02
Type action names (#1079)
* Type action names

* improve typing

Co-authored-by: dwelle <luzar.david@gmail.com>
5 years ago
Lipis 9cc1037e7b
New Crowdin translations (#1076) 5 years ago
David Luzar 42df058223
load from localStorage only if not in multiplayer (#1074) 5 years ago
Sanghyeon Lee 104e48b6cb
Add the shape lock button for mobile (#1054) 5 years ago
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)
5 years ago
Pete Hunt bd7856adf3
Much more thorough tests! (#1053) 5 years ago
David Luzar cf4fa30a57
tweak png copy button label (#1062)
* tweak png copy button label

* fix lint
5 years ago
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>
5 years ago
Lipis c7f10c5de2
New Crowdin translations (#1049)
* New translations en.json (German)

* New translations en.json (German)

* New translations en.json (German)
5 years ago
Jed Fox 8a6e2bf9cf
Use system fonts where possible. (#1050)
Also put Arial after Helvetica. I hate Arial.
5 years ago
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>
5 years ago
Kent Beck ba3cec8d0d
App mitosis begins (#1047) 5 years ago
Lipis 125d1294a0
New Crowdin translations (#1043) 5 years ago
Jed Fox daa121e909
Add a warning to encourage people to update translations direct… (#1045) 5 years ago
Lipis 5b6723b514
New Crowdin translations (#1037) 5 years ago
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
5 years ago
Kent Beck 1e8cd2bd1c
Separated specification and implementation in TopErrorBoundary (#1031)
* Encapsulate SceneHistory. A little.

* Clean up TopErrorBoundary
5 years ago
David Luzar f6b36519f1
don't pass deleted elements to UI (#1029) 5 years ago
Kent Beck dc618ab122
Encapsulate SceneHistory. A little. (#1016) 5 years ago
Lipis 46e619d800
New Crowdin translations (#1020) 5 years ago
David Luzar edd54d93b3
revert #1017 (#1025)
This reverts commit 1546c00c0c.
5 years ago
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>
5 years ago
Chang Yan 1546c00c0c
Fix adding incorrect dragging element when handleCanvasPointerD… (#1017) 5 years ago
Lipis 6b3dee6777
New Crowdin translations (#1011) 5 years ago
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
5 years ago
Faustino Kialungila f14aaccc38
Fix SpaceBar pan (#1013) 5 years ago
David Luzar 82ce068972
fix history (#1009)
* fix history

* tweak withBatchedUpdates typing
5 years ago
Lipis 59fa371367
New translations en.json (Chinese Simplified) (#1006) 5 years ago
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
5 years ago
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>
5 years ago
Lipis cb68153a81
New Crowdin translations (#998) 5 years ago
David Luzar b7da524538
confirm arrow on doubleclick (#949)
* confirm arrow on double click

* change hint

* fix cursor not updating on click
5 years ago
David Luzar 254a0753ff
fix negative resize for non-multipoint elements (#1000) 5 years ago
Jed Fox 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
5 years ago
Lipis 793e0e4aa0
Remove redundant text (#918) 5 years ago
David Luzar 23b785de68
Trim trailing newlines (#999)
* trim newlines for text elements

* fix comment
5 years ago
Chang Yan 6fe40516bf
deselect all elements when inserting text with double click (#996) 5 years ago
Pete Hunt 7d57d124bd
Fix alt drag (#995) 5 years ago
David Luzar 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
5 years ago
Lipis 1c545c1d47
New Crowdin translations (#990) 5 years ago
Pete Hunt b603337c3f
Fix multielements (#987) 5 years ago
Christopher Chedeau 0dc07135b7
Fix three rendering when loading (#986)
The problem is that syncActionResult wasn't using batching.
5 years ago
Pete Hunt e9f5175f51
Fix performance bug (#984) 5 years ago
Lipis a985d1b9b8
New Crowdin translations (#983)
* 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 (French)

* New translations en.json (Portuguese)
5 years ago
Faustino Kialungila ae9b64a623
CMD + D to Duplicate Selection (#982)
* cmd+d to duplicate selection

* use duplicateElement instead

* use duplicateElement instead

* Update actionDuplicateSelection.ts

* select the new duplicated element

* add locale

* use event.key instead of event.code

Co-authored-by: David Luzar <luzar.david@gmail.com>
5 years ago
Lipis 83e49232ee
New Crowdin translations (#978)
* New translations en.json (Korean)

* New translations en.json (Korean)

* New translations en.json (Korean)

* New translations en.json (Korean)

* New translations en.json (Korean)

* New translations en.json (Portuguese)

* New translations en.json (Portuguese)
5 years ago
Christopher Chedeau db1f97f59e
Revert "[RFC] Randomized names next to mouse pointers. (#971)" (#972)
This reverts commit dcb93f75e6.
5 years ago
Pete Hunt 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>
5 years ago
Keyan Zhang d58216f5ec
[RFC] show confirmation dialog before the user closes the page (#957) 5 years ago
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
5 years ago
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.
5 years ago
Lipis 79ea76b48b
Different color for the stroke of the collaborator's arrow (#963)
* Different color for the stroke of the arrow

* Sort
5 years ago
Jed Fox e44801123a
Restyle the color picker a touch (#920) 5 years ago
Lipis d834ff4d89
New Crowdin translations (#912) 5 years ago
Pete Hunt 35ce1729cc
remove most setState({}) (#959) 5 years ago
Pete Hunt e1e2249f57
Abstract away or eliminate most of the mutation of the Elements array (#955) 5 years ago
Keyan Zhang 05af9f04ed
[easy] run typechecking on CI (#954) 5 years ago
Pete Hunt 3f8144ef85
Fix many syncing issues (#952) 5 years ago
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
5 years ago
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>
5 years ago
Christopher Chedeau e19088f214
Make selection handle resolution independent (#948)
They shouldn't really change when zooming in or out.
5 years ago
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
5 years ago
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
5 years ago
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
5 years ago
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.
5 years ago
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 :)
5 years ago
Jed Fox 668f8ec4a6
Make dialogs look better on mobile (#908)
* Standardize mobile media query

* Refactor & add mobile support to dialogs

* back & close icons
5 years ago
David Luzar c85315650f
fix calculating text width for indented text (#930) 5 years ago
David Luzar 450a024f5c
remove object.fromEntries (#933) 5 years ago
dwelle 642e47bd03 Merge remote-tracking branch 'origin/master' into fix_multiplayer_concurrency 5 years ago
dwelle c04fe403fc don't sync editing elements & prefer local versions 5 years ago
Edwin Lin 37284c9174
Merge pull request #915 from excalidraw/fix_remote_pointers
remove remote pointers on client disconnect
5 years ago
dwelle f1ac8cac32 remove unused selectedId 5 years ago
David Luzar 95e726bd6f
cancel text via doubleclick when in multiElement mode (#926) 5 years ago
David Luzar f0e6f4dbb8
Text esc fixes (#925)
* fix incorrectly resetting state on esc

* confirm text on esc
5 years ago
David Luzar 3a5ca27600
fix zero-coalescing roughness (#924) 5 years ago
dwelle 5706dd7ae2 consolidate & align collaboration socket eventing with server 5 years ago