Skip to content

Commit 114fa5f

Browse files
committed
fix build error
1 parent 8f12dc3 commit 114fa5f

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

src/components/mdx/Excalidraw.tsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,15 @@ export function Excalidraw({
8383
const overviewTargetRef = useRef<number[] | null>(null);
8484
const currentViewBoxRef = useRef<number[]>([0, 0, 100, 100]);
8585
// Store raw HTML strings and data URLs for inlining replacement
86-
const formulaDataRef = useRef<Record<string, { html: string, dataURL: string }>>({});
86+
const formulaDataRef = useRef<Record<string, {
87+
html: string,
88+
dataURL: string,
89+
x: number,
90+
y: number,
91+
width: number,
92+
height: number,
93+
angle: number
94+
}>>({});
8795

8896
const requestRef = useRef<number | null>(null);
8997
const transitionRef = useRef<{ start: number[], end: number[], startTime: number, duration: number } | null>(null);
@@ -290,7 +298,7 @@ export function Excalidraw({
290298
const PADDING = 10;
291299

292300
// Move through formulas and place them at absolute coordinates in SVG root
293-
activeElements.forEach(el => {
301+
activeElements.forEach((el: any) => {
294302
if (el.type === "image" && el.fileId && formulaDataRef.current[el.fileId]) {
295303
const matched = formulaDataRef.current[el.fileId];
296304

@@ -330,7 +338,7 @@ export function Excalidraw({
330338
});
331339

332340
// Clean up original tags that might be confusing or covering
333-
svg.querySelectorAll('image').forEach(img => {
341+
svg.querySelectorAll('image').forEach((img: any) => {
334342
const href = (img.getAttribute('xlink:href') || img.getAttribute('href') || "").trim();
335343
if (Object.values(formulaDataRef.current).some(f => f.dataURL === href)) {
336344
img.remove();

0 commit comments

Comments
 (0)