feat(packages): add settings menu (#1615)

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Sam Potts
2026-06-10 13:54:45 +10:00
committed by GitHub
co-authored by Cursor
parent 62d0524b83
commit 00b6f0be1d
117 changed files with 4246 additions and 1208 deletions
+12
View File
@@ -0,0 +1,12 @@
/** Toggle a popup host linked via `commandfor` (menu, popover, etc.). */
export function toggleCommandTarget(host: HTMLElement, commandfor: string): void {
const root = host.getRootNode() as Document | ShadowRoot;
const target =
('getElementById' in root ? root.getElementById(commandfor) : null) ??
root.querySelector<HTMLElement>(`#${CSS.escape(commandfor)}`);
if (!target || !('open' in target)) return;
const popup = target as { open: boolean };
popup.open = !popup.open;
}