mirror of
https://github.com/supabase/supabase.git
synced 2026-06-13 01:39:53 +08: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? Feature, docs update ## What is the new behavior? This PR introduces a new `RealtimeFlow` component and hook to the UI library for building collaborative React Flow with Supabase Realtime: - keeps nodes and edges in sync across multiple connected clients in real time - uses Yjs with `@supabase-labs/y-supabase` to propagate flow updates - supports optional persistence, so a flow can be restored from previously saved shared state ## Additional context https://github.com/user-attachments/assets/90d3a381-6f9c-427f-a493-5d91c2141462 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Collaborative "Realtime Flow" diagram editor with syncing overlays and a dual-view demo component * Interactive demo page and registry example for live editing (add/remove/rename nodes) * Framework-ready registry packages for Next.js, React, React Router, and TanStack * **Documentation** * Comprehensive docs added for Next.js, React, React Router, and TanStack (usage, persistence, hook API) * **Chores** * Added runtime dependency for the flow component package [](https://app.coderabbit.ai/change-stack/supabase/supabase/pull/44273) <!-- end of auto-generated comment: release notes by coderabbit.ai -->
164 lines
4.3 KiB
TypeScript
164 lines
4.3 KiB
TypeScript
import { SidebarNavGroup } from '@/types/nav'
|
|
|
|
export const gettingStarted: SidebarNavGroup = {
|
|
title: 'Getting Started',
|
|
items: [
|
|
{
|
|
title: 'Introduction',
|
|
href: '/docs/getting-started/introduction',
|
|
items: [],
|
|
commandItemLabel: 'Introduction',
|
|
},
|
|
{
|
|
title: 'Quick Start',
|
|
href: '/docs/getting-started/quickstart',
|
|
items: [],
|
|
commandItemLabel: 'Quick Start',
|
|
},
|
|
{
|
|
title: 'FAQ',
|
|
href: '/docs/getting-started/faq',
|
|
items: [],
|
|
commandItemLabel: 'FAQ',
|
|
},
|
|
],
|
|
}
|
|
|
|
export const aiEditorsRules: SidebarNavGroup = {
|
|
title: 'AI Skills',
|
|
items: [
|
|
{
|
|
title: 'Skills',
|
|
href: '/docs/ai-editors-rules/skills',
|
|
items: [],
|
|
new: true,
|
|
commandItemLabel: 'AI Skills',
|
|
},
|
|
],
|
|
}
|
|
|
|
export const platformBlocks: SidebarNavGroup = {
|
|
title: 'Platform',
|
|
items: [
|
|
{
|
|
title: 'Platform Kit',
|
|
href: '/docs/platform/platform-kit',
|
|
items: [],
|
|
commandItemLabel: 'Platform Kit',
|
|
},
|
|
],
|
|
}
|
|
|
|
// Component definitions with supported frameworks
|
|
export const componentPages: SidebarNavGroup = {
|
|
title: 'Components',
|
|
items: [
|
|
{
|
|
title: 'Client',
|
|
supportedFrameworks: ['nextjs', 'react-router', 'tanstack', 'react', 'vue', 'nuxtjs'],
|
|
href: '/docs/nextjs/client',
|
|
items: [],
|
|
commandItemLabel: 'Supabase Client',
|
|
},
|
|
{
|
|
title: 'Password-Based Auth',
|
|
supportedFrameworks: ['nextjs', 'react-router', 'tanstack', 'react', 'vue', 'nuxtjs'],
|
|
href: '/docs/nextjs/password-based-auth',
|
|
items: [],
|
|
commandItemLabel: 'Password-Based Auth',
|
|
},
|
|
{
|
|
title: 'Social Auth',
|
|
supportedFrameworks: ['nextjs', 'react-router', 'tanstack', 'react', 'vue', 'nuxtjs'],
|
|
href: '/docs/nextjs/social-auth',
|
|
items: [],
|
|
new: true,
|
|
commandItemLabel: 'Social Auth',
|
|
},
|
|
{
|
|
title: 'Dropzone',
|
|
supportedFrameworks: ['nextjs', 'react-router', 'tanstack', 'react', 'vue', 'nuxtjs'],
|
|
href: '/docs/nextjs/dropzone',
|
|
items: [],
|
|
commandItemLabel: 'Dropzone (File Upload)',
|
|
},
|
|
{
|
|
title: 'Realtime Cursor',
|
|
supportedFrameworks: ['nextjs', 'react-router', 'tanstack', 'react', 'vue', 'nuxtjs'],
|
|
href: '/docs/nextjs/realtime-cursor',
|
|
items: [],
|
|
commandItemLabel: 'Realtime Cursor',
|
|
},
|
|
{
|
|
title: 'Realtime Monaco',
|
|
supportedFrameworks: ['nextjs', 'react-router', 'tanstack', 'react'],
|
|
href: '/docs/nextjs/realtime-monaco',
|
|
items: [],
|
|
new: true,
|
|
commandItemLabel: 'Realtime Monaco',
|
|
},
|
|
{
|
|
title: 'Realtime Flow',
|
|
supportedFrameworks: ['nextjs', 'react-router', 'tanstack', 'react'],
|
|
href: '/docs/nextjs/realtime-flow',
|
|
items: [],
|
|
new: true,
|
|
commandItemLabel: 'Realtime Flow',
|
|
},
|
|
{
|
|
title: 'Current User Avatar',
|
|
supportedFrameworks: ['nextjs', 'react-router', 'tanstack', 'react', 'vue', 'nuxtjs'],
|
|
href: '/docs/nextjs/current-user-avatar',
|
|
items: [],
|
|
commandItemLabel: 'Current User Avatar',
|
|
},
|
|
{
|
|
title: 'Realtime Avatar Stack',
|
|
supportedFrameworks: ['nextjs', 'react-router', 'tanstack', 'react', 'vue', 'nuxtjs'],
|
|
href: '/docs/nextjs/realtime-avatar-stack',
|
|
items: [],
|
|
commandItemLabel: 'Realtime Avatar Stack',
|
|
},
|
|
{
|
|
title: 'Realtime Chat',
|
|
supportedFrameworks: ['nextjs', 'react-router', 'tanstack', 'react', 'vue', 'nuxtjs'],
|
|
href: '/docs/nextjs/realtime-chat',
|
|
items: [],
|
|
commandItemLabel: 'Realtime Chat',
|
|
},
|
|
{
|
|
title: 'Infinite Query',
|
|
supportedFrameworks: ['react', 'vue'],
|
|
href: '/docs/react/infinite-query',
|
|
new: true,
|
|
items: [],
|
|
commandItemLabel: 'Infinite Query',
|
|
},
|
|
],
|
|
}
|
|
|
|
export const COMMAND_ITEMS = [
|
|
...gettingStarted.items.map((item) => ({
|
|
label: item.commandItemLabel,
|
|
href: item.href,
|
|
})),
|
|
...aiEditorsRules.items.map((item) => ({
|
|
label: item.commandItemLabel,
|
|
href: item.href,
|
|
})),
|
|
...componentPages.items.map((item) => ({
|
|
label: item.commandItemLabel,
|
|
href: item.href,
|
|
})),
|
|
]
|
|
|
|
// Framework titles for display
|
|
export const frameworkTitles: Record<string, string> = {
|
|
nextjs: 'Next.js',
|
|
'react-router': 'React Router',
|
|
tanstack: 'TanStack Start',
|
|
react: 'React SPA',
|
|
vue: 'Vue',
|
|
nuxtjs: 'Nuxt.js',
|
|
}
|