{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "flow-canvas-fixtures",
  "title": "Flow Canvas — fixtures",
  "author": "ilinxa",
  "description": "Flow Canvas plus the dummy-data fixtures used by the docs-site demo.",
  "registryDependencies": [
    "@ilinxa/flow-canvas"
  ],
  "files": [
    {
      "path": "src/registry/components/data/flow-canvas/dummy-data.ts",
      "content": "import type { CanvasData, EdgeRecord, NodeRecord } from \"./types\";\n\nexport const FLOW_CANVAS_EMPTY: CanvasData = {\n  version: 1,\n  nodes: [],\n  edges: [],\n};\n\n// Single custom-JSON node — minimal fixture for render smoke-tests.\nexport const FLOW_CANVAS_HELLO: CanvasData = {\n  version: 1,\n  nodes: [\n    {\n      id: \"hello\",\n      position: { x: 200, y: 120 },\n      data: {\n        __type: \"custom-json\",\n        _label: \"Hello, flow\",\n        message: \"Drop or paste any JSON onto the canvas.\",\n        tip: \"Unknown __type renders here as a custom-JSON node.\",\n      },\n    },\n  ],\n  edges: [],\n};\n\n// Rich, connected workflow — Prompt → LLM → (Display | ProjectCard).\n// Demonstrates: custom renderer registration, typed port handles via\n// <PortsAt>, multi-edge per port (the LLM's `out` fans out to two\n// downstream consumers), card-tree-as-node (ProjectCard adapter),\n// mixed renderers in one canvas, and live drag-to-connect (M2 onConnect).\nexport const FLOW_CANVAS_RICH: CanvasData = {\n  version: 1,\n  nodes: [\n    {\n      id: \"prompt-1\",\n      position: { x: 0, y: 60 },\n      data: {\n        __type: \"prompt\",\n        template: \"Summarize the project brief in two sentences.\",\n        ports: [\n          { id: \"out\", side: \"right\", dir: \"out\", type: \"text\" },\n        ],\n      },\n    },\n    {\n      id: \"llm-1\",\n      position: { x: 280, y: 60 },\n      data: {\n        __type: \"llm\",\n        model: \"claude-opus-4\",\n        // Each tool is a sub-object with its own __type — extractable as a\n        // standalone node via right-click menu OR drag-out gesture (M5).\n        tools: [\n          { __type: \"tool\", name: \"search\", description: \"Web search\" },\n          { __type: \"tool\", name: \"calc\", description: \"Numeric eval\" },\n        ],\n        ports: [\n          { id: \"in\", side: \"left\", dir: \"in\", type: \"text\" },\n          { id: \"out\", side: \"right\", dir: \"out\", type: \"text\", multi: true },\n        ],\n      },\n    },\n    {\n      id: \"display-1\",\n      position: { x: 540, y: 0 },\n      data: {\n        __type: \"display\",\n        label: \"Console\",\n        ports: [{ id: \"in\", side: \"left\", dir: \"in\", type: \"text\" }],\n      },\n    },\n    {\n      id: \"project-1\",\n      position: { x: 540, y: 200 },\n      data: {\n        __type: \"project-card\",\n        project: {\n          id: \"proj-1\",\n          title: \"Onboarding redesign\",\n          category: \"Product\",\n          image:\n            \"https://images.unsplash.com/photo-1551434678-e076c223a692?auto=format&fit=crop&w=640&q=70\",\n          description:\n            \"Reduce friction in the first-run flow; cut signup-to-first-action time in half.\",\n          status: \"ongoing\",\n          location: \"Remote\",\n          year: \"2026\",\n        },\n        ports: [\n          { id: \"in\", side: \"left\", dir: \"in\", type: \"text\" },\n          { id: \"out\", side: \"right\", dir: \"out\", type: \"card\" },\n        ],\n      },\n    },\n    {\n      id: \"json-1\",\n      position: { x: 880, y: 220 },\n      data: {\n        __type: \"custom-json\",\n        _label: \"Saved card\",\n        note: \"Unknown __type renders here as a custom-JSON node.\",\n      },\n    },\n  ],\n  edges: [\n    {\n      id: \"e1\",\n      source: \"prompt-1:out\",\n      target: \"llm-1:in\",\n    },\n    {\n      id: \"e2\",\n      source: \"llm-1:out\",\n      target: \"display-1:in\",\n    },\n    {\n      id: \"e3\",\n      source: \"llm-1:out\",\n      target: \"project-1:in\",\n    },\n  ],\n};\n\n// 200-node stress fixture for M8 perf verification. Custom-JSON nodes laid\n// out in a grid with a sparse, deterministic edge weave. Pair with\n// `onlyRenderVisibleElements` on <FlowCanvas> to see viewport culling kick in.\n//\n// An explicit `viewport` is shipped with the fixture: without it, the canvas\n// would `fitView` on mount and put every node on-screen, defeating\n// `onlyRenderVisibleElements` (xyflow only culls off-screen nodes). The\n// initial zoom shows ~30 nodes; pan to discover the rest. Tune zoom up to\n// see more at once, or set viewport to undefined to opt into fitView.\nexport function makeStressData(count = 200): CanvasData {\n  const cols = 20;\n  const cellW = 200;\n  const cellH = 120;\n  const nodes: NodeRecord[] = [];\n  for (let i = 0; i < count; i++) {\n    const col = i % cols;\n    const row = Math.floor(i / cols);\n    nodes.push({\n      id: `s${i}`,\n      position: { x: col * cellW, y: row * cellH },\n      data: {\n        __type: \"custom-json\",\n        _label: `Node ${i}`,\n        index: i,\n        ports: [\n          { id: \"in\", side: \"left\", dir: \"in\", type: \"data\" },\n          { id: \"out\", side: \"right\", dir: \"out\", type: \"data\", multi: true },\n        ],\n      },\n    });\n  }\n  const edges: EdgeRecord[] = [];\n  // Connect every node to the next-but-one + the next-row neighbor.\n  for (let i = 0; i + 2 < count; i++) {\n    edges.push({\n      id: `se-${i}-a`,\n      source: `s${i}:out`,\n      target: `s${i + 1}:in`,\n    });\n    if (i + cols < count) {\n      edges.push({\n        id: `se-${i}-b`,\n        source: `s${i}:out`,\n        target: `s${i + cols}:in`,\n      });\n    }\n  }\n  return {\n    version: 1,\n    nodes,\n    edges,\n    viewport: { x: 40, y: 40, zoom: 0.9 },\n  };\n}\n\n// v0.2.0 heavy-renderer stress fixture for perf-tier measurement (Q28).\n// Pair with the synthetic heavy renderer registered in the sandbox at\n// `src/app/sandbox/flow-stress/page.tsx` — type discriminator `heavy-stress`.\n// Schema mirrors makeStressData (grid layout, sparse edges) but each node\n// carries ~3 visible fields, a 1-level nested visual block, and 4 ports\n// (left-in, right-out, top-doc-in, bottom-doc-out). Intentionally NOT coupled\n// to ProjectCard or card-tree — keeps the heavy fixture self-contained and\n// the measurements comparable across machines.\nexport function makeHeavyStressData(count = 200): CanvasData {\n  const cols = 20;\n  const cellW = 240; // wider than light fixture — heavier node body\n  const cellH = 160;\n  const nodes: NodeRecord[] = [];\n  for (let i = 0; i < count; i++) {\n    const col = i % cols;\n    const row = Math.floor(i / cols);\n    nodes.push({\n      id: `h${i}`,\n      position: { x: col * cellW, y: row * cellH },\n      data: {\n        __type: \"heavy-stress\",\n        title: `Heavy Node ${i}`,\n        description: `Synthetic node ${i} for perf measurement. Carries three visible fields, one nested visual block, and four ports.`,\n        status: i % 3 === 0 ? \"active\" : i % 3 === 1 ? \"pending\" : \"archived\",\n        priority: ((i * 7) % 5) + 1,\n        nested: {\n          label: \"Nested block\",\n          items: [\n            { key: \"a\", value: `item-${i}-a` },\n            { key: \"b\", value: `item-${i}-b` },\n          ],\n        },\n        ports: [\n          { id: \"in\", side: \"left\", dir: \"in\", type: \"data\" },\n          { id: \"out\", side: \"right\", dir: \"out\", type: \"data\", multi: true },\n          { id: \"doc-in\", side: \"top\", dir: \"in\", type: \"doc\" },\n          { id: \"doc-out\", side: \"bottom\", dir: \"out\", type: \"doc\", multi: true },\n        ],\n      },\n    });\n  }\n  const edges: EdgeRecord[] = [];\n  // Same sparse wiring as light fixture, plus a doc-edge for every 5th node\n  // exercising the top/bottom port pair (doc-out → doc-in on next row).\n  for (let i = 0; i + 2 < count; i++) {\n    edges.push({\n      id: `he-${i}-a`,\n      source: `h${i}:out`,\n      target: `h${i + 1}:in`,\n    });\n    if (i + cols < count) {\n      edges.push({\n        id: `he-${i}-b`,\n        source: `h${i}:out`,\n        target: `h${i + cols}:in`,\n      });\n    }\n    if (i % 5 === 0 && i + cols < count) {\n      edges.push({\n        id: `he-${i}-doc`,\n        source: `h${i}:doc-out`,\n        target: `h${i + cols}:doc-in`,\n      });\n    }\n  }\n  return {\n    version: 1,\n    nodes,\n    edges,\n    viewport: { x: 40, y: 40, zoom: 0.9 },\n  };\n}\n\n// @ilinxa/flow-canvas-fixtures 0.3.1\n",
      "type": "registry:component",
      "target": "components/flow-canvas/dummy-data.ts"
    }
  ],
  "meta": {
    "version": "0.3.1",
    "status": "alpha"
  },
  "categories": [
    "data",
    "flow",
    "canvas",
    "fixtures"
  ],
  "type": "registry:block"
}