mirror of
https://github.com/colanode/colanode.git
synced 2026-07-10 04:19:19 +02:00
Add database table view and record detail screens rendered inside the WebView using shared @colanode/ui components. Extend the bridge protocol with query subscriptions, event forwarding, and global focus tracking for keyboard avoidance. Fix flush on navigation/background to cover all debounced mutations. Update README to reflect current feature set and document the intentional database-runtime duplication. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
131 lines
3.9 KiB
HTML
131 lines
3.9 KiB
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta
|
|
name="viewport"
|
|
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover"
|
|
/>
|
|
<title>Editor</title>
|
|
<style>
|
|
:root {
|
|
--radius: 0.625rem;
|
|
--background: oklch(1 0 0);
|
|
--foreground: oklch(0.145 0 0);
|
|
--card: oklch(1 0 0);
|
|
--card-foreground: oklch(0.145 0 0);
|
|
--popover: oklch(1 0 0);
|
|
--popover-foreground: oklch(0.145 0 0);
|
|
--primary: oklch(0.205 0 0);
|
|
--primary-foreground: oklch(0.985 0 0);
|
|
--secondary: oklch(0.97 0 0);
|
|
--secondary-foreground: oklch(0.205 0 0);
|
|
--muted: oklch(0.97 0 0);
|
|
--muted-foreground: oklch(0.556 0 0);
|
|
--accent: oklch(0.97 0 0);
|
|
--accent-foreground: oklch(0.205 0 0);
|
|
--destructive: oklch(0.577 0.245 27.325);
|
|
--border: oklch(0.922 0 0);
|
|
--input: oklch(0.922 0 0);
|
|
--ring: oklch(0.708 0 0);
|
|
--novel-stone-400: oklch(0.556 0 0);
|
|
}
|
|
|
|
.dark {
|
|
--background: oklch(0.145 0 0);
|
|
--foreground: oklch(0.985 0 0);
|
|
--card: oklch(0.205 0 0);
|
|
--card-foreground: oklch(0.985 0 0);
|
|
--popover: oklch(0.205 0 0);
|
|
--popover-foreground: oklch(0.985 0 0);
|
|
--primary: oklch(0.922 0 0);
|
|
--primary-foreground: oklch(0.205 0 0);
|
|
--secondary: oklch(0.269 0 0);
|
|
--secondary-foreground: oklch(0.985 0 0);
|
|
--muted: oklch(0.269 0 0);
|
|
--muted-foreground: oklch(0.708 0 0);
|
|
--accent: oklch(0.269 0 0);
|
|
--accent-foreground: oklch(0.985 0 0);
|
|
--destructive: oklch(0.704 0.191 22.216);
|
|
--border: oklch(1 0 0 / 10%);
|
|
--input: oklch(1 0 0 / 15%);
|
|
--ring: oklch(0.556 0 0);
|
|
--novel-stone-400: oklch(0.708 0 0);
|
|
}
|
|
|
|
html, body {
|
|
margin: 0;
|
|
padding: 0;
|
|
height: 100%;
|
|
overflow: hidden;
|
|
background-color: var(--background);
|
|
color: var(--foreground);
|
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
-webkit-text-size-adjust: 100%;
|
|
}
|
|
#scroll-container {
|
|
height: 100%;
|
|
overflow-y: auto;
|
|
-webkit-overflow-scrolling: touch;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div id="scroll-container">
|
|
<div id="editor-root"></div>
|
|
</div>
|
|
<script>
|
|
(function () {
|
|
function stringifyError(error) {
|
|
if (!error) {
|
|
return 'Unknown error';
|
|
}
|
|
|
|
if (error.stack) {
|
|
return String(error.stack);
|
|
}
|
|
|
|
if (error.message) {
|
|
return String(error.message);
|
|
}
|
|
|
|
return String(error);
|
|
}
|
|
|
|
function report(message) {
|
|
try {
|
|
const rn = window.ReactNativeWebView;
|
|
if (rn && typeof rn.postMessage === 'function') {
|
|
rn.postMessage(
|
|
JSON.stringify({
|
|
type: 'error',
|
|
payload: { message },
|
|
})
|
|
);
|
|
}
|
|
} catch {
|
|
// Ignore reporting failures inside the reporter itself.
|
|
}
|
|
}
|
|
|
|
window.__colanodeReportFatal = report;
|
|
|
|
window.addEventListener('error', function (event) {
|
|
const location = [event.filename, event.lineno, event.colno]
|
|
.filter(Boolean)
|
|
.join(':');
|
|
const message = event.error
|
|
? stringifyError(event.error)
|
|
: [event.message, location].filter(Boolean).join(' at ');
|
|
report('Window error: ' + message);
|
|
});
|
|
|
|
window.addEventListener('unhandledrejection', function (event) {
|
|
report('Unhandled rejection: ' + stringifyError(event.reason));
|
|
});
|
|
})();
|
|
</script>
|
|
<script type="module" src="/src/main.tsx"></script>
|
|
</body>
|
|
</html>
|