Skip to content

Commit

Permalink
Merge pull request #2 from jacwright/rewrite
Browse files Browse the repository at this point in the history
Rewrite typewriter from scratch using delta and vdom
  • Loading branch information
jacwright authored Apr 17, 2018
2 parents c8b0c05 + 78c38ee commit ae6ce0d
Show file tree
Hide file tree
Showing 62 changed files with 5,578 additions and 3,912 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
.*
node_modules/
build/
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2015-2016 Jacob Wright
Copyright (c) 2018 Jacob Wright

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
Expand Down
31 changes: 26 additions & 5 deletions README.md
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
Loading

0 comments on commit ae6ce0d

Please sign in to comment.