2322 Commits

Author SHA1 Message Date
Gasim Gasimzada
ad4ad238ef
Remove invisibly small elements on scene load (#754) 2020-02-10 15:38:41 +01:00
lissitz
fa12125db0
fix some element types reset to selection when the lock is active (#746)
* keep arrows and lines selected if locked

* keep element type selected if locked after inserting text

* ensure clicking outside doesn't create new text

* esc should switch to selection even if locked

* reset cursor when creating text via doubleClick

Co-authored-by: David Luzar <luzar.david@gmail.com>
2020-02-10 15:09:50 +01:00
dependabot-preview[bot]
1ec3946ed6 Bump @types/jest from 25.1.1 to 25.1.2 (#750)
Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 25.1.1 to 25.1.2.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-10 09:50:57 +01:00
David Luzar
6dd3620dd6 fix cloning element.points (#744) 2020-02-09 23:57:14 +01:00
Christopher Chedeau
b64fe9aae4
Update FG_Virgil to support Russian and Greek characters (#720)
* Update FG_Virgil to support Russian and Greek characters

Fixes #469

* more symbols
2020-02-09 14:51:47 -08:00
David Luzar
2a472bb912
ensure duplicateElement does deep copy of points (#742) 2020-02-09 14:45:21 -08:00
David Luzar
389e40900c
z-index button fixes (#738)
* fix svg attributes

* center z-index icons

* remove unnecessary attributes

* differentiate button :active bg

* prevent selection of ToolIcon hints

* emphasize active elem color
2020-02-09 17:09:21 +01:00
wboucher
471ea4a747
Add zindex to panel (#736)
* Add z-index options back to panel

* Add formatting for z-index panel buttons

* make z-index buttons all the same width

* make z-index button spacing even

* use svg icons & translations

* add ui legend

Co-authored-by: David Luzar <luzar.david@gmail.com>
2020-02-09 15:07:34 +01:00
Gasim Gasimzada
b09373acf7
Align arrow caps based on bezier curve instead of stored points (#737) 2020-02-09 14:23:09 +01:00
Christopher Chedeau
c2a3b67ccc
Fix scrollbar (#735)
The computation was not correct. I'm not really sure how it used to work but it was not taking into account the dimensions of the scene so it was wrong.

The new algorithm is computing the scrollbar such that it's the position of the viewport in relationship to the bounding box of the viewport and all the elements.

Fixes #680
2020-02-08 16:20:14 -08:00
Christopher Chedeau
935a7f58a7
Remove previously loaded scenes (#734)
As mentioned in #724, the current implementation is suboptimal. Let's remove it until we come back with a better design.

Fixes #724
2020-02-08 15:05:38 -08:00
Christopher Chedeau
8d64ec8153
Add lock icon (#733)
Because it looks more secure ;)
2020-02-08 14:53:16 -08:00
Christopher Chedeau
e6d03aeeea
End to end encryption description (#731)
* End to end encryption description

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

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

* capitalize excalidraw

Co-authored-by: David Luzar <luzar.david@gmail.com>
2020-02-08 10:43:59 +01:00
Szymon Pajka
f359a1ea1b
Fix grammar problems in Polish translation 🇵🇱🐛 (#730)
* corrected typos
* fixed grammar
2020-02-07 23:48:39 +01:00
David Luzar
d79293de06
move footer into layerUI & refactor ActionManager (#729) 2020-02-07 23:46:19 +01:00
David Luzar
88eacc9da7
Improve pasting (#723)
* switch to selection tool on paste

* align pasting via contextMenu with pasting from event

* ensure only plaintext can be pasted

* fix findShapeByKey regression

* simplify wysiwyg pasting

* improve wysiwyg blurriness
2020-02-07 18:42:24 +01:00
Lipis
ba1a39c9f3
Add npmrc to have pinned deps (#727) 2020-02-07 13:59:23 +01:00
Szymon Pajka
1cd0dfe922
Add Polish language support (#725) 2020-02-07 12:37:33 +01:00
BM
a7dc067dfe
Fix language selection (#726) 2020-02-07 10:43:30 +00:00
David Luzar
3b20e6e2b8
fix decoding imported data from backend (#722) 2020-02-06 18:46:26 +01:00
Gasim Gasimzada
33016bf6bf
Fix issues related to history (#701)
* Separate UI from Canvas

* Explicitly define history recording

* ActionManager: Set syncActionState during construction instead of in every call

* Add commit to history flag to necessary actions

* Disable undoing during multiElement

* Write custom equality function for UI component to render it only when specific props and elements change

* Remove stale comments about history skipping

* Stop undo/redoing when in resizing element mode

* wip

* correctly reset resizingElement & add undo check

* Separate selection element from the rest of the array and stop redrawing the UI when dragging the selection

* Remove selectionElement from local storage

* Remove unnecessary readonly type casting in actionFinalize

* Fix undo / redo for multi points

* Fix an issue that did not update history when elements were locked

* Disable committing to history for noops

- deleteSelected without deleting anything
- Basic selection

* Use generateEntry only inside history and pass elements and appstate to history

* Update component after every history resume

* Remove last item from the history only if in multi mode

* Resume recording when element type is not selection

* ensure we prevent hotkeys only on writable elements

* Remove selection clearing from history

* Remove one point arrows as they are invisibly small

* Remove shape of elements from local storage

* Fix removing invisible element from the array

* add missing history resuming cases & simplify slice

* fix lint

* don't regenerate elements if no elements deselected

* regenerate elements array on selection

* reset state.selectionElement unconditionally

* Use getter instead of passing appState and scene data through functions to actions

* fix import

Co-authored-by: David Luzar <luzar.david@gmail.com>
2020-02-05 19:47:10 +01:00
David Luzar
972d69da6c
fix hotkeys not working when non-writable input focused (#717) 2020-02-05 19:07:53 +01:00
David Luzar
82eb97462b
fix restoring from localStorage (#715) 2020-02-05 17:57:08 +01:00
David Luzar
b7a6ceba68
Eslint tweaks (#696)
* make eslint styleguide into warnings & drop no-else-return

* reintroduce max-warnings=0

* remove unnecessary eslint line disable

* reintroduce no-else-return rule
2020-02-05 17:41:14 +01:00
Christopher Chedeau
2dd1796351
Add encryption (#642)
* Add encryption

In order to avoid the server being able to read the content of the scene, this PR implements local encryption and decryption. This implements the algorithm described in #610.

Right now the server doesn't support uploading binary files. I mocked the server with comments. @lipis, could you add support on the server and update this PR? I added a bunch of TODO: that tell you where to comment/uncomment in order to get the server flow going.

To test locally right now:
- Import: Open http://localhost:3000/#json=1234,5oYVOnGpWYPPTz19-PMYYw and see a square
- Export: Click the export link and see the right url with the private key + the encrypted binary in the console

Fixes #610

* backend_v2

* v2
2020-02-05 07:35:51 -08:00
Gasim Gasimzada
c7d7d65e1b
Set arrow cap size based on minimum the full length of the arrow instead of last segment (#709) 2020-02-05 03:54:17 -08:00
BM
27a1217981
Remove select color input on click (#708) 2020-02-05 04:04:29 +00:00
Lipis
e79d9f5676
Add white background to og-image (#702) 2020-02-04 17:55:50 +01:00
Gasim Gasimzada
08d80fb4fe
Add points to multi arrows in real time (#697)
* Add points to multi arrows in real time

* Fix linter issues

* Clear unecessary values from local storage
2020-02-04 14:39:08 +01:00
Bakhtiiar Muzakparov
173fe093b6
Fix typing into color picker popup text field (#694)
Co-authored-by: David Luzar <luzar.david@gmail.com>
2020-02-04 13:28:22 +00:00
David Luzar
954d805cb3
rewrite clipboard handling (#689) 2020-02-04 11:50:18 +01:00
Gasim Gasimzada
dab35c9033
Multi Point Lines (based on Multi Point Arrows) (#660)
* Enable multi points in lines

* Stop retrieving arrow points for lines

* Migrate lines to new spec during load

* Clean up and refactor some code

- Normalize shape dimensions during load
- Rename getArrowAbsoluteBounds

* Fix linter issues
2020-02-04 13:45:22 +04:00
Gasim Gasimzada
f70bd0081c
Feature: Hint viewer (#666)
* Add Hint viewer

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

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

* Remove dangling locales from public

* Add shortcut to hide hints

* Change hint texts and show resize hint ONLY during resizing

* Remove hints toggling
2020-02-03 09:52:21 -08:00
rubjo
23d40ae4a5
Added Norwegian Bokmål (#685)
* Added Norwegian Bokmål

* Lint long line
2020-02-03 13:38:07 +01:00
dependabot-preview[bot]
a2db55ae2b
Bump react-scripts from 3.3.0 to 3.3.1 (#684)
Bumps [react-scripts](https://github.com/facebook/create-react-app/tree/HEAD/packages/react-scripts) from 3.3.0 to 3.3.1.
- [Release notes](https://github.com/facebook/create-react-app/releases)
- [Changelog](https://github.com/facebook/create-react-app/blob/master/CHANGELOG.md)
- [Commits](https://github.com/facebook/create-react-app/commits/react-scripts@3.3.1/packages/react-scripts)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-03 10:01:08 +01:00
dependabot-preview[bot]
f6bddd9300
Bump @types/jest from 25.1.0 to 25.1.1 (#683)
Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 25.1.0 to 25.1.1.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-03 09:59:57 +01:00
dependabot-preview[bot]
48900a271b
Bump lint-staged from 10.0.3 to 10.0.7 (#682)
Bumps [lint-staged](https://github.com/okonet/lint-staged) from 10.0.3 to 10.0.7.
- [Release notes](https://github.com/okonet/lint-staged/releases)
- [Commits](https://github.com/okonet/lint-staged/compare/v10.0.3...v10.0.7)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-03 09:59:22 +01:00
dependabot-preview[bot]
0d176caa5b
Bump nanoid from 2.1.10 to 2.1.11 (#681)
Bumps [nanoid](https://github.com/ai/nanoid) from 2.1.10 to 2.1.11.
- [Release notes](https://github.com/ai/nanoid/releases)
- [Changelog](https://github.com/ai/nanoid/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ai/nanoid/compare/2.1.10...2.1.11)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-03 09:58:56 +01:00
Bakhtiiar Muzakparov
f955f58bc4
Allow changing opacity with scroll wheel (#662) 2020-02-03 01:48:41 +00:00
Christopher Chedeau
68ca63ec14
Add step for opacity slider (#670)
Instead of freeform, let's only support 10 increments of opacity. Should help keep things consistent
2020-02-02 17:09:50 -08:00
Faustino Kialungila
abd04cb870
Load only valid excalidraw json when drag&drop (#678)
* Load only valid excalidraw json when drag&drop

* fix lint error
2020-02-02 16:27:02 -08:00
lissitz
92a0f100b8
Drag and drop JSON exports to canvas loads the scene (#676)
* Drag and drop JSON exports to canvas loads the scene

* remove unneeded onDragOver
2020-02-02 21:02:13 +00:00
Lipis
53994e71e5
Add more ESLint rules and change the formatting scripts (#626)
* Add curly rule in ESLint for consistency

* Fix rules

* More rules

* REturn

* Push

* no else return

* prefer const

* destructing
2020-02-02 18:04:35 +00:00
Faustino Kialungila
814299321e
Add missing locales for scrollBackToContent (#663)
* Add missing locales for scrollToContent

* remove duplicated locales
2020-02-02 14:29:09 +00:00
Faustino Kialungila
92deb033a3
Update logo (#665) 2020-02-02 12:06:19 +01:00
Christopher Chedeau
f8a41cee16
Add keybindings for shapes (#648)
* Add keybindings for shapes

I'm not 100% sure about this one. I feel like it's going to help people be a lot more productive to display the key bindings at all time. But it also clutters the UI...

* increase font-size

* fix shape keybindings for non-qwerty keyboards

* tweak position and color

Co-authored-by: David Luzar <luzar.david@gmail.com>
2020-02-01 18:31:28 +01:00
Christopher Chedeau
be97bd980e
Add button when scrolled outside of visible area (#643)
With the infinite scroll behavior, it's easy to scroll super far away from where the content is and have a hard time getting back. This PR adds a button to refocus on the center of the scene when no elements are visible anymore.
2020-02-01 17:52:10 +01:00
Faustino Kialungila
7c9e6dd3f1
support undo/redo for azerty keyboards (#630)
* support undo/redo for azerty keyboards

* migrate to event.key

* remove unnecessary shiftKey check

Co-authored-by: David Luzar <luzar.david@gmail.com>
2020-02-01 17:37:22 +01:00
Christopher Chedeau
46791e6da1
Add keybindings for color picker (#647)
* Add keybindings for color picker

This adds the ability to navigate using left/right/bottom/up keys and shows key bindings for all the different colors. This is only optimized for the qwerty keyboard layout, but unfortunately it's not possible to detect other keyboard layouts :(

* add aria-keyshortcuts and keybinding in title

* make focus select color, confirm on enter

Co-authored-by: David Luzar <luzar.david@gmail.com>
2020-02-01 13:56:15 +01:00
Gasim Gasimzada
1e4ce77612
Reintroduce multi-point arrows and add migration for it (#635)
* Revert "Revert "Feature: Multi Point Arrows (#338)" (#634)"

This reverts commit 3d2e59bfed4fa41a0cae49ee567a6f95ca26e7bf.

* Convert old arrow spec to new one

* Remove unnecessary failchecks and fix context transform issue in retina displays

* Remove old points failcheck from getArrowAbsoluteBounds

* Remove all failchecks for old arrow

* remove the rest of unnecessary checks

* Set default values for the arrow during import

* Add translations

* fix restore using unmigrated elements for state computation

* don't use width/height when migrating from new arrow spec

Co-authored-by: David Luzar <luzar.david@gmail.com>
Co-authored-by: Christopher Chedeau <vjeuxx@gmail.com>
2020-02-01 15:49:18 +04:00