Update editor, themes, menus, backgrounds, and release tooling

This commit is contained in:
Knotty Wyvern
2026-10-14 16:19:51 -07:00
parent f6eaa52949
commit edef2520af
113 changed files with 5722 additions and 386 deletions
+4 -5
View File
@@ -1,10 +1,9 @@
// Readers retain editor selection when toolbar buttons take focus.
let current: { id: string; read: () => string } | undefined;
const readers = new Map<string, () => string>();
export function registerSelection(id: string, read: () => string): () => void {
const owner = { id, read };
current = owner;
return () => { if (current === owner) current = undefined; };
readers.set(id, read);
return () => { if (readers.get(id) === read) readers.delete(id); };
}
export function selectedEditorText(id?: string): string {
return current && current.id === id ? current.read() : "";
return id ? readers.get(id)?.() ?? "" : "";
}