Commit Graph

17 Commits

Author SHA1 Message Date
Tiago Antunes
b79a64e301 feat: add Realtime Flow component (#44273)
## 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

[![Review Change
Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/supabase/supabase/pull/44273)
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-05-26 13:28:52 +03:00
Tiago Antunes
9bf981f371 feat(ui-library): add Realtime Monaco ui component (#41766)
## 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>
2026-03-17 13:55:03 +01:00
Ivan Vasilov
501918857b chore: Remove unused code from ui-library (#38374)
* Remove unneeded code.

* Remove more unused code.

* Update knip.jsonc for ui-library.

* Remove unneeded imports. Change the registry generation to only generate what's needed.

* Cleanup the rehype middleware (it wasn't used). Clean up the example blocks generation.

* Don't show the "show code" button in all dropzone examples.
2025-09-02 15:36:41 +02:00
Filipe Cabaço
7fb163daa9 realtime: add ai rules (#38220)
---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2025-08-28 13:39:50 +01:00
Saxon Fletcher
ef5c15a652 Add platform kit to library (#37068)
* add platform kit to library

* controls

* fix lockfile

* add missing deps

* dynamic form

* update dialog

* prettier

* drawer

* update ai route

---------

Co-authored-by: Alaister Young <a@alaisteryoung.com>
2025-07-14 22:04:57 +10:00
Saxon Fletcher
95ec79b98f feat: Infinite query hook block (#34650)
* infinite list

* infinite list block

* registration

* add missing supportedFrameworks

* Add tables to the supabase project. Generate the types for it.

* Refactor the infinite list query to be just a hook.

* Clean up the block. Add comments.

* Regenerate the registry.

* Fix the docs, the block is not framework-dependent.

* Set the package versions to * to be defined by other packages.

* Minor fixes to the block.

* Fix the examples.

* Fix the docs for the new hook.

* Fix the demo.

* Add more migrations to the db.

* Fix various issues with the query. Rewrote it to useSyncExternalStore.

* Fix the SSR for the hook.

* More fixes.

* Try initializing the store in a useEffect.

* Fix the pnpm-lock file.

* Minor fixes in the docs.

* Put the infinite list under a reusable components section.

* Update apps/ui-library/registry/default/blocks/infinite-query-hook/hooks/use-infinite-query.ts

* Change the example DB to use todos.

* Update the docs to be about Todos quickstart.

* List edits

* Fix link

* Regenerate the registry.

* Add query hook to the landing page.

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
Co-authored-by: Terry Sutton <saltcod@gmail.com>
2025-04-17 15:18:33 +02:00
Ivan Vasilov
2ebf81c601 feat: Add social login to the UI Library (#34803)
* Add social login block.

* Regen the registry.

* Fix the nextjs social auth.

* Add social auth blocks for RR, Tanstack and React.

* Minor fixes.

* Add docs.

* Update the docs.

* Minor fixes to the blocks.

* Update the docs.

* Fix various doc issues.

* Fix the redirect in the password-based auth.

* Fix note about supabase clients in docs.

* Use with instead of assert in the registry imports.

* Update all auth blocks to use /protected.

* Update all docs for the password-based auth.

* Add new label to social auth.

* Fix docs issues.

* Light mode fix

* Smol fixes

* Fix the origin in the login route.

* Add social auth to the landing page.

* Regenerate the registry.

---------

Co-authored-by: Terry Sutton <saltcod@gmail.com>
2025-04-17 14:57:09 +02:00
Ivan Vasilov
802c790b14 fix: Minor fixes to the paths for the AI Editor rules (#34989)
* Rename all files to be mdc.

* Reference the new files in the registry item and fix the installation route.

* Regenerate the registry.

* Add additional note about using rules in monorepo.
2025-04-14 13:41:45 +02:00
Ivan Vasilov
156e8fd9b7 fix: Minor fixes for UI Library (#34535)
* Regenerate the registry.

* Fix the paths of the ai editor rules.

* Fix headings on clients and auth blocks.

* Fix realtime chat and avatar demos.

* Setup mdx-lint for the ui-library. Fix some obvious wordings.

* Fix the tooltips for the examples. Reorder the example pages.
2025-03-30 09:56:03 +02:00
Jordi Enric
daa33f4723 add realtime chat example (#34514)
* add realtime chat

* yolo

* clean up avatar references, leaving those out

* allow to pass messages and receive message change state

* add more names to reduce prob of same name popping up int he example

* update registry, add nextjs docs

* add more usage examples

* Minor changes on the realtime chat component.

* Regenerate the registry.

* docs

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2025-03-28 22:31:13 +01:00
Ivan Vasilov
95ade9f4ca fix: Fix the folder layout for the Nextjs Auth block (#34496)
* Change the destinations for next auth routes.

* Change the folder definition to /auth.

* Fix wrong docs.

* More fixes.

* Fix the redirect url to include the base path.

* Minor fixes to the other auth blocks.

* Fix example URLs. Remove some extra code.

* Minor fixes for the avatar stack demo.

* More fixes.
2025-03-28 13:15:33 -02:30
Ivan Vasilov
a0dc96d1a4 fix: Add previews for the new components on the main page (#34493)
Add previews for the new components on the main page.
2025-03-28 09:47:08 +10:00
Terry Sutton
f3b67a10d3 UI library/rr (#34384)
* Add rr auth block

* Fix file structure

* Update components with new flow

* Fix the registry item for react router auth.

* Update the forgot-password for react router.

* Fix the rest of the link imports.

* Fix the react route client.

* Refactor the auth block for React Router.

* Add config for recovery mail to the ui library supabase config.

* snapshot.

* Minor fixes.

* Minor doc fixes.

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2025-03-27 22:48:28 +01:00
Ivan Vasilov
a81d056d79 feat: Extra components for UI Library (#34363)
* Fix the v0 button. Add some more docs. (+13 squashed commits)
Squashed commits:
[cc5954779e] Add success state to the forgot-password form.
[258bfb1015] Simplify the tanstack auth block.
[1ba5c223d9] Add missing pages to the nextjs auth.
[b842e4acec] Fix the env vars in the React client.
[2a2bcc5356] Fix the command URL.
[a26a2d36c2] Add a tanstack block for password-based auth.
[d68881f0d5] Fix the tanstack client.
[1fd2e16d96] Add missing deps to satisfy TS build.
[9797d745df] Various fixes.
[3e9b676e99] Fix the registryBlock component.
[540a5d600b] Set the supabase project for testing.
[3eba892c92] Regenerate the llms.txt file.
[bf526a0ecb] Regenerate the registry files.

* Add current user avatar.

* Add RealtimeAvatarStack.

* Use the fields which are populated by Auth.

* Regenerate the registry files.

* Fix the imports.

* Rebuild the registry files. Add a github login to the supabase config.

* Minor fixes for the components.

* Minor fix to the avatar stack.

* Remove peekCode, show showCode prop to component preview.

* Add examples for avatar stack and current user avatar.

* Use the new generatenames function in the cursors.

* Add documentation for avatar stack and avatar.

* Switch the profile images.

* Fix a type error.

* More fixes.
2025-03-27 17:41:31 +01:00
Jonathan Summers-Muir
846b470f9d chore: uses iframes for UI lib examples. (#34419)
* init

* Update component-preview.tsx

* please note: changed redirects in block, so need to update the logic to find and replace the redirects

* Fix the redirect urls to work when installing and in examples.

* Revert some of the changes.

* Add a step when building the registry to clean the registry of example code.

* Fix the clean registry script.

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2025-03-26 11:16:09 +01:00
Ivan Vasilov
0990155ae7 feat: more fixes for UI library (#34355)
* Regenerate the registry files.

* Regenerate the llms.txt file.

* Set the supabase project for testing.

* Fix the registryBlock component.

* Various fixes.

* Add missing deps to satisfy TS build.

* Fix the tanstack client.

* Add a tanstack block for password-based auth.

* Fix the command URL.

* Fix the env vars in the React client.

* Add missing pages to the nextjs auth.

* Simplify the tanstack auth block.

* Add success state to the forgot-password form.

* Fix the v0 button. Add some more docs.

* Revert some changes.
2025-03-24 14:24:59 +01:00
Ivan Vasilov
33127bb6ab feat: Library (#34294)
* Copy the design-system app into a new one for ui-library.

* Remove unneeded content.

* Add supabase config.

* Cleanup the css.

* Add bunch of packages.

* Cleanup the registry.

* Regenerate the registry.

* Add needed components for documenting components.

* Add the pages for the components.

* Fix the RegistryBlock.

* Various fixes.

* Add a turbo definition for ui-library.

* Rename Remix to React Router.

* Reorder the pages for all frameworks.

* Remove the bottom pager.

* Fix the pages and command menu.

* Various fixes.

* Minor fixes.

* Add ai editor rules.

* Various fixes.

* Add local supabase env vars.

* Try to fix a package error.

* Bunch of various fixes.

* Fix lint errors.
2025-03-20 22:11:07 +01:00