Add full shell, replaceable Omics adapter and bilingual interaction

Implement approved specification #32 and tickets #33-#37. Keep host authentication server-verified and pin session interaction language. Compile scoped base selectors for browser compatibility and retain full gutters during CSS pruning.
This commit is contained in:
Codex
2026-09-13 14:26:39 +02:00
parent 2d1b714ebe
commit d8a29bfbdd
207 changed files with 8570 additions and 2164 deletions
+14 -5
View File
@@ -1,10 +1,19 @@
let _initialized = false;
let initializedTheme: "light" | "dark" | undefined;
let rendering: Promise<unknown> = Promise.resolve();
export async function renderMermaid(def: string): Promise<string> {
export function renderMermaid(def: string, theme: "light" | "dark" = "light"): Promise<string> {
// Mermaid configuration is global: serialize renders so a theme change cannot
// recolor another diagram midway through its asynchronous rendering.
const result = rendering.then(() => renderDiagram(def, theme));
rendering = result.catch(() => undefined);
return result;
}
async function renderDiagram(def: string, theme: "light" | "dark"): Promise<string> {
const mermaid = (await import("mermaid")).default;
if (!_initialized) {
mermaid.initialize({ startOnLoad: false, theme: "default" });
_initialized = true;
if (initializedTheme !== theme) {
mermaid.initialize({ startOnLoad: false, theme: theme === "dark" ? "dark" : "default" });
initializedTheme = theme;
}
const id = `mermaid-${Math.random().toString(36).slice(2)}`;
const container = document.createElement("div");