{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "rich-text-editor-code",
  "title": "Inline Code",
  "description": "The inline code mark with a toolbar toggle and keyboard shortcut.",
  "dependencies": [
    "@tiptap/extension-code@3.32.2",
    "@tiptap/react@3.32.2",
    "cn",
    "lucide-react"
  ],
  "registryDependencies": [
    "litingyes/blocove/rich-text-editor",
    "litingyes/blocove/rich-text-editor-extension"
  ],
  "files": [
    {
      "path": "src/registry/blocove/ui/rich-text-editor/code.tsx",
      "content": "import type { CodeOptions } from '@tiptap/extension-code'\nimport type { Editor } from '@tiptap/react'\nimport type { ExtensionComponent } from '@/lib/blocove/rich-text-editor-extension'\nimport { Code } from '@tiptap/extension-code'\nimport { useCurrentEditor, useEditorState } from '@tiptap/react'\nimport { CodeIcon } from 'lucide-react'\nimport { EditorToolbarButton } from '@/components/blocove/rich-text-editor/editor'\nimport { defineExtensionComponent } from '@/lib/blocove/rich-text-editor-extension'\n\n/**\n * Registers the Tiptap inline Code mark.\n */\nexport const EditorCode: ExtensionComponent<Partial<CodeOptions>> = defineExtensionComponent(\n  'code',\n  (props: Partial<CodeOptions>) => [\n    Code.configure(props),\n  ],\n)\n\nexport interface EditorCodeToolbarProps {\n  className?: string\n}\n\nexport function EditorCodeToolbar({ className }: EditorCodeToolbarProps) {\n  const { editor } = useCurrentEditor()\n\n  if (!editor) {\n    return null\n  }\n\n  return <EditorCodeToolbarContent editor={editor} className={className} />\n}\n\nfunction EditorCodeToolbarContent({\n  editor,\n  className,\n}: {\n  editor: Editor\n  className?: string\n}) {\n  const active = useEditorState({\n    editor,\n    selector: ({ editor: instance }) => instance.isActive('code'),\n  })\n\n  return (\n    <EditorToolbarButton\n      label=\"Inline code\"\n      shortcut=\"Mod E\"\n      pressed={active}\n      onPressedChange={() => editor.chain().focus().toggleCode().run()}\n      className={className}\n    >\n      <CodeIcon />\n    </EditorToolbarButton>\n  )\n}\n",
      "type": "registry:ui",
      "target": "components/blocove/rich-text-editor/code.tsx"
    }
  ],
  "categories": [
    "rich-text-editor",
    "mark"
  ],
  "type": "registry:ui"
}