{
  "component": {
    "id": "rich-text-editor",
    "name": "Rich text editor",
    "tier": "pro",
    "exampleId": "rich-text-editor",
    "access": "pro",
    "requiresAuthorization": true
  },
  "source": {
    "demoModule": "src/rich-text-editor-demo.tsx",
    "exportName": "RichTextEditorDemo",
    "sha256": "1ebbedd8b828a7cc10c37efb6e451e3b4ccfb25f30ea64a43539df79f8b712c4",
    "helperImports": [],
    "directComponentImports": [
      "rich-text-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/rich-text-editor",
    "registryUrl": "https://tidalui.com/r/pro/rich-text-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/rich-text-editor",
      "purpose": "component",
      "command": "npx shadcn@latest add @tidal-pro/rich-text-editor",
      "registryUrl": "https://tidalui.com/r/pro/rich-text-editor.json",
      "access": "pro",
      "sourceDelivery": "server-gated",
      "requiresAuthorization": true
    }
  ],
  "imports": {
    "componentPath": "components/ui/rich-text-editor.tsx",
    "exports": [
      "TidalRichTextEditor"
    ],
    "stylesheets": [
      "components/ui/tidal.css",
      "components/ui/rich-text-editor.css",
      "components/ui/toolbar.css"
    ],
    "scopeClass": "tidal-scope"
  },
  "dependencies": {
    "npm": [
      "@lexical/link@0.52.0",
      "@lexical/list@0.52.0",
      "@lexical/react@0.52.0",
      "@lexical/rich-text@0.52.0",
      "@lexical/selection@0.52.0",
      "lexical@0.52.0"
    ],
    "registry": [
      "@tidal-pro/toolbar"
    ],
    "additionalRegistry": [],
    "installClosure": [
      "rich-text-editor",
      "toolbar"
    ],
    "css": [
      "components/ui/tidal.css",
      "components/ui/rich-text-editor.css",
      "components/ui/toolbar.css"
    ],
    "demoCss": [],
    "consumerOwned": [
      "react",
      "react-dom"
    ]
  },
  "files": {
    "sourceFile": "/examples/rich-text-editor.tsx",
    "demoStyles": [],
    "inlinedDemoStyles": [
      "src/rich-text-editor-demo.css"
    ],
    "assets": []
  },
  "example": {
    "language": "tsx",
    "source": "import \"./components/ui/tidal.css\";\n\nimport \"./components/ui/rich-text-editor.css\";\n\nimport { useId, useState, type FormEvent } from \"react\";\n\nimport { TidalRichTextEditor } from \"./components/ui/rich-text-editor\";\n\nimport \"./components/ui/toolbar.css\";\n\n\n\nconst tidalExampleStyles = \".tidal-scope .rich-text-editor-demo {\\n  display: grid;\\n  gap: 16px;\\n  inline-size: min(100%, 760px);\\n  min-inline-size: 0;\\n  margin-inline: auto;\\n}\\n\\n.tidal-scope .rich-text-editor-link-row {\\n  display: grid;\\n  grid-template-columns: minmax(0, 130px) minmax(0, 1fr);\\n  align-items: center;\\n  gap: 10px;\\n  padding: 12px;\\n  border: 1px solid var(--t-border);\\n  border-radius: 10px;\\n  background: var(--t-subtle);\\n}\\n\\n.tidal-scope .rich-text-editor-link-row label {\\n  min-inline-size: 0;\\n  font-size: 11px;\\n  font-weight: 740;\\n  overflow-wrap: anywhere;\\n}\\n\\n.tidal-scope .rich-text-editor-link-row input {\\n  box-sizing: border-box;\\n  inline-size: 100%;\\n  min-inline-size: 0;\\n  min-block-size: 44px;\\n  padding-inline: 12px;\\n  border: 1px solid var(--t-border);\\n  border-radius: 10px;\\n  background: var(--t-surface);\\n  color: var(--t-ink);\\n  font: inherit;\\n}\\n\\n.tidal-scope .rich-text-editor-link-row input:focus-visible,\\n.tidal-scope .rich-text-editor-demo-footer button:focus-visible,\\n.tidal-scope .rich-text-editor-guide summary:focus-visible {\\n  outline: 3px solid var(--t-accent);\\n  outline-offset: 2px;\\n}\\n\\n.tidal-scope .rich-text-editor-demo-footer {\\n  display: grid;\\n  grid-template-columns: auto minmax(0, 1fr);\\n  align-items: center;\\n  gap: 12px;\\n}\\n\\n.tidal-scope .rich-text-editor-demo-footer button {\\n  min-block-size: 44px;\\n  padding-inline: 16px;\\n  border: 1px solid var(--t-ink);\\n  border-radius: 10px;\\n  background: var(--t-ink);\\n  color: var(--t-surface);\\n  font: 750 12px/1 var(--t-font);\\n  cursor: pointer;\\n}\\n\\n.tidal-scope .rich-text-editor-demo-footer output,\\n.tidal-scope .rich-text-editor-guide,\\n.tidal-scope .rich-text-editor-sample-note {\\n  color: var(--t-muted);\\n  font-size: 11px;\\n  line-height: 1.5;\\n  overflow-wrap: anywhere;\\n}\\n\\n.tidal-scope .rich-text-editor-guide {\\n  padding-block: 12px;\\n  border-block: 1px solid var(--t-border);\\n}\\n\\n.tidal-scope .rich-text-editor-guide summary {\\n  min-block-size: 44px;\\n  display: flex;\\n  align-items: center;\\n  color: var(--t-ink);\\n  font-weight: 740;\\n  cursor: pointer;\\n}\\n\\n.tidal-scope .rich-text-editor-guide p,\\n.tidal-scope .rich-text-editor-sample-note {\\n  margin: 0;\\n}\\n\\n@media (max-width: 520px) {\\n  .tidal-scope .rich-text-editor-link-row,\\n  .tidal-scope .rich-text-editor-demo-footer {\\n    grid-template-columns: minmax(0, 1fr);\\n  }\\n\\n  .tidal-scope .rich-text-editor-link-row input {\\n    font-size: 16px;\\n  }\\n\\n  .tidal-scope .rich-text-editor-demo-footer button {\\n    inline-size: 100%;\\n  }\\n}\\n\\n@media (prefers-reduced-motion: no-preference) {\\n  .tidal-scope .rich-text-editor-demo-footer button {\\n    transition:\\n      transform 140ms var(--t-ease-out),\\n      background-color 140ms var(--t-ease-out);\\n  }\\n\\n  .tidal-scope .rich-text-editor-demo-footer button:active {\\n    transform: scale(0.98);\\n  }\\n}\";\n\nconst SAMPLE_DOCUMENT = JSON.stringify({\n  root: {\n    children: [\n      {\n        children: [\n          {\n            detail: 0,\n            format: 0,\n            mode: \"normal\",\n            style: \"\",\n            text: \"Workspace notifications\",\n            type: \"text\",\n            version: 1,\n          },\n        ],\n        tag: \"h2\",\n        direction: null,\n        format: \"\",\n        indent: 0,\n        type: \"heading\",\n        version: 1,\n      },\n      {\n        children: [\n          {\n            detail: 0,\n            format: 1,\n            mode: \"normal\",\n            style: \"\",\n            text: \"New:\",\n            type: \"text\",\n            version: 1,\n          },\n          {\n            detail: 0,\n            format: 0,\n            mode: \"normal\",\n            style: \"\",\n            text: \" choose which project updates appear in your weekly summary.\",\n            type: \"text\",\n            version: 1,\n          },\n        ],\n        direction: null,\n        format: \"\",\n        indent: 0,\n        textFormat: 1,\n        textStyle: \"\",\n        type: \"paragraph\",\n        version: 1,\n      },\n    ],\n    direction: null,\n    format: \"\",\n    indent: 0,\n    type: \"root\",\n    version: 1,\n  },\n});\n\nfunction safeFragment(value: string) {\n  return `rich-text-guide-${value.replace(/[^a-zA-Z0-9_-]/g, \"\")}`;\n}\n\nexport function RichTextEditorDemo({\n  theme = \"light\",\n}: {\n  theme?: \"light\" | \"dark\";\n}) {\n  const guideId = safeFragment(useId());\n  const [value, setValue] = useState(SAMPLE_DOCUMENT);\n  const [linkHref, setLinkHref] = useState(`#${guideId}`);\n  const [status, setStatus] = useState(\"Sample content is ready for review.\");\n\n  function review(event: FormEvent<HTMLFormElement>) {\n    event.preventDefault();\n    const submitted = String(\n      new FormData(event.currentTarget).get(\"product-content\") ?? \"\",\n    );\n    setStatus(\n      submitted === value\n        ? \"The current editor JSON was reviewed locally.\"\n        : \"The submitted document did not match the current value.\",\n    );\n  }\n\n  return (\n    <form className=\"rich-text-editor-demo\" onSubmit={review}>\n      <TidalRichTextEditor\n        label=\"Product update\"\n        description=\"Format a short update for the sample workspace guide.\"\n        value={value}\n        onValueChange={(next) => {\n          setValue(next);\n          setStatus(\"Sample content has local changes.\");\n        }}\n        name=\"product-content\"\n        linkHref={linkHref}\n        placeholder=\"Write a product update…\"\n        theme={theme}\n      />\n\n      <div className=\"rich-text-editor-link-row\">\n        <label htmlFor={`${guideId}-link`}>Link destination</label>\n        <input\n          id={`${guideId}-link`}\n          value={linkHref}\n          onChange={(event) => setLinkHref(event.currentTarget.value)}\n          spellCheck={false}\n        />\n      </div>\n\n      <div className=\"rich-text-editor-demo-footer\">\n        <button type=\"submit\">Review content</button>\n        <output>{status}</output>\n      </div>\n\n      <details id={guideId} className=\"rich-text-editor-guide\">\n        <summary>Workspace writing guide</summary>\n        <p>Use short headings, plain links and lists that scan clearly.</p>\n      </details>\n\n      <p className=\"rich-text-editor-sample-note\">\n        Local sample only. The editor returns JSON and does not publish, upload,\n        store or execute content.\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      <RichTextEditorDemo />\n    </div>\n  );\n}\n",
    "sourceFile": "/examples/rich-text-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": "SAMPLE_DOCUMENT",
      "setter": "setValue",
      "proposalCanBeRejected": false
    },
    {
      "prop": "linkHref",
      "type": "inferred-from-existing-demo",
      "initial": "`#${guideId}`",
      "setter": "setLinkHref",
      "proposalCanBeRejected": false
    }
  ],
  "events": [
    {
      "name": "onChange",
      "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": "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": [
      "product-content"
    ],
    "expectedFormData": {
      "product-content": "fixture value"
    },
    "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": []
}
