-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from jacwright/rewrite
Rewrite typewriter from scratch using delta and vdom
- Loading branch information
Showing
62 changed files
with
5,578 additions
and
3,912 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
.* | ||
node_modules/ | ||
build/ |
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 |
---|---|---|
@@ -1,9 +1,30 @@ | ||
# Typewriter | ||
|
||
A browser editor patterened after medium.com's editor described here in https://medium.com/medium-eng/why-contenteditable-is-terrible-122d8a40e480. | ||
A Quill.js clone that uses the [Delta](https://github.com/quilljs/delta/) data format for content but manages the DOM | ||
with a virtual DOM like React and similar frameworks use. Typewriter uses the tiny | ||
[Ultradom](https://github.com/jorgebucaran/ultradom/) for this. This allows decorators—temporary markup which is visible | ||
to the user but does not get merged into the editor contents or sent over the wire to collaborators. | ||
|
||
Typewriter keeps an object model representing the text of the document ensuring it will always contain the supported HTML and nothing more. | ||
## Benefits over Quill.js | ||
|
||
This was pulled from another project and likely needs cleaning up to be used. There are still things needing to be finished such as: | ||
* cleaning paste operations from other sources (such as MS Word) | ||
* supporting OL and UL items as blocks | ||
* The biggest is the decorators feature which I don't believe will be trivial to add to Quill | ||
* I believe it could be faster, but this needs benchmarking | ||
* Lists are handled correctly like normal HTML lists should be | ||
* Allowed `<br>` tags when Shift+Enter is used | ||
* Paragraphs are treated normal, with margins, unless of course you want to remove them in your own stylesheet | ||
* No required stylesheet to make it work | ||
* Undo breaks correctly when actions change—follows the native OS behavior of Mac and Windows | ||
|
||
### TODO | ||
|
||
* Add list handling, fix indent when deleting in the middle of a list (unindent as necessary) | ||
* Paste handling (should be pretty easy with deltaFromDom) | ||
* Code comments | ||
* Testing | ||
* More modules | ||
* Optional UI, toolbars, image handling, etc. | ||
* Benchmarking for good feels | ||
|
||
## Contributing | ||
|
||
Submit PRs, will get a gitter up |
Oops, something went wrong.