feat(frontend): schema-linking viewer (mermaid+table) + markdown view
TDD: SchemaLinkingViewer with mocked renderMermaid, toggle flowchart↔table, ≤45 element cap with Italian notice. MarkdownView renders mermaid fences. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
let _initialized = false;
|
||||
|
||||
export async function renderMermaid(def: string): Promise<string> {
|
||||
const mermaid = (await import("mermaid")).default;
|
||||
if (!_initialized) {
|
||||
mermaid.initialize({ startOnLoad: false, theme: "default" });
|
||||
_initialized = true;
|
||||
}
|
||||
const id = `mermaid-${Math.random().toString(36).slice(2)}`;
|
||||
const { svg } = await mermaid.render(id, def);
|
||||
return svg;
|
||||
}
|
||||
Reference in New Issue
Block a user