{
  "component": {
    "id": "markdown-editor",
    "name": "Markdown editor",
    "tier": "pro",
    "exampleId": "markdown-editor",
    "access": "pro",
    "requiresAuthorization": true
  },
  "source": {
    "demoModule": "src/markdown-editor-demo.tsx",
    "exportName": "MarkdownEditorDemo",
    "sha256": "3300352009f71e513a5ff9e41b29765fcde3e150f01516221ae67c0d9f079357",
    "helperImports": [],
    "directComponentImports": [
      "markdown-editor"
    ],
    "sampleBoundary": "Existing local demo fixture with fictional data and callbacks. No live service, customer data, access key, or Pro source is included."
  },
  "install": {
    "command": "npx shadcn@latest add @tidal-pro/markdown-editor",
    "registryUrl": "https://tidalui.com/r/pro/markdown-editor.json",
    "namespace": "@tidal-pro",
    "access": "pro",
    "sourceDelivery": "server-gated",
    "requiresAuthorization": true,
    "tokenSource": "local-env",
    "tokenEnvName": "TIDALUI_TOKEN",
    "cli": {
      "package": "shadcn",
      "requested": "latest"
    }
  },
  "installPlan": [
    {
      "order": 1,
      "kind": "primary",
      "dependency": "@tidal-pro/markdown-editor",
      "purpose": "component",
      "command": "npx shadcn@latest add @tidal-pro/markdown-editor",
      "registryUrl": "https://tidalui.com/r/pro/markdown-editor.json",
      "access": "pro",
      "sourceDelivery": "server-gated",
      "requiresAuthorization": true
    }
  ],
  "imports": {
    "componentPath": "components/ui/markdown-editor.tsx",
    "exports": [
      "TidalMarkdownEditor",
      "TidalMarkdownEditorMode"
    ],
    "stylesheets": [
      "components/ui/tidal.css",
      "components/ui/markdown-editor.css",
      "components/ui/textarea.css",
      "components/ui/toolbar.css"
    ],
    "scopeClass": "tidal-scope"
  },
  "dependencies": {
    "npm": [],
    "registry": [
      "https://tidalui.com/r/textarea.json",
      "@tidal-pro/toolbar"
    ],
    "additionalRegistry": [],
    "installClosure": [
      "markdown-editor",
      "textarea",
      "toolbar"
    ],
    "css": [
      "components/ui/tidal.css",
      "components/ui/markdown-editor.css",
      "components/ui/textarea.css",
      "components/ui/toolbar.css"
    ],
    "demoCss": [],
    "consumerOwned": [
      "react",
      "react-dom"
    ]
  },
  "files": {
    "sourceFile": "/examples/markdown-editor.tsx",
    "demoStyles": [],
    "inlinedDemoStyles": [
      "src/markdown-editor-demo.css"
    ],
    "assets": []
  },
  "example": {
    "language": "tsx",
    "source": "import \"./components/ui/tidal.css\";\n\nimport \"./components/ui/markdown-editor.css\";\n\nimport { useId, useState, type FormEvent, type MouseEvent as ReactMouseEvent } from \"react\";\n\nimport { TidalMarkdownEditor, type TidalMarkdownEditorMode } from \"./components/ui/markdown-editor\";\n\nimport \"./components/ui/textarea.css\";\n\nimport \"./components/ui/toolbar.css\";\n\n\n\nconst tidalExampleStyles = \".tidal-scope .markdown-editor-demo {\\n  display: grid;\\n  width: 100%;\\n  max-width: 980px;\\n  min-width: 0;\\n  gap: 12px;\\n  margin: 0 auto;\\n}\\n\\n.tidal-scope .markdown-editor-demo-footer {\\n  display: flex;\\n  min-width: 0;\\n  align-items: center;\\n  justify-content: space-between;\\n  gap: 12px;\\n}\\n\\n.tidal-scope .markdown-editor-demo-footer button {\\n  min-width: 112px;\\n  min-height: 44px;\\n  padding: 9px 15px;\\n  color: var(--t-surface);\\n  background: var(--t-ink);\\n  border: 1px solid var(--t-ink);\\n  border-radius: var(--t-radius-control);\\n  font: inherit;\\n  font-size: 12px;\\n  font-weight: 700;\\n  cursor: pointer;\\n}\\n\\n.tidal-scope .markdown-editor-demo-footer button:focus-visible {\\n  outline: 2px solid var(--t-accent);\\n  outline-offset: 3px;\\n}\\n\\n.tidal-scope .markdown-editor-demo-footer output {\\n  min-width: 0;\\n  color: var(--t-muted);\\n  font-size: 11px;\\n  line-height: 1.5;\\n  text-align: end;\\n  overflow-wrap: anywhere;\\n}\\n\\n.tidal-scope .markdown-editor-guide {\\n  padding: 0 12px;\\n  background: var(--t-subtle);\\n  border: 1px solid var(--t-border);\\n  border-radius: var(--t-radius-control);\\n}\\n\\n.tidal-scope .markdown-editor-guide summary {\\n  min-height: 44px;\\n  padding-block: 12px;\\n  font-size: 12px;\\n  font-weight: 700;\\n  cursor: pointer;\\n}\\n\\n.tidal-scope .markdown-editor-guide summary:focus-visible {\\n  outline: 2px solid var(--t-accent);\\n  outline-offset: 3px;\\n  border-radius: 3px;\\n}\\n\\n.tidal-scope .markdown-editor-guide p,\\n.tidal-scope .markdown-editor-sample-note {\\n  margin: 0;\\n  color: var(--t-muted);\\n  font-size: 11px;\\n  line-height: 1.6;\\n  overflow-wrap: anywhere;\\n}\\n\\n.tidal-scope .markdown-editor-guide p {\\n  padding: 0 0 12px;\\n}\\n\\n@media (max-width: 390px) {\\n  .tidal-scope .markdown-editor-demo-footer {\\n    align-items: stretch;\\n    flex-direction: column;\\n  }\\n\\n  .tidal-scope .markdown-editor-demo-footer button {\\n    width: 100%;\\n  }\\n\\n  .tidal-scope .markdown-editor-demo-footer output {\\n    text-align: start;\\n  }\\n}\";\n\nfunction fragmentId(value: string) {\n  return `markdown-guide-${value.replace(/[^a-zA-Z0-9_-]/g, \"\")}`;\n}\n\nexport function MarkdownEditorDemo() {\n  const generatedId = useId();\n  const guideId = fragmentId(generatedId);\n  const [mode, setMode] = useState<TidalMarkdownEditorMode>(\"split\");\n  const [value, setValue] = useState(\n    () => `# Release notes\n\nWorkspace search now keeps recent filters between local views.\n\n## Included\n\n- Faster keyboard navigation\n- Clearer empty states\n- A [writing guide](#${guideId}) for reviewers\n\n\\`\\`\\`ts\nconst mode = \"preview\";\n\\`\\`\\`\n\n> This preview renders a small, safe Markdown subset.`,\n  );\n  const [status, setStatus] = useState(\"Draft is ready for local review.\");\n\n  function review(event: FormEvent<HTMLFormElement>) {\n    event.preventDefault();\n    setStatus(`Reviewed locally at ${value.length} characters.`);\n  }\n\n  function revealGuide(event: ReactMouseEvent<HTMLDivElement>) {\n    if (\n      event.button !== 0 ||\n      event.metaKey ||\n      event.ctrlKey ||\n      event.shiftKey ||\n      event.altKey\n    )\n      return;\n    const target = event.target;\n    if (!(target instanceof Element)) return;\n    const anchor = target.closest<HTMLAnchorElement>(\"a\");\n    if (anchor?.getAttribute(\"href\") !== `#${guideId}`) return;\n    const guide = document.getElementById(guideId);\n    if (guide instanceof HTMLDetailsElement) guide.open = true;\n  }\n\n  return (\n    <form className=\"markdown-editor-demo\" onSubmit={review}>\n      <TidalMarkdownEditor\n        label=\"Release note\"\n        value={value}\n        onValueChange={(next) => {\n          setValue(next);\n          setStatus(\"Draft has local changes.\");\n        }}\n        mode={mode}\n        onModeChange={setMode}\n        description=\"Write Markdown or inspect the safe local preview.\"\n        textareaProps={{\n          name: \"release-note\",\n          placeholder: \"Write a release note…\",\n          rows: 12,\n          required: true,\n          showCount: true,\n        }}\n        previewProps={{ onClick: revealGuide }}\n      />\n\n      <div className=\"markdown-editor-demo-footer\">\n        <button type=\"submit\">Review draft</button>\n        <output>{status}</output>\n      </div>\n\n      <details id={guideId} className=\"markdown-editor-guide\">\n        <summary>Writing guide</summary>\n        <p>\n          Use headings, lists, emphasis, links, quotes and fenced code. Other\n          syntax stays plain text.\n        </p>\n      </details>\n\n      <p className=\"markdown-editor-sample-note\">\n        Local sample only. Editing and review do not publish or store this\n        draft.\n      </p>\n    </form>\n  );\n}\n\nexport default function AgentExample() {\n  return (\n    <div className=\"tidal-scope\" data-theme=\"light\" dir=\"ltr\">\n      <style>{tidalExampleStyles}</style>\n      <MarkdownEditorDemo />\n    </div>\n  );\n}\n",
    "sourceFile": "/examples/markdown-editor.tsx",
    "fixtureData": "Existing demo fixture data only; replace with consumer-owned data before production use."
  },
  "controlledState": [
    {
      "prop": "value",
      "type": "inferred-from-existing-demo",
      "initial": "(",
      "setter": "setValue",
      "proposalCanBeRejected": false
    },
    {
      "prop": "mode",
      "type": "inferred-from-existing-demo",
      "initial": "\"split\"",
      "setter": "setMode",
      "proposalCanBeRejected": false
    }
  ],
  "events": [
    {
      "name": "onModeChange",
      "nativeType": "component callback",
      "callerFirst": true,
      "preventable": true,
      "observedResult": "The existing demo callback remains the source of truth; this example does not call a live service."
    },
    {
      "name": "onSubmit",
      "nativeType": "React synthetic event or native callback",
      "callerFirst": true,
      "preventable": true,
      "observedResult": "The existing demo callback remains the source of truth; this example does not call a live service."
    },
    {
      "name": "onValueChange",
      "nativeType": "component callback",
      "callerFirst": true,
      "preventable": true,
      "observedResult": "The existing demo callback remains the source of truth; this example does not call a live service."
    }
  ],
  "nativeForm": {
    "participates": true,
    "names": [],
    "expectedFormData": {},
    "submitBehavior": "The existing demo's native form callback receives the submit event.",
    "resetBehavior": "Native reset behavior remains available where the demo renders a resettable control.",
    "disabledBehavior": "Disabled controls remain excluded from successful native form submission.",
    "readOnlyBehavior": "Read-only controls retain their value and remain inspectable by the consumer."
  },
  "accessibility": {
    "labelSource": "Existing demo label or ARIA prop",
    "semantics": "Preserve the component's native element and the semantics demonstrated by the source fixture.",
    "keyboard": [
      "Tab and Shift+Tab",
      "Enter or Space for native activation",
      "Arrow keys where the component exposes a composite control"
    ],
    "focusReturn": "Preserve browser focus order and visible focus.",
    "errorAnnouncement": "The existing error or alert path remains consumer-owned and should be announced by the rendered semantics.",
    "reducedMotion": "Verify prefers-reduced-motion with the existing component transition path.",
    "forcedColors": "Verify visible borders, text, and focus in forced-colors mode."
  },
  "responsive": {
    "widths": [
      320,
      390,
      768,
      1260
    ],
    "shortViewport": "Check the example at a 300px viewport height with keyboard or portal content visible.",
    "overflow": "The page should not gain horizontal overflow; component-local scrolling must remain intentional.",
    "touchTargetMinPx": 44,
    "coarseInputFontPx": 16
  },
  "errors": [
    {
      "fixture": "Exercise the existing demo's error, empty, loading, or invalid fixture.",
      "visibleResult": "The consumer-visible result must remain explicit and must not be replaced by a silent console error.",
      "focusResult": "Focus must remain on the triggering control or move to the announced error according to the native pattern.",
      "ownership": "Consumer-owned sample state only; no network request or customer data is used."
    }
  ],
  "verification": {
    "commands": [
      "npx tsc --noEmit",
      "npx vite build"
    ],
    "lockfile": "Use the consumer project's committed lockfile.",
    "browser": [
      "Chromium 1260x800",
      "Chromium 390x844",
      "Keyboard and reduced-motion pass"
    ]
  },
  "validation": {
    "consumerFixture": {
      "tsc": "pass",
      "viteBuild": "pass",
      "resourceModel": "Generated usage plus only the component files and CSS delivered by the primary item and listed registry dependencies."
    },
    "registryArtifact": "server-gated"
  },
  "exceptions": []
}
