0.10.0 • Published 2 years ago

spytext v0.10.0

Weekly downloads
3
License
MIT
Repository
github
Last release
2 years ago

Spytext - The Tiny HTML5 Editor

Spytext is an HTML5 editor, not a Rich Text Editor, weighing in at 8.6 kb.

Spytext is built contentEditable, but most browsers handle handling line breaks, new sections, backspaces, deletes, formatting etc very differently. As a result, Spytext uses it's own DOM manipulating commands (through dollr), selection management (through selektr) and DOM undo/redo (through snapback). The only parts contentEditable still handles are actual type inputs and text traversal (arrow buttons, page up, etc).

Despite all this, the entire library (including ALL dependencies) is tiny.

Demo

There is a Plunker demo at: https://embed.plnkr.co/sJNI4kVqX7VEgA0mY2UJ/

Usage

NPM

$ npm install spytext
import Spytext from 'spytext'

const spytext = new Spytext({ el: document.getElementById('#spytext-field') })

spytext.deactivate()

spytext.activate()

CDN (UMD build)

<div id='spytext-field'></div>

<script src='https://unpkg.com/spytext@0.9.1/dist/spytext.min.js'></script>

<script>
document.addEventListener('DOMContentLoaded', () => {
  const spytext = new Spytext({ el: document.getElementById('#spytext-field') })
}, false)
</script>

Functionality

  • Styling text with italic, bold, underline or strike-trough
  • Change between P, H1, H2, H3, H4, H5 and H6 blocks for text
  • Align/justify text blocks
  • Create ordered and unordered lists
  • Indent/outdent these lists and
  • Selection management
  • Undo/redo (including remembering selections positions)

Spytext is Tiny

MinifiedCompressed
Spytext (UMD build, all deps)29 kb8.6 kb

Compatibility

QuirkyWithout UndoFull
Chrome91618
IEN/A9N/A
Firefox13.614
SafariUnknownUnknown6
OperaUnknownUnknown15
0.10.0

2 years ago

0.9.3

8 years ago

0.9.2

8 years ago

0.9.1

8 years ago

0.9.0

8 years ago

0.8.0

9 years ago

0.8.0-alpha.6

9 years ago

0.8.0-alpha.5

9 years ago

0.8.0-alpha.4

9 years ago

0.8.0-alpha.3

9 years ago

0.8.0-alpha.2

9 years ago

0.8.0-alpha

9 years ago

0.7.0

9 years ago

0.6.4

9 years ago

0.6.3

9 years ago

0.6.2

9 years ago

0.6.1

9 years ago

0.6.0

9 years ago

0.5.1

10 years ago

0.5.0

10 years ago

0.4.2

10 years ago

0.4.1

10 years ago