mirror of
https://github.com/andrewyng/openworker.git
synced 2026-09-10 04:19:56 +00:00
Shell injects the OS; Windows/Linux keep the native title bar with no traffic-light insets. Thin scrollbars on Windows/Linux so panels stop losing width to classic scrollbars.
25 lines
1003 B
TypeScript
25 lines
1003 B
TypeScript
import React from "react";
|
|
import ReactDOM from "react-dom/client";
|
|
import { App } from "./App";
|
|
import { initTheme } from "./theme";
|
|
import { platformOS } from "./tauri";
|
|
import "./tailwind.css";
|
|
import "./styles.css";
|
|
|
|
initTheme();
|
|
// Platform hook for CSS (html[data-platform="windows"] scrollbar styling etc.).
|
|
document.documentElement.dataset.platform = platformOS();
|
|
|
|
// A file dropped OUTSIDE a drop target (the composer) must never navigate the webview to the
|
|
// file itself — the browser/WKWebView default. Drop targets stopPropagation-free preventDefault
|
|
// in their own handlers; these guards only catch the misses. (The desktop shell disables Tauri's
|
|
// native drag-drop interception so HTML5 drag events reach the DOM at all — see lib.rs.)
|
|
window.addEventListener("dragover", (e) => e.preventDefault());
|
|
window.addEventListener("drop", (e) => e.preventDefault());
|
|
|
|
ReactDOM.createRoot(document.getElementById("root")!).render(
|
|
<React.StrictMode>
|
|
<App />
|
|
</React.StrictMode>,
|
|
);
|