{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "rich-text-editor-collaboration-block",
  "title": "Collaborative Editor",
  "description": "A complete collaborative editor: the shared document, the cursors, the presence bar and the connection status.",
  "dependencies": [
    "cn",
    "yjs@13.6.33"
  ],
  "registryDependencies": [
    "litingyes/blocove/rich-text-editor",
    "litingyes/blocove/rich-text-editor-text",
    "litingyes/blocove/rich-text-editor-paragraph",
    "litingyes/blocove/rich-text-editor-hard-break",
    "litingyes/blocove/rich-text-editor-bold",
    "litingyes/blocove/rich-text-editor-italic",
    "litingyes/blocove/rich-text-editor-link",
    "litingyes/blocove/rich-text-editor-collaboration",
    "litingyes/blocove/rich-text-editor-collaboration-caret",
    "litingyes/blocove/rich-text-editor-presence"
  ],
  "files": [
    {
      "path": "src/registry/blocove/blocks/rich-text-editor-collaboration-block.tsx",
      "content": "import type * as Y from 'yjs'\nimport type { CollaborationProvider, CollaborationUser } from '@/components/blocove/rich-text-editor/collaboration'\nimport { cn } from 'cn'\nimport { EditorBold, EditorBoldToolbar } from '@/components/blocove/rich-text-editor/bold'\nimport { EditorCollaboration } from '@/components/blocove/rich-text-editor/collaboration'\nimport { EditorCollaborationCaret } from '@/components/blocove/rich-text-editor/collaboration-caret'\nimport {\n  Editor,\n  EditorCharacterCount,\n  EditorContent,\n  EditorToolbar,\n} from '@/components/blocove/rich-text-editor/editor'\nimport { EditorHardBreak } from '@/components/blocove/rich-text-editor/hard-break'\nimport { EditorItalic, EditorItalicToolbar } from '@/components/blocove/rich-text-editor/italic'\nimport { EditorLink, EditorLinkToolbar } from '@/components/blocove/rich-text-editor/link'\nimport { EditorParagraph } from '@/components/blocove/rich-text-editor/paragraph'\nimport {\n  EditorCollaborationStatus,\n  EditorPresence,\n} from '@/components/blocove/rich-text-editor/presence'\nimport { EditorText } from '@/components/blocove/rich-text-editor/text'\n\nexport interface RichTextEditorCollaborationBlockProps {\n  /** The Yjs document every peer syncs into. */\n  document: Y.Doc\n  /** The connected provider: it carries the cursors, the presence list and the status. */\n  provider: CollaborationProvider\n  /** The current user advertised to the peers. */\n  user: CollaborationUser\n  /** Placeholder shown while the shared document is empty. */\n  placeholder?: string\n  /** Whether the shared document can be edited. Defaults to true. */\n  editable?: boolean\n  /**\n   * Called with the HTML whenever the shared document changes. Remote edits\n   * fire it too: every peer sees the same document.\n   */\n  onChange?: (html: string) => void\n  /** How many presence avatars to show before the overflow counter. */\n  presenceLimit?: number\n  className?: string\n}\n\n/**\n * A ready-to-use collaborative editor: the text, paragraph and hard break\n * nodes, the marks most documents need, the cursors and the presence bar.\n *\n * The block owns no transport. Create the Yjs document and the provider in the\n * app, pass them in, and the block renders the shared document; the docs show\n * the Hocuspocus wiring. The shared document is the source of truth, so the\n * block takes no `value` or `defaultValue`: seed the Yjs document instead of\n * the React tree.\n */\nexport function RichTextEditorCollaborationBlock({\n  document,\n  provider,\n  user,\n  placeholder = 'Start writing together…',\n  editable = true,\n  onChange,\n  presenceLimit,\n  className,\n}: RichTextEditorCollaborationBlockProps) {\n  return (\n    <Editor\n      placeholder={placeholder}\n      editable={editable}\n      onChange={onChange}\n      className={cn('w-full max-w-3xl', className)}\n    >\n      <EditorText />\n      <EditorParagraph />\n      <EditorHardBreak />\n\n      <EditorBold />\n      <EditorItalic />\n      <EditorLink />\n\n      <EditorCollaboration document={document} />\n      <EditorCollaborationCaret provider={provider} user={user} />\n\n      <div className=\"flex items-center justify-end px-3 pt-2\">\n        <EditorPresence provider={provider} max={presenceLimit} />\n      </div>\n\n      <EditorToolbar>\n        <EditorBoldToolbar />\n        <EditorItalicToolbar />\n        <EditorLinkToolbar />\n      </EditorToolbar>\n\n      <EditorContent className=\"min-h-40\" />\n\n      <div className=\"flex items-center justify-between gap-3 border-t px-3 py-1.5\">\n        <EditorCollaborationStatus provider={provider} />\n        <EditorCharacterCount className=\"border-t-0 px-0 py-0\" />\n      </div>\n    </Editor>\n  )\n}\n",
      "type": "registry:block",
      "target": "components/blocove/rich-text-editor-collaboration-block.tsx"
    }
  ],
  "categories": [
    "rich-text-editor",
    "collaboration",
    "block"
  ],
  "type": "registry:block"
}