/** * DOM helpers for F-18 islands. Icon paths are the lucide subset this lane * emits (app.js:7-77); innerHTML is the original SVG injection. */ const ICONS: Record = { plus: '', minus: '', x: '', "message-square": '', "more-vertical": '', pencil: '', "maximize-2": '', download: '', clock: '', provenance: '', star: '', "eye-off": '', link: '', "file-text": '', "trash-2": '', }; export function $(sel: string): HTMLElement | null { if (typeof document === "undefined") return null; return document.querySelector(sel); } export function el( tag: K, className?: string | null, text?: string | number | null, ): HTMLElementTagNameMap[K] { const node = document.createElement(tag); if (className) node.className = className; if (text != null) node.textContent = String(text); return node; } export function icon(name: string, size?: number, cls?: string): string { const px = size || 16; return ``; } export function iconEl(name: string, size?: number, cls?: string): HTMLElement { const wrap = el("span", cls ? "ic " + cls : "ic"); wrap.innerHTML = icon(name, size); return wrap; } export function ghostIconBtn(name: string, title?: string): HTMLButtonElement { const b = el("button", "icon-ghost"); b.innerHTML = icon(name, 16); if (title) b.title = title; return b; }