{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "doc-host",
  "type": "registry:ui",
  "title": "Doc Host",
  "description": "The doc-host primitive.",
  "dependencies": [],
  "registryDependencies": [
    "https://ui.klarhimmel.com/r/theme.json"
  ],
  "files": [
    {
      "path": "src/ui/doc-host.tsx",
      "type": "registry:file",
      "target": "components/klarhimmel/ui/doc-host.tsx",
      "content": "// DocHost on its own, without the editor: an app provides it around its screens while DocPage itself loads lazily (Klar Portal\n// 10-23: the context living in doc-page.tsx pulled ProseKit, about 800 kB of source, into /ws's first script).\nimport { createContext, type ReactNode } from 'react';\n\n/** What the page needs from the app around it. Without a host: pictures keep their stored address, no previews, no pickers. */\nexport interface DocHostValue {\n  /** A stored picture reference (e.g. 'library/<id>') to an <img> src. */\n  pictureSrc(ref: string): string;\n  /** A link to another page to its preview card; null for an ordinary web link. */\n  resolve(href: string): { title: string; line: string; href: string } | null;\n  /** Follow a page link (mod-click, Open). */\n  open(href: string): void;\n  /** The '/' menu's 'Image' picker; the item shows only when there are pictures. `ref` is what the Markdown stores. */\n  pictures: { ref: string; title: string; thumb: ReactNode }[];\n  /** The '/' menu's 'Link to a page' picker; the item shows only when there are pages. */\n  pages: { href: string; title: string; line: string }[];\n}\nexport const DocHostCtx = createContext<DocHostValue>({ pictureSrc: (r) => r, resolve: () => null, open: () => {}, pictures: [], pages: [] });\n/** Provide a DocHostValue to every DocPage below it. */\nexport const DocHost = DocHostCtx.Provider;\n"
    }
  ]
}
