From adea3abff49e2a597ff2cdd60161a08706edc5bc Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Mon, 22 Sep 2025 10:50:03 +0300 Subject: [PATCH] chore(react/type_widget): add missing interface --- apps/client/src/widgets/type_widgets/Canvas.tsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/apps/client/src/widgets/type_widgets/Canvas.tsx b/apps/client/src/widgets/type_widgets/Canvas.tsx index c24516455..1cf83cb53 100644 --- a/apps/client/src/widgets/type_widgets/Canvas.tsx +++ b/apps/client/src/widgets/type_widgets/Canvas.tsx @@ -9,8 +9,7 @@ import "./Canvas.css"; import FNote from "../../entities/fnote"; import { RefObject } from "preact"; import server from "../../services/server"; -import { NonDeletedExcalidrawElement } from "@excalidraw/excalidraw/element/types"; -import { CanvasContent } from "../type_widgets_old/canvas_el"; +import { ExcalidrawElement, NonDeletedExcalidrawElement } from "@excalidraw/excalidraw/element/types"; import { goToLinkExt } from "../../services/link"; // currently required by excalidraw, in order to allows self-hosting fonts locally. @@ -22,6 +21,12 @@ interface AttachmentMetadata { attachmentId: string; } +interface CanvasContent { + elements: ExcalidrawElement[]; + files: BinaryFileData[]; + appState: Partial; +} + export default function Canvas({ note }: TypeWidgetProps) { const apiRef = useRef(null); const isReadOnly = options.is("databaseReadonly"); @@ -141,9 +146,8 @@ function usePersistence(note: FNote, apiRef: RefObject, const { content, svg } = await getData(api); const attachments = [{ role: "image", title: "canvas-export.svg", mime: "image/svg+xml", content: svg, position: 0 }]; + // libraryChanged is unset in dataSaved() if (libraryChanged.current) { - // this.libraryChanged is unset in dataSaved() - // there's no separate method to get library items, so have to abuse this one const libraryItems = await api.updateLibrary({ libraryItems() {