Cross-platform groundwork: platform detection, iOS config, Windows drag-drop fix, Android 10 storage fix (#72), bundled fonts

This commit is contained in:
Yuri Karamian
2026-06-03 14:11:10 +02:00
parent fedbdfd2a1
commit 7cbd112585
67 changed files with 1294 additions and 77 deletions
+20 -1
View File
@@ -7,7 +7,7 @@
let { children } = $props();
const isMobile = /android|ios/i.test(navigator.userAgent);
const isMobile = /android|iphone|ipad|ipod/i.test(navigator.userAgent);
// Reactively apply theme class to <html> whenever $theme changes
$effect(() => {
@@ -160,6 +160,25 @@
}
};
});
// On Windows the native OS drag-drop handler is disabled (dragDropEnabled:false
// in tauri.windows.conf.json) so HTML5 drag-and-drop works for reordering. With it
// off, a file dropped outside a drop zone would make the webview navigate to / open
// that file, replacing the app. Swallow any drag that bubbles up unhandled. Real drop
// zones (editor, sidebar reordering) call preventDefault in their own handlers first;
// these bubble-phase listeners only act as a fallback. On macOS/Linux OS file drops are
// intercepted natively and never surface as HTML5 events, so this is a harmless no-op there.
onMount(() => {
function preventNavigate(e: DragEvent) {
e.preventDefault();
}
window.addEventListener('dragover', preventNavigate);
window.addEventListener('drop', preventNavigate);
return () => {
window.removeEventListener('dragover', preventNavigate);
window.removeEventListener('drop', preventNavigate);
};
});
</script>
<svelte:document oncontextmenu={(e) => { if (!isMobile) e.preventDefault(); }} />