Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
499 changes: 499 additions & 0 deletions docs/wg/research/crdt/tldraw.md

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions editor/grida-canvas-hosted/playground/playground.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ import { DarwinSidebarHeaderDragArea } from "../../host/desktop";
import { editor } from "@/grida-canvas";
import useDisableSwipeBack from "@/grida-canvas-react/viewport/hooks/use-disable-browser-swipe-back";
import { WindowGlobalCurrentEditorProvider } from "@/grida-canvas-react/devtools/global-api-host";
import { EditorYSyncPlugin } from "@/grida-canvas/plugins/yjs";
import { EditorSyncPlugin } from "@/grida-canvas/plugins/sync";
import { Editor } from "@/grida-canvas/editor";
import { PlayerAvatar } from "@/components/multiplayer/avatar";
import grida from "@grida/schema";
Expand Down Expand Up @@ -276,15 +276,15 @@ const get_or_create_demo_session_cursor_id = (): string => {
};

function useSyncMultiplayerCursors(editor: Editor, room_id?: string) {
const pluginRef = useRef<EditorYSyncPlugin | null>(null);
const pluginRef = useRef<EditorSyncPlugin | null>(null);

useEffect(() => {
if (!room_id) return;

const cursorId = get_or_create_demo_session_cursor_id();

if (!pluginRef.current) {
pluginRef.current = new EditorYSyncPlugin(editor, room_id, {
pluginRef.current = new EditorSyncPlugin(editor, room_id, {
cursor_id: cursorId,
palette: colors[randomcolorname({ exclude: neutral_colors })],
});
Expand Down Expand Up @@ -327,7 +327,7 @@ export type CanvasPlaygroundProps = {

export default function CanvasPlayground({
document = distro.playground.EMPTY_DOCUMENT,
backend = "dom",
backend = "canvas",
templates,
src,
room_id,
Expand Down
Loading
Loading