feat: harden plugin api for separate repos, signed updates and generic external login

This commit is contained in:
LukeGus committed 2026-09-29 18:11:59 -05:00
1 parent fb9c168b6b
commit 80944301dd
310 files changed
+6577 -4927

No files matched your search

@@ -0,0 +1,30 @@
import { useSyncExternalStore } from "react";
/**
* The terminal theme the host editor is previewing, so an open terminal for
* that host can show it before the host is saved. Null when nothing is being
* previewed.
*/
let preview: string | null = null;
const listeners = new Set<() => void>();
export function setThemePreview(theme: string | null): void {
if (theme === preview) return;
preview = theme;
for (const listener of listeners) listener();
}
function subscribe(listener: () => void): () => void {
listeners.add(listener);
return () => {
listeners.delete(listener);
};
}
export function useThemePreview(): string | null {
return useSyncExternalStore(
subscribe,
() => preview,
() => preview,
);
}