Virtual wordprocessor engine that runs in mobile (React native), web browser(Javascript) and server (Nodejs)
For virtual calc engine: https://www.github.com/selvan/calc-engine
- Support for Cut/Copy/Paste
- Support for Undo/Redo
- Support for Bold, Italic, Underline, Strike through
- Support for Alignment (Left, Right, Center) and Quote
- Support for List items
There are two kind of nodes in wordprocessor-engine,
- Container (Line, List, HBox)
- Content (Picture, Chart, Text)
Text node holds text content. It supports handling operation such as,
- handleBackspace
- handleDeleteAt
- handleReturnAt
- insertStrAt
- splitNodeAfter
- splitNodeBefore
- splitNodeBetween
- clone
See lib/wordprocessor/node/content/tests/textnode for details on these operations
LineNode holds one or more text nodes. It supports handling operation such as,
- addChildAfter
- addChildBefore
- deleteChildById
- extractChildById
- forEach
- merge
- mergeAfterChild
- pop
- push
- splitAfterChild
- splitAtChild
See lib/wordprocessor/node/container/tests/containernode for details on these operations
See /lib/wordprocessor/visitor/__tests__/CutCopyVisitor-test.js
See /lib/wordprocessor/visitor/__tests__/PasteVisitor-test.js
See lib/wordprocessor/__tests__/UndoManager-test.js
See /lib/wordprocessor/visitor/__tests__/ListStyleVisitor-test.js
See /lib/wordprocessor/visitor/__tests__/LineStyleVisitor-test.js
See /lib/wordprocessor/visitor/__tests__/TextStyleVisitor-test.js
See /lib/wordprocessor/visitor/__tests__/DeleteVisitor-test.js
See /lib/wordprocessor/__tests__/Deserializer-test.js
npm run start
This will create dist/bundle.js
npm run test
npm run build
This will create dist/bundle.min.js
- There are two kind of nodes a) Container (Line, List, HBox) b) Content (Picture, Chart, Text)
- Content node shall be cursor focusable (text node) or non-cusrsor focuable (Picture, Chart)
- User can only set a selection range on a text node.