pasted-file-editor
Type in the editor as usual. A paste of 200 characters or more, a copied
file, a dropped file, or one chosen with Attach file does not land in the
editor: it attaches below as a card with a name and a preview. Open a card
to read the whole file (or see the image), load a text attachment into the
editor, or download it. The editor itself downloads under the filename
field; a blank name becomes pasted-file.txt and a name without an
extension gets .txt. The status line counts characters, lines, and UTF-8
bytes. Clear empties the editor and the attachments. Nothing leaves the
browser.
The pure part is wal-sh.tools.pasted-file-editor.core (host-neutral
.cljc, tested on the JVM with test.check: the reduction is total over
garbage, edit-then-clear is empty, the counts agree with the text, and the
download filename is idempotent). The browser adapter is
wal-sh.tools.pasted-file-editor.browser. Build: gmake tools-cljs; debug
in isolation: gmake dev-tool TOOL=pasted-file-editor.
Adapted from Simon Willison's Pasted File Editor (source); the attachment model, the 200-character threshold, and the preview rules are his.
See experiments: this tool ships behind
tool.pasted-file-editor.