index
index
Interfaces
| Interface | Description |
|---|---|
| MdKitDocumentAdapter | Storage contract the document hooks talk to. Implement it over tRPC, REST, or anything else; only readDocument/writeDocument are required, the checkpoint methods are optional and enable version-history UI. |
Type Aliases
Variables
| Variable | Description |
|---|---|
| CheckpointPolicy | Factories for the policy that decides when a saved document becomes a checkpoint. Pass the result to createMdKitBackend, not to your store. |
| defaultMdKitEditorTheme | - |
| darkMdKitEditorTheme | - |
| yjs | - |
Functions
| Function | Description |
|---|---|
| useMdKitCollaboration | Creates a Hocuspocus/Yjs collaboration session for MdKitEditor, managing the provider connection, local participant, and presence. |
| measureMdKitEditDistance | - |
| normalizeMdKitVersionToken | - |
| detectMdKitDocumentConflict | - |
| createMdKitDocumentRecord | - |
| writeMdKitDocumentRecord | - |
| restoreMdKitDocumentVersion | - |
| MdKitConflictPanel | Base panel for resolving a save conflict. Previews remote and local content and keeps one side. Renders null when the document has no conflict. |
| MdKitDocumentToolbar | Unstyled workflow controls for a connected document: save/collaboration status plus entry points for version history and conflict resolution. Starter UI — drop it for your own controls when it doesn't fit. |
| useMdKitDocument | Connects an editor to a storage adapter: loads the document, debounces autosave, tracks dirty/save status, and surfaces conflicts for resolution. |
| MdKitEditor | Markdown-first rich text editor. Behaves like a controlled textarea in local mode and switches to a Yjs-backed engine when given a collaboration session. |
| MdKitView | Read-only markdown surface that mirrors MdKitEditor's styling and sizing contract without mounting the editor runtime. Use it for previews and restored checkpoints. |
| parseYamlFrontMatter | - |
| extractYamlFrontMatter | - |
| hasYamlFrontMatter | - |
| removeYamlFrontMatter | - |
| prependYamlFrontMatter | - |
| MdKitThemeEditor | Optional controls for editing an MdKitEditorTheme. Intended for theme builders, docs, and debug tools rather than production editing surfaces. |
| createMdKitEditorThemeStyle | - |
| createMdKitRestAdapter | Builds an MdKitDocumentAdapter that talks to the mdkit REST endpoint shape. Restore is not part of the adapter contract, so REST restore needs a separate call from application code. |
| VersionHistoryPanel | Renders checkpoint history from useMdKitDocumentVersions and invokes the host's restore handler for a chosen checkpoint. |
| useMdKitDocumentVersions | Lists a document's checkpoints and lazily reads checkpoint detail, tracking loading state for checkpoint-history UI. |