223 Commits

Author SHA1 Message Date
David Luzar
163ad1f4c4
feat: image support (#4011)
Co-authored-by: Emil Atanasov <heitara@gmail.com>
Co-authored-by: Aakansha Doshi <aakansha1216@gmail.com>
2021-10-21 22:05:48 +02:00
Aakansha Doshi
463857ad9a
feat: Export THEME from the package (#4055)
* Use Theme type everywhere
* Rename Appearance type to Theme for consistency
* Reorder headers in readme
The host don't need to pass hardcoded strings any more and instead can use the exported constant
2021-10-14 14:15:57 +05:30
Steve Ruiz
00c6940851
fix: freehand points (#4031)
Co-authored-by: dwelle <luzar.david@gmail.com>
2021-10-11 20:11:26 +02:00
David Luzar
097362662d
feat: pass localElements to restore and restoreElement API's and bump versions of duplicate elements on import (#3797) 2021-07-04 22:23:35 +02:00
Aakansha Doshi
6dee02e320
feat: expose fontfamily and refactor FONT_FAMILY (#3710)
* feat: expose fontfamily and refactor FONT_FAMILY for better readability

* fix

* fix

* fix

* docs

* fix
2021-06-13 21:26:55 +05:30
Aakansha Doshi
15f02ba191
refactor: code clean up (#3681)
* refactor: code clean up
Move types from App.tsx to types.ts
Move excalidrawPackage.test.tsx inside src/tests/package

* import type
2021-06-01 23:52:13 +05:30
David Luzar
60cea7a0c2
fix: selectedGroupIds not being stored in history (#3630)
thanks!
2021-05-29 21:35:03 +02:00
David Luzar
0bbb4535cf
fix: normalize linear element points on restore (#3633) 2021-05-24 20:35:53 +02:00
Lily Ge
044614dcf3
perf: Improve arrow head sizing (#3480)
Co-authored-by: Steve Ruiz <steveruizok@gmail.com>
2021-05-22 12:30:02 +02:00
David Luzar
11b8cc2caa
fix: remove draw element from codebase (#3559) 2021-05-10 11:01:10 +02:00
Steve Ruiz
49c6bdd520
feat: improved freedraw (#3512)
Co-authored-by: dwelle <luzar.david@gmail.com>
2021-05-09 17:42:10 +02:00
David Luzar
4ef7cb7365
feat: bump element version on z-index change (#3483)
* feat: bump element version on z-index change

* update snaps

* update changelog
2021-04-25 14:09:38 +02:00
Aakansha Doshi
d3106495b2
fix: make history local to a given excalidraw instance (#3481)
* fix: make history local to a given excalidraw instance

* changelog

* Update src/packages/excalidraw/CHANGELOG.md
2021-04-24 18:21:02 +05:30
Aakansha Doshi
891ac82447
fix: use active Excalidraw component when editing text (#3478)
* fix: use active excalidraw component when editing text

* changelog

* tweak
2021-04-23 21:11:18 +05:30
David Luzar
3a0b6fb41b
refactor: move getSyncableElements to CollabWrapper & expose isInvisiblySmallElement helper (#3471)
Co-authored-by: Aakansha Doshi <aakansha1216@gmail.com>
2021-04-21 23:37:44 +02:00
David Luzar
6730eb41c2
fix: scrollToContent only on visible elements (#3466) 2021-04-19 17:29:13 +02:00
Clément Lafont
e0a449aa40
feat: support tab in text Wyswig (#3411)
* fix: support tab in text Wyswig

* Refactor tab handling

Tab now indent the whole line, instead of inserting at the cursor
position.

Shift+Tab now deindent the whole line.

* Add multi-line tabulation support

* rename

* simplify algo for selected lines start indices & naming tweaks

* add cmd-bracket shortcuts as alias to indent/outdent

* support outdenting partial tabs

Co-authored-by: dwelle <luzar.david@gmail.com>
2021-04-13 16:23:46 +02:00
Aakansha Doshi
d126d04d17
feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container

* fix cases around blurring

* fix modal rendering so keyboard shortcuts work on modal as well

* Revert "fix modal rendering so keyboard shortcuts work on modal as well"

This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.

* Attach keyboard event in react way so we need not handle portals separately (modals)

* dnt propagate esc event when modal shown

* focus the container when help dialog closed with shift+?

* focus the help icon when help dialog on close triggered

* move focusNearestTabbableParent to util

* rename util to focusNearestParent and remove outline from excal and modal

* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests

* fix

* focus container after installing library, reset library and closing error dialog

* fix tests and create util to focus container

* Add excalidraw-container class to focus on the container

* pass focus container to library to focus current instance of excal

* update docs

* remove util as it wont be used anywhere

* fix propagation not being stopped for React keyboard handling

* tweak reamde

Co-authored-by: David Luzar <luzar.david@gmail.com>

* tweak changelog

* rename prop to handleKeyboardGlobally

Co-authored-by: dwelle <luzar.david@gmail.com>
2021-04-13 01:29:25 +05:30
Riley Schnee
b0d7ff290f
feat: Add option to flip single element on the context menu (#2520)
Co-authored-by: dwelle <luzar.david@gmail.com>
2021-03-26 16:45:08 +01:00
Hitesh Goyal
78f3a92dd1
feat: replaces fontSize and fontFamily text with icons (#2857)
Co-authored-by: Hitesh Goyal <hiteshlyearn@Hiteshs-MacBook-Pro.local>
Co-authored-by: dwelle <luzar.david@gmail.com>
2021-03-22 14:26:35 +01:00
David Luzar
9a13dd8836
fix: bail on noop updates for newElementWith (#3279) 2021-03-20 13:29:53 +01:00
David Luzar
e90e56452f
fix: stop preventing canvas pointerdown/tapend events (#3207) 2021-03-16 18:04:53 +01:00
Aakansha Doshi
f1daff2437
refactor: Rename appearance to theme (#3237)
* refactor: Rename appearance to theme

* fix

* update changelog

* rename theme_dark to theme--dark

* add about migration
2021-03-13 18:58:06 +05:30
Aakansha Doshi
3780a155f4
fix: Apply correct translation when text editor overflows when zoom not 100% (#3225)
* fix: Apply correct translation when zoom not 100%

* fix

* fix

* Update src/element/textWysiwyg.tsx

Co-authored-by: David Luzar <luzar.david@gmail.com>
2021-03-12 02:38:50 +05:30
Aakansha Doshi
6e629383ea
fix: Don't overflow text beyond width of Excalidraw (#3215)
* fix: Don't overflow text beyond width of Excalidraw

* update changelog
2021-03-10 01:49:32 +05:30
Aakansha Doshi
3a0a638a0d
fix: Position text editor absolute and fix the offsets so it doesn't remain fixed when container is scrolled (#3200)
* fix: Position text editor absolute and fix the offsets so it doesn't remain fixed when container is scrolled

* update changelog

* Update src/packages/excalidraw/CHANGELOG.md
2021-03-07 21:12:10 +05:30
Aakansha Doshi
3d1cbf444d
fix: Use Array.from when spreading over set so that typescript transpiles correctly in the umd build (#3165)
* fix: Use Array.from when spreading over set so that typescript transpiles correctly in the umd build

* patch version

* fix

* update changelog

* tweak
2021-03-03 19:27:15 +05:30
David Luzar
c77c9ce65a
fix: cursor being leaked outside of canvas (#3161) 2021-03-03 14:04:02 +01:00
David Luzar
e6cd97c4f2
feat: adjust line-confirm-threshold based on zoom (#2884)
Co-authored-by: Lipis <lipiridis@gmail.com>
2021-02-14 14:43:23 +01:00
David Luzar
4b253c7362
fix: refresh wysiwyg position on canvas resize (#3008) 2021-02-11 12:24:26 +01:00
David Luzar
6c81a32d62
fix: text editor not visible in dark mode (#2920) 2021-02-04 16:21:48 +01:00
David Luzar
e18e945cd3
fix: incorrect z-index of text editor (#2914) 2021-02-04 14:54:00 +01:00
Aakansha Doshi
675da16ca4
feat: add view mode in Excalidraw (#2840)
Co-authored-by: Lipis <lipiridis@gmail.com>
2021-02-01 21:56:42 +01:00
João Forja
e26f374ca6
improvement: Enhance resize for non generic elements (#2720) 2021-01-16 19:49:13 +01:00
David Luzar
3aab81bc35
docs: add tsdoc for certain element props (#2673)
Co-authored-by: Panayiotis Lipiridis <lipiridis@gmail.com>
2020-12-28 00:17:27 +02:00
Lipis
022f349dc6
feat: Add line chart and paste dialog selection (#2670)
Co-authored-by: dwelle <luzar.david@gmail.com>
Co-authored-by: Jed Fox <git@jedfox.com>
2020-12-27 18:26:30 +02:00
Steve Ruiz
c742225f43
More Arrowheads: dot, bar (#2486)
Co-authored-by: Jed Fox <git@jedfox.com>
Co-authored-by: Lipis <lipiridis@gmail.com>
2020-12-11 18:17:28 +01:00
Lipis
b2d442abce
Support CSV graphs and improve the look and feel (#2495)
Co-authored-by: David Luzar <luzar.david@gmail.com>
Co-authored-by: dwelle <luzar.david@gmail.com>
2020-12-11 12:13:23 +01:00
Lipis
c7b5cdb71e
Reduce the maximum size of the binding gap (#2450) 2020-12-09 14:03:25 +01:00
Steve Ruiz
c291edfc44
Add Arrowheads to Arrows (#2452)
Co-authored-by: dwelle <luzar.david@gmail.com>
Co-authored-by: Lipis <lipiridis@gmail.com>
2020-12-08 16:02:55 +01:00
João Forja
aa221837fc
Enhance aspect ratio tools | Rectangle, Diamond, Ellipses (#2439)
Co-authored-by: dwelle <luzar.david@gmail.com>
2020-12-07 00:39:31 +02:00
Christopher Chedeau
533815c081
Fix middle handles on mobile (#2459)
For rendering we always use mouse in order to check which handles to display but when doing the hit test, we used pointer which has a different size. So we couldn't use the middle handles for small shapes. This is now fixed.

cc @j-f1 as you added it in #790
2020-12-05 16:35:44 -08:00
Lipis
b21fd49412
chore: Minor refactoring for consistency (#2425) 2020-11-29 17:32:51 +01:00
Rene
a1fbec1030
Remove last committed point json (#2371)
Co-authored-by: rene_mbp <harryloveslearning@googlemail.com>
Co-authored-by: dwelle <luzar.david@gmail.com>
2020-11-11 15:55:22 +01:00
Lipis
a20f3240fd
Prefer arrow functions (#2344) 2020-11-06 21:06:39 +01:00
Lipis
e05acd6fd9
Update ESLint rules (#2342) 2020-11-06 21:06:30 +01:00
Lipis
5d295415db
Keep errors, elements and comments consistent (#2340)
Co-authored-by: David Luzar <luzar.david@gmail.com>
2020-11-05 18:06:18 +01:00
João Forja
566e6a5ede
Zoom on cursor | Issue #940 (#2319) 2020-11-04 19:49:15 +02:00
Michal Srb
8a10f2a0b8
Fix collision check for rectangles and rendering of binding area (#2221) 2020-10-11 09:46:13 +03:00
Chrisando Pramudhita
e424ca53c6
fix inconsistent text element color on dark mode while editing. (#2196)
On dark mode, while text element is being edited, it was changing color to the light mode variant (white turns back to black, etc...).

This is caused by the --appearance-filter not being applied to the floating textarea. The css var --appearance-filter is only applied to the .excalidraw class while the floating textarea is being appended to the body which put it outside of .excalidraw.

This change adds excalidraw class to the floating textarea and also adds Appearance_dark to it while dark mode is on.
2020-10-05 17:41:57 +03:00