Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| da358a1857 | |||
| 4feb9f9b7a |
@@ -6,6 +6,13 @@
|
|||||||
:80 {
|
:80 {
|
||||||
encode zstd gzip
|
encode zstd gzip
|
||||||
|
|
||||||
|
header {
|
||||||
|
X-Frame-Options "DENY"
|
||||||
|
X-Content-Type-Options "nosniff"
|
||||||
|
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 {
|
||||||
reverse_proxy 127.0.0.1:3001
|
reverse_proxy 127.0.0.1:3001
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,8 +28,7 @@ function sceneFromEditor(
|
|||||||
files: BinaryFiles,
|
files: BinaryFiles,
|
||||||
): ScenePayload {
|
): ScenePayload {
|
||||||
return {
|
return {
|
||||||
// Excalidraw passes immutable arrays, avoid copying it on every onChange event
|
elements: [...elements],
|
||||||
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>,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -33,20 +33,10 @@ 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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user