Commit Graph

1912 Commits (3b976613bae1ec2242f5abb401754b4b675a8cb4)
 

Author SHA1 Message Date
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
5 years ago
Christopher Chedeau 8d64ec8153
Add lock icon (#733)
Because it looks more secure ;)
5 years ago
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>
5 years ago
Szymon Pajka f359a1ea1b
Fix grammar problems in Polish translation 🇵🇱🐛 (#730)
* corrected typos
* fixed grammar
5 years ago
David Luzar d79293de06
move footer into layerUI & refactor ActionManager (#729) 5 years ago
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
5 years ago
Lipis ba1a39c9f3
Add npmrc to have pinned deps (#727) 5 years ago
Szymon Pajka 1cd0dfe922
Add Polish language support (#725) 5 years ago
BM a7dc067dfe
Fix language selection (#726) 5 years ago
David Luzar 3b20e6e2b8
fix decoding imported data from backend (#722) 5 years ago
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>
5 years ago
David Luzar 972d69da6c
fix hotkeys not working when non-writable input focused (#717) 5 years ago
David Luzar 82eb97462b
fix restoring from localStorage (#715) 5 years ago
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
5 years ago
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
5 years ago
Gasim Gasimzada c7d7d65e1b
Set arrow cap size based on minimum the full length of the arrow instead of last segment (#709) 5 years ago
BM 27a1217981
Remove select color input on click (#708) 5 years ago
Lipis e79d9f5676
Add white background to og-image (#702) 5 years ago
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
5 years ago
Bakhtiiar Muzakparov 173fe093b6
Fix typing into color picker popup text field (#694)
Co-authored-by: David Luzar <luzar.david@gmail.com>
5 years ago
David Luzar 954d805cb3
rewrite clipboard handling (#689) 5 years ago
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
5 years ago
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
5 years ago
rubjo 23d40ae4a5
Added Norwegian Bokmål (#685)
* Added Norwegian Bokmål

* Lint long line
5 years ago
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>
5 years ago
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>
5 years ago
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>
5 years ago
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>
5 years ago
Bakhtiiar Muzakparov f955f58bc4
Allow changing opacity with scroll wheel (#662) 5 years ago
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
5 years ago
Faustino Kialungila abd04cb870
Load only valid excalidraw json when drag&drop (#678)
* Load only valid excalidraw json when drag&drop

* fix lint error
5 years ago
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
5 years ago
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
5 years ago
Faustino Kialungila 814299321e
Add missing locales for scrollBackToContent (#663)
* Add missing locales for scrollToContent

* remove duplicated locales
5 years ago
Faustino Kialungila 92deb033a3
Update logo (#665) 5 years ago
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>
5 years ago
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.
5 years ago
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>
5 years ago
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>
5 years ago
Gasim Gasimzada 1e4ce77612
Reintroduce multi-point arrows and add migration for it (#635)
* Revert "Revert "Feature: Multi Point Arrows (#338)" (#634)"

This reverts commit 3d2e59bfed.

* 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>
5 years ago
Christopher Chedeau 4ff88ae03d
Fix caret for real! (#653)
Turns out the root cause was the outline. For some reason, doing "transparent" doesn't work but doing "1px solid transparent" does. Don't know why but I'll take it!
5 years ago
Christopher Chedeau 9a76556bea
Fixed wysiwyg carret disappearing on Chrome (#652)
There's a bug where the carret doesn't show up when the text is first focused on Chrome with the previous combination of CSS. I tweaked it and now it seems to work (don't ask me why!).

Unfortunately on Safari, ever since we moved to contentEditable on #274, the carret disappeared the first time. I unsuccessfully tried to repro in a smaller codebase ( https://jsfiddle.net/u2mjs90y/1/ ) but it does work in Safari...

I'm not exactly sure what's going on, there are bunch of issues opened against this bug when googling against all the browsers...
5 years ago
Christopher Chedeau 70db792549
Allow copy pasting inside of wysiwyg element (#651)
We did some hackery to prevent copy pasting when we didn't support multilines. But we do now so we can remove it.

Interestingly, newlines are actually <br /> elements. So we need to tweak the isInputLike logic a bit
5 years ago
Christopher Chedeau f261d6f2fc
Fix font preloading (#649)
Thanks to this stack overflow answer ( https://stackoverflow.com/a/41678350/232122 ) I was able to fix the font preloading!

If we put fonts.css in the public/folder and include it with normal html, we can avoid going through the build pipeline!
5 years ago
Christopher Chedeau e50dc5dbed
Fix wysiwyg text overflow (#650)
By using position: fixed like the rest of the UI components, it will no longer make the body change size and have bad side effects like scrolling.

Fixes #365
5 years ago
Christopher Chedeau 47f6328ae1
Fix ability to use arrow keys to navigate between shapes (#646)
This is the only way to navigate using the keyboard and was prevented by #596. Now it works fine.

Test Plan:
- Click on selection icon
- Use left/right arrow keys to move between tool icons, that works.

- Click on a shape, cmd+c
- Click on the selection icon
- Cmd+v, it pastes correctly
5 years ago
Christopher Chedeau 39674fe2b0
Add outline to button list (#644)
It's unclear otherwise when using the keyboard
5 years ago
Christopher Chedeau 29f1465b81
Fix wrong cursor for selection keyboard shortcut (#645)
Pressing 1 would change the cursor to a + instead of normal cursor
5 years ago
Christopher Chedeau c7eebd42c1
Fix conflict (#641) 5 years ago
Lipis fc341c3763
Better handling of 404 errors when loading from backend (#608) 5 years ago