{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "code-editor-line-numbers",
  "title": "Line Numbers",
  "description": "Line numbers, the fold gutter and the active line highlight for the code editor.",
  "dependencies": [
    "@codemirror/language",
    "@codemirror/state",
    "@codemirror/view"
  ],
  "registryDependencies": [
    "litingyes/blocove/code-editor-extension"
  ],
  "files": [
    {
      "path": "src/registry/blocove/ui/code-editor/line-numbers.tsx",
      "content": "import type { Extension } from '@codemirror/state'\nimport { foldGutter, indentUnit } from '@codemirror/language'\nimport {\n  highlightActiveLine,\n  highlightActiveLineGutter,\n  lineNumbers,\n} from '@codemirror/view'\nimport { defineCodeEditorExtension } from '@/lib/blocove/code-editor-extension'\n\nexport interface CodeEditorLineNumbersProps {\n  /** Render the fold gutter next to the line numbers. */\n  foldable?: boolean\n  /** Highlight the line the cursor is on. */\n  activeLine?: boolean\n  /** Indentation width in spaces. */\n  indentSize?: number\n}\n\n/**\n * Line numbers, the fold gutter and the active line highlight. This is the\n * chrome of the editor, so it does not add any language or highlighting.\n */\nexport const CodeEditorLineNumbers = defineCodeEditorExtension<CodeEditorLineNumbersProps>(\n  'line-numbers',\n  (props: CodeEditorLineNumbersProps): Extension[] => {\n    const foldable = props.foldable ?? true\n    const activeLine = props.activeLine ?? true\n    const indentSize = props.indentSize ?? 2\n\n    return [\n      lineNumbers(),\n      activeLine\n        ? [\n            highlightActiveLineGutter(),\n            highlightActiveLine(),\n          ]\n        : [],\n      foldable\n        ? foldGutter()\n        : [],\n      indentUnit.of(' '.repeat(indentSize)),\n    ]\n  },\n)\n",
      "type": "registry:ui",
      "target": "components/blocove/code-editor/line-numbers.tsx"
    }
  ],
  "categories": [
    "code-editor",
    "chrome"
  ],
  "type": "registry:ui"
}