/** * The shared table of the workbench's line icons (lucide paths, app.js:7-77). * * The port split app.js's single table into per-lane copies, and the copies * drifted: `panel-left` / `panel-right` / `moon` / `sun` ended up in no table * `paintIcons()` reads, so the sidebar, dock and theme buttons rendered an * empty ``. `features/sessions/icon.ts`, `features/chrome/dom.ts` and * `features/notebook/chrome.ts` draw from this table; add a name here, not to * a lane. send/icon.ts, timeline/dom.ts, islands/dom.ts and artifacts/api.ts * still keep tables of their own. * * Paths are a closed allowlist of static markup, injected as innerHTML the * way app.js did. Never build an entry from data. */ export const ICON_PATHS: Readonly> = { plus: '', share: '', "chevron-down": '', "chevron-right": '', "arrow-left": '', x: '', check: '', box: '', clock: '', sliders: '', files: '', settings: '', "more-horizontal": '', "thumbs-up": '', "thumbs-down": '', pencil: '', copy: '', package: '', "trash-2": '', download: '', server: '', notebook: '', folder: '', compass: '', "file-text": '', stop: '', "alert-triangle": '', "eye-context": '', "cloud-upload": '', provenance: '', search: '', terminal: '', book: '', users: '', "circle-dot": '', grid: '', loader: '', archive: '', file: '', "message-square": '', sparkles: '', moon: '', sun: '', "panel-left": '', "panel-right": '', }; /** * Give a node its icon and draw it now. paintIcons() runs once, when the Shell * is bound, so a node created after that which only carries `data-icon` stays * an empty button. */ export function paintIcon(node: HTMLElement, name: string, size = 16): void { node.setAttribute("data-icon", name); node.setAttribute("data-icon-size", String(size)); node.innerHTML = iconSvg(name, size); (node as HTMLElement & { _painted?: boolean })._painted = true; } /** An inline `` for `name`; an unknown name is an empty drawing. */ export function iconSvg(name: string, size?: number, cls?: string): string { const px = size || 16; const paths = Object.prototype.hasOwnProperty.call(ICON_PATHS, name) ? ICON_PATHS[name] : ""; return ( `" ); }