import type { DocumentHandle } from '../documents/types'; import { resolveEditor } from './registry'; import type { EditorProps } from './types'; import { DocumentEditorError } from './ui/DocumentEditorError'; export type DocumentPaneProps = Omit & { handle: DocumentHandle; }; // `mode`, `onOpenLink`, `wikiLinkVault` and `onOpenWikiLink` all flow through // the `...editorProps` spread below. /** * Workspace-facing editor mount. Resolves a registered `Editor` by binding * `kind` — no document provider or sync-backend imports. */ export function DocumentPane({ handle, ...editorProps }: DocumentPaneProps) { const binding = handle.getEditorBinding(); const editor = resolveEditor(binding); if (!editor) { const message = import.meta.env.DEV ? `Unknown editor binding "${String(binding.kind)}" (not registered in editors/registry.ts).` : 'This document cannot be opened in the editor.'; return ( ); } const { Component } = editor; return ; }