mirror of
https://github.com/supabase/supabase.git
synced 2026-12-06 08:29:01 +00:00
## I have read the [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) file. YES ## What kind of change does this PR introduce? Adds a new Realtime Monaco component to the UI Library, enabling collaborative code editing with Supabase Realtime synchronization using Monaco Editor and Yjs. ## Additional context This is WIP and used for discuss further changes to the y-supabase provider. ## Demo https://github.com/user-attachments/assets/84a761e5-73bb-478e-979a-682121ffee89 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes * **New Features** * Added a new Realtime Monaco collaborative code editor component with real-time synchronization support across multiple frameworks (Next.js, React, React Router, Tanstack). * **Documentation** * Added comprehensive documentation and usage guides for the Realtime Monaco component across all supported frameworks. * **Dependencies** * Added Monaco editor, Yjs, y-monaco, and Supabase collaboration packages. <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
30 lines
602 B
TypeScript
30 lines
602 B
TypeScript
'use client'
|
|
|
|
import { useTheme } from 'next-themes'
|
|
import dynamic from 'next/dynamic'
|
|
|
|
const Editor = dynamic(
|
|
() =>
|
|
import('../blocks/realtime-monaco/components/realtime-monaco').then(
|
|
(mod) => mod.RealtimeMonaco
|
|
),
|
|
{ ssr: false }
|
|
)
|
|
|
|
const RealtimeMonacoDemo = () => {
|
|
const { resolvedTheme } = useTheme()
|
|
const isDark = resolvedTheme?.includes('dark')
|
|
|
|
return (
|
|
<div className="p-4">
|
|
<Editor
|
|
channel="realtime-monaco-demo"
|
|
language="typescript"
|
|
theme={isDark ? 'dark' : 'light'}
|
|
/>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export default RealtimeMonacoDemo
|