Compare commits

..

3 Commits

Author SHA1 Message Date
ruinivist e27e5e4c41 feat: add security headers to caddyfile 2026-06-02 10:41:45 +00:00
ruinivist fcb2c499cf feat: add security headers to caddyfile 2026-06-02 10:31:07 +00:00
ruinivist 887d3776b8 feat: add security headers to caddyfile 2026-06-01 07:41:22 +00:00
3 changed files with 12 additions and 2 deletions
-1
View File
@@ -10,7 +10,6 @@
X-Frame-Options "DENY" X-Frame-Options "DENY"
X-Content-Type-Options "nosniff" X-Content-Type-Options "nosniff"
Referrer-Policy "strict-origin-when-cross-origin" Referrer-Policy "strict-origin-when-cross-origin"
Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob:; font-src 'self' data:;"
} }
handle /mcp { handle /mcp {
+2 -1
View File
@@ -28,7 +28,8 @@ function sceneFromEditor(
files: BinaryFiles, files: BinaryFiles,
): ScenePayload { ): ScenePayload {
return { return {
elements: [...elements], // Excalidraw passes immutable arrays, avoid copying it on every onChange event
elements: elements as unknown[],
appState: appState as unknown as Record<string, unknown>, appState: appState as unknown as Record<string, unknown>,
files: files as unknown as Record<string, unknown>, files: files as unknown as Record<string, unknown>,
}; };
+10
View File
@@ -33,10 +33,20 @@ export function useThemeTokenSync(
return; return;
} }
// Read all tokens first to avoid layout thrashing
const computedStyles = window.getComputedStyle(excalidrawRoot); const computedStyles = window.getComputedStyle(excalidrawRoot);
const updates: Array<[string, string]> = [];
for (const [sourceToken, targetToken] of EXCALIDRAW_THEME_TOKEN_MAP) { for (const [sourceToken, targetToken] of EXCALIDRAW_THEME_TOKEN_MAP) {
const value = computedStyles.getPropertyValue(sourceToken).trim(); const value = computedStyles.getPropertyValue(sourceToken).trim();
if (value) { if (value) {
updates.push([targetToken, value]);
}
}
// Write in a separate pass, skipping unchanged values
for (const [targetToken, value] of updates) {
if (appShell.style.getPropertyValue(targetToken) !== value) {
appShell.style.setProperty(targetToken, value); appShell.style.setProperty(targetToken, value);
} }
} }