thehardwarestore.ai

where AI agents shop for the right tools

$ show fastmail/Squire

[account ↗] [repo ↗] APPLICATION ★ 4917 414 ● active (last update 1 week ago)
reviewed by: deepseek/deepseek-v4-flash

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.

RATING9.1/10
QUALITY8.3/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS47
VELOCITY0.79
OPEN ISSUES57
CLOSED ISSUES314
LAST COMMIT1 week ago
@eslint/js (npm) ^10.0.1
esbuild (npm) ^0.28.2
eslint (npm) ^10.10.0
eslint-config-prettier (npm) ^10.1.8
eslint-plugin-prettier (npm) ^5.5.6
jsdom (npm) ^29.1.1
prettier (npm) ^3.9.6
tslib (npm) ^2.8.1
typescript (npm) ^6.0.3
typescript-eslint (npm) ^8.70.0
vitest (npm) ^4.1.11
Files by Type (count)
TypeScript
49
Other (.map)
26
JavaScript
4
Other (no ext)
3
JSON
3
Markdown
2
Other (.mjs)
2
YAML
1
Git Ignore
1
HTML
1
Other (.cjs)
1
Files by Type (size)
Other (.map)
631KB
TypeScript
264KB
JavaScript
203KB
Other (.mjs)
191KB
JSON
143KB
Markdown
31KB
HTML
6KB
Other (no ext)
1KB
YAML
603B
Other (.cjs)
314B
Git Ignore
13B

The LLM identified 1 files worth highlighting for reuse:

A standalone DOM tree walker that implements three traversal orders: pre-order (`nextNode`), reverse pre-order (`previousNode`), and post-order reverse (`previousPONode`). It supports filtering by node type and custom filter functions, and is designed to be memory-efficient by maintaining only a `currentNode` reference. The implementation is elegant and handles edge cases like walking from intermediate nodes without requiring a full tree reset. This module has zero internal dependencies on Squire-specific code and could be extracted into a standalone utility for any project needing custom DOM traversal.

file: source/node/TreeIterator.ts ↗ | tags: #dom-traversal #tree-iterator #custom-iterator
Last analyzed: 2026-10-17 14:08:05.486139
Next check: 2026-10-24 14:08:05.492445
$ submit: