2026-02-14 18:20:07 +01:00
|
|
|
import { StrictMode } from 'react'
|
|
|
|
|
import { createRoot } from 'react-dom/client'
|
2026-02-16 16:56:44 +01:00
|
|
|
import { TooltipProvider } from '@/components/ui/tooltip'
|
2026-02-14 18:20:07 +01:00
|
|
|
import './index.css'
|
|
|
|
|
import App from './App.tsx'
|
2026-03-19 08:47:25 +01:00
|
|
|
import NoteWindow from './NoteWindow.tsx'
|
|
|
|
|
import { isNoteWindow } from './utils/windowMode'
|
2026-02-14 18:20:07 +01:00
|
|
|
|
2026-02-21 16:36:45 +01:00
|
|
|
// Disable native WebKit context menu in Tauri (WKWebView intercepts right-click
|
|
|
|
|
// at native level before React's synthetic events can call preventDefault).
|
|
|
|
|
// Capture phase fires first → prevents native menu; React bubble phase still fires
|
|
|
|
|
// → our custom context menus (e.g. sidebar right-click) work correctly.
|
|
|
|
|
if ('__TAURI__' in window || '__TAURI_INTERNALS__' in window) {
|
|
|
|
|
document.addEventListener('contextmenu', (e) => e.preventDefault(), true)
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-19 08:47:25 +01:00
|
|
|
const RootComponent = isNoteWindow() ? NoteWindow : App
|
|
|
|
|
|
2026-02-14 18:20:07 +01:00
|
|
|
createRoot(document.getElementById('root')!).render(
|
|
|
|
|
<StrictMode>
|
2026-02-16 16:56:44 +01:00
|
|
|
<TooltipProvider>
|
2026-03-19 08:47:25 +01:00
|
|
|
<RootComponent />
|
2026-02-16 16:56:44 +01:00
|
|
|
</TooltipProvider>
|
2026-02-14 18:20:07 +01:00
|
|
|
</StrictMode>,
|
|
|
|
|
)
|