-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…Fix #28 Editor overhaul
- Loading branch information
Showing
16 changed files
with
236 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
draftail documentation | ||
====================== | ||
|
||
## Editor behavior | ||
|
||
### Keyboard shortcuts | ||
|
||
We support most of the common keyboard shortcuts users would expect to find in text editors thanks to [Draft.js key bindings](https://facebook.github.io/draft-js/docs/advanced-topics-key-bindings.html). | ||
|
||
Here are the most important shortcuts: | ||
|
||
|Shortcut|Function| | ||
|--------|--------| | ||
|Cmd + B | Bolden text (if enabled) | | ||
|Cmd + I | Italicise text (if enabled) | | ||
|Cmd + U | Underline text (if enabled) | | ||
|Cmd + J | Format as code (if enabled) | | ||
|Cmd + Z | Undo | | ||
|Cmd + Maj + Z | Redo | | ||
|Cmd + Left | Move selection to start of block | | ||
|Cmd + Right | Move selection to end of block | | ||
|Cmd + Tab|Increase indentation of list items| | ||
|Cmd + Maj + Tab|Decrease indentation of list items| | ||
|
||
Other shortcuts we would like to support in the future: | ||
|
||
|Shortcut|Function| | ||
|--------|--------| | ||
|Cmd + Option + 1/2/3/4/5/6 | Format as heading level | | ||
|Cmd + Option + 0 | Format as paragraph | | ||
|Cmd + K | Create a link (if enabled) | | ||
|
||
### Expected behavior | ||
|
||
### Unsupported scenarios | ||
|
||
- Nesting `ol` inside `ul` or the other way around. | ||
|
||
## R&D notes | ||
|
||
### Other Draft.js editors | ||
|
||
> Full list on https://github.com/nikgraf/awesome-draft-js | ||
Other approaches: | ||
|
||
- https://github.com/ianstormtaylor/slate | ||
- http://quilljs.com/ | ||
|
||
### Other Wagtail-integrated editors to learn from. | ||
|
||
Things to borrow: keyboard shortcuts, Wagtail integration mechanism, | ||
|
||
- https://github.com/jaydensmith/wagtailfroala | ||
- https://github.com/isotoma/wagtailtinymce |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import React from 'react'; | ||
import { shallow } from 'enzyme'; | ||
import Button from '../components/Button'; | ||
|
||
describe('Button', () => { | ||
it('exists', () => { | ||
expect(Button).toBeDefined(); | ||
}); | ||
|
||
it('basic', () => { | ||
expect(shallow(<Button label="Test" onClick={() => {}} />)).toBeDefined(); | ||
}); | ||
}); |
Oops, something went wrong.