{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "annotation-layer-demo",
  "title": "Annotation Layer Demo",
  "description": "A worked example of Annotation Layer: Notes attached to regions of a page. Drag to add one, select to read it, and the coordinates stay relative to the page rather than the screen.",
  "registryDependencies": [
    "https://ui.tinkererslabs.com/r/annotation-layer.json"
  ],
  "files": [
    {
      "path": "components/demos/annotation-layer-demo.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\n\nimport { pageImage, paymentRegion } from \"@/components/demos/document-fixtures\"\nimport {\n  AnnotationLayer,\n  type Annotation,\n} from \"@/registry/default/annotation-layer/annotation-layer\"\n\nexport function AnnotationLayerDemo() {\n  const [notes, setNotes] = React.useState<Annotation[]>([\n    {\n      id: \"net30\",\n      ...paymentRegion,\n      note: \"Finance asked whether this should be net 45.\",\n      author: \"Priya\",\n    },\n  ])\n\n  return (\n    <AnnotationLayer\n      className=\"w-full max-w-sm\"\n      alt=\"Master Services Agreement, page 1\"\n      annotations={notes}\n      src={pageImage}\n      onCreate={(rect) =>\n        setNotes((current) => [\n          ...current,\n          { id: `note-${current.length + 1}`, ...rect, note: \"New note\" },\n        ])\n      }\n      onDelete={(id) =>\n        setNotes((current) => current.filter((note) => note.id !== id))\n      }\n    />\n  )\n}\n",
      "type": "registry:example"
    },
    {
      "path": "components/demos/document-fixtures.ts",
      "content": "/** Generated from public/demo/documents/master-services-agreement.pdf. */\nexport const SAMPLE_PDF = \"/demo/documents/master-services-agreement.pdf\"\nexport const SAMPLE_DOCX = \"/demo/documents/master-services-agreement.docx\"\nexport const SAMPLE_CSV = \"/demo/documents/invoices.csv\"\nexport const PDF_WORKER = \"/demo/pdf.worker.min.mjs\"\n\nexport const PAGE_COUNT = 3\n\nexport const samplePages = Array.from({ length: PAGE_COUNT }, (_, index) => ({\n  number: index + 1,\n  src: `/demo/documents/page-${index + 1}.png`,\n}))\n\nexport const pageImage = samplePages[0]!.src\n\n/**\n * Read out of the PDF text layer and checked by drawing them back onto the\n * exported page, so every region sits on the value it names.\n */\nexport const invoiceBoxes = [\n  {\n    id: \"customer\",\n    label: \"Customer\",\n    x: 0.2979,\n    y: 0.1893,\n    width: 0.1397,\n    height: 0.022,\n  },\n  {\n    id: \"agreement-no\",\n    label: \"Agreement number\",\n    x: 0.2979,\n    y: 0.2484,\n    width: 0.125,\n    height: 0.022,\n    tone: \"accent\" as const,\n  },\n  {\n    id: \"net30\",\n    label: \"Payment window\",\n    x: 0.3247,\n    y: 0.6301,\n    width: 0.0553,\n    height: 0.0214,\n  },\n  {\n    id: \"late-fee\",\n    label: \"Late payment\",\n    x: 0.3247,\n    y: 0.6876,\n    width: 0.1011,\n    height: 0.0214,\n    tone: \"warning\" as const,\n  },\n]\n\nexport const customerRegion = {\n  x: 0.2979,\n  y: 0.1893,\n  width: 0.1397,\n  height: 0.022,\n}\nexport const agreementRegion = {\n  x: 0.2979,\n  y: 0.2484,\n  width: 0.125,\n  height: 0.022,\n}\nexport const paymentRegion = {\n  x: 0.3247,\n  y: 0.6301,\n  width: 0.0553,\n  height: 0.0214,\n}\n",
      "type": "registry:example"
    }
  ],
  "type": "registry:example"
}