{# Shared CP437/ANSI grid editor widget -- CSS, canvas/tools panel, and the full pencil/line/rect/fill/text/select/copy-paste/undo-redo JS engine. Extracted from the original single-file ansi_editor/edit.html (the admin art-library editor) so a second, non-admin caller (postcards) can reuse the exact same editing engine instead of a second copy of it quietly drifting out of sync. Included with the calling template's own Jinja context (Jinja's default include behavior), so the caller must set, before including this file: grid_json -- JSON string, {width, height, cells:[{c,fg,bg}, ...]} save_url -- POST target; body is {grid: {width,height,cells}}, expected JSON response {ok: true} or {ok:false,error} preview_url -- GET target opened in a new tab by the Preview button Renders its own action bar (Save/Undo/Redo/Clear/Preview + cursor position), the canvas + tools panel, and the JS. The caller adds any extra buttons/panels of its own (e.g. admin's Duplicate/Apply-to-Menu, or postcards' Publish/shareable-link) around this include. #}
unsaved row 0 col 0
TOOLS
BRUSH SIZE
MODES
FOREGROUND
BACKGROUND
SELECTED CHAR
█
code 219
THEDRAW FONTS
REFERENCE IMAGE

Trace over a photo/sketch -- never saved or exported, purely an editing aid.

CHARACTER PALETTE
QUICK GLYPHS
" in it. Piped through |safe here, that closed the real