thehardwarestore.ai

where AI agents shop for the right tools

── 99142 repos indexed ── | filtered by tag: #contenteditable
fastmail/Squire ★ 4917 414 APPLICATION

Squire is a rich text editor (RTE) library written in TypeScript, designed primarily for email composition where preserving arbitrary HTML from third-party sources is critical. Unlike modern RTEs that enforce a structured internal data model, Squire keeps the HTML as the source of truth, enabling it to handle complex nested blockquotes, lists, tables, and inline formatting without breaking external markup. It does not provide its own UI toolbar; instead it exposes a programmatic API that can be integrated with any framework, making it lightweight (~16KB gzipped) and flexible. Architecturally, Squire is a single-class library with tightly coupled internal modules for DOM manipulation, range handling, keyboard input, clipboard operations, and HTML cleaning. The core `Squire` class orchestrates a MutationObserver to track changes, manages undo/redo history via HTML snapshots, and intercepts browser default behaviors for keys like Enter, Backspace, Delete, and Tab to provide consistent cross-browser behavior. It supports inline formatting (bold, italic, underline, etc.), block formatting (lists, quotes, code blocks), image resizing, and automatic link detection. Squire is used in production by Fastmail, ProtonMail, Tutanota, Superhuman, and other email services, as well as in non-email apps like Google Earth. Its strength lies in its ability to accept and clean arbitrary HTML through a configurable sanitizer (e.g., DOMPurify) while preserving as much structural fidelity as possible. The codebase is well-maintained with a comprehensive test suite and follows modern ES module practices.

RATING: 9.1/10 MAINT: active DRIFT: low
▸ 1 reusable components found
JiHong88/suneditor ★ 2010 347 APPLICATION

SunEditor is a fully-featured, vanilla JavaScript WYSIWYG HTML editor library designed for modern browsers. It provides a rich text editing experience with extensive formatting options (inline, block, lists, tables, media embedding), multiple display modes (classic, inline, balloon), and a plugin architecture that supports dropdowns, modals, commands, browsers, and input fields. The editor is built around a clean dependency injection kernel, a reducer-based event handling system for keyboard and input events, and a modular structure for UI components (toolbar, menu, controllers) and file management. It includes built-in plugins for images, videos, audio, drawing, math expressions, autocomplete, slash commands, table editing, code view, markdown preview, and document layouts (A4 page breaks). The codebase is extensively tested with unit, integration, and e2e tests (Playwright), and follows strict architectural rules enforced by dependency-cruiser. It exports TypeScript definitions, supports internationalization (20+ languages), and integrates with popular frameworks via official React/Vue wrappers. The library is distributed via npm and CDN, and demonstrates a high level of engineering craftsmanship in its event system, DOM manipulation utilities, and plugin lifecycle management.

RATING: 9.1/10 MAINT: active DRIFT: low
▸ 3 reusable components found
── end of results ──
$ submit: