19 | Oxc
20 |
21 |
28 | @{{ commit.slice(0, 7) }}
29 |
30 | 72 | {{ 73 | vizLoading 74 | ? "Loading graph visualization..." 75 | : "Rendering graph..." 76 | }} 77 |
78 |Failed to load graph visualization library
83 |84 | {{ vizError }} 85 |
86 |87 | Please use the "Raw" view to see the graph data. 88 |
89 |${escapeHtml(code)}`;
87 | }
88 | }
89 |
90 | function escapeHtml(text: string): string {
91 | const div = document.createElement("div");
92 | div.textContent = text;
93 | return div.innerHTML;
94 | }
95 |
96 | const highlightToken = useMemoize(async (code: string, theme: string) => {
97 | try {
98 | const highlighter = await createHighlighter();
99 | return highlighter.codeToTokens(code, {
100 | lang: "typescript",
101 | theme,
102 | });
103 | } catch {
104 | return { tokens: [[{ color: "#666666" }]] }; // Fallback gray color
105 | }
106 | });
107 |
108 | export function useHighlightColor(content: MaybeRefOrGetter