diff --git a/apps/client/src/widgets/type_widgets/file/Pdf.tsx b/apps/client/src/widgets/type_widgets/file/Pdf.tsx index 8c503a2b0..bca0b06db 100644 --- a/apps/client/src/widgets/type_widgets/file/Pdf.tsx +++ b/apps/client/src/widgets/type_widgets/file/Pdf.tsx @@ -1,9 +1,18 @@ -import { useEffect } from "preact/hooks"; +import { useEffect, useRef } from "preact/hooks"; import FNote from "../../../entities/fnote"; import server from "../../../services/server"; +const VARIABLE_WHITELIST = new Set([ + "root-background", + "main-background-color", + "main-border-color", + "main-text-color" +]); + export default function PdfPreview({ note }: { note: FNote }) { + const iframeRef = useRef(null); + useEffect(() => { function handleMessage(event: MessageEvent) { if (event.data?.type === "pdfjs-viewer-document-modified" && event.data?.data) { @@ -20,7 +29,39 @@ export default function PdfPreview({ note }: { note: FNote }) { return (