browser-focus-editor
v1.0.4
Published
focus editor for the focused editor
Readme
Focus Editor
… for the focused editor
Features
- distraction free zen-mode
- zero dependencies
- responsive
- lightweight
- ~80Kbytes uncompressed <-> ~20Kbytes compressed
Usage
<head>
<link rel="stylesheet" href="https://unpkg.com/browser-focus-editor@latest/src/css/FocusEditor.css">
</head>
<body>
<focus-editor></focus-editor>
<script type="module">
import { init } from "https://unpkg.com/browser-focus-editor@latest/src/FocusEditor.mjs"
init();
</script>
</body>Replacing textareas with focus-editor
<head>
<link rel="stylesheet" href="https://unpkg.com/browser-focus-editor@latest/src/css/FocusEditor.css">
</head>
<body>
<textarea name="my-textarea"></textarea>
<script type="module">
import { textareasAsFocusEditor } from "https://unpkg.com/browser-focus-editor@latest/src/FocusEditor.mjs"
textareasAsFocusEditor();
</script>
</body>JavaScript usage in older browser without module support
<script src="https://unpkg.com/browser-focus-editor@latest/cjs/FocusEditor.js"></script>
<script>
window.initFocusEditor();
</script>Todos
- [ ] refactor cursor class, md and helper module
- [ ] sync web component with existing textarea/input
- [ ] limit undo steps
- [ ] complete api docs
