@k2b/cloud 0.11.1 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,5 @@
1
+ import { mermaidConfig } from "../../browser/mermaid";
2
+
1
3
  /**
2
4
  * Initialize Mermaid diagrams within a container element.
3
5
  * Call this in onMount() of your client-side component.
@@ -6,39 +8,7 @@
6
8
  */
7
9
  export async function initMermaid(container: HTMLElement): Promise<void> {
8
10
  const mermaid = (await import("mermaid")).default;
9
- // Initialize mermaid with theme detection
10
- const isDark = document.documentElement.classList.contains("dark");
11
- mermaid.initialize({
12
- startOnLoad: false,
13
- theme: "base",
14
- themeVariables: isDark
15
- ? {
16
- darkMode: true,
17
- background: "#09090b",
18
- textColor: "#e5e7eb",
19
- lineColor: "#6b7280",
20
- primaryTextColor: "#e5e7eb",
21
- secondaryTextColor: "#e5e7eb",
22
- tertiaryTextColor: "#e5e7eb",
23
- noteTextColor: "#e5e7eb",
24
- mainBkg: "#111827",
25
- secondBkg: "#1f2937",
26
- tertiaryColor: "#374151",
27
- }
28
- : {
29
- darkMode: false,
30
- background: "#ffffff",
31
- textColor: "#111827",
32
- lineColor: "#6b7280",
33
- primaryTextColor: "#111827",
34
- secondaryTextColor: "#111827",
35
- tertiaryTextColor: "#111827",
36
- noteTextColor: "#111827",
37
- mainBkg: "#ffffff",
38
- secondBkg: "#f9fafb",
39
- tertiaryColor: "#f3f4f6",
40
- },
41
- });
11
+ mermaid.initialize(mermaidConfig({ dark: document.documentElement.classList.contains("dark") }));
42
12
 
43
13
  // Find mermaid blocks (rendered with fixed-height container from server)
44
14
  const mermaidBlocks = container.querySelectorAll(".md-mermaid-block");