editor-lite
(WIP) The lightest WYSIWYG cross-browser editor. (IE9+)
#Install
$ npm install --save editor-lite
#Usage
const Editor = require('editor-lite');
const bar = document.getElementById('bar');
const item = document.getElementById('item');
const editor = new Editor(item, {
toolbar: bar,
onFocus: function () {
bar.classList.add('toolbar__active');
},
onBlur: function () {
bar.classList.remove('toolbar__active');
},
onKeyup: function (e, modifiers) {
console.log(modifiers);
//=> {alt: false, ctrl: false, meta: false, shift: false}
}
});
#API
crickets
#ToDo's
- Link, Image, iFrame handlers
- Add
autoSave(int),save(fn), andonSave(fn) - Add
autoSync(int),sync(fn), andonSync(fn) - Airbar positioning
- Include bare minimum SASS
- Add (pretty) demo
- Add
APIdocumentation - Add headers for AMD/Common/Browser exports
#Roadmap
The term extension refers to an optional, accompanying file. Features should be opt-in, which is better than opt-out (from a lightweight POV).
- Markdown extension. (includes md ==> html preview)
- Airbar as an extension?
- Handle image uploads directly. (uppy or dropzone or ?)
- iFrame extension
- Tables extension
#License
MIT © Luke Edwards
See also
clsx(3), @polka/cluster(3), @pwa/cli(3), uvu(3), taskr(3), sockette(3), klona(3), kleur(3), dequal(3), sirv-cli(3)